API Reference

Provide Liquidity with Fixed Amounts

This method allows the caller to provide liquidity to a pool by setting a fixed amount for either coin A or coin B. The liquidity is computed based on the input amount. The following interfaces can be used to call the method, with the arguments described below:

Interfaces

 
public entry fun provide_liquidity_with_fixed_amount<CoinTypeA, CoinTypeB>(
        clock: &Clock,
        protocol_config: &GlobalConfig, 
        pool: &mut Pool<CoinTypeA, CoinTypeB>, 
        position: &mut Position,
        coin_a: Coin<CoinTypeA>,
        coin_b: Coin<CoinTypeB>,
        amount: u64,
        coin_a_max: u64,
        coin_b_max: u64,
        is_fixed_a: bool,
        ctx: &mut TxContext) {
        abort 0

    }

    /// Parameters:
    /// - clock              : Sui clock object
    /// - protocol_config    : The `config::GlobalConfig` object used for version verification
    /// - pool               : Mutable reference to the pool to which liquidity is to be provided
    /// - position           : The position to which the liquidity is being provided
    /// - coin_a             : The Coin A object. Should have at max `coin_a_max` amount and min `amount`
    /// - coin_b             : The Coin A object. Should have at max `coin_b_max` amount and min `amount`
    /// - amount             : The amount of Coin A or Coin B to be provided
    /// - coin_a_max         : The maximum amount of Coin A, the user wants to provide (Used for slippage check)
    /// - coin_b_max         : The maximum amount of Coin B, the user wants to provide (Used for slippage check)
    /// - is_fixed_a         : True if the amount provided belongs to token A
    /// - ctx                : Murable reference to caller's transaction context
    /// 
    /// Events Emitted       : LiquidityProvided