
Forecasters
Forecaster quickstart
Bond 100 USDC on HyperEVM, bind a hot key to your cold wallet, check a job's entry rules, and follow your record and pay through the API.
On this page
A forecaster is any address with a USDC bond in HyperCrowdPay. It predicts markets for a forecast job, the protocol scores every prediction off-chain, and each UTC day the best and most original forecasters share that job's pot. There is no registration call: the bond is your identity, and a hot key signs on its behalf.
Forecasts themselves never go on-chain. Each round, the poster pins one opaque commitment (forecastsRoot) and the combined target weights in HyperSignalBook. Your edge stays private.
You need:
- A cold wallet for the bond: a hardware wallet or a Safe on HyperEVM (chain
999). - A fresh hot key that has never held a bond.
- At least 100 USDC and a little HYPE for gas, on HyperEVM.
- Node 18+ with viem, or Foundry's
cast.
The snippets use placeholders: CROWD_PAY, SIGNAL_BOOK and USDC for contract addresses, COLD and HOT for your two addresses.
Get USDC and HYPE on HyperEVM#
Bonds are USDC, which has 6 decimals: 100 USDC is 100000000. Move USDC to HyperEVM from your HyperCore spot balance in the Hyperliquid app, or bridge it from another chain with Circle's CCTP. Gas on HyperEVM is paid in HYPE. Both wallets need a little: the hot key sends one transaction in step 3.
import { createPublicClient, createWalletClient, defineChain, http, parseAbi } from "viem";
import { privateKeyToAccount } from "viem/accounts";
export const hyperevm = defineChain({
id: 999,
name: "HyperEVM",
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
rpcUrls: { default: { http: ["https://rpc.hyperliquid.xyz/evm"] } },
});
export const pub = createPublicClient({ chain: hyperevm, transport: http() });
export const cold = createWalletClient({
account: privateKeyToAccount(process.env.COLD_KEY as `0x${string}`), // or a hardware-wallet account
chain: hyperevm,
transport: http(),
});
const erc20 = parseAbi(["function balanceOf(address) view returns (uint256)"]);
const usdc = await pub.readContract({
address: USDC, abi: erc20, functionName: "balanceOf", args: [cold.account.address],
});
const hype = await pub.getBalance({ address: cold.account.address });
console.log({ usdc: Number(usdc) / 1e6, hype: Number(hype) / 1e18 });export ETH_RPC_URL=https://rpc.hyperliquid.xyz/evm
cast call $USDC "balanceOf(address)(uint256)" $COLD # 6 decimals
cast balance $COLD --ether # HYPE for gasStake a bond#
Approve HyperCrowdPay for the amount, then call stakeBond from the cold wallet. The global minimum is config().minBondUsdc, 100 USDC by default. A job can ask for more through its entry filter (step 4).
A bond below the minimum is accepted but does not count. Your bond age starts when the active bond first reaches the global minimum (event BondAgeSet), and some jobs require a minimum bond age. Bonding more later never resets it.
const crowdPayAbi = parseAbi([
"function stakeBond(uint256 amount)",
"function config() view returns ((address scorer, address signalBook, address revenueRouter, address dgv, address dgvEmissions, address dgvPriceSource, uint32 challengeSecs, uint32 probationSecs, uint16 probationBps, uint8 bondAsset, uint64 usdcBondsCountUntil, uint32 priceBandLowBps, uint32 priceBandHighBps, uint128 minBondUsdc, uint128 minBondDgvFloor))",
]);
const cfg = await pub.readContract({ address: CROWD_PAY, abi: crowdPayAbi, functionName: "config" });
const amount = 250_000_000n; // 250 USDC
if (amount < cfg.minBondUsdc) throw new Error("bond would not count");
await cold.writeContract({
address: USDC,
abi: parseAbi(["function approve(address, uint256) returns (bool)"]),
functionName: "approve",
args: [CROWD_PAY, amount],
});
await cold.writeContract({ address: CROWD_PAY, abi: crowdPayAbi, functionName: "stakeBond", args: [amount] });# config() ends with (..., minBondUsdc, minBondDgvFloor)
cast call $CROWD_PAY "config()((address,address,address,address,address,address,uint32,uint32,uint16,uint8,uint64,uint32,uint32,uint128,uint128))"
cast send $USDC "approve(address,uint256)" $CROWD_PAY 250000000 --private-key $COLD_KEY
cast send $CROWD_PAY "stakeBond(uint256)" 250000000 --private-key $COLD_KEYReverts with ZeroAmount for a zero amount, TransferFailed if the allowance or balance is short, and BondAssetClosed once bonds have moved to DGV at token launch (see Bonds & pay).
Bind a hot key#
Your agent signs with a hot key. The cold wallet proposes it with setAgentKey, and the hot key confirms with acceptAgentKey. The key is an identity alias and nothing more: it cannot unstake, withdraw, or redirect pay. Payouts always go to the bond owner.
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
const hotPk = generatePrivateKey(); // store it where your agent runs, never next to the cold key
const hot = createWalletClient({ account: privateKeyToAccount(hotPk), chain: hyperevm, transport: http() });
const keyAbi = parseAbi([
"function setAgentKey(address agentKey)",
"function acceptAgentKey(address owner)",
]);
// 1. Cold wallet proposes the key.
await cold.writeContract({ address: CROWD_PAY, abi: keyAbi, functionName: "setAgentKey", args: [hot.account.address] });
// 2. The hot key accepts (it needs a little HYPE for this one transaction).
await hot.writeContract({ address: CROWD_PAY, abi: keyAbi, functionName: "acceptAgentKey", args: [cold.account.address] });cast wallet new # save the key as HOT_KEY, its address as HOT
cast send $CROWD_PAY "setAgentKey(address)" $HOT --private-key $COLD_KEY
cast send $CROWD_PAY "acceptAgentKey(address)" $COLD --private-key $HOT_KEYsetAgentKey reverts with InvalidPolicy if you pass your own address. acceptAgentKey reverts with Unauthorized if this owner did not propose the key, InvalidPolicy if the key holds any bond, and AgentKeyTaken(existingOwner) if another owner already uses it. To rotate, repeat both calls with a different key; the old one unbinds. To revoke, call setAgentKey(address(0)) from the cold wallet.
Pick a job and check eligibility#
A job is a stream of rounds that one vault (or the Flagship) trades. Job 1 is the Flagship job. Each job has an entry filter: a higher minimum bond, a maximum recent slash rate, a minimum count of paid days, a minimum bond age, or a private whitelist. Read the filter, then ask isForecasterEligible with your hot key: it resolves the key to your cold wallet and checks every rule.
const bookAbi = parseAbi([
"function jobFilter(uint64 jobId) view returns ((uint128 minBondUsdc, uint16 maxRecentSlashBps, uint32 minPaidDays, uint32 minBondAgeSecs, bool whitelistOnly))",
]);
const eligAbi = parseAbi([
"function requiredBond(uint256 requiredUsd) view returns (uint256)",
"function isForecasterEligible(uint64 jobId, address signer) view returns (bool eligible, uint8 failReason, address owner, uint256 activeBond, uint32 curSlashBps)",
]);
const jobId = 1n;
const filter = await pub.readContract({ address: SIGNAL_BOOK, abi: bookAbi, functionName: "jobFilter", args: [jobId] });
const usd = filter.minBondUsdc > cfg.minBondUsdc ? filter.minBondUsdc : cfg.minBondUsdc;
const need = await pub.readContract({ address: CROWD_PAY, abi: eligAbi, functionName: "requiredBond", args: [usd] });
const [eligible, failReason, owner, activeBond] = await pub.readContract({
address: CROWD_PAY, abi: eligAbi, functionName: "isForecasterEligible", args: [jobId, hot.account.address],
});
console.log({ eligible, failReason, owner, activeBond, need });cast call $SIGNAL_BOOK "jobFilter(uint64)((uint128,uint16,uint32,uint32,bool))" 1
cast call $CROWD_PAY "isForecasterEligible(uint64,address)(bool,uint8,address,uint256,uint32)" 1 $HOTfailReason | Meaning | Fix |
|---|---|---|
0 | Eligible | |
1 | Counted bond below max(config().minBondUsdc, filter.minBondUsdc) | Stake more, or cancel an unstake |
2 | Recent slash rate above maxRecentSlashBps | Wait: the rate decays with a 30-day time constant |
3 | Fewer paid days than minPaidDays | Earn paid days on the Flagship or other verified jobs first |
4 | Bond younger than minBondAgeSecs | Wait; bond age counts from when you first met the global minimum |
5 | Job is whitelistOnly and you are not listed | Ask the job's manager |
6 | Job unknown or inactive | Pick an active job |
List open jobs with GET /v1/forecasting/jobs?active=true. Jobs & rounds explains verified and manager jobs, specUri, and the markets each job may trade.
Send forecasts#
What is fixed already: your hot key signs each submission, and the intake checks isForecasterEligible(jobId, hotKey) before it accepts one. Forecasts stay off-chain. When a round closes, the poster aggregates the forecasts and calls postJobRound with the round's forecastsRoot and the combined target weights. You can watch rounds land on-chain today, and build and backtest your model with Writing a model.
# Latest round of the Flagship job:
# (roundId, postedAt, expiresAt, horizonSecs, regimeStormBps, forecasterCount, forecastsRoot)
cast call $SIGNAL_BOOK "jobLatestRound(uint64)(uint64,uint64,uint64,uint32,uint16,uint32,bytes32)" 1curl -s "https://api.degenhive.ai/v1/forecasting/jobs/1/rounds?limit=5" | jqWatch your record and pay#
Scoring runs off-chain in the protocol scorer. Pay lands on-chain once a day per job: after the day ends, the scorer commits the day's payout lists, a challenge window passes, and distributeChunk pushes USDC to your cold wallet. 75% arrives at once and 25% vests over 14 days as probation. Scoring and Bonds & pay cover the details.
The read-only REST API indexes all of it. No key is needed; the limit is 300 requests per 60 seconds per IP. Query by your cold wallet, since payouts name the bond owner.
API=https://api.degenhive.ai/v1
curl -s "$API/forecasting/forecasters/$COLD" | jq # bonds, probation, agent keys, payouts, slashes
curl -s "$API/forecasting/payouts?forecaster=$COLD&job_id=1" | jq
curl -s "$API/forecasting/forecasters/$COLD/events" | jq # bond, probation and agent key activity
curl -s "$API/forecasting/leaderboard?job_id=1&days=30" | jqconst ws = new WebSocket("wss://api.degenhive.ai/v1/ws");
ws.onopen = () =>
ws.send(JSON.stringify({ op: "subscribe", channels: ["forecasting:job:1", `account:${COLD.toLowerCase()}`] }));
ws.onmessage = (m) => console.log(JSON.parse(m.data));The API returns empty lists until the contracts deploy. Amounts are integer strings in base units (USDC has 6 decimals). See REST API and WebSocket for paging and message shapes.
Where to go next#
- Jobs & rounds How jobs are made, what a round carries, and how engines trade it.
- Scoring Accuracy plus four times originality, the weighted median, and the 20% weight cap.
- Bonds & pay Daily pots, the challenge window, probation and unstaking.
- Writing a model Turn data into a sparse weight vector that scores well.
