$CLAPPER Coming soonRunning on a mainnet fork until launch
Fork of chain 4663

Docs, down to the source.

The API, the contract interface, every feed with its explorer page, and the tests. Press Run to call an endpoint from this page.

API

JSON, GET unless marked. Every reply is { ok, data } or { ok: false, error }. USDG amounts are strings in 6-decimal units; prices use the feed's decimals. Times are Unix seconds.

/api/v1/markets?asset=&kind=&state=&symbol=

All markets. Filter by asset (crypto, etf, stock), kind (above, move_up, range), state (live, open, locked, due, settled, void) and symbol.

/api/v1/markets/:id

One market with every stake in order.

/api/v1/markets/:id/settle-round

What settle would need right now: the round id, or wait, void, done.

/api/v1/rounds/:feed?at=&mode=at|first

The feed round current at a time, or the first one at or after it.

/api/v1/feeds

Verified feeds with the on-chain check and the last mainnet round.

/api/v1/activity?limit=&event=

Contract events, newest first, with the market each one belongs to.

/api/v1/stats

The counters, contract totals, fees, burns and the source of each.

/api/v1/status

Blocks, feed ages, keeper, reserve.

/api/v1/contracts

Addresses on the fork. The mainnet field is null until deploy.

/api/v1/positions/:address

An account's stakes and what it can claim.

/api/v1/sources

Every number the pages print, with its value, source and block.

/api/v1/proof

Contracts, deploy transactions, bytecode match, feed per market, keeper address.

/api/v1/markets/:id/proof

One settlement re-read on the fork and on mainnet, with six checks.

/api/v1/tx/:hash

A fork transaction with its decoded events. These hashes are not on Blockscout.

/api/v1/burns

Buy and burn history with transactions. Empty until the token is set.

/api/v1/uptime

One sample a minute, kept across restarts.

/api/v1/tests

The last recorded test runs.

/api/v1/site

Public site settings: token address, links, launch time.

/.well-known/clapper.json

Where a machine starts.

/api/v1/events

Server-sent events: stake, settle, void, claim, market. Opens with hello.

POST /api/v1/fork/faucet

Body { "address": "0x.." }. Writes 1,000 test USDG and 0.1 test ETH on the fork. One call per address per minute. Use the button on a market page.

POST /rpc

JSON-RPC to the fork. Read methods and eth_sendRawTransaction.

The reply appears here.

Contracts

Solidity 0.8.28, built with Foundry. Running on a mainnet fork until launch. Addresses below are on the fork; the mainnet address appears at deploy. Source repository

Download: ClapperMarkets ABI, ClapperFeeReserve ABI, all ABIs. Solidity: ClapperMarkets.sol, ClapperFeeReserve.sol, Interfaces.sol. Compiler input: markets, reserve.

Feeds

Each feed answered description(), decimals() and latestRoundData() on Robinhood Chain mainnet. Sparse feeds have gaps over 6 hours after the close, so the keeper schedules no markets on them. You can still create one.

SymbolDescription on chainAddressLast roundScheduled

Tests

test:forge
61 passed source. Unit tests with coverage 218/218 lines, 76/76 branches source, plus runs against real NVDA and BTC rounds on a mainnet fork.
npm test
98 passed source. Schedule with daylight saving and holidays, round finder across phases, payout math, keeper plan, RPC failover, every API endpoint, every CLI command, admin login and settings. In test/.
outsider
81 passed source. test/outsider.mjs drives Chrome from outside: every link, every endpoint, then create, stake, settle and claim with a wallet on its own fork.

curl

Copy any line into a terminal. The test suite runs each of them against this server.

curl -s https://clappermarkets.com/api/v1/stats
curl -s https://clappermarkets.com/api/v1/proof
curl -s "https://clappermarkets.com/api/v1/markets?state=settled"
curl -s https://clappermarkets.com/api/v1/markets/0/proof
curl -s https://clappermarkets.com/api/v1/burns
curl -s https://clappermarkets.com/api/v1/uptime
curl -s https://clappermarkets.com/.well-known/clapper.json
curl -s https://clappermarkets.com/rpc -H "content-type: application/json" -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_blockNumber\",\"params\":[]}"
curl -s -o ClapperMarkets.json https://clappermarkets.com/abi/ClapperMarkets.json

Security

No outside audit. The contracts have no owner, pause, upgrade or withdraw function, so the site operator cannot move staked USDG. The operator edits links and the announcement, and can call the same public create and void functions as any account. security.txt names the contact. MIT license, README, changelog.

Run it

npm install
cd contracts && forge build && cd ..
npm run fork     # anvil fork of chain 4663 on 8560, replays the journal
npm run build    # web-src to web
npm start        # site, API and keeper on 127.0.0.1:5360

To stake from your own wallet, add chain 4663 with the RPC /rpc and use a throwaway account. The site refuses to send if the wallet's RPC is the live network.