Ambient Docs
  • Introduction to Ambient
  • Concepts
    • AMMs
    • Concentrated Liquidity
    • Knockout Liquidity
    • Governance & Policy
    • Surplus Collateral
    • Permissioned Pools
    • Account Abstraction
  • Users
    • Swaps
    • LP Positions
    • Surplus Collateral
    • Dynamic Fees
    • Knockout Positions
    • Initializing Pools
    • Gasless Transactions
    • External Routers
  • Governance & Policy
    • Ops & Treasury Multisigs
    • Policy
    • Upgrading Code
    • Emergency
  • Developers
    • Deployed Contracts
    • Token Transfers
    • Type Conventions
    • DEX Contract Interface
      • userCmd Callpaths
      • Swaps
        • Hot Path Swap Migration
          • Directly Calling CrocSwapDex
          • External Swap Router
      • Flat LP Calls
      • Long Form Orders
      • Knockout LP Calls
      • Pool Initialization
      • Surplus Collateral
      • Router Calls
      • Relayer Calls
    • Query Contracts
      • CrocQuery Contract
      • CrocImpact Contract
    • Logs and Queries
    • Libraries and APIs
      • SDK
      • Indexer API
      • Subgraph
Powered by GitBook
On this page
  1. Developers
  2. DEX Contract Interface

userCmd Callpaths

The standard call to CrocSwapDex is run through userCmd()

The method call follows the below generalized format:

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

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

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.

PreviousDEX Contract InterfaceNextSwaps

Last updated 1 year ago