One bet, five cents,
one accountable answer
POST /api/edge is gated by the real OKX x402 exact scheme — @okxweb3/x402-express's paymentMiddleware runs before the verdict engine, so unpaid calls never touch business logic. No account, no API key: the HTTP status code is the paywall.
Propose unpaid
POST /api/edge with no payment. The server answers with a real challenge — price, network, pay-to address, and dual accepts: USD₮0 or USDG.
Sign & pay 5¢
The buyer signs an EIP-3009 TransferWithAuthorization (EIP-712, via viem) for exactly $0.05 and replays the request. Zero gas on X Layer.
Verdict + receipt
APPROVED / REJECTED / SKIP, edge grade A+…F, a conviction-ladder stake, mirror receipts, and a pick_hash stored beside the settlement reference.
Re-verify any receipt
Anyone can re-check a settlement for free — POST /api/receipts/verify calls the OKX Facilitator's GET /settle/status live. No trust in our database required.
One paid verdict,
four free proofs
The 5¢ verdict is the product. Everything that lets you audit the verdict — the slate, the loss-inclusive ledger, your own history, receipt re-verification — is free by design.
Send {fixture, selection, odds, bankroll}. Get verdict, edge_pct, edge_grade, a 5-rung ladder stake, mirror (what we staked), similar_settled ROI, decay_min_halflife, and a pick_hash. Outside model coverage? An honest SKIP — never an invented edge.
Today's fixtures with a public BET / SKIP call on each — the free teaser for the paid grade. Grades and stakes live on /api/edge.
Every settled call — pre-match odds, fair prob, grade, stake, result, P&L, CLV, pick-hash + receipt — losses included. A predict-only competitor can't fabricate this after the fact.
BuyerLens: your graded call history, keyed off the EIP-3009 authorization.from recovered from your X-PAYMENT signature. The payment is the login; {forget:true} deletes it.
Re-check any settlement live against the OKX Facilitator's GET /settle/status. Receipts stay verifiable without trusting EdgeLedger.
Wrong verb, honest answer. The self-check gate is three curls — 402, 200, 405 — reproducible by any judge in ten seconds.
REJECTED. Grade F.
Stake $0.00.
No users to quote yet — this is a hackathon build, so here are signals you can recompute instead. A bettor asks to put $500 on the hype favorite — Spain to advance at 1.45 in the semi-final. Every predict-only agent on the board would hand over a pick. EdgeLedger charges five cents and says no:
{
"fixture": "SF: FRA vs ESP",
"selection": "Spain to advance",
"verdict": "REJECTED",
"edge_pct": -0.0697,
"edge_grade": "F",
"fair_prob": 0.62,
"market_implied": 0.6897,
"ev_pct": -0.101,
"stake": { "pct": 0, "amount": 0, "rung": "pass" },
"decay_min_halflife": 30,
"mirror": { "our_stake": 0, "receipt": null, "note": "we are flat this market" },
"similar_settled": { "n": 0, "win_rate": 0, "roi_pct": 0 },
"pick_hash": "…"
}
Genuine output from this build. Even the awkward part is honest: similar_settled is n:0 because the grade-F bucket is empty — the seller never actually placed a negative-edge bet, so there is no grade-F history to cite, and EdgeLedger refuses to fabricate one. The grade-A approve side cites a populated bucket (n=4, ROI +105%). Reproduce both with two curls in Run locally.
Why ONLY OKX
The verdict engine is portable. The economics and the trust chain are OKX-specific — these are the real surfaces wired into this build, not logos on a slide.
Paywall before logic
@okxweb3/x402-express's paymentMiddleware(routes, resourceServer) gates POST /api/edge at $0.05 before business logic — unpaid calls never reach the verdict engine. Zero payment code in the product.
Settlement as a service
OKXFacilitatorClient({apiKey, secretKey, passphrase}) handles signature verification + on-chain settlement. EdgeLedger holds only a receive address — no node, no KYC, no relayer.
Dual-token, zero gas
ExactEvmScheme on X Layer eip155:196 with dual accepts: the buyer pays 5¢ in either USD₮0 or USDG, both zero-gas. That's what makes a five-cent verdict a rational agent action.
Login = the payment
BuyerLens decodes the X-PAYMENT header's EIP-3009 authorization.from — an unforgeable, ECDSA-recovered identity — into per-buyer discipline memory. Personalization with zero auth stack.
Trustless receipts
Free /api/receipts/verify re-checks any settlement live against OKX's own Facilitator API (GET /settle/status, HMAC OK-ACCESS-*) — a buyer verifies without trusting EdgeLedger's database.
Anchored tamper-evidence
Every verdict's pick_hash is stored beside its settlement reference, and contracts/LedgerAnchor.sol anchors a daily Merkle root of the ledger on X Layer — explorer-verifiable, not "trust me".
Run the interactive demo locally
# git clone https://github.com/edycutjong/edgeledger && cd edgeledger npm install npm run settle # seeds fixtures/ledger-state.json + db/ledger.sqlite npm test # 188 vitest, fully offline npm run api # boots on :8403 with the REAL x402 payGate
The boot uses the real @okxweb3/x402-express middleware — every 402 byte you'll see (x402Version, dual accepts, scheme, payTo, amount) is produced by the shipped SDK, not hand-rolled.
curl -i -X POST http://localhost:8403/api/edge # -> 402, PAYMENT-REQUIRED header, x402Version:2 curl -i -X POST http://localhost:8403/api/slate # -> 200, today's BET/SKIP verdicts curl -i -X GET http://localhost:8403/api/edge # -> 405, POST only
Decode the challenge yourself: the base64 PAYMENT-REQUIRED header expands to x402Version: 2 with dual accepts — USD₮0 and USDG, both scheme: "exact", both zero-gas, same $0.05.
npm run api -- --demo # ⚠ paygate off — verdict engine only, no receipt open http://localhost:8403/ # live VerdictCard + loss-inclusive ledger curl -s -X POST http://localhost:8403/api/edge -H "Content-Type: application/json" \ -d '{"fixture":"SF: FRA vs ESP","selection":"Spain to advance","odds":1.45,"bankroll":500}'
The served page renders the headline REJECTED · grade F · $0 stake on load, next to the settled ledger with the losses in pink. Under the real payGate (no --demo) the same panel shows the honest HTTP 402 paywall instead — the page hits real routes, nothing mocked.
FAQ
Short, honest answers — the same ones a judge would get.
Because recreational bettors during a live World Cup mostly lose to sizing and discipline failures, not to a shortage of predictions. Every other agent in the category tells you who wins; none will tell you your proposed bet is bad, size a stake responsibly, or show you their own settled losses. EdgeLedger answers "should I bet", not "who wins" — and a graded, receipt-backed "no" is often worth far more than another pick.
No — and it doesn't pretend to be. This is a static GitHub Pages site with zero fetches, so it cannot run the API. The real interactive demo runs locally: npm run api boots :8403 with the genuine x402 payGate, and npm run api -- --demo serves a visible VerdictCard page. Everything shown here (the REJECTED JSON, the +9.2% approve side) is real, unmodified output from that build.
One verdict on one proposed bet: APPROVED / REJECTED / SKIP, an edge grade (A+…F) with the fair-vs-implied probability math, a conviction-ladder stake in dollars, mirror receipts (what the seller actually staked on the same market, with settled P&L), the settled ROI of similar past calls, a decay half-life stating how fast the edge goes stale toward kickoff, and a pick_hash committed beside the payment receipt for tamper-evidence.
A 5-rung stake-sizing map from edge grade × bankroll — calibrated to the real settled record, not textbook Kelly. Strong graded edges earn the bigger rungs; weak ones get a token probe; anything negative gets rung "pass": $0.00. The $500-on-Spain example lands on pass; the grade-A France side sizes to $30 on a $500 bankroll (value rung).
Not in this build session — and the build says so itself. Without OKX Developer Portal credentials, the local facilitator does real EIP-3009 signature verification (viem's recoverTypedDataAddress over the exact EIP-712 struct) but refuses to fabricate a settlement receipt, and the paid-call smoke test exits rather than invent one. With OKX_API_KEY / SECRET / PASSPHRASE plus a funded X Layer wallet, the same code path switches to the real OKXFacilitatorClient and settles for real.
The 24 seed rows are a labeled World Cup record ported from a previously verified sibling build — every row carries is_placeholder: true, and totals honestly stay at zero until real paid calls settle. What matters is the mechanism: losses are shown, placeholder rows are excluded from totals, and every row re-hashes correctly under an independent audit script (npm run audit -- --all).
You get verdict: "SKIP", reason: "no_model_coverage" — never a fabricated edge. Model coverage is intentionally narrow and labeled: the thesis is that accountability is the gap in the category, not model novelty, so EdgeLedger only grades fixture/selection pairs it has a real basis for.
Three layers. Every verdict's payload hash (pick_hash) is stored beside its settlement reference at response time. Daily Merkle roots of the whole ledger are computed for anchoring via contracts/LedgerAnchor.sol on X Layer — the contract exists and is tested, though not yet deployed in this build session (a credential/funds-gated step, stated plainly). And /api/receipts/verify lets anyone re-check a settlement against OKX's own Facilitator API, bypassing our database entirely.