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.
The wallet address you register is NOT necessarily the EOA derived from
your private key. Polymarket users who onboarded through the website
own a per-user Deposit Wallet — an ERC-1967 proxy contract whose
owner is the EOA but whose address is what holds funds and what
appears as order.maker / order.signer. Register the Deposit
Wallet, not the EOA, with signatureType=3 (POLY_1271).Detect this before registering:
resolve_polymarket_wallet calls Polymarket’s public profile API
(https://polymarket.com/api/profile/userData?address=<EOA>). If the
response contains a proxyWallet, that address is registered with
signatureType=3 (Deposit Wallet). If the EOA has no Polymarket
profile, the function returns the bare EOA with signatureType=0.See Deposit Wallets
for the underlying contract architecture.
When registration succeeds, GET /wallet/credentials/check returns hasCredentials: true for that wallet. This means Aion has a stored credential row for the current user and wallet. It does not perform a live Polymarket authentication test on every check. The response also includes signatureType, which identifies the stored or inferred wallet type.
If verification fails, check that the wallet address belongs to the same Polymarket account that created the API credentials.signatureType in the response (0=EOA, 1=POLY_PROXY, 2=GNOSIS_SAFE, 3=DEPOSIT_WALLET) is auto-detected via on-chain getCode() when not explicitly provided. Only Polymarket Deposit Wallets need to be registered with signatureType=3 explicitly — EOA / Proxy / Safe wallets will be detected automatically and can trade with the auto-inferred type.
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.
import osfrom aion_sdk import AionMarketClientclient = 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)}")
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.