MCDEX
Search…
MCDEX
Overview
Protocol
Mai Protocol V3
V3 AMM Design
Tunable Oracle
Audits
DAO
MCDEX DAO
MCB Tokenomics
Developer
Mai3 Contracts
Quick Start
Get Pool Info
Get Perpetual Info
Get Account
Adding Margin
Removing Margin
Trade
Adding Liquidity
Removing Liquidity
Liquidate
Mai3 SDK
Mai3 Subgraph
Deployed Contracts
Bug Bounty
Trader
Basis Trading
LP Hedging
Powered By
GitBook
Adding Liquidity
This guide shows how to add liquidity into pool by using the
ILiquidityPoolFull
interface.
Add Liquidity
Function
function addLiquidity(int256 cashToAdd)
parameters
type
description
cashToAdd
int256
amount of cash to add. The amount always use decimals 18.
Notice
Add liquidity to the liquidity pool. Liquidity provider deposits collaterals then gets share tokens back.
The ratio of added cash to share token is determined by current liquidity.
Can only called when the pool is running.
Example
1
ILiquidityPoolFull liquidityPool
=
ILiquidityPoolFull
(
liquidityPoolAddress
)
2
liquidityPool
.
addLiquidity
(
amount
)
Copied!
Sample Code
Github
Previous
Trade
Next
Removing Liquidity
Last modified
5mo ago
Copy link
Contents
Add Liquidity
Function
Example
Sample Code