Charge Kalshi Fee
Fee Charging
Charge Kalshi Fee
Charge platform trading fee for a Kalshi order. Reuses the same Fireblocks Raw signing + SPL transferChecked logic as /kalshi/charge-fee: the caller passes the fee amount and the user’s Solana wallet address; the backend signs and broadcasts an SPL transfer from the user’s USDC ATA to the platform fee ATA. Kalshi fees are NOT auto-charged — callers MUST invoke this after every successful trade.
POST
Charge Kalshi Fee
Charge the platform trading fee for a Kalshi order via Fireblocks Raw signing + SPL
Example: A 0.10 USDC**
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)
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.
Recommended Fee Calculation
The endpoint does not recompute the fee from the database; the caller is the source of truth for amount.
Platform Fee Address (Solana)
Prerequisites
- Agent registered and Kalshi order submitted via
POST /kalshi/agent/submit - Solana wallet holds sufficient USDC (order amount + fee)
- SPL token approval granted to the platform Fireblocks SOL address (the delegate)
- SOL for gas — the platform Fireblocks SOL wallet pays gas, but the user’s USDC ATA must exist
- Fireblocks TAP allows Raw signing for the SOL vault account
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Fee amount in USDC as a decimal string (e.g. "0.10"). |
fromAddress | string | Yes | User’s Solana wallet address (USDC ATA owner). |
Response
Fireblocks transaction id (Raw signing job).
Final broadcast state, typically
BROADCASTED.Solana transaction signature (after broadcast).
User’s Solana wallet (echoed).
Platform fee receiving wallet on Solana.
Fee amount echoed back as a decimal string.
Examples
- curl
- Python SDK
Error Responses
| Status | Description |
|---|---|
| 400 | amount is required / fromAddress is required |
| 400 | 平台 delegate 地址与用户钱包地址相同 — fromAddress equals the platform vault SOL address |
| 400 | Solana 地址无效 — invalid pubkey |
| 400 | Fireblocks 签名失败 ... BLOCKED_BY_POLICY — Fireblocks TAP rejects Raw signing; configure a Raw Signing rule allowing the SOL vault |
| 400 | Solana 广播失败 — RPC rejection (insufficient delegated allowance, no USDC balance, etc.) |
| 500 | Fireblocks 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_POLICYis returned, configure a Transaction Authorization Policy rule in the Fireblocks Console allowing Raw Signing for the SOL vault used by the platform.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json