POST
/
v1
/
hosts
/
withdraw-fees
Withdraw Host Fees
curl --request POST \
  --url https://api.amm.flashnet.xyz/v1/hosts/withdraw-fees \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "assetBAmount": 500000,
  "lpIdentityPublicKey": "03abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567",
  "nonce": "550e8400-e29b-41d4-a716-446655440000",
  "signature": "3045022100a7e5d4f8b2c9a1e6f0d5b8c4a9e7f2d1c8b5a4e9f0d6c5b3a2e1d0c9b8a7f02201f2e3d4c5b6a7980e9f0a1b2c3d4e5f67889a0b1c2d3e4f5a6b7c8d9e0f1a2b3"
}'
{
"message": "Host fee withdrawal initiated successfully",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"status": "initiated"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

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.

lpIdentityPublicKey
string
required

Identity public key of the LP wallet (pool ID). This identifies which pool to withdraw fees from.

Example:

"03abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"

nonce
string
required

Nonce used for signature replay-protection.

Example:

"550e8400-e29b-41d4-a716-446655440000"

signature
string
required

ECDSA signature of the vectorized JSON payload including all the other fields in this request.

Example:

"3045022100..."

assetBAmount
integer | null

Optional: Amount of asset B fees to withdraw in the smallest unit. If not specified, all available asset B fees will be withdrawn.

Required range: x >= 0
Example:

500000

Response

Fee withdrawal initiated successfully

Response for host fee withdrawal

requestId
string
required

Request ID for tracking

Example:

"01HJZKFABCDEFGHJKLMNPQRSTVW"

accepted
boolean
required

Whether withdrawal was initiated

Example:

true

assetBWithdrawn
integer | null

Asset B amount withdrawn

Required range: x >= 0
Example:

"500000"

transferId
string | null

Spark transfer ID for withdrawal

error
string | null

Error message if rejected