Docs

Shim fills an order in a tokenized share on Robinhood Chain against every Uniswap pool that can actually take it, at one price. This page is what it does, what it will not do, and what has been proved.

The clearing price

A share here trades in up to eighteen pools — Uniswap v3 at four fee tiers and v4 at whatever fee each pool's creator chose. They are separate pieces of liquidity and nothing keeps them level.

Shim solves for one number, lambda: buy from every pool whose ask (its price marked up by its own fee) is below lambda, sell into every pool whose bid (its price marked down by its fee) is above it, and trade each exactly that far. Choose lambda so the shares balance against what you asked for. Any two pools you buy from that finish at different marginal prices are a trade left on the table, so this is the cheapest fill that exists — not a heuristic.

The fee enters as a factor on price, so in the square-root space a pool's arithmetic lives in, it enters as its own square root. Using (1 − fee) there instead of √(1 − fee) doubles every spread and invents gaps that are not there.

What Shim refuses

  • A pool that cannot absorb $1.00, in either direction, inside the tick data Shim has read. 11 of the 279 pools on this chain are like that: they quote a price and hold nothing. They are also where the biggest apparent gaps live: CRCL shows 574 basis points between its pools if you count every pool that quotes. Counting only the pools that can fill a $1.00 order, it shows -53.
  • A pool charging more than 1%. 100 pools here charge more — up to 90% — and they quote happily. A 50% pool will show a 50% "gap" that is entirely its own fee.
  • An order it cannot price inside its own data. Shim reads a window of 25% around each pool's price. A walk that would leave that window is traded to the edge of what is known and no further, never guessed past.
  • An order that would overspend the budget. "Spend $10,000" must not spend $10,000.000002; if no price can be found that fits, the order is refused rather than rounded up.

The transaction

One call to Uniswap's Universal Router, through Permit2. Dollars are pulled once; each buy leg spends its share; each sell leg is fed by the router's own balance; the shares are swept to you with a floor on the total, and any dollars the sell legs returned are swept back. Shim deploys no contract and holds no keys.

The floor is the guard, and it is the router's own: if the pools moved and the order would deliver less than 0.30% below the quote, the sweep reverts and nothing happened. When a plan sells into a pool on the way past, your wallet needs the gross for the length of the call — the app says so before you sign.

What is proved

  • 39/39 properties on Robinhood Chain itself, each executed by an eth_call with no to — real creation code on the real evaluator, no deployment, no gas. Init code 20,143 bytes against EIP-3860's 49,152. 19 of 21 deliberate defects caught by a named property; 2 declared unobservable with the property that proves why.
  • 10,890 assertions over 600 random orders against pool state frozen at one block, plus 15 named properties; 19 of 20 deliberate bugs caught.
  • 21/21 on a fork of this chain with the real router and real pools: a $100k order delivered the predicted shares to the wei and beat the best single pool by 27 bps.

Every share, at $50k

Read at block 64,043,251. Columns after the spread are what Shim saves against that share's own best single pool, at $1k · $10k · $50k · $250k.

SharePoolsThinSpread (bps)$1k$10k$50k$250k
AAPL5-100 bps0 bps14 bps69 bps
AMC5-120 bps0 bps18 bps56 bps
AMD4-350 bps2 bps43 bps
AMZN32-482 bps0 bps0 bps2 bps
ASML4-6021 bps95 bps
BABA5-70 bps11 bps84 bps
CLSK00
COIN2-67455 bps
COST6-100 bps6 bps12 bps49 bps
CRCL51-530 bps0 bps4 bps42 bps
CRWV100 bps
DELL3-1100 bps9 bps115 bps
DJT31-170 bps0 bps0 bps96 bps
EWY21-132 bps26 bps
GLD650 bps0 bps0 bps8 bps
GME41-100 bps1 bps14 bps76 bps
GOOGL5-80 bps0 bps0 bps3 bps
HIMS6-470 bps0 bps0 bps0 bps
IBM5-352 bps14 bpsonly Shim
INTC100 bps0 bps0 bps
IONQ00
LLY5-90 bps1 bps103 bps99 bps
LULU41-571 bps15 bps20 bps
META4-601 bps1 bps2 bps28 bps
MRNA4-441 bps4 bps42 bps
MSFT4-150 bps0 bps11 bps88 bps
MSTR5-410 bps1 bps5 bps104 bps
MU1200 bps0 bps0 bps0 bps
NBIS00
NFLX3-355 bps2 bps7 bps
NVDA5-00 bps0 bps0 bps0 bps
ORCL00
PLTR2-350 bps6 bps26 bps
QQQ4-90 bps0 bps0 bps3 bps
RBLX31-243 bps63 bpsonly Shim
RDDT3-603 bps34 bps14 bps10 bps
RGTI00
RIVN41-539 bps122 bps140 bps
RKLB100 bps0 bps
SGOV6-30 bps0 bps0 bps0 bps
SLV4-20 bps0 bps0 bps8 bps
SNDK2-1340 bps0 bps0 bps
SPCX4-100 bps0 bps0 bps15 bps
SPY4-100 bps0 bps2 bps11 bps
TSLA5-100 bps4 bps10 bps66 bps
TSM6-755 bps2 bps18 bpsonly Shim
TTWO5-470 bps3 bps19 bpsonly Shim
USAR100 bps0 bps
USO4-190 bps3 bps1 bps0 bps

The raw results, as the runs wrote them: the chain properties, the offline suite and its fuzz, the fork test, the census, every figure on this site. A summary nobody can check is a slogan.

What is not built

  • Selling is not built. The solver handles it — the arithmetic is symmetric and the fuzz exercises both sides — but the app prices and sends buys only.
  • No flash loan. When a plan sells into a pool on the way past, your wallet must hold the gross for the length of the call. Morpho's flash loan would remove that and is not wired up.
  • Hooked v4 pools are ignored rather than priced with a hook in the way.
  • Nothing watches anything. No alerts, no limit orders, no scheduling.
  • Not audited. By anyone.