Build a web app that trades Hyperhook hourly Bitcoin up or down markets
Fetch market state and price quotes from an Ethereum node
Claim epoch winnings or early-exit a winning position from a script
Approve USDC and place trades from a viem wallet client
Needs an Ethereum RPC, a viem or ethers wallet, and USDC plus ETH for gas. SDK does not sign transactions itself.
This repository is a TypeScript software development kit, or SDK, that goes with a separate project called Hyperhook. The README explains that Hyperhook itself runs hourly prediction markets on whether Bitcoin will go up or down, built on top of Uniswap version 4, which is a popular system for trading tokens on the Ethereum blockchain. The SDK is the library a developer would pull into their own app to talk to those markets. The SDK has a clear boundary on what it does and does not do. It can read the current state of a market off the blockchain, ask for price quotes from the trading curve, and prepare the exact data needed to send a transaction. It does not send transactions itself and it does not store private keys. The user is expected to plug in their own wallet library, such as viem, ethers, or MetaMask, and use that wallet to actually sign and broadcast each transaction. The README lists the main functions in a table. There are read functions like getMarket, getCurveState, and getUserPosition, quote functions for buying or selling outcome tokens, and a set of build functions that produce ready-to-sign transaction calldata. The build set covers buying and selling during an open epoch, claiming winnings after an epoch ends, a tax-discounted early exit for winners, a consolation claim for losers, redeeming the project token at a floor price, and approving USDC to be spent by the contract. The quick-start example shows creating a client for mainnet, fetching the current market, requesting a quote for a three-dollar buy on the UP side, and applying a 100 basis point slippage allowance before passing the resulting transaction object to a wallet. A second example wires the same flow to a viem wallet client using a private key from an environment variable. Defaults for Ethereum mainnet, including the Hyperhook contract address and the USDC token address, are bundled in. For other chains or custom deployments, a separate async client constructor accepts a hook address and an RPC URL. The SDK lists viem version 2 as a peer dependency and is released under the MIT license.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.