LP Token

Liquidity Book was originally proposed by Trade joe. In Trade Joe's initial design, LP Token was ERC1155 asset, but it was modified to ERC721 asset in Midaswap. The reason is that Midaswap deals with the matching of NFT assets, and each NFT asset has its own independent Token ID. Therefore, whether the trader buys NFTs from the Pool or sells NFTs to the Pool, the ultimate ownership of each NFT asset needs to be clear. Through NFT LP Token, each LPs in Midaswap can have its own Token ID number, so users can liquidate NFT assets through the ID number of LP Token.

NFT Liquidation in Pool

When LP provides liquidity, he will get ERC721 LP Token. Each NFT LP Token has a unique corresponding Token ID. Midaswap's NFT Vault contract will identify the NFT&FT assets provided by LP in the Pool through the LP Token ID. The Vault contract updates the NFT asset ownership each time a trader trades with the NFT&FT asset belonging to the LP. When the trader purchases an NFT from the NFT liquidity provided by the LP, the NFT Vault will delete the sold NFT Token ID information and add ETH and fees to the LP Token Token ID. When a trader sells an NFT to the ETH provided by an LP, the NFT Vault will add the acquired NFT Tokenid information and add the acquired NFT and fee to the LP Token Tokenid. With each transaction, the Pool liquidates the NFT asset and fee information in real time, and when the LP takes the NFT LP Token to remove the liquidity, he can see the final NFT, FT, and fee data they hold.

Last updated