Skip to main content
This page walks you from a fresh pmxt_api_key to a confirmed position on Polymarket in under a minute. Hosted mode is the default: PMXT custodies USDC in PreFundedEscrow and your wallet only ever signs EIP-712 typed-data payloads — no private key leaves your machine when you trade.
Hosted trading currently supports Polymarket (Polygon) and Opinion (cross-chain). Other venues are read-only via the hosted catalog. To trade on those, run the self-hosted server with raw venue credentials.

1. Get an API key

Go to pmxt.dev/dashboard, create a key, and copy it. It looks like pmxt_live_... and works immediately.
export PMXT_API_KEY="pmxt_live_..."

2. Install the SDK

pip install pmxt

3. Construct a hosted client

A hosted trading client takes three things: your PMXT API key, the wallet address you’ll trade from, and the private key for that wallet (used only to sign EIP-712 messages locally — it is never sent to PMXT). The SDK auto-wraps private_key into an EthAccountSigner / EthersSigner for you.
import pmxt

client = pmxt.Polymarket(
    pmxt_api_key="pmxt_live_...",
    wallet_address="0xYourWallet...",
    private_key="0xYourPrivateKey...",
)
Use a dedicated trading wallet. The private key only stays on your machine for local signing, but treat the wallet as compromised if the host is ever compromised. Read Security before funding production wallets.

4. Approve and deposit USDC into escrow

Hosted trades execute against your balance in PMXT’s PreFundedEscrow contract. The first time you trade, you need to (a) approve the escrow to pull USDC from your wallet, and (b) deposit. Both methods on client.escrow build unsigned transactions — you submit them with your wallet (web3, ethers, viem, MetaMask, etc.).
# 1. Build an unsigned ERC-20 approval tx for USDC
approve_tx = client.escrow.approve_tx("usdc")
# Sign and send approve_tx with your wallet library...

# 2. Build an unsigned deposit tx for 10 USDC
deposit_tx = client.escrow.deposit_tx(amount=10.0)
# Sign and send deposit_tx with your wallet library...

# 3. Confirm the deposit landed
balance = client.fetch_balance()
print(f"Escrow USDC: {balance.free}")
Approval and deposit are one-time setup. Subsequent trades just spend from escrow until you withdraw. See Escrow Lifecycle for the full deposit / withdraw flow.

5. Place your first market order

Let’s buy 5 USDC of the YES outcome on “Will the Knicks win the 2026 NBA Championship?”. These UUIDs come straight from the live hosted catalog.
order = client.create_order(
    market_id="2eeb03dc-404b-41d5-bc57-6aeb37927ae6",
    outcome_id="a114f052-1fd1-4bcd-b9cf-de019db81b67",
    side="buy",
    order_type="market",
    amount=5.0,
    denom="usdc",
    slippage_pct=30.0,
)
print(f"Order {order.id}: {order.status}")
Polymarket has a 5-share minimum per order. At ~0.78/share,a5USDCbuyis 6.4sharesfine.But0.78/share, a 5 USDC buy is ~6.4 shares — fine. But 2 at the same price is only 2.5 shares and will be rejected with OrderSizeTooSmall. Size up or switch to a cheaper outcome.
Use aggressive slippage_pct until the upstream economic validator tightens its worst_price checks. Pragmatic defaults: slippage_pct=30 for buys, slippage_pct=99.9 for sells. Lower values frequently trip a precision check that has nothing to do with actual slippage.

6. Verify the fill

Hosted positions appear immediately on fetch_positions. The position’s quantity and notional reflect the escrow-side accounting.
positions = client.fetch_positions()
for p in positions:
    print(f"{p.market_id}  qty={p.quantity}  notional={p.notional}")
That’s it — you placed a real trade through hosted PMXT. From here:
  • Escrow lifecycle — deposits, withdrawals, the request/claim timelock.
  • Hosted errors — what each error means and how to recover.
  • Signing — the EIP-712 protocol underneath create_order.
  • Self-hosted — when to skip hosted and run pmxt-core yourself.