Vessel Finance API
  1. AMM
Vessel Finance API
  • Introduction
  • General Info
  • HMAC Signature Guide
  • Poseidon Signature Guide
  • Internal Transfer Signature Guide
  • Error Code
  • Vessel REST API
    • Public
      • Market Data
        • 24hr Ticker Statistics
        • Kline / Candlestick Data
        • Order Book
        • Recent Trades List
        • Average Price
        • AMM Pool Last 24h Data
      • Exchange Data
        • Ticker Info
        • Asset Info
        • Trade Fee
        • AMM Pool Info
    • User
      • Asset
        • User Asset
        • Withdraw
        • Withdraw History
        • Deposit History
        • Claim History
        • Internal Transfer (Send)
        • Internal Transfer History
      • Order
        • Place Order
        • Cancel Order
        • Open Orders
        • Completed Orders
        • All Orders
        • Query Order
        • Modify Order
      • AMM
        • Add Liquidity
          POST
        • Remove Liquidity
          POST
        • Collect Fee
          POST
        • AMM Position
          GET
        • AMM Action History
          GET
      • Account
        • User Profile
        • User Trade List
  • Vessel WebSocket
    • Market
      • Order Book
      • K Line
      • Recent Trades
      • 24hr Ticker Statistics
      • Ticker Setting Upade
    • User
      • Authorize
      • Balance
      • Account
  1. AMM

Remove Liquidity

Testnet Env
https://testnet.trade.vessel.finance
Testnet Env
https://testnet.trade.vessel.finance
POST
/api/v1/amm/remove
Last modified:2024-10-15 06:23:56
Remove 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.

Request

Header Params
VESSEL-TIMESTAMP
integer 
required
VESSEL-API-KEY
string 
required
Default:
{{API_KEY}}
VESSEL-PASSPHRASE
string 
required
Default:
{{API_PASSPHRASE}}
VESSEL-SIGNATURE
string 
required
Use signRequest script to generate
Body Params application/json
poolId
string 
required
The unique identifier of the AMM pool.
tickIndexL
string 
required
The minimum price tick index
tickIndexR
string 
required
The maximum price tick index.
baseAmount
string 
required
The amount of the base asset to remove from the pool.
quoteAmount
string 
required
The amount of the quote asset to remove from the pool.
nonce
string 
required
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.
signature
string 
required
The cryptographic signature generated using the Poseidon algorithm. Refer to the Poseidon Signature Guide for details on generating the signature.
Example
{
  "poolId": 2,
  "tickIndexL": 222,
  "tickIndexR": 350,
  "baseAmount": 1,
  "quoteAmount": 100000,
  "nonce": "1715321003889",
  "signature": "0xa742f3a4296aa5d8221451793f2c2d835f0aa484b37c021fa7953a6aa78c053f67972dc251ce763b0c4b8a7b843d5d4f28c6b5d6dff674a44a0850966e598123"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://testnet.trade.vessel.finance/api/v1/amm/remove' \
--header 'VESSEL-TIMESTAMP;' \
--header 'VESSEL-TIMESTAMP;' \
--header 'VESSEL-API-KEY;' \
--header 'VESSEL-PASSPHRASE;' \
--header 'VESSEL-SIGNATURE;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "poolId": 2,
    "tickIndexL": 222,
    "tickIndexR": 350,
    "baseAmount": 1,
    "quoteAmount": 100000,
    "nonce": "1715321003889",
    "signature": "0xa742f3a4296aa5d8221451793f2c2d835f0aa484b37c021fa7953a6aa78c053f67972dc251ce763b0c4b8a7b843d5d4f28c6b5d6dff674a44a0850966e598123"
}'

Responses

🟢200OK
application/json
Body
baseAssetAmount
string 
required
The amount of base asset removed from the pool (negative value indicates removal).
quoteAssetAmount
string 
required
The amount of quote asset removed from the pool (negative value indicates removal).
baseAssetFeeAmount
string 
required
The fee collected from the position in terms of base asset.
quoteAssetFeeAmount
string 
required
The fee collected from the position in terms of quote asset.
Example
{
  "baseAssetAmount": "-0.6808",
  "quoteAssetAmount": "-89747.84",
  "baseAssetFeeAmount": "0",
  "quoteAssetFeeAmount": "0"
}
Previous
Add Liquidity
Next
Collect Fee
Built with