Charge the platform trading fee for a Polymarket order placed by an EOA wallet (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.
signatureType=0) on Polygon.
Overview
This is the EOA-wallet counterpart ofPOST /aiagent/charge-fee/polymarket/trade-fee. Use it whenever the order was signed with signatureType=0 (a raw externally-owned account, the most common setup for autonomous agents).
The backend executes:
msg.sender. For this to succeed, the EOA must have already approved the Vault as a pUSD spender on Polygon:
GET /aiagent/charge-fee/polymarket/spender (or client.get_polymarket_eoa_spender()).
Since SDK v0.10.0,
client.trade() calls this endpoint automatically after a successful order with signatureType=0, and runs pUSD.approve(...) for you when you pass eoa_private_key= (or set AION_EOA_PRIVATE_KEY). Calling this endpoint directly is only required when you opt out of auto-charging or are not using the Python SDK.Recommended Fee Calculation
Platform Fee Address (Polygon)
Prerequisites
- Agent registered and order placed via
POST /markets/tradewithsignatureType=0 - EOA wallet holds enough pUSD to cover the fee
- EOA has approved the Fireblocks Vault as pUSD spender on Polygon — i.e. on-chain
pUSD.allowance(eoaAddress, <Vault>) >= amount. The endpoint validates this allowance and returns400with a clear remediation message if it is insufficient.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Fee amount in pUSD as a decimal string (e.g. "0.55"). Parsed with token decimals on the backend (6). |
eoaAddress | string | Yes | User’s EOA Polygon address (the funder). |
Response
The response is the raw FireblockscreateTransaction response.
Fireblocks transaction id for tracking.
Fireblocks status, typically
SUBMITTED / PENDING_SIGNATURE initially.Examples
- curl
- Python SDK (recommended one-shot)
- Python SDK (manual)
Error Responses
| Status | Description |
|---|---|
| 400 | amount is required / eoaAddress is required |
| 400 | EOA 钱包对平台 Fireblocks 地址的 pUSD 授权额度不足 — EOA hasn’t run pUSD.approve(<Vault>, allowance), or allowance is below amount. The error message includes spender and the required amount; remediate by re-running approve_pusd_for_fireblocks(...). |
| 400 | 无法解析 Fireblocks Vault (...) 的 Polygon 地址 — operator-side Fireblocks misconfiguration |
| 400 | BLOCKED_BY_POLICY — Fireblocks TAP rejected the contract call |
| 500 | Fireblocks SDK call failed |
Notes
- Stateless — the caller decides amount and wallet; the backend does no database lookup of the order.
- Not idempotent — calling twice will broadcast two
transferFromtransactions. If you opt out ofauto_charge_fee, implement deduplication on your side. - The on-chain spender for
pUSD.approveis the Fireblocks Vault address (returned byGET /aiagent/charge-fee/polymarket/spender), not the platform fee receiver0xeA44.... The fee receiver is the destination inside thetransferFromcall, not the spender.