Add Liquidity
POST
/api/v1/amm/addAdd Liquidity allows users to add liquidity to an Automated Market Maker (AMM) pool. Users must provide the pool ID, price tick range, base and quote asset amounts, a nonce, and a signature for authentication. Upon successful execution, the API returns the amounts of base and quote assets added to the pool.
请求参数
The unique identifier of the AMM pool to add liquidity.
The minimum price tick index
The maximum price tick index.
The amount of the base asset to add to the pool.
The amount of the quote asset to add to the pool.
A unique identifier for the request, typically a Unix timestamp indicating the time at which the request was made. It helps prevent replay attacks by ensuring that each request is unique.
The cryptographic signature generated using the Poseidon algorithm. Refer to the Poseidon Signature Guide for details on generating the signature.
{
"poolId": 2,
"tickIndexL": 222,
"tickIndexR": 350,
"baseAmount": 1,
"quoteAmount": 100000,
"nonce": "1715321003889",
"signature": "0xa742f3a4296aa5d8221451793f2c2d835f0aa484b37c021fa7953a6aa78c053f67972dc251ce763b0c4b8a7b843d5d4f28c6b5d6dff674a44a0850966e598123"
}
示例代码
Responses
Indicates whether the operation was successful (true if there was an error, false otherwise).
The amount of base asset added to the pool.
The amount of quote asset added to the pool.
{
"error": false,
"baseAssetAmount": 0.6808,
"quoteAssetAmount": 89747.84
}