explaingit

crimsonluckylabs/hyperhook-sdk

0TypeScriptAudience · developerComplexity · 3/5ActiveLicenseSetup · moderate

TLDR

TypeScript SDK to read state and build transactions for Hyperhook, an hourly Bitcoin up-or-down prediction market on Uniswap v4. Bring your own wallet.

Mindmap

mindmap
  root((hyperhook-sdk))
    Inputs
      Hyperhook contract address
      RPC URL
      User wallet
    Outputs
      Market state reads
      Trade quotes
      Unsigned transaction calldata
    Use Cases
      Build a UI on top of Hyperhook markets
      Trade UP or DOWN positions from code
      Claim winnings or early exit
    Tech Stack
      TypeScript
      viem
      Ethereum
      Uniswap v4

Things people build with this

USE CASE 1

Build a web app that trades Hyperhook hourly Bitcoin up or down markets

USE CASE 2

Fetch market state and price quotes from an Ethereum node

USE CASE 3

Claim epoch winnings or early-exit a winning position from a script

USE CASE 4

Approve USDC and place trades from a viem wallet client

Tech stack

TypeScriptviemEthereumUniswap

Getting it running

Difficulty · moderate Time to first run · 30min

Needs an Ethereum RPC, a viem or ethers wallet, and USDC plus ETH for gas. SDK does not sign transactions itself.

MIT: do almost anything with the code as long as you keep the copyright notice.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me how to fetch the current Hyperhook market with hyperhook-sdk on mainnet
Prompt 2
Write a Node.js script using hyperhook-sdk and viem that buys 5 dollars of UP at 100 bps slippage
Prompt 3
Build a small React widget that shows getCurveState and the user position for Hyperhook
Prompt 4
Add error handling around the build functions in hyperhook-sdk so failed quotes do not crash the trade flow
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.