Ecosystem
SDKs, APIs, and libraries for building on PerpCity -- choose the right tools for your use case.
Everything you need to build on PerpCity: an SDK to trade, the Bot API and subgraph to read market data, and eth.zig if you are building in Zig.
Choosing an SDK
There are three SDKs, and none of them is a reference implementation the others follow. Each covers the core trading surface -- opening, adjusting and closing taker and maker positions, reading market state, approving USDC -- and each is used somewhere in Strobe's own stack:
- Zig runs Strobe's production liquidation engine, together with eth.zig. It has no runtime and no garbage collector, encodes ABI calls at compile time, and ships the HFT pieces a bot needs: a lock-free nonce manager, gas cache, transaction pipeline, multi-RPC failover, opt-in pre-flight simulation, AWS KMS signing, event watching and stop-loss/take-profit triggers. Calls are synchronous, so concurrency is yours to structure.
- TypeScript runs the PerpCity web app. It is built on viem and signs through whatever wallet client you give it, and
0.19.0carries the protocol math for both deployed contract builds. Choose it for a UI, a Node.js bot, or an agent. - Rust is async on Tokio and Alloy, with Multicall3 batching, read/write RPC splitting, local swap simulation and maker-equity previews. Strobe's Legion agent framework builds on it from a git commit. The crates.io release is
0.3.0(September 2026); later releases are tagged on GitHub only.
Mixing is normal: run a strategy in Zig, Rust or TypeScript and put a TypeScript UI in front of the same markets.
At a glance
| Zig | TypeScript | Rust | |
|---|---|---|---|
| Latest release | v0.7.0 | 0.19.0 | 0.3.0 on crates.io; v0.12.0 on GitHub |
| Concurrency model | Synchronous | Promises | Async (Tokio) |
| Ethereum client | eth.zig | viem | Alloy |
| Used by Strobe in | Liquidation engine | Web app | Legion agents |
| Install | build.zig.zon git dependency | npm install @strobelabs/perpcity-sdk | Installation |
Liquidating current markets
Markets created since October 2026 run contracts v0.2.2, whose liquidate calls take a third argument. The Zig v0.7.0 and Rust crates.io 0.3.0 helpers send only the two-argument form and decode only the earlier close events, and the TypeScript SDK has no liquidation helper; TypeScript 0.19.0 carries both ABI forms, so you can encode the call yourself. Strobe's liquidation engine does the same on top of the Zig SDK. Rust v0.12.0 liquidates both builds, but only as a git dependency on the GitHub tag.
Data
- Bot API -- An indexed, read-only REST and WebSocket API for bots and agents: markets, prices, trades, positions, and liquidation candidates, on mainnet and testnet. Keys are self-service. See Bot API.
- Subgraph -- The Goldsky subgraph the Bot API is built on, queryable directly over GraphQL. Endpoints are on the Contracts page.
Libraries
- eth.zig -- A Zig Ethereum library with no package dependencies (its cryptography uses vendored C: libsecp256k1, blst, c-kzg-4844): comptime ABI encoding, signing, HD wallets, and full transaction support. It is the Ethereum client underlying the Zig SDK and Strobe's liquidation engine.
Oracles and market creation
Every market reads its index from a beacon oracle. Beacons and markets are created and updated by Strobe's internal infrastructure; there is no public API for creating them. To propose a market, contact the team.