Polymarket Edge Trader
Setup
Install the AION SDK:
pip install aion-sdk
This is a template. The default signal is a user-supplied fair YES probability for markets matching MARKET_QUERY.
Remix the query, the probability model, or the candidate selection logic. The skill already handles market discovery,
dry-run safety, pre-trade context checks, position sizing, operator summaries, and AION trade tagging.
What It Does
- Scans active AION Polymarket markets matching
MARKET_QUERY
- Scores each candidate against
MODEL_PROBABILITY
- Picks the market with the largest absolute edge
- Skips trades when edge is too small, slippage is too high, briefing risk alerts are active, or AION warns about flip-flopping
- Sizes the position with a Kelly-style bankroll model
- Prints an operator summary with risk state, decisions, and order updates
- Executes through
AionMarketClient.trade() when you explicitly provide --live and a signed order payload
Defaults
MARKET_QUERY=bitcoin
MODEL_PROBABILITY=0.60
TARGET_VENUE=polymarket
MAX_MARKETS=25
MAX_STAKE_USD=50
MIN_EDGE=0.03
MAX_SLIPPAGE_PCT=0.15
STARTING_BALANCE_USD=1000
AION_BASE_URL=https://pm-t1.bxingupdate.com/bvapi
AION_KELLY_MULTIPLIER=0.25
AION_MIN_EV=0.03
WALLET_ADDRESS=
AION_SIGNED_ORDER_JSON=
How To Run
Dry-run is the default:
python edge_trader.py
Trade a different query with a custom fair probability:
python edge_trader.py --query "fed" --probability 0.64
Live trading requires an explicit live flag, a wallet address, and a pre-signed order payload:
WALLET_ADDRESS=0xYourWallet \
AION_SIGNED_ORDER_JSON='{"maker":"...","signer":"...","taker":"0x0000000000000000000000000000000000000000","tokenId":"...","makerAmount":"...","takerAmount":"...","side":"BUY","expiration":"...","signature":"...","salt":"...","signatureType":0,"nonce":"...","feeRateBps":"0"}' \
python edge_trader.py --query "bitcoin" --probability 0.58 --live
Required Credentials
AION_API_KEY is always required
WALLET_PRIVATE_KEY is optional and only needed for self-custody Polymarket trading
WALLET_ADDRESS is required for user-scoped briefing and live order submission
AION_SIGNED_ORDER_JSON is only required for live order submission, because the AION SDK expects a complete signed order payload
Remix Ideas
- Replace
MODEL_PROBABILITY with your own model output or external API
- Swap
discover_markets() for briefing.opportunityMarkets or another shortlist source
- Generate the signed order JSON from your own order builder or wallet flow before calling
--live
- Add sell logic or rebalance logic around existing positions
- Tighten or relax the context filters for a higher-frequency strategy