πBonding Curve
Since v2.4.0, Flap supports multiple bonding curves, but only one is active.
What is a Bonding Curve
Before listing on DEX, each token launched on flap is bonded to a bonding curve. When you buy tokens from the bonding curve, you send your ETH (or other quote token, usually the native token of that chain) to the bonding curve as a reserve, and the bonding curve mints tokens to your address. Or if you sell your tokens to the bonding curve, the bonding curve would burn your selling tokens and send the ETH back to you.

A bonding curve defines the relationship between the trading token's supply and the reserve (i.e. Quote tokens like ETH or BNB). The change of the reserve respect to the supply is the price. Our bonding curve is based on a constant product equation. You may have heard about this equation, which Uniswap popularized.
You may even wonder what is the difference between a bonding curve token launching platform like flap and Unsiwap? The answer is the liquidity. The liquidity does not change on the bonding curve. However, anyone can add liquidity to the Uniswap pools.
Flap's Bonding Curve V2
The token created on our platform has the same max supply of 109 , with 18 decimals. For each token, the amount of token and the ETH (the native token of the target chain) follow the following constant product equation:
r ,h and K are constant parameters dependent on the target chain ( check Bonding Curves On Different Chains for more details).
x is the amount of token in the bonding curve, initially, it is 109, which means all the tokens are still in the bonding curve.
y is the amount of ETH , it is 0 in the beginning.
Our curve have 3 constant parameters:
r can be interpreted as the virtual reserve of ETH in the bonding curve
h can be interpreted as the virtual reserve of token in the bonding curve
K is the square of the virtual liquidity
To better understand the bonding curve, we use s to denote the token's current (circulating) supply. And the relationship between s and x is straightforward:
We can get the following relationship between s and y :
Based on the above equation, we can get the relationship betweenthe circulating supplyand ETH in the bonding curve.
Bonding Curves On Different Chains
We don't recommend that you hardcode the bonding curve parameters in your application. Instead, you should use getTokenV5 method from the Portal contract to get the parameters for each token. The parameters are immutable for each token, so you only need to fetch them once and cache them in your application.
For different and different payment , the constants are different:
BSC (Legacy before block #42042177 )
15
0
15β 109
BSC (Legacy since block 42042177 and before 47855189 )
4
0
4β 109
BSC(before 61837444, BNB as payment Token)
4
0
4β 109
BSC(before 61837444, USD1/lisUSD as payment token)
2500
0
2500β 109
BSC(lastest, BNB as payment Token)
6.14
107036752
6797205657.28
BSC(latest, USD1/lisUSD as payment token)
3837
107036752
4247700017424
ToshiMart
0.5
0
0.5β 109
XLayer (Before block 31564005)
28
0
28β 109
XLayer (Before block 32470187)
21.25
0
21.25β 109
XLayer(Since block 32470187)
28.25
108002126
31301060059
Monad (mainnet)
50000
107036752
55351837600000
Last updated