> 01 / What it is
A launchpad that opens the market itself.
Stonk.Fi pools USDG for a token that has no market yet, then creates that market and makes the first purchase in it — pool creation, liquidity and the opening buy in one transaction, in one block.
A backer holds a position in a raise, not a claim on a promise. Everything a backer receives is produced by that single launch transaction: the coin bought in the opening swap, split by contract-defined weight. There is no pre-launch price, no fixed allocation and no guaranteed outcome.
The inaugural raise is the protocol's own token and is special in several ways: it can never be cancelled, it is the only raise that mints founder tranches, and its launch window is measured from its own creation rather than from the last launch. Until it launches, no one can create a second raise. Once it launches, anyone can, for any of four quote assets — the same rules apply to all of them, except that a stock-quoted raise is capped at 5,000 USDG of total backing.
There is no owner.No contract in the protocol has an admin key, a pause switch, an upgrade path or a migration. The only privileged callers are a raise's own rights holder and fee recipient, the keeper contract, the memento collection and the controller itself. That cuts both ways: nobody can seize or redirect a raise, and nobody can rescue one either. The protocol cannot be paused — though the issuer of a centralised quote asset can pause that asset, which stops the raises using it.
Nothing in the protocol runs on a schedule. Launches, fee collection, buybacks, burns, price warming and token delivery all happen because someone sent a transaction and paid for it. Every interval below is an earliest-possible time, never an appointment.
ProtocolStonkFi.sol
- Controller
- StonkFiOne non-upgradeable contract. No owner, no pauser, no admin key, no proxy.
StonkFi.sol:1–1443 - Deposit asset
- USDGThe constructor reverts unless the configured token reports 6 decimals.
StonkFi.sol:284 - Quote assets
- Native ETH · USDG · Stock token · STONKFIA raise names its quote at creation; deposits are converted into it on the way in.
StonkFi.sol:70–75 - Venue
- Uniswap v4One canonical pool per launch, created by the protocol with the Damper hook attached. Nothing stops a third party opening another market for the same coin afterwards.
CanonicalV4Adapter.sol:335–336; StonkCoin.sol:68–72 - Raise creation
- Locked until launch 0createRaise reverts PublicCreationLocked until the inaugural launch succeeds; after that anyone may create one.
StonkFi.sol:565, 909 - Launch trigger
- PermissionlessStonkCrank takes no allowlist, bond or registration; the caller becomes the keeper for reward purposes.
StonkCrank.sol:371, 414, 948 - Token handling
- Exact balance deltasEvery token transfer in or out is checked against before/after balances on both sides. A fee-on-transfer, rebasing or otherwise inexact token reverts rather than silently under-delivering. On the native-ETH path only the contract's own side is asserted.
StonkFi.sol:1227–1273 - Stray ETH
- Not recoverableThe controller accepts plain transfers and has no sweep. ETH sent outside a native-quote flow stays there, and no owner exists to return it.
StonkFi.sol:484
> 02 / Lifecycle
Funding, then one of two endings.
A raise is Funding, Launched or Cancelled. There is no paused state, no expiry and no automatic close — a raise stays open until it launches or its creator cancels it.
While a raise holds at least the viability floor it sits in a queue ordered by total backing, largest first. A keeper takes the top of that queue when the cadence allows: once for the inaugural raise, 24 hours after it was created, and then at most once every eight hours across the entire protocol.
Eligibility is not a deadline. Reaching the 24-hour mark makes a launch possible, not scheduled: it still needs a keeper to call, a passing price reference at that moment, and — unless the crank is reviving a quarantined raise by id — no larger raise ahead of it. A small raise can wait behind larger ones indefinitely. Repeated failed attempts drop a raise out of the queue entirely — the third candidate-attributable revert, or the fifth unclassified one — until its rights holder calls retryLaunch eight hours later, while a price-feed failure only parks it for eight minutes in a queue the crank alone can revive. And a raise that dips below the floor loses its place and rejoins behind everything that stayed viable.
Cancellation belongs to whoever holds creator rights — the creator, until they transfer them — and only while Funding. It needs no backer consent, and it can happen after significant backing has accumulated — at which point every backer claims their own refund, in the raise's quote asset. The inaugural raise is the exception: it cannot be cancelled at all, and because public raise creation only unlocks when it launches, a permanently failing inaugural launch leaves the launchpad closed.
LifecycleStonkFi.sol
- States
- Funding · Launched · CancelledThe whole state machine. There is no paused, expired or refunding state; a failed launch is carried by a queue sentinel rather than by a status.
StonkFi.sol:64–68, 784 - Inaugural window
- 24 hoursRaise 0 becomes launch-eligible 24 hours after it is created, not at a fixed clock time.
StonkFi.sol:161, 793 - Launch cadence
- 8 hoursAfter the inaugural launch, at most one launch every 8 hours across the whole protocol.
StonkFi.sol:162, 790–791 - Viability floor
- 5 USDG totalA raise is only queued while its total backing is at or above the floor.
StonkFi.sol:163, 1336–1338 - Queue order
- Largest backing firstA max-heap on total backing; ties break by the time a raise became viable. A crank-scheduled retry is attempted by id and bypasses the ordering.
StonkFi.sol:766, 708–723, 1432–1441 - Cancellation
- Rights holder only, while FundingRaise 0 can never be cancelled. Any other raise can be, at any point before launch, without backer consent — by whoever holds creator rights at the time, which is transferable.
StonkFi.sol:680–688, 966–977 - After cancellation
- claimRefundEach backer withdraws their own position. Nothing is pushed automatically.
StonkFi.sol:725–739 - Failed launch
- 8-hour quarantine, or an 8-minute parkOne failure does not unqueue a raise. A candidate-attributable revert quarantines it on the third attempt, an unclassified one on the fifth, and a consumed retry that fails again immediately — then it rejoins through retryLaunch, called by the rights holder, or by anyone for raise 0. A price or stock-readiness failure takes the other branch: an 8-minute park in a queue only the crank can revive, through crankRetryLaunch.
StonkFi.sol:778–786, 690–702, 708–723; StonkCrank.sol:105–109, 482–517, 520–529 - Losing the floor
- Forfeits seniorityA raise that falls below the viability floor is unlinked from the queue and its viableAt timestamp is deleted. Crossing back gets a new timestamp, behind everything that stayed viable.
StonkFi.sol:1313–1324 - Cancelling raise 0
- Impossiblecancel reverts for raiseId 0. Since public raise creation only unlocks on its launch, a permanently failing inaugural launch leaves the launchpad closed.
StonkFi.sol:680–682, 565, 908–909
> 03 / Quote assets
Backed in USDG, denominated in something else.
Every raise is backed in USDG, but it is denominated in one of four quote kinds: native ETH, USDG itself, a tokenised stock, or STONKFI. The quote is what the pool is paired against, what the launch buys with, and what a withdrawal returns.
Which assets qualify is decided in code, not by curation. Native ETH must be the zero address; USDG and STONKFI must be the exact addresses fixed at deployment; a stock token must prove its own provenance by resolving back to itself through the stock factory. WETH is rejected outright, whichever kind is claimed.
Stock quotes carry the most outside dependency. They need a price feed that matches a pinned proxy codehash, owner, decimals and description, bound once and never rebindable. They stop working whenever the issuer pauses the token or its oracle, or schedules a share-multiplier change. And they are capped: 5,000 USDG of total backing per raise. A STONKFI-quoted raise has the opposite problem — no external feed exists for it at all, so both its floor and its valuation come from the same market the backer is trading into.
Quote kindsLaunchPlanner.sol · StonkPriceGuard.sol
- USDG
- Quote kind 1The deposit asset and the simplest quote: no conversion on the way in, and a withdrawal returns exactly what was paid.
LaunchPlanner.sol:52–55; StonkFi.sol:746–748 - Native ETH
- Quote kind 0The proposed quote must be the zero address. Backing still arrives as USDG and is converted to ETH at deposit time.
LaunchPlanner.sol:48–51 - Stock token
- Quote kind 2Must prove factory provenance: the token's own uid must resolve back to that exact address through the stock factory. A centralised asset with issuer and custody risk.
LaunchPlanner.sol:60; lib/StockProvenance.sol:8–22 - STONKFI
- Quote kind 3Must be the protocol's own coin. It has no oracle feed, and its TWAP does not floor a deposit: backing a STONKFI raise is floored by the same-block route preview alone, with only a live USDG peg check on top.
LaunchPlanner.sol:56–59; StonkPriceGuard.sol:307–317, 620–624 - WETH
- Rejected outrightAny raise proposing WETH as its quote reverts InvalidQuote, whichever kind is claimed.
LaunchPlanner.sol:47 - Re-validated per deposit
- Every back() callThe quote is checked again on each deposit, not only at creation. A stock token that stops resolving through the factory stops accepting backing.
StonkFi.sol:615, 1164–1165 - Stock feed binding
- First writer wins, forevercreateRaise binds a price feed to the stock quote. A different feed later reverts StockFeedBindingConflict — nobody, including the protocol, can rebind it.
StonkFi.sol:568; StonkPriceGuard.sol:261–266 - Feeds are not shared
- One feed, one assetA feed already bound elsewhere reverts StockFeedInUse, and the USDG and ETH feeds can never be bound to a stock. A non-stock raise must pass the zero address or the call reverts InvalidStockFeed.
StonkPriceGuard.sol:253–256, 267–273 - Stock feed authentication
- Codehash, owner, decimals, descriptionA bound feed must match a pinned proxy codehash and owner, report 8 decimals, and carry a description naming the token's own symbol.
StonkPriceGuard.sol:124–126, 696–712 - Issuer controls
- Pause and share multipliersA stock quote whose token reports paused, tokenPaused or oraclePaused reverts StockPaused, and a pending multiplier change reverts MultiplierTransition. Backing and launching stop until the issuer clears it.
StonkPriceGuard.sol:810–836 - Decimals
- 18, except USDGTracked assets must report 18 decimals; USDG is asserted to be 6 at construction and native ETH is exempt from the check.
StonkFi.sol:284; StonkPriceGuard.sol:838–847
> 04 / Backing
One position per wallet.
Backing is always paid in USDG. A wallet's position must total at least 5 USDG; above that it can be topped up any number of times, up to 128 deposits per raise.
If the raise's quote asset is not USDG, the deposit is converted into that asset on the way in, at the moment you deposit, through a guarded route. That conversion is what a withdrawal returns: you get back the quote acquired at deposit time, not the USDG you paid. Where the quote is USDG the two are identical; for an ETH-, stock- or STONKFI-quoted raise a withdrawal can be worth materially more or less than the deposit.
Every deposit carries its own minimum output and deadline, and both are enforced. A deposit can also fail for reasons that have nothing to do with you: a stale or off-peg USDG reading, an unavailable route price, or a protocol floor above what the route can deliver will revert it rather than fill it badly.
Exit is all-or-nothing, and only before launch.There is no partial withdrawal — leaving means leaving completely, which also destroys that wallet's queue contribution, memento units, referral attribution and deposit count. After a raise is Launched there is no exit at all; from that point the only way out is the market.
BackingStonkFi.sol
- Minimum position
- 5 USDG5e6 at 6 decimals. The floor is on a wallet's total position, not on each top-up.
StonkFi.sol:163, 606 - Deposits per wallet
- 128Per raise. The 129th deposit reverts TooManyDeposits; only a full exit resets the count.
StonkFi.sol:166, 617 - Every deposit requires
- minOut + deadlineback() reverts on a zero minimum output or an expired deadline.
StonkFi.sol:596–597 - Withdrawal
- Full position onlyThere is no partial withdrawal. Exiting deletes that wallet's deposits, its memento units and the referral basis they credited. The raise's own queue seniority is only lost if the exit drops its total below the floor.
StonkFi.sol:671–678, 1191–1225, 1313–1319 - Withdrawal window
- Funding or CancelledAfter a raise is Launched, withdrawFull and claimRefund both revert InvalidState.
StonkFi.sol:672–673, 735 - Withdrawal asset
- The raise's quoteYou are returned the quote acquired at deposit time, not the USDG paid in. Identical only where the quote is USDG.
StonkFi.sol:674–676, 746–748 - Payout destination
- Caller may redirectwithdrawFullTo, claimRefundTo and claimReferral each take a recipient; the position or claim is still debited from the caller. The zero address and the controller itself are rejected.
StonkFi.sol:666–668, 729–731, 928–929 - Stock-quoted raises
- 5,000 USDG capA deposit that would cross the cap reverts rather than partially filling.
StonkFi.sol:167, 608–610 - Referrer
- Fixed per depositRecorded on the deposit itself. Self-referral and self-excluded addresses revert InvalidReferrer.
StonkFi.sol:618–625, 647, 957–960
> 05 / Referrals
A rebate, not just a reward.
A referrer is recorded on the deposit, not on the wallet. Two deposits from the same address can name different referrers, or none. No later deposit rewrites an earlier one, though a full exit deletes a deposit and its attribution with it.
Referred backing pays one extra 6.67% lane at launch — and that lane is not a payment to the referrer alone. It is split roughly in half: one half is claimable by the referred backer as a rebate, the other by the referrer, pro rata across everyone they brought. The odd unit rounds to the backer. Both halves settle in the raise's quote asset and both are claimed rather than pushed.
None of it exists unless the raise launches — the referral pool is only sized inside the launch transaction, so a cancelled raise pays neither side. And a referrer's share can shrink without their involvement: when a referred wallet withdraws in full, the contract walks its deposits and decrements the referrer's recorded basis.
ReferralsStonkFi.sol · LaunchPlanner.sol
- Recorded on
- The depositEach deposit stores its own referrer. A later deposit can name a different one, or none.
StonkFi.sol:618–625, 646–647 - Rejected referrers
- Yourself, and opt-outsNaming your own address reverts InvalidReferrer, as does naming an address that has called selfExclude.
StonkFi.sol:621, 957–960 - Lane taken
- 6.67% of referred backingCharged against the referred subtotal only, and only at launch. Unreferred backing is untouched by it.
lib/LaunchEconomics.sol:9; LaunchPlanner.sol:79; StonkFi.sol:807, 840–847 - Backer's half
- ceil(lane / 2)The referred backer can claim it back as a rebate — the odd unit rounds to the backer, not the referrer.
StonkFi.sol:842–843 - Referrer's half
- The remainderSplit pro rata across everyone that referrer brought, by the quote basis each deposit contributed.
StonkFi.sol:845–846, 945–949 - Claiming
- Once per address per raiseA single claimReferral pays a backer rebate and a referrer share together. An address with no referred basis at all reverts NoAccrual and keeps its claim.
StonkFi.sol:928–955 - No launch, no referral
- Pool is sized at launchThe referral pool is only funded inside executeLaunch. A cancelled raise, or one that never launches, pays nothing to either side.
StonkFi.sol:840–847 - If the referee exits
- The reward shrinksA full withdrawal walks that wallet's deposits and decrements the referrer's recorded basis. The referrer is not consulted.
StonkFi.sol:1205–1211 - Visibility
- OnchainReferred backing and referral claims settle on the chain. A referral code hides an address in a link, not the relationship in the ledger.
StonkFi.sol:221–223, 248
Referral is public, not privateReferred backing and referral claims settle onchain, so a referred deposit is visible once it lands. A referral code hides the referrer's address in the link, not the relationship in the ledger.
> 06 / Routing
Three lanes, all the same size.
At launch the pooled quote is split into lanes of 667 basis points — 6.67% — each. An unreferred deposit pays two of them, so 86.66% reaches the opening purchase. A referred deposit pays a third, leaving 79.99%.
The two lanes every deposit pays are the creator lane and the Stonk Pipe lane. The Pipe's is transferred immediately; the creator's is credited as a dated lot to be claimed, on the same terms as pool fees later on.
Because a referred deposit sends less into the opening purchase, it earns proportionally less of it — a weight of 7,999 against 8,666, or about 92.3%. Referral changes routing and weight. It does not change the token price, withdrawal rights or any deadline.
The opening price itself is derived, not chosen: the planner values the whole supply at roughly 2.43 times the value of the raise and derives the opening price from that. The multiplier is computed as though every raise took the maximum three lanes and the opening purchase paid the pool's 1% fee. It is not a floor, an appraisal, or a statement about where the coin will trade afterwards.
RoutingLaunchEconomics.sol · StonkFi.sol
- Lane size
- 667 bps (6.67%)MAX_LANE_BPS. Every lane is the same size; the planner fixes the raise's laneBps at this value.
lib/LaunchEconomics.sol:9 - Unreferred deposit
- 86.66% to launchTwo lanes are taken: creator and Stonk Pipe.
lib/LaunchEconomics.sol:9; LaunchPlanner.sol:83, 101–102, 105 - Referred deposit
- 79.99% to launchA third lane is taken from the referred subtotal only.
lib/LaunchEconomics.sol:10; LaunchPlanner.sol:79–80, 103; StonkFi.sol:840–847 - Referral lane split
- ≈50 / 50Half is claimable by the referred backer as a rebate, half by the referrer. Both settle in the quote asset.
StonkFi.sol:842–846 - Claiming a referral
- One claim per address per raiseclaimReferral pays a backer rebate and a referrer share together, and only after the raise has launched.
StonkFi.sol:928–955 - Referred token weight
- 7,999 / 8,666 ≈ 0.923Referred backing earns proportionally less of the opening buy, matching the extra lane taken out of it.
StonkFi.sol:1108–1109, 1179–1189 - Creator lane
- Accrual, then claimCredited as a dated lot the creator claims. Lots unclaimed for 365 days can be swept to the Pipe by anyone.
StonkFi.sol:165, 837, 1057, 1074–1090 - Planner target
- 500 bps unrealisedTARGET_UNREALISED_PNL_BPS is an input to the opening price calculation, computed at the maximum three-lane take. Actual outcomes move with the referral mix and the market; it is not a promised return.
lib/LaunchEconomics.sol:13, 16, 18–19, 21–22 - Fee in the sizing
- 1% assumed on the opening buyPOOL_FRACTION_WAD multiplies the 79.99% three-lane residue by (10,000 − LP_FEE_BPS), so the multiplier assumes the opening purchase also pays the pool's 1% fee. That second factor, not the lanes alone, produces 2.43.
lib/LaunchEconomics.sol:11–12, 16 - Opening valuation
- ≈2.43 × the raiseMARKET_CAP_MULTIPLIER_WAD turns the raise's own value into a target valuation for the whole supply, which the adapter divides by that supply to set the opening price. It is a price input, not a floor, an appraisal or a statement about where the coin will trade.
lib/LaunchEconomics.sol:16–30; LaunchPlanner.sol:65, 76; CanonicalV4Adapter.sol:569–573
> 07 / Launch
One transaction, or none.
The launch is a single call that either lands completely or reverts completely. There is no state in which the pool exists but the opening purchase has not happened, which is the gap a launch sniper would otherwise occupy.
- The raise is sealed
Status moves to Launched, the raise leaves the queue, coin transfers unlock, and the creator and Stonk Pipe lanes are taken out of the pooled quote. On the inaugural raise the three founder tranches move here too.
- The pool is created
A Uniswap v4 pool is initialised at the planned price with the Damper hook attached. If the pool comes back at a different tick than the plan, the whole call reverts PriceMismatch.
- Liquidity is seeded
One coin-only position is minted inside the pool manager, spanning from the launch tick outward. The settlement delta must be exactly the coin principal with nothing on the quote side.
- The pool is registered
A one-USDG-equivalent buy runs first and must match its own simulation exactly, which proves the pool prices the way the plan said it would before the real money moves.
- The opening purchase executes
The pooled backer quote is swapped as exact input. Returned amounts must equal the simulated amounts or the launch reverts OpeningSwapMismatch.
- The result is re-checked
The controller independently re-reads the pool price through StateView, checks the hook registration and anchor, and requires that it ends the transaction holding no coin at all. Any disagreement reverts InvalidLaunchResult.
- The launch is recorded
Allocation is configured on the coin, the memento id is registered, public raise creation unlocks on the inaugural launch, the Pipe inflow is recorded, and the next eight-hour window starts.
Every step is checked against a simulation run in the same transaction, and the controller re-derives the result independently of the adapter that produced it. The launch is not trusted because the adapter says it worked; it is accepted because two readings of the pool agree.
A failed attempt does not cancel anything. The raise is quarantined out of the queue and stays in Funding with every position intact and still withdrawable; its rights holder can return it to the queue, and the crank can revive one due retry per window. Failures are recorded as a selector and a hash, so the chain does not carry a human-readable reason.
LaunchStonkCrank.sol · StonkFi.sol
- Who can launch
- AnyoneA keeper calls StonkCrank, which calls the controller, which self-calls executeLaunch.
StonkCrank.sol:371, 929–930; StonkFi.sol:762–763, 796–797 - Gas floor
- ≈8,500,000 to attemptThe crank defers the job below its own preflight floor; the controller separately requires 6,550,000 at the inner call.
StonkCrank.sol:163–164, 675; StonkFi.sol:169–172, 775 - Post-launch checks
- Revert on any mismatchThe adapter re-reads the pool and the controller independently re-reads price and hook state; disagreement reverts InvalidLaunchResult.
StonkFi.sol:878–892; CanonicalV4Adapter.sol:339–359 - On failure
- Quarantine, not cancellationThe raise leaves the queue and stays in Funding. Backing is untouched and can still be withdrawn.
StonkFi.sol:778–786 - Retry
- Rights holder, or the crankretryLaunch returns a quarantined raise to the queue; the crank revives one due environmental retry per window.
StonkFi.sol:690–702, 708–723 - Keeper reward
- 1.00 USDG of STONKFILaunch is a premium-tier job, so the Pipe credits STONKFI worth 1.00 USDG out of its STONKFI reserve. No USDG is paid, the amount is exact or nothing, and the balance is claimed in a separate call.
StonkPipe.sol:50–52, 639–645, 666, 773–782; StonkCrank.sol:1359–1361 - Failure reason
- Selector and hashThe controller emits a hash of the truncated revert data; the crank emits the four-byte selector alongside it. Neither carries the revert's arguments, so a UI can name the error but not explain it.
StonkFi.sol:785, 1275–1296; StonkCrank.sol:271–278, 516
> 08 / Keepers
Someone has to press the button.
StonkCrank is the only contract allowed to drive the protocol's recurring work, and anyone at all is allowed to drive StonkCrank. There is no allowlist, no bond and no registration: the caller becomes that call's keeper.
A crank call does at most one useful job, chosen by a fixed priority ladder — fresh distribution, price warming, launch, artwork, then a twelve-slot maintenance rotation covering fee collection, stock drips, distribution, price warming and Pipe settlement. Every external call is made with an explicit gas cap and a reserve, so a job that fails is recorded as deferred or failed rather than reverting the whole transaction.
The incentive is thin and it is honest about it. A rewarded maintenance job credits STONKFI worth 0.10 USDG; a launch or artwork job credits 1.00 USDG of it. Nothing is paid in USDG itself, and the reserve behind it is fed only by the 20% of STONKFI-side pool fees held back from the burn — while the recommended gas limit for a crank transaction is 32,000,000. Payment is exact or nothing: a reserve that cannot cover the whole tier credits zero, and if the reward call reverts the work still happened and the keeper is paid nothing.
So the honest summary of this section is: if nobody runs a keeper, nothing happens. No launch, no fee collection, no buyback, no burn, no artwork, no price warming and no automatic token delivery. Those are not background processes; they are transactions someone chose to send.
KeepersStonkCrank.sol
- Who may crank
- AnyoneNo allowlist, bond, stake or registration. msg.sender becomes the keeper for that call's rewards.
StonkCrank.sol:371–373, 385, 414, 437 - Jobs
- 8 kinds, one per callLaunch, USDG burn, stock drip, fee collection, distribution, price warming, artwork and pending-STONKFI settlement. A call does at most one useful job, chosen by priority.
StonkCrank.sol:96–103 - Recommended gas limit
- 32,000,000RECOMMENDED_CRANK_GAS_LIMIT. Jobs are skipped rather than half-run when the remaining gas is below their own preflight floor.
StonkCrank.sol:129 - Launch call budget
- 7,500,000 forwardedThe crank caps the controller call; the controller then self-calls the launch with 6,000,000 and catches any revert.
StonkCrank.sol:131, 930; StonkFi.sol:169, 1276–1280 - Quarantine threshold
- 3 classified failuresMAX_CANDIDATE_LAUNCH_FAILURES. Unclassified failures are tolerated to 5 before the same treatment.
StonkCrank.sol:105–106, 496 - Retry delay
- 8 hoursLAUNCH_RETRY_DELAY, matching the global launch interval.
StonkCrank.sol:107–108 - Readiness quarantine
- 5 unreadable probesWhen the crank cannot read whether a deferred raise's launch environment is ready, it counts the attempt. After MAX_ENVIRONMENT_READINESS_UNKNOWNS it drops the raise out of the environmental retry queue and sets an 8-hour retry, so recovery falls back to the rights holder.
StonkCrank.sol:110, 733–747, 831–842 - Price warming
- Every 8 minutesPRICE_WARM_INTERVAL. STONKFI's TWAP buckets only exist because keepers warm them, so pricing degrades when nobody cranks.
StonkCrank.sol:109, 1323 - Artwork job
- 30,000,000 gas, 3 failuresARTWORK_CALL_GAS with a 1-hour retry delay; after MAX_ARTWORK_FAILURES the job backs off for that hour. The fallback is not tied to the failure count — a launch whose artwork is not ready for any reason pins prior art and proceeds anyway.
StonkCrank.sol:112, 114, 126, 610–611, 903–909 - Distribution
- 32 per batch, 256 attemptsMAX_DISTRIBUTION_BATCH and MAX_DISTRIBUTION_ATTEMPTS_PER_LAUNCH bound the push. What is not pushed stays claimable.
StonkCrank.sol:118, 123, 1240 - Fee collection share
- 4 of 12 maintenance slotsFee collection gets slots 0, 3, 7 and 10 of the rotation, walking a cursor one launch at a time with a 1,500,000-gas budget per call.
StonkCrank.sol:143, 1008, 1132–1135 - Reward floor
- 2 USDG of workMIN_REWARDABLE_USDG. Below it a crank does the work without earning a reward, so dust cycles are not farmable.
StonkCrank.sol:116, 1087, 1112, 1152 - Maintenance rotation
- 12 slotsFee collection takes slots 0, 3, 7 and 10; stock drips 1, 5 and 9; distribution 2, 6 and 11; price warming 4; pending-STONKFI settlement 8.
StonkCrank.sol:183, 1007–1013 - Reward funding
- 20% of STONKFI pool feesKEEPER_REWARD_SHARE_BPS is the only thing that funds crank rewards: a fifth of the coin-side pool fees that reach the Pipe denominated in STONKFI. The other 80%, and every other launch coin's fees in full, are burned.
StonkPipe.sol:48, 594–618 - Reward tiers
- 0.10 or 1.00 USDG in STONKFIA rewarded maintenance job credits STONKFI worth 0.10 USDG; launch and artwork credit 1.00 USDG of it. Nothing is paid in USDG. Payment is exact or nothing: an underfunded reserve, or a price low enough to need more than 10,000 STONKFI, credits zero rather than a partial.
StonkPipe.sol:50–52, 639–645, 773–786; StonkCrank.sol:1359–1361 - Rewards are best-effort
- May credit nothingThe reward call is capped at 750,000 gas. If it reverts the crank emits KeeperRewardFailed and carries on; if the reserve cannot cover the full tier the call succeeds and credits zero. Either way the work still happened, unpaid.
StonkCrank.sol:147, 1363–1375; StonkPipe.sol:643–645 - Reward versus cost
- Cents against 32m gasThe recommended gas limit for a crank transaction is 32,000,000, against a reward of at most 1.00 USDG of STONKFI. Keepers are not paid in proportion to what they spend.
StonkPipe.sol:50–51; StonkCrank.sol:129 - If nobody cranks
- Nothing happensNo launch, no fee collection, no buyback, no burn, no artwork, no price warming, no automatic distribution. There is no internal scheduler and no fallback caller.
StonkFi.sol:762–763, 1005–1010
> 09 / Guards
Prices the protocol will refuse.
Whenever the protocol converts one asset into another — a deposit into a non-USDG quote, or the Pipe selling an asset for USDG — it sets its own minimum before your own is considered, and takes whichever is stricter.
That protocol minimum is the higher of two independent floors: an oracle fair-value band, and a floor at 99% of a same-block simulation of the same trade. STONKFI-quoted deposits are the exception — only the route floor and a live USDG peg check apply, with no fair-value band at all. The oracle side reads Chainlink first with strict round-shape and staleness checks, falls back to a cached answer, and only then to a median of route probes that must sit within 5% of a cached anchor. STONKFI has no feed at all and is priced from nine interval-TWAP buckets read off the Damper hook, with a five-bucket quorum — buckets that only exist because keepers warmed them.
Notice what the band does and does not promise. A 110% buy ceiling means a conversion can still fill meaningfully worse than fair value before the protocol refuses it, which is why your own minimum output matters: it can only tighten the floor, never loosen it.
Routes are not registered, whitelisted or governed. They are deterministic Uniswap v4 pool keys over a fixed set of fee and tick-spacing templates, probed in a fixed order, and the first that completes within its tick-read budget is used. Alternates are availability fallbacks, not price competitors.
Known limitRoute discovery reads a bounded number of initialised ticks, and the fast pass gives each candidate pool only eight of them. Only the primary template and one designated fallback get a retry at the full forty-read budget; a candidate that exhausts its budget is skipped, and RouteUnavailable is raised only once every template has failed. So a liquidity provider who fragments the primary pool with consecutive out-of-range positions can push a size onto a worse template, or past all of them at once.
GuardsStonkPriceGuard.sol
- Buy band
- ≤ 110% of fair valueMAX_BUY_PRICE_BPS. A deposit conversion may not pay more than 10% above the oracle-derived fair price.
StonkPriceGuard.sol:82 - Sell band
- ≥ 90% of fair valueMIN_SELL_VALUE_BPS, applied to protocol-side sells such as Pipe conversions.
StonkPriceGuard.sol:83 - Route floor
- 99% of a same-block quoteROUTE_FLOOR_BPS. The protocol minimum is the larger of this and the oracle band; your own minOut can only raise it.
StonkPriceGuard.sol:84, 314–318; StonkFi.sol:634–635 - Price sources
- Chainlink → cache → probesFeeds are read with round-shape and staleness checks; probe medians must sit within 5% of a cached anchor.
StonkPriceGuard.sol:89, 102–103 - STONKFI reference
- 9 TWAP buckets, quorum 5STONKFI has no feed. Its price comes from 8-minute interval buckets read off the Damper hook's accumulator.
StonkPriceGuard.sol:98–100, 549–556, 570–573; DamperHook.sol:352–363 - Bucket freshness
- 4 hoursPricing STONKFI needs five buckets newer than OBSERVATION_TTL and from the current epoch. Stale buckets are skipped and a short quorum reverts PriceUnavailable, so the price fails closed rather than drifting when keepers stop warming it.
StonkPriceGuard.sol:101, 620–624, 1023–1032 - Tick feed
- Clamped to the launch rangeBefore the hook records a tick, it clamps the observation into the immutable launch position's range and reverts InvalidLaunchPosition if that position is missing or does not match the coin. The one exception is the atomic launch itself, where the position does not exist yet and an armed, coin-matching pending config lets the tick through unclamped.
DamperHook.sol:584–585, 599–621 - Feed freshness
- 25 hoursFEED_HEARTBEAT plus FEED_GRACE. An answer older than that cannot price a trade; between then and ROUTE_ANCHOR_TTL of 7 days it may still anchor a route median.
StonkPriceGuard.sol:102–103, 107, 629–645 - Route depth probe
- 50 USDG, 98–105% round tripROUTE_ENABLE_PROBE_USDG. At feed binding the round trip must return at least 98% and no more than 105%, and the probe rate must sit within 5% of the oracle. The same $50 probe runs when a raise crosses the viability floor, but there only a non-zero round trip is required. Passing says nothing about depth at the size you will actually trade.
StonkPriceGuard.sol:96, 108, 208–216, 278, 714–727; StonkFi.sol:612–613 - USDG peg band
- 0.98 – 1.02A readable but off-peg answer reverts UnsafeUsdgPrice. A stale or unreadable feed instead degrades to a cached answer or a route median, with the peg unchecked.
StonkPriceGuard.sol:109–110, 617, 657–659, 780–783 - STONKFI-quoted raises
- Route floor onlyThere is no fair-value branch for a STONKFI quote — only the same-block route floor and a live USDG peg check apply, and that peg check is skipped entirely if the USDG feed is unreadable.
StonkPriceGuard.sol:307–318, 780–783 - Stock quotes
- Pausable by their issuerThe guard reads paused(), tokenPaused() and oraclePaused() on the stock token and reverts StockPaused. The protocol has no pause of its own; the issuer of a centralised quote asset does.
StonkPriceGuard.sol:810–818 - Tick-read budget
- 8 reads, 40 on retryMAX_PREVIEW_STEPS = 40 is the hard envelope, but ordinary discovery gives each candidate pool only FAST_DISCOVERY_STEPS = 8; the primary template and one designated fallback get the single 40-read retry. A candidate that runs out is skipped, and RouteUnavailable is raised only once every template has failed.
CanonicalV4Routes.sol:168–169, 173, 685–700, 715–732 - Route templates
- Fixed, not governedDeterministic Uniswap v4 pool keys over fixed fee/tick-spacing templates, probed in a fixed order. Nothing is registered or whitelisted.
CanonicalV4Routes.sol:154–158, 715–718, 819–825
> 10 / Damper
Three hours of sell-side friction.
For three hours after a launch, a Uniswap v4 hook takes a surcharge out of sells and burns it. Buys are never surcharged. The ceiling starts at 31% and falls in a straight line to zero, after which the hook stops charging and cannot be re-armed.
Thirty-one percent is a ceiling, not an opening rate. Both of the counters the surcharge is computed from start at zero, so the first sells into a fresh pool are surcharged little or nothing, and the ceiling is only approached under sustained heavy selling early in the window.
The surcharge has two parts, and both scale by the same decay factor. Up to 7% comes from recent sell flow over a rolling 30-minute window, saturating at ten million coins — one percent of supply. Up to 24% comes from price impact, but the impact measured is the cumulative net sell flow since launch against the launch position, not the impact of your own trade in isolation. It contributes nothing below 2% and is maximal at 8%.
None of it is a fee. The hook does not override the pool's fee at all; it settles the surcharge separately, taking it in the coin itself and sending it to 0x…dEaD — no liquidity provider, creator or treasury receives it. The pool's ordinary 1% fee is separate, does not decay, and is not part of the 31%.
The Damper is a price, not a gate. It inspects no addresses, keeps no allowlist and imposes no cooldown; anyone willing to pay the surcharge can sell as much as the pool will fill. It shapes the cost of exiting early. It does not prevent loss.
DamperDamperHook.sol
- Window
- 3 hoursDAMPER_DURATION, measured from the recorded launch timestamp. It cannot be extended, re-armed or disabled.
DamperHook.sol:68, 578–582 - Applies to
- Sells onlyBuys pass through unsurcharged at every point in the window, and reduce both counters.
DamperHook.sol:258–261, 341–343, 526–535 - Ceiling at open
- 31%24% impact plus 7% stress, scaled by the same remaining/duration factor. A ceiling, not a starting rate: both flow counters begin at zero, so early sells are surcharged little or nothing.
DamperHook.sol:62–63, 395–405 - Stress component
- ≤ 7%MAX_STRESS_PIPS = 70,000. Driven by sell flow over a rolling 30-minute window, saturating at 10,000,000 tokens.
DamperHook.sol:62, 69–70 - Impact component
- ≤ 24%MAX_IMPACT_PIPS = 240,000. Zero below 2% projected impact, maximal at 8%.
DamperHook.sol:63, 71–72, 481–486 - Impact is measured on
- Cumulative net sell flowSince launch, against the launch position — not the price impact of your own trade alone.
DamperHook.sol:290–294, 407–420, 475–480 - Surcharge goes to
- 0x…dEaDTaken in the coin and burned. It is not an LP fee, it does not override the pool's fee, and no one receives it.
DamperHook.sol:78, 309–312 - Pool fee
- 1%BASELINE_PIPS, the ordinary static Uniswap fee. It does not decay and is not part of the 31%.
DamperHook.sol:61, 170; lib/LaunchEconomics.sol:11–12 - During the window
- Exact-input, full-fill sellsExact-output and price-limited partial sells revert until the window expires.
DamperHook.sol:269–272, 335–340
> 11 / Trading
One pool, one position, forever.
Each launch creates one canonical pool: the coin against its quote, a static 1% fee, tick spacing 60, Damper hook attached. Its parameters are fixed at creation and nothing can change them afterwards.
Canonical is not exclusive. Once transfers unlock, the coin is an ordinary ERC-20 and nothing in the protocol prevents anyone from opening a second market for it — with no hook, no surcharge and none of the liquidity described below. Everything in this section is a property of the pool the protocol seeded, not of the token.
The launch liquidity is a single position seeded once, and it is permanent in the strong sense: the adapter has no code path that reduces it, and the hook rejects add-liquidity and remove-liquidity from every address except the adapter itself. Nobody can withdraw the protocol's liquidity — and nobody else can provide any, so holders cannot earn a share of the pool's 1% fee.
The position is one-sided.It is seeded with coin only, spanning from the launch tick outward, so there is no liquidity on the far side of the launch price. The quote a seller receives is quote that earlier buyers put in. Price can be walked back toward the launch tick but not through it, and once that range's quote is exhausted, a sell cannot fill against it at all.
Anyone can sell through the adapter, which previews the Damper charge, enforces the fee ceiling you supply, requires a full fill and pays the quote straight to a recipient address you name. During the Damper window sells must be exact-input and must fill completely; after it expires the hook stops constraining swap shape and stops reading your fee ceiling at all — a silent mode change worth handling explicitly if you are integrating.
TradingCanonicalV4Adapter.sol · DamperHook.sol
- Canonical pool
- 1% fee, 60 tick spacingOne protocol-seeded pool per launch, with the Damper hook attached. Its parameters are fixed at creation.
lib/LaunchEconomics.sol:11–14; CanonicalV4Adapter.sol:94–95, 672–681 - Other pools
- Not preventedOnce transfers unlock the coin is an ordinary ERC-20. Anyone can open a second market for it — no hook, no surcharge, no protocol liquidity. Everything else in this section describes the canonical pool only.
StonkCoin.sol:68–72, 149–160 - Launch liquidity
- Written once, permanentThe position is recorded at launch and a second launch on the same pool reverts PoolAlreadyLaunched. Nothing adds to it, withdraws it or moves it afterwards.
CanonicalV4Adapter.sol:277, 295, 361 - Other liquidity providers
- None permittedThe hook rejects liquidity changes from anyone but the launch adapter. Holders cannot LP into the pool, and cannot earn a share of its 1% fee.
DamperHook.sol:200–218, 365–370 - Liquidity shape
- One-sided from the launch tickThe position is seeded with coin only, spanning from the launch tick out to the extreme usable tick. There is no liquidity on the other side of the launch price.
CanonicalV4Adapter.sol:586–600 - What that means for sellers
- The quote is what buyers paid inSelling walks the price back toward the launch tick against quote that earlier buyers put in. It cannot be pushed through that tick, and once the range's quote is exhausted a sell cannot fill.
CanonicalV4Adapter.sol:586–591 - Selling through the adapter
- Open to anyonesell(poolId, coinIn, minQuoteOut, maxFeePips, recipient) routes a sale against the permanent position for any holder.
CanonicalV4Adapter.sol:420–430 - Adapter sells
- All-or-nothingA sale routed through the adapter reverts OpeningSwapShortFill unless the pool fills the entire coinIn and pays at least minQuoteOut. That holds after the Damper window too, when the hook itself no longer constrains swap shape.
CanonicalV4Adapter.sol:557 - Fee ceiling
- maxFeePips, caller-setThe adapter previews the Damper charge first and reverts FeeBoundExceeded before touching your tokens if it exceeds your cap.
CanonicalV4Adapter.sol:429–430, 436; DamperHook.sol:220–227 - During protection
- Exact-input, full fillExact-output and price-limited partial sells revert while the Damper window is open, including zero-amount swaps.
DamperHook.sol:269–272, 335–340 - After expiry
- Ordinary v4 poolThe hook stops surcharging and stops constraining swap shape. Preview still returns the baseline fee rather than zero, so a UI must not read a non-zero preview as an active surcharge.
DamperHook.sol:266–267, 376–378 - Buying
- Never surchargedBuys pass through at the pool fee at any point in the window, and reduce the counters the sell surcharge is computed from.
DamperHook.sol:258–261, 341–343 - Fee ceiling encoding
- Empty or 32 byteshookData must be absent or exactly one abi-encoded uint24 while protection is live; any other length reverts InvalidFeeBoundData. After expiry the hook ignores it, including malformed data.
DamperHook.sol:276–283 - Uniswap protocol fee
- Zero at launch, not afterThe launch asserts the pool's protocol fee is exactly zero. That is a one-time check: Uniswap governance can set one later, and the hook folds it into the total a seller pays.
CanonicalV4Adapter.sol:345–349; DamperHook.sol:567–576
> 12 / Token
Fixed supply, lazy delivery.
Every launch mints its own coin with a fixed supply of 1,000,000,000 at 18 decimals. The number is a compile-time constant and there is no mint function, so supply cannot change under any code path.
Transfers are frozen for everyone but the controller until the launch unlocks them, once, permanently. For the inaugural raise, 910,000,000 tokens go to the launch — seeded as liquidity and bought in the opening swap — and three tranches of 30,000,000 go to founder destinations fixed at deployment: one unlocked, one locked for 730 days, one vesting linearly over 365 days. Founder allocation exists on that raise only; every later raise puts its whole supply into its launch.
Allocation is delivered lazily.After launch the coin contract holds the backers' tokens and hands them over when materialize is called — by anyone, for any account. Until then balanceOf already adds the unclaimed entitlement, so the number reads correctly while the tokens themselves have not moved, and visibleBalanceOf returns the same figure. The keeper pushes allocations in batches, but only up to a bounded number of attempts per launch; past that it is pull-only, and an indexer rebuilding balances from transfer logs alone will show nothing until someone makes the call.
Burns throughout the protocol are transfers to 0x…dEaD rather than supply reductions. Circulating supply falls; the number totalSupply reports never moves.
TokenStonkCoin.sol · FounderLocks.sol
- Supply
- 1,000,000,000A compile-time constant at 18 decimals. There is no mint function anywhere in the token.
StonkCoin.sol:17–18 - Transfers
- Locked until launchOnly the controller can move the coin before unlockForLaunch, which is one-shot and permanent.
StonkCoin.sol:68–72, 151 - Launch allocation (raise 0)
- 910,000,000 (91%)Seeded as liquidity and bought in the opening swap. Later raises put 100% of their own supply into launch.
lib/LaunchEconomics.sol:24–26; StonkFi.sol:805 - Founder tranches (raise 0 only)
- 3 × 30,000,000 (9%)Unlocked at launch; fixed-locked for 730 days; linearly vested over 365 days from launch.
StonkFi.sol:173–176, 820–825 - Founder locks
- No admin, no clawbackBeneficiaries are fixed at deployment. Release is permissionless and always pays the beneficiary.
FounderLocks.sol:8–17, 27–31, 37–50, 68–72 - Backer delivery
- Lazy, but visibleThe coin contract holds the tokens until materialize() moves them. balanceOf already adds the unclaimed entitlement, so it reads the full amount before the transfer happens, and visibleBalanceOf returns the same number.
StonkCoin.sol:51–65, 119–121 - Who may materialize
- Anyone, for any accountmaterialize(account) has no caller check, and any transfer out of an account materializes it first. A stalled keeper cannot keep a backer from their allocation.
StonkCoin.sol:119–121, 149–152 - Automatic distribution
- 32 per batch, 256 attemptsThe crank pushes allocations up to that bound per launch. Beyond it, entitlements are pull-only, and an indexer rebuilding balances from transfer logs may show nothing until someone calls.
StonkCrank.sol:118, 123 - Launch invariant
- Controller ends with zero coinThe launch reverts unless the controller holds no coin afterwards and the coin contract holds exactly the amount owed to backers.
StonkFi.sol:891–892 - Leftover allocation
- BurnedDust left after the last account materializes is swept to 0x…dEaD. Total supply is a constant and never changes.
StonkCoin.sol:182–195
> 13 / Fees
Collected by whoever shows up.
The pool charges a static 1%, and because the protocol's position is the only liquidity in it, all of that fee accrues to the protocol. None of it streams anywhere on its own: it sits uncollected inside the pool manager until a keeper collects it.
When collection runs, the coin side goes to the Stonk Pipe. Every launch coin is burned in full there; when the coin is STONKFIitself the Pipe keeps 20% as the keeper reward reserve and burns the other 80%. The quote side is halved between the raise's fee recipient and the Stonk Pipe, with the odd unit going to the Pipe. Anyone modelling fee revenue as half of one percent of volume is wrong on the coin leg: none of it reaches the fee recipient.
The fee recipient is credited rather than paid. Each collection appends a dated accrual lot, and the recipient claims a window of lots at a time to an address of their choosing. Lots never compact, so a long history of dust collections stays paginated forever — and any lot left unclaimed for 365 days can be swept to the Pipe by any passing address, with no notice and nothing in it for the caller.
Accruals do not follow the office. When creator rights or the fee seat change hands, outstanding fees settle to the outgoing address first and stay claimable by it. A successor — including a community that has just completed a takeover — inherits the future, not the balance.
FeesStonkFi.sol · LaunchEconomics.sol
- Pool fee
- 1% (100 bps)LP_FEE_BPS, static for the life of the pool. It is an ordinary Uniswap fee and is unrelated to the Damper surcharge.
lib/LaunchEconomics.sol:11 - Collection
- Keeper-triggeredcrankCollect is callable only by the crank. Fees also settle incidentally when the fee seat is transferred or a memento takeover completes — a rights-only transfer collects nothing.
StonkFi.sol:1005–1015, 973, 1000 - Coin side of fees
- Burned via the PipeThe controller sends the coin side to the Stonk Pipe and calls recordCoinFees. Every launch coin is burned to 0x…dEaD in full; when the coin is STONKFI itself, 20% is held back as the keeper reward reserve and the other 80% burns.
StonkFi.sol:1029–1031; StonkPipe.sol:48, 594–620 - Quote side of fees
- Split 50 / 50creatorShare = quoteFees / 2 and the Pipe takes the remainder, so an odd unit rounds to the Pipe.
StonkFi.sol:1033–1034 - Creator's share
- Credited, not paidEach collection appends a dated accrual lot. The fee recipient must call to receive it; nothing is pushed.
StonkFi.sol:1035–1037, 1168–1177 - Claiming accruals
- PaginatedclaimCreatorAccrual(raiseId, asset, from, maxLots, to) sweeps a window of lots. A window with nothing in it reverts NoAccrual.
StonkFi.sol:1057–1072 - Escheat
- 365 daysESCHEAT_DELAY. After it, any address may sweep those lots to the Stonk Pipe — the caller gains nothing, and the creator loses the balance.
StonkFi.sol:165, 1074–1091 - Lots never compact
- Storage only growsClaiming and escheat zero a lot's amount but never remove it, so a history of dust collections stays paginated forever.
StonkFi.sol:1065–1068, 1081–1085 - Fee recipient vs. rights
- SeparableThey move together until a memento takeover splits them, after which each transfers on its own. Outstanding fees settle to the old recipient first.
StonkFi.sol:966–982, 992–1003
> 14 / Stonk Pipe
Fees in, STONKFI out.
The Pipe is where the protocol's share of value goes. It takes one 6.67% lane from every launch, half of every quote-side pool fee collected, the whole coin side of those fees, escheated accruals and marketplace royalties. It converts what it receives into STONKFI and burns it.
Apart from the coin side of pool fees, which is burned on arrival, nothing is spent when it lands. Every other balance decays out of a locked bucket on a one-day half-life — continuous exponential decay, not a delay and not a release schedule — and only the matured part can be processed, at most 100 USDG of swap budget per block across all assets.
All of the USDG realised buys STONKFI through the same guarded routes as everything else. Purchased STONKFI then matures on the same half-life and is burned in full at settlement, as is STONKFI that reached the Pipe without being purchased. Keeper rewards are funded separately, from a 20% share of the coin-side pool fees that arrive denominated in STONKFI— the only value that leaves the burn path.
The Pipe has no owner. Nobody can redirect it, pause it or withdraw from it; the burn address is a constant, and the crank is the only caller that can move value through it — the one exception being a keeper withdrawing STONKFI already credited to it.
Stonk PipeStonkPipe.sol
- Inflows
- Launch lane · pool fees · WETHA 6.67% lane of each launch's quote, half of every quote-side pool fee and the whole coin side of it, escheated accruals, and marketplace royalties paid in WETH.
StonkFi.sol:838, 912, 1029–1031, 1038–1040, 1088–1089; StonkPipe.sol:221–232 - Maturation
- 1-day half-lifeContinuous exponential decay out of a locked bucket — not a 24-hour delay and not a release schedule.
StonkPipe.sol:45 - Swap budget
- 100 USDG per blockMAX_USDG_PER_SWAP, keyed on block number and shared across every asset in the Pipe.
StonkPipe.sol:46 - Coin side of pool fees
- Burned on arrivalThe controller hands the whole coin side of each collection to the Pipe, which burns it immediately rather than maturing it. Launch coins burn in full; a STONKFI-denominated fee reserves 20% for keeper rewards first.
StonkFi.sol:1029–1031; StonkPipe.sol:594–631 - Keeper funding
- 20% of STONKFI coin feesKEEPER_REWARD_SHARE_BPS. That share of the STONKFI-denominated coin fees is the only thing that funds crank rewards. Nothing is skimmed from processed USDG or from matured STONKFI.
StonkPipe.sol:48, 594–620 - Buyback
- All realised USDGEvery USDG the Pipe processes is swapped for STONKFI through the guarded route, tagged with its USDG cost basis. No share is held back.
StonkPipe.sol:501, 505–515 - Burn
- 100% of a matured batchMatured STONKFI is burned in full, whether the Pipe purchased it or it arrived as an inflow. Nothing is deducted at settlement.
StonkPipe.sol:570–571, 580–588 - Burn destination
- 0x…dEaDA transfer, not a supply reduction: circulating supply falls, reported total supply does not.
StonkPipe.sol:32 - Drip registration floor
- 2 USDG of valueMIN_DRIP_REGISTRATION_USDG. A non-USDG asset only joins the crank's scan once its obligation is worth that much at a 90% haircut on the oracle rate, so smaller balances sit in the Pipe untouched.
StonkPipe.sol:55, 285–309 - Control
- OwnerlessNo admin can redirect, pause or withdraw the Pipe, and the crank can be bound only once. Only the crank may move value through it; a keeper whose reward was already credited can withdraw that STONKFI itself.
StonkPipe.sol:174–180, 462, 547, 653, 666–689
> 15 / Mementos
A receipt, and a lever.
Every launch mints an ERC-1155 collection with one token id for that launch. A wallet earns one unit for every whole 5 USDG of its total backing, floor rounded, claimable only once the raise has launched.
A memento is a record of having backed a launch. It is not a fee share, an ownership interest, a redemption right or a promise of value — the token's own onchain description says so. Units are ordinary transferable ERC-1155 balances delivered lazily, and unlike the coin an unmaterialized entitlement shows as a zero balanceOf — only visibleBalanceOf adds it — and produces no transfer log.
Each launch also mints one permanent anchor unit that can never be transferred or burned, plus up to two bonus units for the addresses that spent the most gas building the artwork. Marketplace royalties are set at 5% and always name the Stonk Pipe, but ERC-2981 is a signal, not an enforcement: an ordinary transfer can omit it entirely.
The takeover is narrower than it sounds. At least 14 days after a launch, a single address holding a ceiling-75% supermajority of the community supply can burn it in one call and take over — the buy-side quote-fee recipient, and nothing else. Creator control stays with the rights holder. NFT royalties stay with the Pipe. Outstanding accruals stay with the outgoing recipient. It can happen once per launch and cannot be undone.
MementosStonkMemento.sol
- Standard
- ERC-1155One token id per launch. Units are transferable and are not fee shares, ownership or redemption rights.
StonkMemento.sol - Earned at
- 1 unit per 5 USDGFloor-rounded on a wallet's total backing in the raise, and only claimable after that raise launches.
StonkFi.sol:163–164, 1112–1119 - Delivery
- Zero until materializedUnlike the coin, an unmaterialized memento entitlement reads as a zero balanceOf and produces no transfer log; only visibleBalanceOf adds it. Anyone may materialize for another wallet, and the units land with that wallet.
StonkMemento.sol:263–275, 277–289 - Metadata
- Fully onchainJSON with an embedded base64 SVG. Until a launch's own artwork finishes rendering, the token shows a deterministic placeholder or a remix of earlier art.
art/LaminarMementoRenderer.sol - Anchor unit
- 1 per launch, permanentNon-transferable and non-burnable, held by a custodian, and excluded from the takeover quorum.
StonkMemento.sol:118, 251, 360, 488 - Artwork rewards
- Up to 2 unitsPaid to the addresses that burned the most gas rendering the launch's artwork. They do count toward quorum.
StonkMemento.sol:70, 360, 456–462 - Royalty
- 5% to the Stonk PipeERC-2981 always names the Pipe. Plain transfers can omit it — this is signalling, not enforced revenue.
StonkMemento.sol:68, 380–390; StonkFi.sol:1133–1136 - Takeover delay
- 14 daysCTO_DELAY, measured from the launch timestamp.
StonkMemento.sol:69, 366 - Takeover threshold
- ceil 75% of community supplyOne address must hold and burn that many units in a single call. Community supply excludes the anchor unit.
StonkMemento.sol:360–368 - Not always possible
- Needs more than the anchorA launch where no wallet earned a memento unit mints only the anchor, and a takeover of it reverts permanently.
StonkMemento.sol:248, 354 - Takeover transfers
- The buy-side fee recipientThat field and nothing else. Creator control stays with the rights holder and royalties stay with the Pipe. Once per launch, permanently.
StonkFi.sol:992–1003, 1128–1136; StonkMemento.sol:346, 369 - Takeover closes artwork pay
- If it lands firstA completed takeover closes the artwork reward for good when the recipients have not been reserved yet. Finishing the artwork afterwards pays nothing.
StonkMemento.sol:372–375
> 16 / Artwork
Drawn by contracts, paid for in gas.
A memento's image has no server, no IPFS and no URL behind it. The token returns a data URI whose JSON and 1000 × 1000 SVG are assembled by contracts at read time, from path data held in storage contracts and a palette recomputed from the launch id.
The picture is not drawn in one transaction. It is built in batches of ten paths — six for the Perfect Vortex archetype — by anyone willing to send them, and only for the launch that has not happened yet — seven to forty-five calls, depending on how dense the composition turns out. The keeper will take a turn at it, but the artwork job is best-effort and is preempted by the launch job whenever a launch is due.
The launch is the deadline.Once a launch succeeds, its artwork can never be finished, and that token permanently shows a substitute: either a deterministic geometric placeholder derived from the launch id, or an earlier launch's finished artwork rotated by a multiple of 90 degrees and hue-shifted. Both substitutes label themselves in the traits, so a holder can always tell which of the three they are looking at.
The two addresses that burned the most gas building a launch's artwork are recorded when it completes and later receive two memento units between them. The metric is gas spent rather than work completed, the leaderboard holds exactly two places, and nothing is paid at all if the artwork never finishes, if the launch was too small, or if a community takeover closed the reward before it was reserved.
Artworkart/LaminarMementoRenderer.sol
- Where it lives
- Entirely onchainNo server, no IPFS, no URL. The token returns a data: URI whose image is a base64 SVG assembled by contracts at read time.
art/laminar/StonkMementoMetadata.sol:95–121 - Canvas
- 1000 × 1000 SVGA flow-field composition with a text plate carrying the ticker, name, quote, edition and launch time, and an embedded font so it renders the same everywhere.
art/laminar/LaminarRenderer.sol:593–595; art/laminar/StonkTextRenderer.sol:79–91 - What is stored
- Paths, fates, traitsRaw SVG path strings in code-only storage contracts plus a few counters. The palette, background, border, grain, font and JSON wrapper are recomputed from the launch id on every read.
art/LaminarMementoRenderer.sol:51–65; art/laminar/LaminarCodeStore.sol:16–35 - Built by
- Whoever pays the gasAnyone may materialize batches of 10 paths — 6 for the Perfect Vortex archetype — but only for the launch that has not happened yet. Seven to forty-five calls finish one artwork.
art/LaminarMementoRenderer.sol:231–237, 292–315; art/laminar/LaminarPathRenderer.sol:9–10, 20 - Deadline
- The launch itselfMaterialization is only possible while the id equals the next launch. The moment that launch succeeds, unfinished artwork can never be completed.
art/LaminarMementoRenderer.sol:231–237; StonkFi.sol:914 - If it is not ready
- Placeholder or remixThe token shows a deterministic geometric placeholder, or a previous launch's finished artwork rotated by a multiple of 90° and hue-shifted. The remix branch needs a fallback source pinned before that launch; an id that was never pinned keeps the placeholder forever.
art/LaminarMementoRenderer.sol:257–281, 519–559, 571–581 - Fallbacks are labelled
- In the traitsFinished artwork carries no Artwork trait. A placeholder reads Artwork: Fallback, Fallback Source: Genesis; a remix names the launch it borrowed from.
art/LaminarMementoRenderer.sol:560–568, 584–592 - Traits
- 10 dimensionsArchetype, Palette, Density, Launch, Ghost, Ink, Accent, Wind, Singularities and Streamlines, all derived from the launch id.
art/laminar/LaminarTraits.sol:22–40 - Artwork reward
- 2 memento unitsOne unit each to the top two gas contributors, frozen when the artwork completes; a single contributor takes both. Not paid if it never completes, if the launch earned fewer than six backer units, or if a takeover closed the reward first.
art/LaminarMementoRenderer.sol:352–362; StonkMemento.sol:70–71, 257–260, 372–375, 456–462 - Size ceiling
- 640,000 bytesMAX_BASE_SVG_BYTES. A composition that would exceed it cannot be completed by anyone, and that launch falls back permanently.
art/LaminarMementoRenderer.sol:78–79, 500–506
> 17 / Architecture
Deployed once, then fixed.
The protocol is a controller plus a set of components — launch adapter, canonical routes, price guard, Damper hook, Stonk Pipe, crank, memento collection and the onchain artwork stack — most of them created by their own factory during construction and bound to the controller as immutable addresses. The artwork renderer is the exception: it is deployed beforehand and passed in, bound once at construction, and thereafter read by the memento collection for metadata and driven directly by the crank.
Nothing is upgradeable. There is no proxy in front of the controller, no admin able to swap a component, and no migration path. The correctness of every component is fixed at deployment; the controller validates their results and reverts, but cannot replace them.
The release itself is a deterministic seventeen-transaction stream from one address: six Laminar libraries, the renderer, seven factories, two preparation calls and then the controller. That ordering is described by a comment on the controller's constructor rather than enforced onchain. What the constructor does enforce is narrower than it sounds: the Damper, adapter, routes and price guard must each report the expected pool manager, controller and token bindings or construction reverts, while the Pipe, crank and renderer are checked only for their controller binding and the inaugural coin, lock and vesting are trusted from the asset factory. The fork rehearsal, the recorded runtime hashes and the broadcast checksum are release-driver output recorded alongside the release; nothing on this page recomputes them.
DeploymentStonkFi.sol
- Deployment shape
- 17 transactions, one EOASix Laminar libraries, the renderer, seven factories, two preparation calls, then the controller at N+16. The ordering is described by a comment on the constructor; nothing onchain enforces the sequence itself.
StonkFi.sol:269 - Upgradeability
- NoneNo proxy, no admin, no migration path. Component addresses are immutable on the controller from construction.
StonkFi.sol:179–193 - Components
- Created by factories, bound onceThe controller creates the hook, adapter, routes, assets, Pipe, crank and guard through their factories during construction. The artwork renderer is the exception: it is deployed beforehand and passed in as config. The controller binds it once; after that the memento reads it for metadata and the crank drives materialization against it directly.
StonkFi.sol:77–94, 291–294, 305, 311–317, 361; StonkCrank.sol:235 - Release inputs
- Four operator addressesAn inaugural creator and three distinct founder destinations; a zero or duplicated founder address reverts. Every other config field is an infrastructure or factory address the deployment itself produces, and no signer material is a constructor input.
StonkFi.sol:77–94, 271–283 - Stop conditions
- Construction reverts, selectivelyThe Damper, adapter, routes and price guard must each report the expected pool manager, controller and token bindings or construction reverts. The Pipe, crank and renderer are checked only for their controller binding, and the inaugural coin, lock and vesting are trusted from the asset factory without a read-back.
StonkFi.sol:271–283, 291–294, 298–301, 308–309, 311–317, 323–328, 330–337, 359–361 - Pre-broadcast evidence
- Release-driver outputThe fork rehearsal, the recorded runtime hashes and the broadcast checksum are produced by the release driver and written to its deployment record. No contract enforces them and nothing on this page recomputes them — check them against the record and the chain, not against this row.
StonkFi.sol:269
> 18 / Reading state
What the chain will and will not tell you.
Every raise emits a small, stable set of events — creation, each deposit and the quote purchase it triggered, withdrawal, cancellation, refund, launch, launch failure, referral claim, fee collection and the two handover events — with raise id, coin, backer, referrer and asset as indexed topics.
Positions and entitlements are read through struct-returning views, but two of the ones users care about most return nothing meaningful until the raise has launched. Any pre-launch “you will receive N” figure is an off-chain estimate that depends on the final totals and the rate resolved at launch — not a quote from the chain.
The subtlety that catches integrators is lazy delivery. Coins and mementos sit with the token contract or a custodian until someone materializes them, so an indexer that reconstructs balances from transfer logs will honestly report zero for a backer who is genuinely owed tokens. Read balanceOfor the entitlement views rather than replaying logs — the coin's balanceOf already adds the unclaimed allocation, and visibleBalanceOf returns the same number. The memento is the one that still reads zero until it is materialized.
Some things simply are not readable. Queue position is private with no getter, so any displayed position is a reconstruction. Launch failure reasons are hashes, not messages. And several views revert rather than returning a default, so read them defensively.
Integrator referenceStonkFi.sol · StonkCoin.sol · StonkMemento.sol
- Raise state
- getRaise(raiseId)Returns the whole Raise struct: status, quote kind and token, timestamps, totals, lane size, pool id, rights holder and fee recipient.
StonkFi.sol:525–527, 96–123 - A wallet's position
- backingOf(raiseId, account)Returns the unreferred and referred amounts, the quote acquired for each, and whether the referral has been claimed.
StonkFi.sol:529–531, 125–131 - What a backer will receive
- coinAllocation(raiseId, account)Returns the coin amount and an eligibility flag. Zero and false until the raise has launched.
StonkFi.sol:1093–1110 - Memento entitlement
- mementoEntitlement(launchId, account)Units earned, floor-rounded on total backing. Also zero until the raise launches.
StonkFi.sol:1112–1121 - Balance, honestly
- balanceOf already includes itThe coin's balanceOf returns the raw balance plus the still-unmaterialized allocation, and visibleBalanceOf is now the identical expression. Because the coin contract also still holds those tokens, summing balanceOf across every address exceeds totalSupply until everyone has materialized.
StonkCoin.sol:51–66, 149–160 - Queue position
- Not readable onchainThe priority heap and the quarantine sentinel are private with no getter. Any displayed queue position is reconstructed off-chain and can disagree with the contract.
StonkFi.sol:212–213, 784, 1327 - Viability timestamp
- viableAt(raiseId)The timestamp a raise became viable, used to break ties in the launch queue. Deleted whenever it drops below the floor.
StonkFi.sol:215, 1309–1324, 1436–1438 - Accruals
- accrualLotCount / accrualLotFee lots are read by index, with the amount and the timestamp that starts the 365-day escheat clock. AccrualCreated emits the index of each new lot, so an integrator does not have to scan for it.
StonkFi.sol:146–149, 165, 1045–1055, 1168–1176 - Lifecycle events
- RaiseCreated · Backed · LaunchedPlus QuoteAcquired, BackingWithdrawn, RaiseCancelled, RefundClaimed and LaunchFailed. Raise id, coin, creator, backer and referrer are indexed.
StonkFi.sol:218–247 - Settlement events
- FeesCollected · AccrualCreatedWith AccrualClaimed, AccrualEscheated, ReferralClaimed, RightsTransferred and FeeRecipientTransferred — the last carrying a flag for takeover-driven changes.
StonkFi.sol:248–267 - FeesCollected's coin field
- Routed, not burned hereThe second field is coinFees, renamed from coinBurned. The controller hands those tokens to the Stonk Pipe; whether they burn, and how much, is decided there. Reading the number as a burn amount over-reports burns.
StonkFi.sol:267, 1029–1032, 1042 - Failure detail
- Selector, never argumentsLaunchFailed carries only a hash of the truncated revert data. The four-byte error selector is emitted separately by the crank, as an indexed topic on LaunchFailureObserved, so an integrator holding the error ABI can name the failure — but the revert arguments are unrecoverable.
StonkFi.sol:237, 776–778, 1275–1296; StonkCrank.sol:271–278, 491, 516 - Views that revert
- Rather than return zeroIndex getters panic out of range, and the memento's uri and royaltyInfo revert NotRegistered for a launch id that does not exist yet. Read them defensively.
StonkFi.sol:1049–1055; StonkMemento.sol:144–147, 380–390 - ControlProved
- An assertion, not a proofThe event carries an arbitrary bytes32 supplied by whoever holds the rights-holder key. Nothing onchain verifies it.
StonkFi.sol:259, 984–987
> 19 / Status
What is and is not settled.
The contracts described here are deployed on Robinhood Chain, chain 4663. The controller is 0x5DB57a2e6DAD60E9964531bC7244Ff9E712c6999, and the code at that address — not this page — is the protocol.
Everything above is still a reading of source code, not of a chain. A deployed contract is only the code that was actually broadcast, so treat this page as a claim about that deployment to be checked, not as evidence of it. This docs page does not sign. The raise, creation and claims interfaces can build transactions, and each signing surface states what it will ask the connected wallet to do.
The address graph
Every address below was read back off chain 4663 rather than copied from a deployment log: the controller's own views name its components, and the three it does not expose were confirmed to carry runtime code. The controller was created in block 28,629,638.
One package, both pages
The raise page and this one are read from the same contract package, so their numbers agree. If they ever diverge again — a new revision landing on one page before the other — the disagreement belongs on this page, named, rather than quietly reconciled.
Before anything is signed
Verify the chain and chain id, the controller and USDG addresses against the official announcement, then the deployment timestamp, contract-read backing, and the amount, deadline, slippage and referrer on the transaction itself — before signing. An address that is not published here and by @stonkdotfi is not this protocol, whatever it says it is.
Backing is speculative and may result in total loss. STONKFI is not equity, debt, a deposit account or a promise of profit. Contract-derived target valuations are launch inputs, not predicted prices or returns. This page is informational, not financial advice.