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 some commonly used callpath indices:

callpathDescription
1Vanilla swaps
3Policy implementations
4Long form orders
5Microcall orders
6Multicall orders
128LP operations

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.