Magicswap v2: Powering a New Category of Game Exchanges (GEX)
Treasure’s permissionless AMM with universal token compatibility has launched to power the first GEX by Zeeverse.
Magicswap is a permissionless AMM that provides universal token compatibility and allows users to pool any kind of NFT together and trade them like you would on AMMs like Uniswap. Users never touch underlying vault tokens, and handle only NFTs directly, simplifying the whole experience. Users can create pools for any combination of ERC-20s, ERC-721s, and ERC-1155s. Pools can include multiple vault token types and are compatible with new token standards in the future.
Magicswap is intended to be complementary to protocols like Sudoswap, which are more optimal for trading ERC-721s and low-supply tokenIds of an ERC1155. Magicswap emphasizes a single pool designed for game economies with diverse items as well as new kinds of highly-liquid NFTs that function like currency.
Over time, we may look to recreate Magicswap using Uniswap v4 hooks and the Magicswap vaults. This design will allow traders to access broader Uniswap liquidity while benefiting from this new frontier being pioneered at Treasure. The Magicswap front end and the Treasure Development Kit (TDK) will still be needed to deliver the particular kind of experience we intend, which is allowing the user to have an collectible-first trading experience but with the frictionlessness of a DEX.
The Magicswap vaults are the key feature of this implementation. We expect most games to utilize the DEX through the game engine (what we’re calling a GEX – a Game Exchange). Similar to the Uniswap front-end, game makers will have the freedom to make opinionated decisions about the ways in which things can be traded. Future areas of application include using attestations and the TDK to introduce “friction” into the trading experience to create a design surface for game designers to create challenges for the users – just by combining the DEX and game data.
The vaults have use cases independent of the AMM, which we discuss later. One can create an ERC-721 that behaves like an ERC-1155 on buy orders by being ‘ghost minted’ into the user’s wallet. This feature will be most useful for attracting long-term collectors who tend to buy large quantities and hold.
General Design Choices
The project initially began with the limited goal of making a DEX in which different tokenIds of an ERC1155 game currency could be made fungible with each other. At the time, Treasure was in need of an AMM that could support “Treasure Tiers” (groups of 1155 token Ids treated as fungible for crafting purposes) rather than single token Ids of an ERC1155. In the process of developing this use case, we created a larger feature set:
Issuing LP rewards in NFTs
Creating pools that use NFTs as the base pair
Treating any set of NFTs, ERC20s, or combination of the two as fungible
“Ghost minting” ERC721s to the user when they buy from an AMM, enabling the user to buy any number of collection as if transacting a single tokenId of an 1155
Magicswap v2 is based on the assumption that many users, especially gamers, prefer holding NFTs as such rather than fractionalized vault tokens. The Magicswap vaults act as an intermediary that allow the user to trade through the AMM without needing to handle vault tokens.
Magicswap includes a three-tier royalty system: the protocol fee, LP fees, and the token creator fee. Currently, the contract admin can set these fees for pools. We will iteratively make this more permissionless. The protocol fee will eventually be sunset for a front-end fee with royalty distribution happening from this fee. For now as ratified in TIP-40, every pool in Magicswap will have (i) a 0.3% baseline protocol fee and variable (ii) LP fees; and (iii) creator fees, all of which can be overridden on a per-pool basis.
Features
Universal NFT Support
Magicswap v2 handles any combination of ERC-721s, ERC-1155s, ERC-20s and simplifies the user experience for both the pool creators and traders. The pool creator first creates and deposits ERC-721s, ERC-1155s, ERC-20s into a vault, then creates a trading pool for them. When users trade out of the AMM, they never interact with the vault and only handle actual NFTs.
NFT-NFT pools
These pools are technically ERC-20-ERC-20 given that Magicswap pools hold vault tokens. However, the same UX applies in which the user is transacting into the pools in discrete units of an NFT. These pools require an extremely high denominator for the base pair to be feasible. The ideal base pair is an ERC-1155 with a very high token supply, more akin to a memecoin supply than a 10k collection.
The user leaves remainders of each trade in the pool which contribute to fees sent to liquidity providers.
Ghost Minting
ERC-721s designed to conform with Magicswap vaults are ghost minted to the user when they buy from an AMM, meaning the user can purchase any number of ERC-721s from the same collection at the same cost of transferring one tokenId of an ERC-1155. (The same is not true for selling in which the user must pay to transfer each ERC-721 into the pool.)
Magicswap is not ideal for low-supply ERC-721s so this feature is most useful when the vault is used separately from the AMM. Initial use cases would be reducing gas costs for long-term collectors who tend to buy in large quantities when they make targeted buys from the vault.
ERC-721A (created by Azuki) makes it possible for the user to mint a sequence of tokenIds for lower gas costs during initial mint. Magicswap vaults extend this feature further to whenever NFTs are purchased from the vault.
LP Rewards (Forthcoming)
The pool creator will be able to issue LP rewards in up to 20 tokens, including ERC721s and ERC1155s. The LP can withdraw these additional token rewards as NFTs or vault tokens. Similarly, LP positions can be removed with only partial NFTs.
For the first iteration, we are assuming that LPs have the understanding of DeFi required by NFTX whereas the consumer-facing side of Magicswap is designed for users who do not know what a vault is. Later, we will add an additional utility function to streamline removal process and conversion of vault token dust into an ERC20. The use case for this feature would be getting average users to act as liquidity providers without realizing it. Adding and removing liquidity would be elements in the game abstracted into something else. Such experimentations become possible in combination with the TDK.
Zeeverse: The Game Exchange (GEX)
We have partnered with our friends at Zeeverse to launch the first native GEX built directly in-game (in-engine in Unity!) – all powered by Magicswap and TDK.
The Zeeverse GEX will allow players to trade NFTs and tokens, add liquidity, and earn LP fees without ever leaving the game or signing a single transaction. This abstracts away the ability for game makers to bring their economies onchain, enabling even more player-driven economies to emerge without compromising on the player experience.
Zeeverse has already surpassed 1M onchain transactions since rolling out their integration in late June. Through the power of TDK, it unlocks Zeeverse’s ability to make blockchain contract calls in-game and within Unity across a variety of gameplay mechanics from daily reward claims of their native token VEE through to onchain gameplay skills.
Anything surfaced in-game will also be accessible on the Magicswap v2 web front-end. For those familiar with DEXs, the experience is similar to Uniswap or Sudoswap to provide an additional path for users outside of the game to trade and interact with the token economy.
With Magicswap v2, we anticipate the amount of transactions they will drive to grow exponentially, leading to even more onchain activity initially on Arbitrum One and, soon, on the Treasure Chain.
GEXs unlock a new kind of dApp opportunity to integrate the DeFi layer directly in-game, enabling games to offer fully onchain game economies without compromising on gameplay or pulling their players out of the game.
—
→ Magicswap v2 is now live at magicswap.lol as well as in-game on zee-verse.com!
→ Check out Zeeverse’s launch post about their native GEX.
→ To build your own GEX powered by Magicswap and the Treasure Development Kit (TDK), check out the Treasure Developer Docs and the Magicswaps v2 Contracts repository on GitHub!