Fair Launch
Introduction
The Fair Launch hook allows tokens that have just been flaunched to be purchased at a consisten token price before it is affected by liquidity supply.
This creates a time window right after the token is launched that keeps the token at the same price in a single tick position. Fees earned from this are kept within the position and cannot be sold into until the fair launch window has finished.
Once the FairLaunch period has ended, the ETH raised and the remaining tokens areboth deployed into a Uniswap position to facilitate ongoing transactions and create a price discovery.
The Fair Launch period runs for 30 minutes.
When we are filling from our Fair Launch position, we will always be buying tokens with ETH. The amount specified that is passed in, however, could be positive or negative.
The positive / negative flag will require us to calculate the amount the user will get in a different way. Positive: How much ETH it costs to get amount. Negative: How many tokens I can get for amount.
The amount requested can exceed the Fair Launch position, but we will additionally have to call _closeFairLaunchPosition
to facilitate it during this call. This will provide additional liquidity before the swap actually takes place.
If the user has requested more tokens than are available in the fair launch, then we need to strip back the amount that we can fulfill.
The Fair Launch window can end in one of two ways:
The Fair Launch runs out of time, without tokens selling out during the 30 minutes allocation
The Fair Supply token supply has been purchased to point of exhaustion
When the FairLaunch position ends, it creates two Uniswap V4 positions:
A wide range memecoin position from just above current tick to the max value
A single tick ETH position just below the current tick
Public Calls
inFairLaunchWindow
Checks if the PoolKey is within the fair launch window.
fairLaunchInfo
Call the FairLaunchInfo
struct for a pool, which provides information about the Fair Launch activity of a pool. After the Fair Launch has finished, the struct data will still be present for historical purposes, but the closed
boolean will be marked true
and if the period ended early, then the endsAt
will have also been updated to reflect the actual time that the period closed.
The FairLaunchInfo
struct is:
Last updated