Skip to content

userCmd Callpaths

The standard entry-point to the DEX contract is through userCmd(), following the format below:

solidity
function userCmd(
    uint16 callpath,
    bytes cmd
) public payable returns (bytes)

callpath is a 16-bit index that identifies the specific proxy contract the command call is forwarded to through DELEGATECALL.

Following are the commonly used callpath indices:

callpathDescription
1Vanilla swaps
2LP operations
3Policy implementations
4Long form orders

cmd is the raw bytestring that's passed unmodified to the specific callpath. The format of this bytestring is dependent on the specific callpath.

Every call returns the raw bytestring returned by the raw callpath, which may or may not be empty.