Docs

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

CapabilityHowStatus
Read markets, prices, open interest, trades, positionsBot API (REST + WebSocket)Live (testnet; API key required)
Open, adjust, and close positionsSDKs (on-chain transactions)Live (mainnet and testnet)
Provide liquidity as a makerSDKsLive
Liquidate underwater positionsSDKs + Bot API liquidatable-position feedLive

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/ws for 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:

SDKInstallBest for
TypeScriptnpm install @strobelabs/perpcity-sdkGeneral bots, frontends
Pythonpip install perpcity-sdkResearch, strategy prototyping
RustGitHub: StrobeLabs/perpcity-rust-sdkHFT, latency-sensitive systems
ZigGitHub: StrobeLabs/perpcity-zig-sdkHFT, 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:

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 (public faucets)
CollateralNative USDC 0xaf88d065e77c8cC2239327C5EDb3A432268e5831PerpCity 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.

  1. Explore markets in the app or via the Bot API to pick what to trade.
  2. Install an SDK and run its examples 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.