Skip to main content

IMarketAddLiquidity.sol

IMarketAddLiquidity

The interface for adding and claiming liquidity in a market.

addLiquidity

function addLiquidity(address recipient, int16 tradingFeeRate, bytes data) external returns (struct LpReceipt)

Adds liquidity to the market.

  • Parameters:

    NameTypeDescription
    recipientaddressThe address to receive the liquidity tokens.
    tradingFeeRateint16The trading fee rate for the liquidity.
    databytesAdditional data for the liquidity callback.
  • Return Values:

    NameTypeDescription
    [0]struct LpReceiptThe liquidity receipt.

addLiquidityBatch

function addLiquidityBatch(address recipient, int16[] tradingFeeRates, uint256[] amounts, bytes data) external returns (struct LpReceipt[])

Adds liquidity to multiple liquidity bins of the market in a batch.

  • Parameters:

    NameTypeDescription
    recipientaddressThe address of the recipient for each liquidity bin.
    tradingFeeRatesint16[]An array of fee rates for each liquidity bin.
    amountsuint256[]An array of amounts to add as liquidity for each bin.
    databytesAdditional data for the liquidity callback.
  • Return Values:

    NameTypeDescription
    [0]struct LpReceipt[]An array of LP receipts.

claimLiquidity

function claimLiquidity(uint256 receiptId, bytes data) external

Claims liquidity from a liquidity receipt.

  • Parameters:

    NameTypeDescription
    receiptIduint256The ID of the liquidity receipt.
    databytesAdditional data for the liquidity callback.

claimLiquidityBatch

function claimLiquidityBatch(uint256[] receiptIds, bytes data) external

Claims liquidity from a liquidity receipt.

  • Parameters:

    NameTypeDescription
    receiptIdsuint256[]The array of the liquidity receipt IDs.
    databytesAdditional data for the liquidity callback.

distributeEarningToBins

function distributeEarningToBins(uint256 earning, uint256 marketBalance) external

Distributes earning to the liquidity bins.

  • Parameters:

    NameTypeDescription
    earninguint256The amount of earning to distribute.
    marketBalanceuint256The balance of the market.