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.
Hashprice oracles — Chainlink AggregatorV3-compatible
Unified collateral — CollateralVault and PortfolioMarginEngine
Hashprice futures marketplace — the Futures contract
Perpetuals CLOB — the HashPowerPerpsDEX contract
Deployed addresses & endpoints
Merged from the published packages — the same data as JSON for runtime resolution.
testnet base-sepolia · chain 84532
| Contract | Address |
|---|---|
| HashpriceBTC | 0x7b7f9698cadca34f13d6091c4ee34045f97442e7 |
| HashpriceUSD | 0x7df07e84e57890f429935946748757758f7964f1 |
| BtcUsdAggregator | 0x37b5E07C59238ad3bB11AC27129387A67F3340B6 |
| HashrateOracleLegacy | 0xf97a1bbfb5e061ef73dad8ebf25939d93639fb7f |
| CollateralVault | 0x54A79e2a5C60ACe37b280eBbCda51b4E903d25F0 |
| PortfolioMarginEngine | 0x3899e429Ef47140eC46c6E23F04253C24F221b69 |
| Points | 0x153F6cb4386d717AD94791E6Ee8ae37f80315972 |
| CollateralToken | 0xDd15eED84065A58c9E9ff9E95fb996be0fff22AA |
| HashPowerFutures | 0x56d8d4a03a0f34b93B86E0b7941aFF29178D0479 |
| HashPowerPerpsDEX | 0x0d412BC34a48e434144687Aac03b9C593F5237B6 |
| oracles subgraph | https://api.goldsky.com/api/public/project_cmmz59uoa7b5201wthnkxbuqy/subgraphs/hpow-oracles/dev-latest/gn |
| futures subgraph | https://api.goldsky.com/api/public/project_cmmz59uoa7b5201wthnkxbuqy/subgraphs/hpow-futures/dev-latest/gn |
| perps subgraph | https://api.goldsky.com/api/public/project_cmmz59uoa7b5201wthnkxbuqy/subgraphs/hpow-derivatives/dev-latest/gn |
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
How to read hashprice on-chain (AggregatorV3 / latestRoundData) and the PH/s·day unit.
/semantics/oracle-reading.mdUnified CollateralVault: deposit, withdraw, free margin, and the shared account model.
/semantics/collateral-and-accounts.mdPerps order API (createOrder / simulateOrder) and QUANTITY_DECIMALS scaling.
/semantics/perps-trading.mdMark/index price, PnL, and funding formulas for perpetual positions.
/semantics/perps-positions-and-funding.mdInitial/maintenance margin, portfolio PME, and liquidation triggers for perps.
/semantics/perps-margin-and-liquidation.mdFutures contract unit, tick size, PnL, and settlement surface.
/semantics/futures-contract-specs.mdFutures margin types, PME coupling, and liquidation rules.
/semantics/futures-margin.mdFutures order placement (signed qty, GTC/IOC/FOK) and prerequisites.
/semantics/futures-trading.mdCash settlement lifecycle for dated futures contracts.
/semantics/futures-delivery-settlement.mdMCP 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
- Install the primitives —
npm i @hashpower/futures-abi @hashpower/collateral-abi(and the oracle/perps packages as needed). - Resolve the environment — read addresses, chain ID, and
subgraph URLs from
deployments.json(in each package, or merged at/deployments.json). - Read and simulate — hashprice via
latestRoundData(), full books/tape/funding/expiries via the subgraphs (orget_market_snapshoton MCP), andcanPlaceOrderbefore every order. - 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.