Developer Portal

Everything needed to read, verify or build on HYPERHEDGE. Monad testnet, chain id 10143. Source: github.com/Venkat5599/Mn.

Contracts

Oracle API

  • GET /api/oracle/contractsevery tracked contract with challenge progress
  • GET /api/oracle/contracts/:idone contract with every challenge
  • GET /api/oracle/evidence/:hashthe evidence file whose keccak256 is onchain
  • GET /api/oracle/events?source=market|vault|pooldecoded onchain events, newest first
  • GET /api/oracle/price/latestMON/USD signed by 2 of 3 oracle keys
  • GET /api/oracle/price/candles?granularity=3600exchange candles for MON-USD

Verify a settlement from your own code

import { createPublicClient, http } from "viem";
import { computeMarketAbi, verifyEvidence, slaFromUri } from "@hyperhedge/sdk";

const client = createPublicClient({ transport: http("https://testnet-rpc.monad.xyz") });
const market = "0x9dc5f35B0866bB0a1F046712B38f11E2544D701E";

// read a contract's committed terms and state
const terms = await client.readContract({ address: market, abi: computeMarketAbi, functionName: "terms", args: [2n] });
const status = await client.readContract({ address: market, abi: computeMarketAbi, functionName: "status", args: [2n] });

// fetch its evidence and re-check every proof of work yourself
const o = await (await fetch("https://hyperhedge-app.vercel.app/api/oracle/contracts/2")).json();
const evidence = await (await fetch(`https://hyperhedge-app.vercel.app/api/oracle/evidence/${o.evidenceHash}`)).json();
const check = await verifyEvidence(evidence, o.sla, async (n) => (await client.getBlock({ blockNumber: BigInt(n) })).hash);
console.log(check.ok, check.verdict, check.solved);

Run your own delivery host

# run a delivery host: answers proof-of-work challenges with this machine's compute
git clone https://github.com/Venkat5599/Mn && cd Mn
AGENT_PORT=9795 COMPUTE_CLASS="my-gpu-box" bun apps/agent/src/index.ts

Name its URL as the host when you issue a contract. The oracle challenges it through the delivery window.