POST
/
v1
/
liquidity
/
add
Add liquidity
curl --request POST \
  --url https://api.amm.flashnet.xyz/v1/liquidity/add \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "assetAAmountToAdd": "100000000",
  "assetASparkTransferId": "550e8400-e29b-41d4-a716-446655440000",
  "assetBAmountToAdd": "50000",
  "assetBSparkTransferId": "650f9500-f39c-51e5-b827-557766550001",
  "nonce": "add-liquidity-1702934567890",
  "poolId": "03aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899",
  "signature": "3045022100abc...",
  "userPublicKey": "03abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
}'
{
"accepted": false,
"error": "Pool is not accepting liquidity",
"refund": {
"assetAAmount": "100000000",
"assetATransferId": "850h9700-h50e-73g7-d049-779988770003",
"assetBAmount": "50000",
"assetBTransferId": "950i0800-i61f-84h8-e150-880099880004"
},
"requestId": "01HJZKFABCDEFGHJKLMNPQRSTVW"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Liquidity addition details including assets, amounts, and authentication

Request body for adding liquidity to a pool.

When adding liquidity to a pool, you must provide both assets in the correct ratio for constant product pools, or can provide single-sided liquidity for single-sided pools. The system will automatically calculate the optimal amounts and refund any excess.

Response

200
application/json

Liquidity addition executed successfully

Response for adding liquidity to a pool