Remove Liquidity
POST
/api/v1/amm/removeRemove Liquidity allows users to remove liquidity from an Automated Market Maker (AMM) pool. Users must provide the pool ID, price tick range, base and quote asset amounts to remove, a nonce, and a signature for authentication. Upon successful execution, the API returns the amounts of base and quote assets removed from the pool, as well as any fee amounts incurred.
请求参数
The unique identifier of the AMM pool.
The minimum price tick index
The maximum price tick index.
The amount of the base asset to remove from the pool.
The amount of the quote asset to remove from 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 removed from the pool (negative value indicates removal).
The amount of quote asset removed from the pool (negative value indicates removal).
The fee collected from the position in terms of base asset.
The fee collected from the position in terms of quote asset.
{
"error": false,
"baseAssetAmount": -0.6808,
"quoteAssetAmount": -89747.84,
"baseAssetFeeAmount": 0,
"quoteAssetFeeAmount": 0
}