Lunette
A stone lectern in a niche. On it lies a great open book with ribbon markers, between a brass astrolabe, a candle, an hourglass and a key.

The codex

How the window is made: the whole mechanism, every parameter, the contracts, and what can go wrong. Nothing here is live yet.

In one paragraph

LUNETTE is a token with one Uniswap V4 pool and one hook. Every swap in that pool pays a 3% tithe in ETH (as WETH). The hook reads the phase of the moon from the block time and splits the tithe: the lit share goes to holders as Light, the dark share goes into the Well. The Well divided by the token supply is the floor. When someone sells, the pool fills the sale only down to the floor price. The Well buys whatever is left at exactly the floor, and burns it. There is no owner, no admin and no way to change any of this.

The tithe

  • 3% on every buy: 3% of the WETH you pay.
  • 3% on every sell: 3% of the WETH you would receive, whether it comes from the pool, the Well, or both.
  • All four swap types are covered: exact input and exact output, each way.
  • Transfers between wallets pay nothing. The token contract itself has no tax code.
  • The tithe exists only in the official pool. Any other pool somebody creates pays nothing and feeds nothing.

The Moon

The hook does not ask an oracle. It computes the mean lunar phase from the block timestamp with integer arithmetic.

age = (now - 947,168,374) mod 2,551,443
moonlight = 1 - | 2 * age / 2,551,443 - 1 |947,168,374 is the mean new moon of 6 January 2000. 2,551,443 seconds is one mean lunation, 29.530589 days.
  • moonlight is 0 at the new moon, 1 at the full moon, and a straight line between them.
  • toLight = tithe * moonlight, and toWell = tithe - toLight.
  • Over a full lunation the split averages one half each.
  • It is continuous. There is no epoch, no snapshot and no boundary to trade around.
  • It is the mean moon: within about 14 hours of the true one, drifting by less than two seconds a year.

The Well

floor = well / supplysupply = every token that has not been burned, including the unsold tokens still in the pool

How a sale is filled

  1. The hook takes the whole sale into its own hands.
  2. It sells into the pool, with a price limit at the floor. The pool can never be pushed under it.
  3. Anything the pool did not take is bought by the Well at exactly well / supply, rounded down.
  4. Those tokens are burned. The 3% tithe is taken from the total. The seller receives the rest in the same swap.

The seller does nothing special. It is an ordinary swap through any router. If the pool price is already at or under the floor, the whole sale goes to the Well.

Why the floor cannot fall

What happensWellSupplyFloor
A tithe arrivesupsameup
The Well buys r tokens for floor(r * well / supply)down by at most r * floordown by rsame or up
Someone buys in the poolsamesame (unsold tokens were already counted)same
Someone burns, or gifts WETHsame or upsame or downup

Why it cannot run dry

By definition the Well holds floor * supply. It can buy every token in existence at the floor and end at exactly zero. Counting unsold tokens in supply is what makes this true, and it is why the floor is conservative: it trails the market price, especially early.

When the pool sits under the floor

If tithes lift the floor above the pool price, anyone can buy in the pool and sell to the Well. That costs two tithes, so the pool price settles at or above about 94% of the floor. The trade leaves the floor where it was, and its tithes lift it.

The Light

The Light share of each tithe is sent to the token contract as real WETH and enters the Glass. The Glass releases it over time:

released = glass * (1 - 2^(-dt / 637,860))637,860 seconds is a quarter of a lunation. Half of whatever is in the Glass falls every quarter moon.
  • Whatever is released is credited to every eligible holder, pro rata to balance, through a running index (lightPerToken).
  • The token advances that index on every transfer, before balances change. Light is therefore earned per token per second held.
  • A flash loan earns nothing. A wallet that buys today earns nothing for yesterday. Splitting a bag earns the same.
  • claim(holder) sends a holder their WETH. Anyone may call it for anyone. It can only pay the holder.
  • Everyone earns except the Uniswap PoolManager (which holds the unsold supply), the dead address, the token contract and the zero address.

Upkeep

Nothing needs a keeper to stay safe. Two functions exist for tidiness, and anyone can call them:

  • hook.poke() turns WETH sent to the hook by mistake into Well, burns LUNETTE sent to the hook, finishes any pending burn, and calls token.pour().
  • token.pour() advances the Glass and books any WETH sitting on the token as Glass.

Every parameter

ParameterValueWhy
Supply1,000,000,000Fixed. No mint function exists. Burn only.
Tithe3% / 3%Paid in ETH so holders receive ETH and the hook never sells tokens.
SplitmoonlightContinuous, public, averages 50/50, nothing to snipe.
Lunation2,551,443 sThe mean synodic month.
Epoch947,168,374Mean new moon, 6 January 2000.
Floorwell / supplyAll unburned supply: monotone and undrainable.
Glass half-life637,860 sA quarter moon. Slow enough to defeat sniping, fast enough to feel.
LP fee0The tithe is the fee.
Liquiditylaunch onlyAdding is blocked after launch and donations revert: no untaxed side door.
Opening tick-201,600A 1.758 ETH market cap on one billion tokens.
Bands20 / 25 / 30 / 25%From the opening price to x3.16, x10, x100, x1004.

None of these can be changed after launch, by anyone.

Where every wei goes

// a buy with A WETH, the moon k lit
tithe   = floor(A * 3%)
toLight = floor(tithe * k)        // WETH, to the token: the Glass
toWell  = tithe - toLight         // stays with the hook: the Well
swapped = A - tithe

// a sale of T tokens
(x, y)  = pool leg, limited at the floor   // x tokens for y WETH
r       = T - x                            // what the pool did not take
g       = floor(r * well / supply)         // the Well pays the floor
burn(r)
tithe   = floor((y + g) * 3%)              // split by the moon as above
seller receives  y + g - tithe

The books, which the invariant tests check after every random action:

  • The hook's WETH claims at the PoolManager are never less than the Well.
  • The token's WETH is never less than everything it owes holders plus the Glass.
  • Tithes + gifts = Well + what the Well has paid out + Light booked.

The contracts

ContractAddressWhat it is
Lunetteat launchThe ERC-20 and the Light. No owner, no mint.
LunetteHookat launchThe pool hook: tithe, moon, Well.
LunetteLauncherat launchDoes the whole launch in its constructor. Has no functions afterwards.

Check it yourself

Every claim on this site is a read call. No wallet is needed, only a block explorer.

// the hook
floorPrice()          // WETH wei per whole token
well()                // WETH in the Well
supply()              // every unburned token
moonlight()           // 0 = new moon, 1e18 = full moon
quoteDrown(tokens)    // what the Well pays for them, before the tithe
totalTithe() totalToWell() totalToLight() totalDrowned()

// the token
earned(holder)        // Light a holder can be paid now
glass()               // Light collected, not yet fallen
lightPerToken()       // lifetime WETH per token, scaled 1e36
totalSupply()         // only ever falls

// anyone may call, for anyone
claim(holder)         // sends the holder their WETH
poke()                // upkeep

Launch

  • One transaction deploys the token, deploys the hook at a mined address, opens the pool, places the whole supply as four token-only liquidity bands, sends the position NFTs to the dead address and seals the pool.
  • The deployer ends with zero tokens. There is no team allocation and no presale.
  • The whole first band, 20% of supply, costs about 0.65 ETH including the tithe. Whoever buys early is, for a while, most of the eligible supply and receives most of the early Light. That is what a launch with no allocation looks like.

Attacks and defences

One test exists for every row. The longer version is in the design document that ships with the source.

AttackDefence
SandwichTaxed, not prevented. The attacker keeps 97% of what the victim loses and pays 5.91% of the front-run, so it pays only when it takes more than 6.09% of its own size. Your minimum-out caps what can be taken. A sandwiched seller still gets the floor.
Hold one block around a big tradeLight falls over days. One block earns one block.
Flash loanZero seconds held, zero Light. The floor does not depend on balances or spot.
Wash tradingYou get back only your pro-rata share of the Light part of your own tithe. Nothing rewards volume.
Splitting walletsEverything is linear in balance.
Donating to the poolReverts.
Just-in-time or range-order liquidityAdding liquidity reverts after launch.
Pushing the pool to the floorHarms nobody but the pusher. Sales at the floor are paid the floor.
Buy, sell to the Well, repeatThe floor divides by all supply, so every such sale is floor-neutral and costs two tithes.
Gift WETH to move the floorA gift lifts the floor for every token. The giver recovers at most their own share.
Rounding dustEvery rounding goes against the taker and for the Well or the Glass.
Stuck fundsStray WETH becomes Well or Glass. Stray LUNETTE is burned. Plain ETH is refused.
Contract wallets, EIP-7702No code checks exist. Light is plain WETH with no callback.
Price-limited swapsA swap its own limit would cut short reverts instead of being taxed on what did not trade.
Gaming the moonThe split changes where the tithe goes, never how much. A block proposer's seconds move it by about 0.001%.
Buy off-market, then pokeEvery transfer advances the Glass first.
ReentrancyHook entry points answer only the PoolManager. WETH has no callback.
A second pool on the same hookThe hook binds to one pool, once.

Known limits

  • Experimental and immutable. Reviewed by AI only. A bug cannot be fixed.
  • The floor starts at zero and trails the price. It counts unsold tokens, so it is conservative.
  • No volume, no Light. Light is other people's tithes and nothing else.
  • Sandwiches are taxed, not prevented. A buy that moves the price by more than about 6% on its own can be sandwiched even with a tight minimum-out. Early on, when the pool is thin, that is most buys. Split large buys and use private order flow.
  • The tithe lives in one pool. Trades elsewhere pay nothing and are not protected by the Well.
  • Contracts that hold tokens earn Light for whoever controls them: exchange wallets, bridges, other pools.
  • ETH in the pool under the floor line is out of reach. Once the floor passes a price, sales stop there and the pool's bids below it are never used again.
  • Aggregators that ignore the hook can misquote sales near the floor. The on-chain quoter is right.
  • A holder gets back a share of their own tithe equal to their share of the eligible supply times the moon's light. At launch the first buyers are the whole eligible supply, so near a full moon a dominant early holder trades almost tithe-free.
  • The moon is the mean moon.
  • Swaps that rely on partial fills revert. The Universal Router does not.

Tests and review

The contracts ship with 126 tests, all passing: unit and fuzz tests, 7 invariants run over 32,768 random actions each, 14 mainnet-fork tests against the real Uniswap contracts, and one attack test per row above. The review was done by AI: a hostile re-read by the author model, one independent pass by a second model with no knowledge of the first one's reasoning (no high or medium findings; its low findings are the limits listed above), and mutation checks. No professional audit firm has read the code. Treat it accordingly, and read the disclaimer.