Inspiration
Few months ago, qilin investment team tried to invest in some nftfi projects. But after talking to more than 40 of these projects, we found that nobody solved the most important issue of nft liquidity——how to distinguish ERC721 NFTs with different ids in nft trading protocol and how to aggregating NFT's liquidity in primary sale(mint) and secondary sale. When we saw chainlink's hack, we decided to build a killer protocol solving these core issues ourselves. We believe wider use of nfts (gamefi, socialfi and lots of web3 dapps ect.) will be the topic of the next cycle while the liquidity and pricing of NFT have always been the core problems of the whole NFT industry. We can see that Sudoswap tries to solve these two problems with bonding curve and takes the first step in this direction. However, in the final result, we found that Bonding Curve didn’t not solve the above problems. We were quite familiar with all kinds of dex and have experience of developing amm, so we found building a nft amm based on uniswap v3 utilizing customizable liquidity position, Multihop Swap and fractional NFT were the only ways to solve these problems. Also, we found that gamefi developers were unlikely to launch their erc20 to cex while the funding number of gamefi was still high(there were still so many on-going projects) and gamefi nft mint usually started before the dapps launched. So both their erc20 and nft lack external liquidity and we can do something for them.
What it does
Midaswap is an NFT Automated Market Maker (AMM) that is designed based on Uniswap V3. Different from other floor NFT trading protocols, midaswap is able to distinguish and price ERC721 NFTs with different ids utilizing customizable liquidity position, Multihop Swap and fractional NFT. Users can trade NFTs and provide liquidity to be liquidity providers. NFT developers (including PFP / GameFi, etc.) are allowed to create liquidity pools for their primary sale and secondary sale and earn royalty fee(as well as swap fee for they are also liquidity providers). Midaswap was first deployed on polygon and may go to fvm and polygon for mainnet since we were quite excited to find that nfts were able to minted, exchanged and stored under a single root. That says, the user experience (gas and smoothness) of midaswap will improve a lot on fvm. Midaswap, as an nft decentralized marketplace, can complement lots of web3 dapps(gamefi,socialfi ,metaverse ect.) on polygon(fvm in the future) as an automated liquidity provider, solving the problem of nft illiquidity and trying to combine the liquidity of pfp and gamefi nft. Also, midaswap allows nft/dapps developers to manage their nft liquidity, helping solve the death spiral of gamefi. The standardized NFT price index is exported through Twap, which lays the foundation for the construction of NFTFI ecology on polygon with NFT as the core asset. Also the NFT price index of midaswap can increase accuracy of chainlink’s nft oracle since it comes from real nft trading. Users can swap within any of the liquidity pools, meaning that users can trade NFT to get FT or trade FT to get NFT, and NFT purchasers are free to buy any NFT in the liquidity pool. Users can also purchase fractional NFTs (ERC-20 standard tokens) and enjoy the same ups and downs in the price of the collection by purchasing only a portion of a particular NFT. Liquidity Management: Anyone can initial a new liquidity pool if Midaswap didn't have a pool of this assets pair before. If there is an existing liquidity pool, anyone can add assets to it to become an LP. For deal matching, Midaswap takes the Automated Market Maker (AMM) as the deal matching mechanism, which aggregates liquidity of same NFT collections into one liquidity pool. For asset pricing, Midaswap offers customizable liquidity position (Range Order), which allows NFT holders to decide the price range of their NFT liquidity.
How we built it
why we choose to build based on uniswap v3 and how we integrate nft into uniswap v3 mechanism: Since we want to gain instant liquidity and pool mechanism accumulated liquidity while meeting users' needs for differentiated pricing, we need to bind nft tokenid and price range. Our approach is to bind Uniswap v3’s tick to nft tokenid We use Uniswap v3’s tick to bind to nft tokenid to identify each different NFT information. Through the binding of Tick and TokenID, we can obtain tokenid information through tick and tick information through TokenID, so as to accurately identify different nfts in Uniswap v3. Then we can aggregate nft liquidity from different pricing ranges in the same liquidity pool. Also we hope to lower user threshold We use vToken to describe the actual number of NFT assets, so as to complete NFT pricing with Uniswap v3 AMM. By using vToken, we can use Uniswap v3 to quickly and efficiently complete NFT transactions, add/remove liquidity and other related operations, lower the threshold for users to participate in NFTS, and export more accurate and effective NFT pricing through Twap. Then we can aggregate nft liquidity from different pricing ranges in the same liquidity pool. IPFS NFTStorage for data storage on IPFS-we will launch nfts as Governance tokens(play the same role as $bnb in cex), so there will be lots of need for nfts'flexible storage. Other data(including nfts)
Challenges we ran into
Problem
- The tick design of Uniswap v3 AMM can only support users to trade in the current tick i range, while nft trading scenario needs to be within the tick i-∞ range. Uniswap v3 does not meet the requirements of nft trading scenarios.
- Through our research, we found that the number of gamefi(also socialfi ect.)users was three times larger than pfp users while gamefi(also socialfi ect.) nft liquidity was confined to their own marketplace.
- Different from erc20, nfts have their own community culture.
Solution
- Through the analysis, it can be known that in the tick design of Uniswap v3, only LPs can operate within any tick interval. Therefore, by encapsulating LPs ' LP token and calling LP Token through the contract to withdraw liquidity, we are able to simulate the nft trading scenario of buying NFTS above the floor price.
- Gamefi(also socialfi ect.) nft holders and developers are able to create different pools(native tokens-nft, nft-usdc, nft-eth) so as to open external liquidity and do their liquidity management avoiding inflation.Also we design a tokeneconomic to help developers to gain liquidity and attract users.
Accomplishments that we're proud of
We built a new NFT AMM based on Uniswap v3 which is a completely new paradigm nft trading protocol different from sudoswap, gem, opensea.... Liquidity is unified in Midaswap. Users can freely trade different tokenids'NFTs or Fractional nfts, lowering the threshold for traders and pooling NFT liquidity.Also, we expected it could be a game changer for nft of web3 dapp which we believe will be the theme of the next cycle.
What we learned
We interviewed lots of different kinds of nft holders including professional traders, newbies, senior gamefi users, nftfi projects, gamefi projects on polygon and learned a lot about the nft economy.
What's next for Midaswap
- 2022.11-12:applying for polygon's(also others) grant and talking about some projects which may compose with/ cooperate with us.;Build our own community
- Reconstruct Midaswap UI/UX in 2023.1, launch Demo2.0 and realize all functions planned
- Put Midaswap on testnet in February, public testnet activities, and invite NFT projects and users
- Put Midaswap on mainnet in March
Key Info
You need to provide the address to get test nfts to try midaswap demo, the test address can be sent to gxie996@gmail.com
Built With
- amazon-web-services
- hardhat
- remix
- solidity
- web3
Log in or sign up for Devpost to join the conversation.