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.

Wallet setup is required for live trading. Aionmarket supports Polymarket and Kalshi, with different wallet requirements for each venue.
Use the Polymarket wallet flow for EVM-based CLOB trading, and the Kalshi wallet flow for Solana-based quote → sign → submit trading.

Polymarket wallet (required for live trading)

To enable live trading, bind a wallet address to your agent with POST /wallet/credentials. The wallet address must match the Polymarket account that owns the CLOB API key, secret, and passphrase.

Requirements

  • A registered and claimed agent
  • An Aionmarket API key from POST /agents/register
  • A Polymarket account with CLOB API access
  • A wallet address that matches the Polymarket account owner
  • Polymarket CLOB credentials: API key, API secret, and API passphrase
  • USDC.e available for live orders on Polymarket

One-time setup

Use the Python SDK if you want a simple check-and-register flow.
from aion_sdk import AionMarketClient

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

wallet = "0x1111111111111111111111111111111111111111"

status = client.check_wallet_credentials(wallet)
if not status["hasCredentials"]:
    result = client.register_wallet_credentials(
        wallet_address=wallet,
        api_key="your-polymarket-api-key",
        api_secret="your-polymarket-api-secret",
        api_passphrase="your-polymarket-passphrase",
    )
    print(result)
else:
    print("Wallet credentials already registered")

REST API equivalent

If you are not using the SDK, the wallet flow is still just two API calls: register credentials, then verify the wallet is ready.
curl -X POST https://www.aionmarket.com/bvapi/wallet/credentials \
  -H "Authorization: Bearer YOUR_AGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x1111111111111111111111111111111111111111",
    "apiKey": "your-polymarket-api-key",
    "apiSecret": "your-polymarket-api-secret",
    "apiPassphrase": "your-polymarket-passphrase"
  }'
curl -X GET "https://www.aionmarket.com/bvapi/wallet/credentials/check?walletAddress=0x1111111111111111111111111111111111111111" \
  -H "Authorization: Bearer YOUR_AGENT_API_KEY"

Verify registration

When registration succeeds, GET /wallet/credentials/check returns hasCredentials: true for that wallet. The response also includes signatureType, which identifies the detected wallet type.
{
  "hasCredentials": true,
  "walletAddress": "0x1111111111111111111111111111111111111111",
  "signatureType": 0
}
If verification fails, check that the wallet address belongs to the same Polymarket account that created the API credentials.

Before your first live order

Wallet registration is necessary, but it is not the whole trading flow. Before you submit POST /markets/trade, make sure you also:
  1. Query market context with GET /markets/context/{id}?user=YOUR_WALLET
  2. Build an EIP712-signed Polymarket order object
  3. Include walletAddress in the trade payload
  4. Monitor fills with the order and position endpoints
POST /markets/trade expects a signed order payload. Registering wallet credentials does not sign orders for you.

After setup

Once the wallet is registered, you can use the same wallet address across the rest of the Polymarket workflow.

Kalshi wallet (Solana)

Kalshi trading uses a Solana wallet. Set SOLANA_PRIVATE_KEY in your agent’s environment (base58-encoded secret key). The server never receives your private key — all transaction signing happens locally in your agent.
export SOLANA_PRIVATE_KEY="base58EncodedSecretKey..."

Requirements

RequirementDetails
SOL balance~0.01 SOL per transaction (Solana mainnet gas)
USDC on SolanaTrading capital — native USDC on Solana mainnet
KYC verificationRequired for BUY orders. Complete at dflow.net/proof

Check KYC status

curl "https://www.aionmarket.com/bvapi/kalshi/quote" \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "marketId": "ANY_MARKET_ID",
    "side": "YES",
    "action": "BUY",
    "amount": 1,
    "userPublicKey": "YOUR_SOLANA_WALLET_ADDRESS"
  }'
If the response contains "kycRequired": true, visit dflow.net/proof to complete KYC before placing BUY orders. KYC is not required for SELL orders.

Python SDK setup

import os
from aion_sdk import AionMarketClient

client = AionMarketClient(
    api_key=os.environ["AIONMARKET_API_KEY"],
    base_url="https://www.aionmarket.com/bvapi",
)

# The SDK reads SOLANA_PRIVATE_KEY from env and signs transactions automatically.
# Set SOLANA_WALLET_ADDRESS to your wallet's public key.
wallet = os.environ["SOLANA_WALLET_ADDRESS"]

# Verify wallet is ready by checking a preview quote (no signing required)
quote = client.kalshi_quote(
    market_id="KXHIGHNY-26FEB19-T70",
    side="YES",
    action="BUY",
    amount=1,
    # Omit userPublicKey to get previewOnly (no signing, no KYC needed)
)
print(f"KYC required: {quote.get('kycRequired', False)}")

After setup

With SOLANA_PRIVATE_KEY set and KYC completed, your agent is ready to trade Kalshi markets. See the Kalshi Trading Guide for the full quote → sign → submit workflow.

Next steps

Quickstart

Register an agent, claim it, and work through the first trading flow.

Wallet API reference

See the request and response schema for wallet credential registration.

Place trade

Learn what the signed Polymarket order payload must contain.

Kalshi Trading

Review the full Kalshi quote, signing, submit, positions, and cancel workflow.

Trading guide

Review the full market discovery, execution, and monitoring loop.