Skip to Content

Flat LP Calls

Simple LP operations should use flat calls for gas efficiency. Supported flat operations are:

  • Mint panoptis liquidity
  • Mint concentrated liquidity
  • Burn panoptis liquidity
  • Burn concentrated liquidity
  • Harvest accumulated fees in concentrated liquidity

Flat LP calls use callpath index 2:

userCmd(2, abi.encode( code, // uint8 base, // address quote, // address poolIdx, // uint256 bidTick, // int24 askTick, // int24 qty, // uint128 limitLower, // uint128 limitHigher, // uint128 settleFlags, // uint8 lpConduit // address ))

The call code specifies the type of LP action according to the following codes:

  • Mint concentrated liquidity:
    • 1 - Fixed in liquidity units
    • 11 - Fixed in base tokens
    • 12 - Fixed in quote tokens
  • Burn concentrated liquidity:
    • 2 - Fixed in liquidity units
    • 21 - Fixed in base tokens
    • 22 - Fixed in quote tokens
  • Mint panoptis liquidity
    • 3 - Fixed in liquidity units
    • 31 - Fixed in base tokens
    • 32 - Fixed in quote tokens
  • Burn panoptis liquidity
    • 4 - Fixed in liquidity units
    • 41 - Fixed in base tokens
    • 42 - Fixed in quote tokens
  • 5 - Harvest accumulated fees (concentrated liquidity)

The remaining parameters are

  • base - The address of the base token or virtual token
  • quote - The address of the quote token or virtual token
  • poolIdx - The arbitrary index of the pool type the user is swapping on.
  • bidTick - The tick index of the lower range of the LP position (ignored for panoptis liquidity operations)
  • askTick - The tick index of the lower range of the LP position (ignored for panoptis liquidity operations)
  • qty - The size of the liquidity being added or removed. Fixed in terms of liquidity units, base token deposit or quote token deposit. Ignored for harvest calls.
  • limitLower - The minimum acceptable curve price. If the price of the pool is below this threshold the transaction will revert.
  • limitUpper - The maximum acceptable curve price. If the price of the pool is above this threshold the transaction will revert.
  • settleFlags - Flag indicating how the user wants to settle the traded tokens for this swap (seetype-conventions)
  • lpConduit - The address of the tracker the liquidity is deposited at. E.g. the LP token tracken if the user is creating ERC20 LP tokens. If LP position is stored natively at the exhange this should be to address(0)
Last updated on