Building a v4 hook? Four house hooks already earn on every swap: volatility fee, anti-snipe, agent rebate and weekend gap guard.Read the protocol.Building a v4 hook? Four house hooks already earn on every swap: volatility fee, anti-snipe, agent rebate and weekend gap guard.Read the protocol.
v4 Marketplace docs

Build on v4 Marketplace

Build a v4 hook

The Build a v4 hook page takes your contract from source to listed: the site compiles it, your wallet deploys it and Sourcify verifies it. Every swap that runs your hook pays you.

01 site
start
template, your .sol, or a listed hook
02 site
compile
solc 0.8.26 on the site, ILog check
03 wallet
deploy
your wallet signs the creation
04 site
verify
standard JSON input to Sourcify
05 wallet
list
publishLog with the Sourcify link
06 wallet
stake
approve and stake 10,000 $V4M

Start

Download the starter: the template src/MyHook.sol, the ILog interface, a Foundry fork test, foundry.toml and remappings. Or open any listed hook in Storefronts, download its verified source and ABI, or pick Start from this hook to load it into the editor.

forge install foundry-rs/forge-std uniswap/v4-core
RH_RPC_URL=https://rpc.mainnet.chain.robinhood.com forge test

Compile

Drop or paste your .sol file on Build a v4 hook. The site compiles it with solc 0.8.26, optimizer at 200 runs, EVM cancun. Imports resolve to the files you send and to Uniswap v4-core under v4-core/. Compile errors come back with file, line and column. The site only compiles: it never runs your code, files are capped at 64 KB each and the endpoint is rate limited.

The result is checked against ILog by selector: onStack, beforeSwap returning (uint24, uint8, bool), and afterSwap. A contract that misses one cannot be called by the hook stack, so the page stops there.

Deploy and verify

Deploy from your wallet signs the contract creation on Robinhood Chain; the constructor's hook stack address is filled in for you. Once the receipt is in, the page sends the exact standard JSON input it compiled to Sourcify with the creation transaction, and waits for the match. It also measures what beforeSwap costs and suggests a gas limit.

List and stake

  1. Open a storefront if this wallet has none: a name and an X handle, one transaction.
  2. List the hook: the address, a name, a royalty from 0 to 10 bps, a gas limit from 10,000 to 80,000, afterSwap on or off, and the Sourcify link, all prefilled.
  3. Stake 10,000 $V4M: the page shows your balance, approves and stakes. Short of $V4M, it links to Pons.
  4. The house verifier checks the source every hour and flags the hook verified. Verified and staked, it is active and any pool can stack it.

Limits

beforeSwap gasthe limit you list, 10,000 to 80,000
afterSwap gas40,000 more in every stack, when turned on
Answer size96 bytes at most
Royalty0 to 10 bps per hook, 30 bps per stack
Stack5 hooks and 400,000 gas per pool
Failed runs3 in seven days burn 10% of the stake and remove the hook
Contract size24,576 bytes deployed