Skip to main content
POST
/
aiagent
/
charge-fee
/
kalshi
/
trade-fee
Charge Kalshi Fee
curl --request POST \
  --url https://www.aionmarket.com/bvapi/aiagent/charge-fee/kalshi/trade-fee \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": "0.10",
  "fromAddress": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1"
}
'
{
  "id": "<string>",
  "status": "<string>",
  "txSignature": "<string>",
  "fromAddress": "<string>",
  "toAddress": "<string>",
  "amount": "<string>"
}

Documentation Index

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

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

Charge the platform trading fee for a Kalshi order via Fireblocks Raw signing + SPL transferChecked on Solana.

Overview

After a successful Kalshi trade submission, the agent (or frontend) calls this endpoint with:
  • the fee amount (typically 1% of order amount)
  • the user’s fromAddress (Solana wallet, USDC ATA owner)
The backend reuses the exact same Fireblocks Raw signing + SPL transferChecked logic as POST /kalshi/charge-fee — the platform Fireblocks SOL key (already approved as the user’s SPL token delegate) signs an SPL transfer that moves USDC from the user’s USDC ATA to the platform fee ATA.
fee = orderAmount × 0.01
Example: A 10USDCbuyorderfee=10 USDC buy order → fee = **0.10 USDC**
The endpoint does not recompute the fee from the database; the caller is the source of truth for amount.

Platform Fee Address (Solana)

CHMkL5utJWFFHSkHX6pwWcb8VXj5jAz5fAqqMGAyEXcX

Prerequisites

  1. Agent registered and Kalshi order submitted via POST /kalshi/agent/submit
  2. Solana wallet holds sufficient USDC (order amount + fee)
  3. SPL token approval granted to the platform Fireblocks SOL address (the delegate)
  4. SOL for gas — the platform Fireblocks SOL wallet pays gas, but the user’s USDC ATA must exist
  5. Fireblocks TAP allows Raw signing for the SOL vault account

Request Body

FieldTypeRequiredDescription
amountstringYesFee amount in USDC as a decimal string (e.g. "0.10").
fromAddressstringYesUser’s Solana wallet address (USDC ATA owner).
{
  "amount": "0.10",
  "fromAddress": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1"
}

Response

id
string
Fireblocks transaction id (Raw signing job).
status
string
Final broadcast state, typically BROADCASTED.
txSignature
string
Solana transaction signature (after broadcast).
fromAddress
string
User’s Solana wallet (echoed).
toAddress
string
Platform fee receiving wallet on Solana.
amount
string
Fee amount echoed back as a decimal string.

Examples

curl -X POST "https://www.aionmarket.com/bvapi/aiagent/charge-fee/kalshi/trade-fee" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "0.10",
    "fromAddress": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1"
  }'

Error Responses

StatusDescription
400amount is required / fromAddress is required
400平台 delegate 地址与用户钱包地址相同 — fromAddress equals the platform vault SOL address
400Solana 地址无效 — invalid pubkey
400Fireblocks 签名失败 ... BLOCKED_BY_POLICY — Fireblocks TAP rejects Raw signing; configure a Raw Signing rule allowing the SOL vault
400Solana 广播失败 — RPC rejection (insufficient delegated allowance, no USDC balance, etc.)
500Fireblocks SDK call failed

Important Notes

  • Kalshi fees are NOT auto-charged — the agent must call this endpoint after every successful trade.
  • This endpoint is stateless — the caller decides amount and wallet; the backend does no DB lookup. Callers must implement idempotency.
  • Underlying logic is identical to POST /kalshi/charge-fee.
  • If BLOCKED_BY_POLICY is returned, configure a Transaction Authorization Policy rule in the Fireblocks Console allowing Raw Signing for the SOL vault used by the platform.

Authorizations

Authorization
string
header
default:YOUR_API_KEY
required

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

Body

application/json
amount
string
required

Fee amount in USDC as a decimal string (e.g. '0.10').

Example:

"0.10"

fromAddress
string
required

User's Solana wallet address (USDC ATA owner).

Example:

"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1"

Response

Fee broadcast result

id
string

Fireblocks transaction id (Raw signing job)

status
string

Broadcast status, typically BROADCASTED

txSignature
string

Solana transaction signature

fromAddress
string
toAddress
string
amount
string