Trading Bots and Agents
How trading bots and AI agents read PerpCity market data and place trades - APIs, SDKs, and wallet requirements.
PerpCity is a perpetual futures exchange on Arbitrum One for non-financial indices - fantasy-sports player points, maritime traffic, social metrics, and other real-world data streams. Trading is fully on-chain and non-custodial, which makes PerpCity directly usable by programmatic traders: a bot holds its own keys, reads market data over HTTP, and settles trades as ordinary Arbitrum transactions.
This page is the map: what a bot or agent can do today, what it needs, and where each piece lives.
What a bot can do
| Capability | How | Status |
|---|---|---|
| Read markets, prices, open interest, trades, positions | Bot API (REST + WebSocket) | Live (testnet; API key required) |
| Open, adjust, and close positions | SDKs (on-chain transactions) | Live (mainnet and testnet) |
| Provide liquidity as a maker | SDKs | Live |
| Liquidate underwater positions | SDKs + Bot API liquidatable-position feed | Live |
There is no custodial trading API: PerpCity never holds bot funds or keys. Every trade is a transaction the bot signs itself.
Market data: the Bot API
A read-only REST API over indexed protocol data, so bots do not need their own chain indexer:
- Base URL:
https://testnet-bot-api.perp.city(Arbitrum Sepolia data) - Interactive docs: /docs, machine-readable spec: /openapi.json
- Endpoints: markets, per-market stats and live state, price history, recent trades, positions, and liquidatable-position candidates
- WebSocket stream at
/v1/wsfor live prices and trades
Access currently requires an API key issued by the team - contact contact@strobe.org. Mainnet market data is available through the SDKs directly from the chain.
Placing trades: the SDKs
Trading is on-chain through the protocol contracts. Pick a language:
| SDK | Install | Best for |
|---|---|---|
| TypeScript | npm install @strobelabs/perpcity-sdk | General bots, frontends |
| Python | pip install perpcity-sdk | Research, strategy prototyping |
| Rust | GitHub: StrobeLabs/perpcity-rust-sdk | HFT, latency-sensitive systems |
| Zig | GitHub: StrobeLabs/perpcity-zig-sdk | HFT, minimal-footprint systems |
Each SDK covers the full trading surface: open/adjust/close taker positions, maker liquidity, liquidations, and market reads. Contract addresses are on the Contracts page.
What a bot needs: wallet requirements
Humans do not need this
A human trading in the app can sign in with just an email - an embedded wallet is created automatically. The requirements below are for standalone bots signing their own transactions.
A bot needs three things before its first trade:
| Requirement | Mainnet (Arbitrum One, chain 42161) | Testnet (Arbitrum Sepolia, chain 421614) |
|---|---|---|
| Wallet keypair | Any EOA the bot controls | Same |
| Gas | ETH on Arbitrum One (cents per trade) | Arbitrum Sepolia ETH (public faucets) |
| Collateral | Native USDC 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 | PerpCity test USDC 0xBEF280BefeE2Cb28c20D1E4Cc1da999B4DA0f1fD |
Funding the wallet is the one step that is not yet self-serve for autonomous agents: a human transfers USDC and gas to the bot's address. Start on testnet, verify your strategy, then fund a mainnet wallet.
Recommended path
- Explore markets in the app or via the Bot API to pick what to trade.
- Install an SDK and run its examples against Arbitrum Sepolia with a funded test wallet.
- Verify fills, funding payments, and liquidation behavior on testnet.
- Fund a mainnet wallet with USDC and gas, point the SDK at Arbitrum One, and go live.
Protocol mechanics that strategies depend on: Fees, Funding, Liquidations, Liquidity.