API Reference

Provide Liquidity

This method allows the caller to provide liquidity to a pool on the exchange without specifying the exact amounts for coin A or coin B. The following interfaces can be used to call the method, with the arguments described below:

Interfaces

  
public entry fun provide_liquidity<CoinTypeA, CoinTypeB>(
        clock: &Clock,
        protocol_config: &GlobalConfig, 
        pool: &mut Pool<CoinTypeA, CoinTypeB>, 
        position: &mut Position,
        coin_a: Coin<CoinTypeA>,
        coin_b: Coin<CoinTypeB>,
        coin_a_min: u64,
        coin_b_min: u64,
        liquidity: u128, 
        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 the atleast `coin_a_min` amount
    /// - coin_b             : The Coin B object. Should have the atleast `coin_b_min` amount
    /// - coin_a_min         : The minimum amount of Coin A, the user wants to provide (Used for slippage check)
    /// - coin_b_min         : The minimum amount of Coin B, the user wants to provide (Used for slippage check)
    /// - liquidity          : The amount of liquidity to provide
    /// - ctx                : Murable reference to caller's transaction context
    /// 
    /// Events Emitted       : LiquidityProvided