This endpoint allows registered hosts to withdraw trading fees they have earned from AMM pools. The withdrawal is processed asynchronously through the TEE settlement system.
Hosts earn fees from every trade executed in pools associated with their namespace:
Requires a valid JWT bearer token. The token’s public key must match the fee recipient public key registered for the host.
lpIdentityPublicKey - The LP public key of the pool to withdraw fromassetAAmount - Optional amount of asset A fees to withdrawassetBAmount - Optional amount of asset B fees to withdrawnonce - Unique value for replay protectionsignature - Signature of the requestReturns a request ID for tracking the asynchronous withdrawal operation. The actual withdrawal will be processed by the settlement service.
lp_identity_public_key - Pool identifier (LP public key)asset_a_amount - Optional amount of asset A fees to withdrawasset_b_amount - Optional amount of asset B fees to withdrawnonce - Unique nonce for replay protectionsignature - Request signature200 OK if withdrawal is initiated successfully400 Bad Request if validation fails401 Unauthorized if authentication fails404 Not Found if pool or host not found500 Internal Server Error if settlement service failsBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Fee withdrawal details including pool ID, amounts, and authentication
Request payload for withdrawing host fees from an AMM pool.
This struct defines the required parameters for a host to withdraw accumulated fees from an AMM pool. The request includes the pool ID, optional amounts to withdraw, and authentication/signature data.
Identity public key of the LP wallet (pool ID). This identifies which pool to withdraw fees from.
"03abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
Nonce used for signature replay-protection.
"550e8400-e29b-41d4-a716-446655440000"
ECDSA signature of the vectorized JSON payload including all the other fields in this request.
"3045022100..."
Amount of asset B fees to withdraw in the smallest unit. Set to 0 to withdraw all available fees.
x >= 0500000
Fee withdrawal initiated successfully
Response for host fee withdrawal
Request ID for tracking
"01HJZKFABCDEFGHJKLMNPQRSTVW"
Whether withdrawal was initiated
true
Settlement service request ID for correlation
"018D5E56-9D80-7890-A1B2-C3D4E5F6G7H8"
Asset B amount withdrawn
x >= 0"500000"
Spark transfer ID for withdrawal
Error message if rejected