Skip to main content
POST
/
aiagent
/
charge-fee
/
polymarket
/
{orderHashId}
Charge Polymarket Fee
curl --request POST \
  --url https://pm-t1.bxingupdate.com/bvapi/aiagent/charge-fee/polymarket/{orderHashId} \
  --header 'Authorization: Bearer <token>'
{
  "transactionId": "<string>",
  "feeAmount": 123,
  "status": "PENDING"
}

Documentation Index

Fetch the complete documentation index at: https://docs-t.aionmarket.com/llms.txt

Use this file to discover all available pages before exploring further.

Charge the 1% platform trading fee for a Polymarket order via Safe AllowanceModule.

Overview

After a successful Polymarket trade, the platform charges a 1% fee on the order’s notional value (orderSize × price). Fees are denominated in pUSD on Polygon. Fee collection is handled automatically by a server-side cron (every 3 seconds), but agents can also trigger it explicitly via this endpoint.

Fee Calculation

fee = orderSize × price × 0.01
Example: 100 contracts at 0.55notional=0.55 → notional = 55 → fee = $0.55 pUSD

Platform Fee Address (Polygon)

0xeA44cAF1f893729342dC5D8903F658E8D3e2379B

Prerequisites

  1. Agent registered and order placed via POST /markets/trade
  2. Safe AllowanceModule enabled on user’s Polygon Safe wallet
  3. Fireblocks platform address added as delegate in the AllowanceModule
  4. Sufficient pUSD allowance set on the AllowanceModule for the platform delegate

Path Parameters

ParameterTypeRequiredDescription
orderHashIdstringYesPolymarket CLOB order hash (e.g. 0xabc123...)

Response

transactionId
string
Fireblocks transaction ID for tracking the fee transfer
feeAmount
number
Fee amount charged in pUSD (6 decimals)
status
string
Transaction status — typically PENDING initially, confirmed by Fireblocks webhook

Examples

curl -X POST "https://pm-t1.bxingupdate.com/bvapi/aiagent/charge-fee/polymarket/0xabc123def456" \
  -H "Authorization: Bearer YOUR_API_KEY"

Error Responses

StatusCodeDescription
400ORDER_NOT_FOUNDOrder hash not found in system
400SAFE_NOT_CONFIGUREDUser’s Safe wallet address not configured
400INVALID_FEE_AMOUNTCalculated fee is zero or negative
400ALLOWANCE_INSUFFICIENTSafe AllowanceModule has insufficient pUSD allowance
500FIREBLOCKS_ERRORFireblocks API call failed

Notes

  • Polymarket fees are also collected automatically by a cron job every 3 seconds
  • If the fee has already been charged (order handleStatus = 1), calling this endpoint again is a no-op
  • The transactionId can be used to poll Fireblocks for final confirmation status
  • Agent commission (10% of fee) is recorded automatically when fee is charged

Authorizations

Authorization
string
header
default:YOUR_API_KEY
required

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

Path Parameters

orderHashId
string
required

Polymarket CLOB order hash (e.g. 0xabc123...)

Response

Fee charge initiated

transactionId
string

Fireblocks transaction ID

feeAmount
number

Fee amount in USDC.e (6 decimals)

status
enum<string>

Transaction status

Available options:
PENDING,
COMPLETED,
FAILED