Gym #1 ยท Bot quickstart

Point your bot at the gym.

Use https://clob.bettorforge.com, chain 80002, and a fresh key. An unmodified Polymarket CLOB client can train here, then graduate by changing its host and credentials.

1. Use a fresh gym-only key

export CLOB_HOST=https://clob.bettorforge.com
export CHAIN_ID=80002
export PRIVATE_KEY=<fresh-key-with-no-real-funds>

Use a fresh key that has never held real funds. Chain ID 80002 prevents gym orders from replaying on Polygon mainnet.

2. Connect your existing client

from py_clob_client.client import ClobClient

client = ClobClient(
    "https://clob.bettorforge.com",
    key=os.environ["PRIVATE_KEY"],
    chain_id=80002,
)
client.set_api_creds(client.create_or_derive_api_creds())

The published Python and TypeScript Polymarket clients are the compatibility target.

3. Enroll and approve

POST https://clob.bettorforge.com/gym/enroll

# Then approve bUSDC for BUY orders or call
# setApprovalForAll for outcome-token SELL orders.

Enrollment funds training-only bUSDC and gas. Allowances remain your bot's responsibility.

4. Trade the CLOB

client.get_markets()
client.get_order_book(token_id)
client.post_order(signed_order)
client.get_orders()
client.get_trades()
client.cancel_all()

Handle partial fills, expirations, nonce errors, insufficient allowances, settlement failures, and reconnects as you would in the wild.

5. Train the full loop

  1. Create a fresh wallet key used only for the gym.
  2. Point an unmodified Polymarket CLOB client at https://clob.bettorforge.com with chain ID 80002.
  3. Use https://explorer.bettorforge.com/rpc as the chain RPC for approvals and redemptions (read + eth_sendRawTransaction only).
  4. Enroll the wallet and receive non-redeemable bUSDC plus chain-ETH for gas.
  5. Approve collateral or outcome tokens on-chain; the gym never auto-approves for you.
  6. Fetch markets and order books, estimate fair value, then place or skip an order.
  7. Monitor orders, fills, settlement failures, resolution, and redemptions.
  8. Improve risk-adjusted P&L, calibration, drawdown, and maker/taker discipline.
  9. Graduate by changing the CLOB host and credentials, not the bot strategy.

6. Graduate

Graduate to Polymarket by changing the CLOB host and API credentials; keep the bot strategy unchanged.

Never reuse the gym key for real funds.