How it works
A miller's trade
A quern is a hand mill: two stones, an eye in the upper one for the grain, and furrows cut across the face to carry the flour out to the rim. The miller does not speculate on grain. He owns the stones, and keeps a portion of what passes through.
What a position actually is
When you open a position, Quern sends one transaction to Uniswap's own v4 PositionManager. It mints an ERC-721 to your wallet and moves your USDG and your shares into Uniswap's PoolManager as liquidity, inside the price range you chose.
Quern has no contract in that path. There is nothing of ours holding your money, no admin key, no upgrade, no custody. The position is an ordinary Uniswap v4 position: you can manage it or close it at Uniswap's own interface, or by hand, whether this site is up or not.
Where the toll comes from
Every swap through a Uniswap pool pays a fee. That fee is divided among whoever has liquidity at the price the swap moves through — so while the market is inside your range, you are paid a share of every trade, in proportion to how much of the liquidity there is yours.
Robinhood Chain's pools also take a protocol fee, charged on the way in before the pool's own fee applies. So a 0.30% pool with a 500-pip protocol fee pays providers 0.2999%, not 0.30%. Quern shows the number after that deduction, and the test suite checks it against what a real swap actually pays — the advertised rate and the measured rate agree to within 0.02%.
Fees do not compound into the position. They sit alongside it until you take them, which you can do at any time without disturbing the position itself.
The gap
Your range is the band of prices you are willing to make a market between. It is a geometric band: “±10%” means from the price divided by 1.1 to the price multiplied by 1.1, which is what centres it properly. Uniswap's prices live on a grid of ticks, so the range is snapped outward to the nearest usable ticks — never inward, so you always get at least the range you asked for.
- Inside the range you hold a mixture, and it shifts as the price moves: the pool sells your shares as the price rises and buys them back as it falls.
- Above the range the pool has sold all your shares; you hold only USDG, and earn nothing until the price comes back.
- Below the range it has spent all your USDG; you hold only shares.
Narrowing the range concentrates the same money into fewer prices, so it earns several times more while the price is inside — and nothing at all once the price is out. That is the whole trade-off, and the app draws where the price sits against every range you hold.
What can go wrong
Impermanent loss. Because the pool sells into strength and buys into weakness, a position that ends up on one side is worth less than simply having held the two assets. If a stock runs up and stays up, you will have sold it on the way — you keep the dollars and the fees, but you no longer have the shares. The fees are the payment for taking that side. If the market barely moves and trades a lot, you do well; if it moves a long way in one direction, holding would have done better.
A thin mill. Some of these pools are small. The app lists how much is working within 1% of the price, and the price is checked against Uniswap v3 — a separate deployment — before a stock is listed at all. An early version of the scanner listed SPCX at $16.7 trillion a share because it had believed a single untraded pool; it now needs an outside opinion.
Tokenized stocks are not stocks. They are tokens issued on this chain, with their own issuer and their own risks, and they trade whenever the pool does — including when the underlying market is closed.
How your positions are found
This is worth saying plainly, because it is the one place Quern depends on something outside the chain. A Uniswap v4 position NFT is not enumerable — the contract has no “list what this wallet owns” — and Robinhood Chain's public node serves no log history, so past transfers cannot be replayed either.
So the app asks the block explorer's index for candidate token ids, and also remembers the ones you opened in this browser. Every candidate is then verified against the chain — owner, pool, ticks, liquidity, fees — and anything that does not check out is dropped. The index is a hint that is allowed to be wrong; the chain decides.
How this is checked
Every transaction the site sends is built by a single file, js/liquidity.js.
That same file — not a copy of it — is run against the real Uniswap v4 contracts on a fresh
fork of Robinhood Chain: positions opened in pools of both orientations, earned on by a
separate wallet trading through them, added to, half-withdrawn, walked out of range, and
closed.
The checks are written to be able to fail. The amounts charged are compared to the plan to the wei; the fees predicted are compared to the tokens actually paid out to the wei; the range is priced against the market independently of the builder; and the slippage minimums are tested by moving the price against a built transaction and requiring the chain to refuse it.
Then deliberately broken copies of the builder are run through the same suite, to check the suite still fails when it should. That exercise has already caught real defects here: a “±40%” range that was really ±52% and eight per cent off centre, and ranges that snapped inward instead of outward in exactly the half of the mills where USDG is the pool's first token.
The contracts
All of these are somebody else's, already deployed, and were read back on chain before being written into this site's configuration.