A gold bar dissolving into a lattice of glowing particles

Uniswap v4 · Base mainnet · fork of commodites.market

Meme markets that
settle against real commodities.

Every token launches into a pool quoted in a commodity coin — gold, oil, copper, wheat — whose price is held to an oracle by a single-sided v4 peg pool. Price discovery in ounces, not in someone's bag.

Opening FDV
$5,000
Curve cap
$35,000
Supply
1,000,000,000
Fork tests
10 / 10 pass
XAU gold · troy ozWTI crude · barrelHG copper · poundZW wheat · bushelKC coffee · poundXAG silver · troy ozNG nat gas · MMBtuZC corn · bushel

The protocol

A commodity desk, compressed into four contracts.

The original runs on Robinhood Chain with Uniswap v3 peg pools and v4 launch pools. commodibase rebuilds the whole stack on Base as all-v4: one PoolManager, one unlock, one accounting path. Multi-hop routing gets cheaper, the keeper gets simpler, and every swap settles inside a single transient-balance context.

  • Feed Keeper pushes USD prices at 1e8 precision with a per-coin freshness window. Stale price, no launch.
  • Peg Each commodity coin gets a single-sided coin/USDC v4 pool that the manager repositions as the oracle moves.
  • Launch Anyone lists a token against one commodity — or a weighted basket of up to five.
  • Treasury Trading fees split 40 / 30 / 30 between holders, buybacks and the protocol.
Gold, wheat, crude oil, copper and coffee arranged on dark slate
Eight reference commodities, quoted in USD and mirrored on-chain as ERC-20 coins.

Mechanics

Three moving parts, no discretion.

01

The peg pool

A commodity coin is not backed — it is quoted. The manager mints a coin, opens a coin/USDC v4 pool at 0.05% with a single-sided range around the oracle price, and provides ask depth in USD. Buying walks the range up; the keeper repositions on 0.3% drift, so the pool tracks the printed futures price instead of an AMM's memory.

02

The launch curve

A launch mints one billion tokens. 80% goes into a concentrated v4 range priced to open at a $5,000 fully-diluted valuation and run to a $35,000 cap; the remaining 20% is held as reserve so trading continues past the cap instead of hitting a wall. First buy is mandatory and at least $1 — the deployer eats the first tick.

03

The fee treasury

LP fees are dynamic between 1% and 3% and accrue to a treasury that splits every claim 40% to holders, 30% to buybacks, 30% to the protocol, with a 2% payout reserve held back for gas. Holder payouts are computed from a Transfer-log snapshot, so no staking contract is needed.

Price discovery

From $5,000 to $35,000, then open water.

The curve is not a bonding curve contract — it is a Uniswap v4 range, so every position is a real LP position from block one. The chart traces fully-diluted valuation against the share of the curve allocation sold. Past the cap, the 20% reserve keeps the book two-sided.

Curve allocation
80%
Reserve
20%
LP fee band
1% – 3%
Basket size
up to 5 coins
Every collectFees() call, split on-chain.

Fee routing

40 / 30 / 30, settled on claim.

  • 40% Holders — distributed from a Transfer-log snapshot of the market token.
  • 30% Buyback — swept back into the market's own pool.
  • 30% Protocol — funds the keeper, oracle pushes and repositioning gas.

A 2% payout reserve stays in the treasury so holder distribution never strands itself without gas. Fees accrue in the quote asset: commodity coin, USDC, or both for basket markets.

Verification

Ten fork tests against Base mainnet state.

The suite runs against a Base mainnet fork with the live Uniswap v4 PoolManager at 0x4985…2b2b and native USDC at 0x8335…2913. Every number below is an assertion in the suite, not a projection.

Fork test results
TestAssertsResult
Opening valuationLaunch FDV lands within 1% of $5,000pass
First buy$35 first buy moves FDV to $5,071pass
Past the capTrading continues on reserve above $35,000pass
Router round tripUSDC in → token → USDC out, one unlockpass
Fee split40 / 30 / 30 exact to the weipass
Basket launch60/40 gold + corn basket, 4,768 wei dustpass
Commodity sizing$35,000 of gold buys 10 oz at $3,500pass
Peg trackingPool follows a 10% oracle move after repositionpass
Staleness gateA 7-hour-old gold price blocks the launchpass
Hook isolationFee hook rejects foreign pool initialisationpass

Run locally: BASE_RPC_URL=https://mainnet.base.org forge test -vv — Solidity 0.8.26, Cancun, via-IR, optimizer at 800 runs.

Builders

Clone, configure, broadcast.

Contract map

  • CommodityFeedKeeper-pushed USD prices, per-coin max age, Stale(coin) revert.
  • PegManagerLists coins, opens and repositions the single-sided peg pools, buyCoin / sellCoin.
  • CommodityLaunchpadMints markets, builds the v4 curve range, settles the mandatory first buy.
  • LaunchFeeHookafterInitialize-only hook, CREATE2-mined for the 1<<12 flag.
  • LaunchRouterBuy or sell with coin, USDC or ETH inside one unlock.
  • FeeTreasury4000 / 3000 / 3000 bps accounting with a 2% payout reserve.

Deploy flow

# WSL / Ubuntu, from the project root
export PATH="$HOME/.foundry/bin:$PATH"
forge install && forge build

# 1 — deploy and auto-wire the stack
forge script script/Deploy.s.sol \
  --rpc-url $BASE_RPC_URL --broadcast

# 2 — list commodity coins + first oracle push
forge script script/ListCoins.s.sol \
  --rpc-url $BASE_RPC_URL --broadcast

# 3 — launch a market against a coin or basket
forge script script/Launch.s.sol \
  --rpc-url $BASE_RPC_URL --broadcast

# 4 — keeper: prices, repeg, fees, payouts
python keeper.py   # DRY_RUN = True by default

The broadcast key must equal ADMIN in the deploy config; the script writes deployments/base.json and wires the hook into the launchpad with a one-shot setHook.

Honest answers

What this is, and what it is not.

Are the commodity coins redeemable for metal?

No. They are oracle-quoted ERC-20s. The peg holds because the manager runs a single-sided pool around the printed price and repositions it — there is no vault, no custodian and no physical delivery. If the keeper stops pushing prices, the feed goes stale and launches stop.

How is this different from the original commodites.market?

The original lives on Robinhood Chain and uses Uniswap v3 for the peg pools with v4 for launches. commodibase targets Base and moves everything to v4: one PoolManager, one unlock pattern, cheaper multi-hop routing, and a hook set once after deployment rather than baked into a constructor cycle.

Who controls the oracle?

An owner address appoints keepers; keepers push prices and the lister role configures coins. That is a trusted role and the honest description is centralised price input. Freshness windows bound the damage: a price older than its maxAge reverts rather than trading on a ghost.

What happens above the $35,000 cap?

The 20% reserve keeps quoting. The curve range simply runs out of tokens at the cap; the reserve position keeps the market two-sided so price discovery continues rather than printing an untradeable wall.

Is this audited?

No. It is a working fork with ten passing Base-fork tests and it has not been reviewed by a third party. Treat mainnet deployment as experimental, start with the dry-run keeper, and size positions accordingly.