Dabba

Own a stock basket on Uniswap v4 and earn from every trade, even Monday’s opening gap

Dabba

Created At

ETHGlobal Mumbai

Project Description

Dabbah is a token that holds a basket of stocks (Nvidia, Apple, Microsoft) plus USDC, a quarter each. Holders own a share of the basket. Traders swap against it at any hour, and every swap pays a fee that stays in the basket, so each share is worth a little more after every trade. You keep the stocks’ price exposure, and you can buy or sell your share for USDC whenever you want.

How it's Made

The core is one Uniswap v4 hook that runs six pools, one for each pair of NVDA, AAPL, MSFT and USDC. All six trade against a single shared reserve held as ERC-6909 claims in the PoolManager. In beforeSwap the hook prices each trade with an equal-weight weighted-pool formula and returns a BeforeSwapDelta, so the hook does the pricing, not Uniswap’s default curve. Buying and selling the basket token with USDC alone uses the same formula, capped at 30% of the reserve per trade.

A MarketClock contract stores each stock’s price and whether NYSE is open. A Chainlink CRE workflow fills it: nodes fetch the prices, agree on the median, work out NYSE hours (weekends, holidays, early closes), and sign one report that the clock accepts only from Chainlink’s forwarder. On every swap the hook reads the clock, picks the posted fee, measures the trader’s edge against Chainlink’s price, and keeps 80% of it, capped at 10% of the trade. On testnet we ran the workflow through the CRE CLI with one real broadcast, and a keeper pushes reports in the same format hourly.

Arc settles everything in USDC with sub-second finality, and gas is paid in USDC too. We built the contracts and the React + viem frontend in Arc Studio. Testing:

Contracts: Foundry unit, fuzz and invariant tests. Frontend: a Playwright suite drives the live app with a real wallet and real Arc testnet transactions.

Hacky bits:

Arc’s USDC calls a precompile that Foundry can’t simulate, so transactions that move USDC go through viem scripts. The app races the Arc explorer’s index against two RPCs to read history, because the free RPC tiers reject large log queries. A replay script posts a Monday opening price to show the gap capture live.

background image mobile

Join the mailing list

Get the latest news and updates