SAIL Bonding Curve
A bonding curve is a pricing mechanism that determines the price of a token based on its supply. As more tokens are bought, the price per token generally increases according to a pre-defined mathematical function (e.g., linear or exponential). This approach creates a dynamic, automated pricing system that reflects demand.
In the SAIL Bonding Curve, buyers deposit an asset (such as USDC) to purchase tokens (such as SAIL). The bonding curve contract mints new tokens based on the current price along the curve and builds token liquidity with the deposited balance. Conversely, tokens can be sold back, with the contract returning the corresponding amount of the underlying asset. The ERC20BondingCurve (SAILBondingCurve) contract serves as the token mechanism for SAIL, with an integrated bonding curve that distinguishes it from standard ERC20 tokens. This bonding curve operates as a constant function market maker utilizing two token reserves. These reserves consist of a base token (e.g., USDC) and SAIL. The bonding curve follows the equation:
K = rUSDC * rSAIL
Here, K is a constant, rUSDC represents USDC in the reserve, and rSAIL represents SAIL in the reserve.
The reserve SAIL (rSAIL) always mirrors the actual SAIL supply (aSAIL) within the bonding curve. The USDC reserve (rUSDC) is divided into three distinct components: virtual USDC (vUSDC), borrowed USDC (bUSDC), and actual USDC (aUSDC). The protocol employs vUSDC and bUSDC as placeholders in the reserve.
vUSDC sets the initial USDC reserve value but doesn't exist as actual liquidity. This mechanism concentrates the available liquidity, establishing a price floor and enhancing the protocol's capital efficiency.
bUSDC ensures the reserve's integrity by accounting for USDC borrowed from the bonding curve.
aUSDC and aSAIL represent liquid USDC and SAIL in the reserves, respectively.
This division allows the bonding curve's constant K to be redefined as:
K = (vUSDC + bUSDC + aUSDC) * (aSAIL)
Initial State
The initial state of the bonding curve depends on vUSDC and the total SAIL supply (tsSAIL). For example, if vUSDC and tsSAIL are both set to 100, the reserves would be:
K = 100 rUSDC * 100 rSAIL K = (100 vUSDC + 0 bUSDC + 0 aUSDC) * (100 aSAIL) Initial SAIL price:100 vUSDC / 100 aSAIL = 1 USDC/SAIL
At this point, there is no liquid USDC in the reserves, but this isn’t problematic because no SAIL has entered circulation. Actual USDC liquidity is added when SAIL is purchased from the bonding curve. For instance, after a purchase of 1 SAIL, the reserves adjust as follows:
K = (100 vUSDC + 0 bUSDC + 1.01 aUSDC) * (99 aSAIL)
SAIL Price = (100 vUSDC + 1.01 aUSDC) / 99 aSAIL ≈ 1.02 USDC/SAIL
Once there is SAIL in circulation, any sold back into the bonding curve will access the actual USDC liquidity. The final SAIL token sold would be exchanged at the established floor price, ensuring SAIL's price cannot fall below this value, and liquidity remains available for sellers.
Swap Mechanism
Each SAIL purchase from the bonding curve increases its price. This reduces the reserve SAIL (rSAIL) while increasing the reserve USDC (rUSDC).
For purchases, the USDC input (inUSDC) from the buyer determines the amount of SAIL tokens received (outSAIL) using the formula:
outSAIL = (aSAIL * inUSDC) / (vUSDC + bUSDC + aUSDC + inUSDC)
When SAIL is sold back, the reverse occurs: the reserve USDC decreases, while reserve SAIL increases. The USDC output (outUSDC) for the seller is calculated as:
outUSDC = ((vUSDC + bUSDC + aUSDC) * inSAIL) / (aSAIL + inSAIL)
Swap Fees
A 2.5% fee is applied to every transaction on the bonding curve. This fee is deducted from the input token and held in the treasury, outside of the bonding curve reserves. These accumulated fees are periodically distributed to designated addresses or contracts when triggered by specific functions. As swaps/redemptions occur. A harvest function can be called by anyone at any time to transfer the tokens in the treasury to their appropriate addresses.
The Fee Treasury Split is;
80% to SAIL lenders (2% total)
20% to Blacksail Treasury (0.5% total)
Please note in the following examples that the swap fee amount is simplified to 1% for better readability.
Buy scenario example:
Current Supply of SAIL: There are 50 SAIL tokens currently in the bonding curve backed by 100 USDC.
User Purchase Attempt: A user decides to buy SAIL with 50.5 USDC.
Swap Fee: The system takes a 0.5 USDC fee for the protocol. Leaving 50 USDC for actual token purchasing.
The majority of the fee (80%) is paid to SAIL lenders while they are using their SAIL as collateral for USDC.
The minority of the fee (20%) is allotted to the Blacksail protocol to support protocol operations.
Token Issuance: Based on the bonding curve formula, the user receives 10 SAIL tokens for their 50.5 USDC (assuming the price formula calculated this amount).
This process achieves a few things:
Dynamic Pricing: Each purchase or sale adjusts the price on the curve, reflecting the token's increasing demand or supply.
SAIL Lending Rewards: The majority of the swap fee is used to pay SAIL lenders while they are using their SAIL as collateral for USDC.
Treasury Funding: A small portion directed to the treasury, helping sustain the protocol's operation.
User Benefits: The user receives SAIL tokens, potentially at a lower cost compared to a traditional exchange if they act early when the token supply is low, rewarding early adopters of the protocol and encouraging long-term adoption.
Sell scenario example:
The user sells 10.1 SAIL to the bonding curve and receives 33.33 USDC (calculated using the price formula). Before the transaction, the reserves were 200 rUSDC and 50 rSAIL.
After the sale:
The rUSDC reserve decreases to 166.67 USDC as 33.33 USDC is sent to the seller.
The rSAIL reserve increases to 60 SAIL, reflecting the 10 SAIL sold by the user.
The system takes a 0.1 SAIL fee for the protocol.
The majority of the fee (80%) is paid to SAIL lenders while they are using their SAIL as collateral for USDC.
The minority of the fee (20%) is allotted to the Blacksail protocol to support protocol operations.
This process achieves several outcomes:
Dynamic Pricing: Selling SAIL increases the token reserve within the bonding curve while reducing the USDC reserve. This adjustment lowers the SAIL price, creating opportunities for new buyers and maintaining a dynamic balance between supply and demand.
SAIL Lending Rewards: The majority of the swap fee is used to pay SAIL lenders while they are using their SAIL as collateral for USDC.
Treasury Funding: A small portion directed to the treasury, helping sustain the protocol's operation
User Benefits: The user exits their SAIL position with predictable liquidity provided by the bonding curve. The transparent pricing mechanism ensures fairness and mitigates reliance on volatile external markets.
Last updated