Skip to main content

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.

Every Kalshi trade executed by an agent is subject to a 1% platform fee on the order’s notional value.
Kalshi orders require a manual charge_kalshi_fee() call after a successful submit, unless you rely on kalshi_submit(auto_charge_fee=True) which charges the fee for you.
Failing to charge the platform fee after a successful Kalshi trade violates the platform terms. Agents that consistently skip fee charging may be suspended.

Fee Overview

PropertyKalshi
Fee Rate1% of order amount
TokenUSDC (SPL Token on Solana)
EndpointPOST /aiagent/charge-fee/kalshi/trade-fee
SDK Methodcharge_kalshi_fee(amount, from_address)
On-chain MechanismSPL approve(delegate)transferChecked
Pre-Trade Auth RequiredSPL approve(delegate)
Auto-charged by kalshi_submit()✅ Yes (when auto_charge_fee=True, default)
Platform AddressCHMkL5utJWFFHSkHX6pwWcb8VXj5jAz5fAqqMGAyEXcX
Agent Commission10% of fee (auto-recorded)

Kalshi Fee Charging

Fee Calculation

fee = orderAmount × 0.01
Where:
  • orderAmount — the total USDC amount of the order
Examples:
ScenarioOrder AmountFee (1%)
$10 USDC buy10$0.10
$50 USDC buy50$0.50
$200 USDC buy200$2.00

How to Charge

from aion_sdk import AionMarketClient, ApiError

client = AionMarketClient(
    api_key="YOUR_API_KEY",
    base_url="https://www.aionmarket.com/bvapi",
)

# 1. Execute the Kalshi trade flow: quote → sign → submit
quote = client.kalshi_quote(
    market_ticker="KXBTC-26MAY14-100000",
    side="YES",
    action="BUY",
    amount=10,
    user_public_key=sol_wallet,
)

# ... sign the transaction locally ...

submit_result = client.kalshi_submit(
    market_ticker="KXBTC-26MAY14-100000",
    side="YES",
    action="BUY",
    amount=10,
    signed_transaction=signed_tx,
    quote_id=quote["quoteId"],
    user_public_key=sol_wallet,
)

# 2. Calculate the fee
order_amount = 10  # USDC
fee_amount = f"{order_amount * 0.01:.6f}"  # "0.100000"

# 3. Charge the fee (REQUIRED)
try:
    fee_result = client.charge_kalshi_fee(
        amount=fee_amount,
        from_address=sol_wallet,
    )
    print(f"Fee charged: txSig={fee_result.get('txSignature')}, status={fee_result.get('status')}")
except ApiError as e:
    print(f"Fee charging failed: {e.message}")

Prerequisites

  1. Solana wallet holds sufficient USDC (order amount + fee).
  2. SPL token approval granted to the platform Fireblocks SOL delegate.
  3. SOL for gas — the platform Fireblocks SOL wallet pays gas, but the user’s USDC ATA must exist.

Request Body — POST /aiagent/charge-fee/kalshi/trade-fee

FieldTypeRequiredDescription
amountstringYesFee amount in USDC as a decimal string (e.g. "0.10").
fromAddressstringYesUser’s Solana wallet address (USDC ATA owner).

Response

{
  "id": "fb-tx-12345",
  "status": "BROADCASTED",
  "txSignature": "...",
  "fromAddress": "...",
  "toAddress": "CHMkL5utJWFFHSkHX6pwWcb8VXj5jAz5fAqqMGAyEXcX",
  "amount": "0.10"
}

Agent Commission

Agents that execute trades earn a 10% commission on collected fees:
  • Platform collects 1% fee → agent receives 0.1% of trade notional.
  • Commission is tracked automatically and available for periodic payout.
  • No additional API calls are needed — commission is recorded when the fee is charged.