BootstrapNFT Contract Introduction
Background Introduction
BootstrapNFT is an NFT liquidity auction platform that provides healthy and stable price discovery for NFT assets by creating a liquidity market for NFT projects and conducting “Dutch auctions” (auction prices will be decreasing from high to low).
Any issuer that owns an NFT can build a vault and mint an alternative ERC20 token (vToken). After the NFT is fragmented, issuers can create their own liquidity bootstrap pools and set custom liquidity pool weights, either linear or exponential curves, thus regulating the value of the token and preventing spikes in the price of new NFTs due to early speculation and hype.
The BootstrapNFT project attempts to solve the mess of opaque pricing and bot rush in the NFT market by giving people enough opportunities to participate in transactions at a fair price.
Advantages of BootstrapNFT
High liquidity
Fragmentation allows more people to trade NFT at lower prices, thus increasing the liquidity of NFT. Also, users do not need to match a single buyer and seller as per traditional NFT trading. Smart order routing means that users can trade for vToken at a lower slippage price and redeem NFT at any time, thus increasing the liquidity of NFT.
High Fairness
The continuous downward pressure on prices discourages users/bots from pre-emptive trading and bulk buying, giving people enough opportunities to participate in transactions at fair prices, which naturally leads to fair and equitable distribution.
Stable price discovery
Optimized for small orders, a giant whale of a large number of purchases does not sway prices. A liquid start-up pool can accommodate large purchases and fall back before other potential buyers can join. Minimizes price volatility, resulting in a healthy and stable price discovery process.
Basic introduction to contracts
BootstraNFT implements the fragmentation and auction process through contracts. The contract is currently deployed for testing on Mumbai. The related code github address is as follows.
https://github.com/bootstrapnft/bootstrapnft-contracts
The BootstrapNFT contract framework is shown in the following diagram.
The NFT manager can retrieve the VaultFactory to create a corresponding Vault for the NFT asset. the Vault is a erc20 token, which is very convenient for fragmentation and trading.
The NFT manager creates a SmartPool transaction pool for the Vault and other Tokens via BAction, which allows users to exchange the Vault with other Tokens. BootstrapNFT auctions, in essence, also follow the AMM model. But at the same time, auctions add the x*y=k constant product to two or more token pools, and assign each token corresponding weights to accommodate tokens of different valuations.
Model
Fragmentation Model
The Mint/Redeem/Swap mathematical models in NFT fragmentation, under models that do not include a fee, all use a 1:1 ratio, i.e.
The actual fragmentation model will become when the handling fee is included in the model:
Model for auction
Spot price
Calculate the spot price, without the inclusion of transaction fees, the calculation model is as follows.
In Eq.
- Bi is the balance of token i, the token sold by the trader
- Bo is the balance of token o, tokens purchased by the trader
- Wi is the weight of token i
- Wo is the weight of token o
When we consider the processing fee and use Ai(1-swapFee)instead of Ai, this time the formula deforms to
Swap
which is the model for calculating the number of swaps in the pool, using the following formula.
In Eq.
- Ao are tokens received by the trader
- Ai are the tokens paid by traders
When we consider the fees and use Ai(1-swapFee)instead of Ai, this time the formula deforms to
Multi-asset collateralization and withdrawal
Anyone can obtain credentials for the pool by depositing a proportional amount of each token contained in the pool into the pool, assuming that the user deposits token k. The number of tokens to be invested is calculated as follows,
In Eq,
- Dk is the number of tokens k that the trader needs to deposit
- Psupply is the number of credentials of the pool which are already provided
- Pissued is the number of pool credentials required by the user
- Bk is the balance of token k in the pool
Conversely, when a user wants to redeem their credentials for a share of each base coin in the pool, the formula is as follows,
In Eq,
- Ak is the number of token k acquired by the trader
- Psupply is the number of provided vouchers of the pool
- Predeemed is the number of redeemed vouchers in the pool
- Bk is the balance of token k in the pool
Single Asset Pledge and Withdrawal
Single Asset Pledge
The transaction pair also offers to deposit a single token to obtain the corresponding pool credentials, if we put in the token a, the pool credentials obtained are calculated as follows.
In Eq,
- At is the number of tokens invested by the trader
- Psupply is the number of provided pool credentials
- Pissued is the muber of pool credentials obtained by users
- Bt is the balance of token t in the pool
Since it is allowed to deposit and withdraw liquidity to and from the pool using only one token, it can be used to do the equivalent with swap, providing liquidity to deposit in token A and immediately withdrawing liquidity from token B. Therefore a swap fee must be charged, based on the conversion into an all-asset collateral share.
Wt, only the remaining deposit is charged a swap fee, labeled At(1 — Wt), so the formula for the calculation is deformed to
Since token t in the pool already has a certain share, labeled Wt,only the remaining deposit is charged a swap fee, labeled At(1-Wt),so the formula for the calculation is deformed to
In Eq,
- At is the number of tokens invested by the trader
- Psupply is the number of provided pool credentials
- Pissued is the number of pool credentials obtained by the users
- Bt is the balance of token t in the pool
- Wt is the weight of token t in the pool
The above formula calculates the number of pool credentials obtained when a certain amount of individual token assets are deposited. The following formula calculates the number of deposited tokens required for a user to receive a specific number of pool credentials.
After adding the swap fee, the formula deforms to:
Single Asset Withdrawal
The single token withdrawal is the inverse of the single deposit, and without considering the swap fee, the formula is
In Eq,
- At is the number of tokens acquired by the trader
- Psupply is the number of provided pool credentials
- Predeemed is the number of pool vouchers redeemed by users
- Bt is the balance of token t in the pool
- Wt is the weight of token t in the pool
After adding the swap fee, the formula morphs to,
When it is necessary to calculate the number of pool credentials that can be redeemed based on the number of token t provided by the user, the formula is deformed to,
When the swap fee is added, the formula deforms to
Summary
With the functions and features of BootstrapNFT contracts, NFT issuers can more easily create price anchors for their projects and issue their projects with less capital. Users can participate in the project more fairly and easily.