Perp CityDocs

Trading Bots and Agents

How trading bots and AI agents read PerpCity market data and place trades - the Bot API, 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, what it needs, and where each piece lives.

What a bot can do

CapabilityHow
Read markets, prices, open interest, trades, positionsBot API (REST + WebSocket), or the subgraph
Open, adjust, and close positionsSDKs (on-chain transactions)
Provide liquidity as a makerSDKs
Find and liquidate underwater positionsBot API liquidation feed + an on-chain liquidation call

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 and WebSocket API over indexed protocol data, so bots do not need their own chain indexer. It never makes on-chain calls per request; confirm anything you are about to act on against the chain.

Mainnet (Arbitrum One)Testnet (Arbitrum Sepolia)
Base URLhttps://bot-api.perp.cityhttps://testnet-bot-api.perp.city

Keys are self-service, from perp.city/developer or by signing a challenge with a wallet. Send the key in the X-API-Key header; the limit is 120 requests per minute per key. The Bot API section covers endpoints, the liquidation feeds and the WebSocket protocol, and Authentication & Rate Limits covers keys and errors.

Placing trades: the SDKs

Trading is on-chain through each market's Perp contract. Pick a language:

SDKBest for
ZigNo-runtime trading systems and liquidators; Strobe's liquidation engine runs on it
TypeScriptFrontends, Node.js bots and agents; the PerpCity web app runs on it
RustAsync Rust systems on Tokio and Alloy

Ecosystem compares them, including which releases can liquidate current markets.

Contract addresses are on the Contracts page.

Liquidations on current markets

Markets created since October 2026 run contracts v0.2.2, whose liquidateTaker / liquidateMaker take a third argument (the amount to liquidate). Older markets use the two-argument form. Check that your SDK version supports the market you are liquidating.

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:

RequirementMainnet (Arbitrum One, chain 42161)Testnet (Arbitrum Sepolia, chain 421614)
Wallet keypairAny EOA the bot controlsSame
GasETH on Arbitrum One (cents per trade)Arbitrum Sepolia ETH from a public faucet
CollateralNative USDC 0xaf88d065e77c8cC2239327C5EDb3A432268e5831PerpCity test USDC 0xBEF280BefeE2Cb28c20D1E4Cc1da999B4DA0f1fD

Funding is not self-serve for autonomous agents: a human transfers USDC and gas to the bot's address. Test USDC is not on public faucets; ask the team in Telegram.

  1. Explore markets in the app or through the Bot API.
  2. Create an API key and install an SDK; run it against Arbitrum Sepolia with a funded test wallet.
  3. Verify fills, funding payments, and liquidation behavior on testnet.
  4. 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.

On this page