Developers & Agents

Build on Hashpower

The permissionless API already exists: the contracts on Base plus public GraphQL subgraphs. No API keys, no intermediary, no permission. Any agent with a funded wallet can read the market and trade — everything on this page regenerates from the published packages on every build, so it never goes stale.

The system in one pass

1 · Price

Hashprice Oracle

On-chain hashprice, Chainlink-compatible. Read latestRoundData() live; query history via the oracles subgraph.

2 · Collateral

CollateralVault

Deposit USDC once. One unified margin account backs every venue.

3 · Margin

PortfolioMarginEngine

Portfolio margin across venues. canPlaceOrder is the pre-trade gate and your simulator.

4 · Trade

Futures & Perps

On-chain CLOBs: Futures for dated contracts, HashPowerPerpsDEX for perpetuals.

ABI packages on npm

Versioned, viem-ready as const TypeScript ABIs plus raw JSON, published automatically by CI whenever the contracts change. Each package ships its own deployments.json.

Deployed addresses & endpoints

Merged from the published packages — the same data as JSON for runtime resolution.

mainnet base · chain 8453

Not deployed yet — mainnet addresses land here automatically at GA.

The rules your agent must respect

Bring a funded wallet

Your agent signs its own transactions. The wallet needs Base ETH for gas and USDC for collateral before anything works — we never hold keys and are never in the trade path.

Deposit before trading

Deposit USDC to the CollateralVault first. Collateral is unified: one margin account backs positions on both futures and perps.

Check margin before submitting

Call PortfolioMarginEngine.canPlaceOrder as the pre-trade gate. It is a view function — use it as your simulator while developing.

Orders are transactions, not API calls

There is no trading API and no API keys. Encode calldata with the npm ABI packages, sign locally, and send to Base.

Read hashprice the Chainlink way

Live hashprice comes from latestRoundData() on the oracle contracts. History, order-book depth, the public tape, funding, expiries, and fills come from the public subgraphs — the MCP server exposes the same surfaces the trading UI scans.

Market rules & semantics

Units, margin formulas, order APIs, settlement, and oracle reading — pulled at build time from the same /docs that feed GitBook ( @dev). Raw markdown for agents; rendered pages for humans. Download everything as one file · index.json

MCP server

Knowledge base, live market scanner, and simulator — not a trading API. Hosted at https://mcp.dev.hashpower.io/mcp (Streamable HTTP, stateless). Cursor MCP key for this site is dev-hashpower . Or run locally with npx @hashpower/mcp. Scan, decide, simulate, then execute from your own wallet — the server never holds keys. Instruction manual (any harness, guardrails, tool catalog, units, local execution).

Scan

get_market_snapshot (or get_hashprice, get_orderbook with sizes, get_trades, get_funding, get_expirations, get_market_stats, get_oracle_history) — the same book, tape, funding strip, expiries, and oracle chart the UI shows.

Decide

get_market_rules / get_margin_model / get_units_and_scaling plus the operator's goals. Wallet-scoped get_positions and get_margin_status when an account is in play.

Simulate

simulate_order and check_can_place_order are on-chain views. Nothing is placed.

Execute elsewhere

Production bots import @hashpower/*-abi, sign locally, and send to Base. Scaffold build_*_tx tools are prototypes only.

A trading agent in four steps

  1. Install the primitivesnpm i @hashpower/futures-abi @hashpower/collateral-abi (and the oracle/perps packages as needed).
  2. Resolve the environment — read addresses, chain ID, and subgraph URLs from deployments.json (in each package, or merged at /deployments.json).
  3. Read and simulate — hashprice via latestRoundData(), full books/tape/funding/expiries via the subgraphs (or get_market_snapshot on MCP), and canPlaceOrder before every order.
  4. Trade directly on-chain — encode with the ABIs, sign with your wallet, send to Base. Connect the trading UI with the same wallet for a live dashboard of what your bot is doing.

Deployments generated 2026-09-16T15:08:37.464Z from @hashpower/oracle-abi@0.1.0, @hashpower/collateral-abi@0.2.0, @hashpower/futures-abi@0.4.0, @hashpower/perps-abi@0.3.0. Semantics fetched 2026-09-16T15:08:43.258Z from contracts repos @ dev. This page rebuilds automatically when new package versions publish.