Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
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.
Hex-encoded secp256k1 public key of the liquidity provider. This must match the public key in your authentication token.
"03abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
Unique identifier of the pool to add liquidity to. This is the pool's identity public key.
"03aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899"
Spark network transfer ID for the Asset A deposit. This transfer must not have been used before and will be reserved during validation.
"550e8400-e29b-41d4-a716-446655440000"
Spark network transfer ID for the Asset B deposit. Required for constant product pools, can be empty for single-sided pools.
"650f9500-f39c-51e5-b827-557766550001"
Amount of Asset A to add, in its smallest unit (e.g., satoshis for Bitcoin). The actual amount used may be less if the ratio needs adjustment.
x >= 0
100000000
Amount of Asset B to add, in its smallest unit. For single-sided pools, this should be 0.
x >= 0
50000
Minimum amount of Asset A to receive, in its smallest unit. If the pool doesn't have enough liquidity to meet this, the request will be rejected.
x >= 0
95000000
Minimum amount of Asset B to receive, in its smallest unit. If the pool doesn't have enough liquidity to meet this, the request will be rejected.
x >= 0
45000
Unique nonce
to prevent replay attacks.
Each nonce
can only be used once per user.
"add-liquidity-nonce-456"
Hex-encoded secp256k1 signature of the request. Must be signed by the private key corresponding to userPublicKey.
"3045022100abc..."
Response
Liquidity addition executed successfully
Response for adding liquidity to a pool
User-friendly request ID for tracking
"01HJZKFABCDEFGHJKLMNPQRSTVW"
Whether liquidity addition was accepted
true
LP tokens minted (populated if accepted)
"12340000.00000000"
Actual asset A amount used (populated if accepted)
x >= 0
"100000000"
Actual asset B amount used (populated if accepted)
x >= 0
"50000"
User-friendly error message (populated if rejected)
Details about refunded assets