# Hashpower > Hashpower is a permissionless marketplace for Bitcoin hashprice risk: futures and perpetuals on hashprice, priced by an on-chain oracle, settled in USDC on Base. There is no trading API and no API keys - the contracts and subgraphs ARE the API. Any agent with a wallet (Base ETH for gas, USDC for collateral) can trade directly on-chain. Key facts for agents building against Hashpower: - The write path is on-chain contract calls signed by your own wallet (we never hold keys and are never in the trade path). - The read path is public GraphQL subgraphs plus Chainlink-compatible oracle reads (`latestRoundData()`). - Contract ABIs ship as versioned npm packages under the @hashpower scope; each package includes a `deployments.json` mapping environments to addresses and subgraph URLs. - Collateral is unified: deposit USDC to the CollateralVault once, trade futures and perps against the same margin account. Check `PortfolioMarginEngine.canPlaceOrder` before submitting orders. - Market rules (units, margin, trading, settlement) are regenerated at build time from the contracts repos' `/docs` - the same source that feeds GitBook. Prefer `/semantics/` over scraping GitBook. - Everything below is regenerated automatically on every site build - it does not go stale. ## Integration - [Build on Hashpower](/build/): system map, deployed addresses, subgraph endpoints, invariants, and market-rules index - [MCP instruction manual](/build/mcp.md): how any agent harness connects, the guardrails, scan -> simulate -> execute - [MCP instruction manual (HTML)](/build/mcp/): same document rendered for humans - [Deployments manifest (JSON)](/deployments.json): machine-readable contract addresses and subgraph URLs per environment, merged from the published npm packages - [Semantics index (JSON)](/semantics/index.json): catalog of market-rules docs with stable URLs - [All semantics (markdown)](/semantics/FULL.md): single-file dump of every market-rules doc ## Market rules (semantics) Pull these before writing a trading bot. Raw markdown at stable URLs; HTML renderings under `/build/rules//`. - [/semantics/oracle-reading.md](/semantics/oracle-reading.md): how to read hashprice on-chain (AggregatorV3 / latestRoundData) - [/semantics/collateral-and-accounts.md](/semantics/collateral-and-accounts.md): unified CollateralVault deposit/withdraw model - [/semantics/perps-trading.md](/semantics/perps-trading.md): perps order API and QUANTITY_DECIMALS - [/semantics/perps-positions-and-funding.md](/semantics/perps-positions-and-funding.md): mark/index, PnL, funding - [/semantics/perps-margin-and-liquidation.md](/semantics/perps-margin-and-liquidation.md): IM/MM, portfolio PME, liquidation - [/semantics/futures-contract-specs.md](/semantics/futures-contract-specs.md): futures units, ticks, settlement surface - [/semantics/futures-margin.md](/semantics/futures-margin.md): futures margin types and PME coupling - [/semantics/futures-trading.md](/semantics/futures-trading.md): futures order placement (GTC/IOC/FOK) - [/semantics/futures-delivery-settlement.md](/semantics/futures-delivery-settlement.md): cash settlement lifecycle ## ABI packages (npm) - [@hashpower/futures-abi](https://www.npmjs.com/package/@hashpower/futures-abi): hashprice futures marketplace (Futures) - [@hashpower/perps-abi](https://www.npmjs.com/package/@hashpower/perps-abi): perpetuals CLOB (HashPowerPerpsDEX) - [@hashpower/oracle-abi](https://www.npmjs.com/package/@hashpower/oracle-abi): hashprice oracles (HashpriceUSD, HashpriceBTC), Chainlink AggregatorV3-compatible - [@hashpower/collateral-abi](https://www.npmjs.com/package/@hashpower/collateral-abi): unified collateral system (CollateralVault, PortfolioMarginEngine) All packages ship viem-ready `as const` TypeScript ABIs, raw JSON ABIs, and a `deployments.json`. Versions follow semver against the ABI surface (0.x while pre-GA). ## MCP server (knowledge + simulate, not a trading API) - [hashpower-mcp](https://github.com/Lumerin-protocol/hashpower-mcp) / [@hashpower/mcp](https://www.npmjs.com/package/@hashpower/mcp): knowledge base, live market scanner, and simulator. An agent scans the same surfaces a human reads on the trading UI (`get_market_snapshot`, books with size, tape, funding, expiries, oracle history), reads `/semantics`, simulates, then writes its own bot. - It never holds keys and is never in the production trade path. Production bots import the npm ABI packages, sign locally, and send to Base. - Hosted Streamable HTTP (this site's environment): `https://mcp.dev.hashpower.io/mcp` - Cursor MCP key for this site: `dev-hashpower` (testnet `dev-hashpower` -> `https://mcp.dev.hashpower.io/mcp`; mainnet `hashpower` -> `https://mcp.hashpower.io/mcp`) - Local stdio: `"command": "npx", "args": ["-y", "@hashpower/mcp"]` with `HASHPOWER_ENV=testnet` - Instruction manual: [/build/mcp.md](/build/mcp.md) (HTML: [/build/mcp/](/build/mcp/)) - Typical loop: `get_market_snapshot` -> operator goals + `get_market_rules` -> recommend, then `simulate_order` / `check_can_place_order` -> encode `@hashpower/*-abi` from your wallet. Local executor: approve+deposit to CollateralVault, then createOrder/cancelOrder/withdraw. This server never holds keys. ## Optional - [Blog](/blog/): product announcements and updates