The WANT Token Exchange Pool allows you to deposit ERC20 tokens, receive WANT tokens in return, and redeem a WANT token for a random token from the pool.
The WANT Token Exchange Pool was conceived as a whimsical approach to DeFi. A "gashapon" (https://en.wikipedia.org/wiki/Gashapon) is a type of coin operated vending machine that is popular in Japan. It dispenses a random toy or collectible in a capsule when used. What if you had a gashapon style decentralized token pool that allowed you to receive random ERC20 tokens? We implemented a pool for items that give you tokens based on the scarcity of item. In that way it works like a self-balancing stable coin. Participants are incentivized to add tokens with lower representation in the overall pool. Users are rewarded when they redeem a WANT token in a way that is fair and fun!
How it's made
There is a smart contract suite built in Solidity that uses Open Zeppelin libraries and relies on Uniswap for token exchanges. The demo contract is deployed on Rinkeby at address: 0x42F3e1c5C32819255a18F22bB6eF342f8C73Ba37 We currently have four tokens to put into our pool: ZRX: 0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6 WBTC: 0x577D296678535e4903D59A4C929B718e1D575e0A USDC: 0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b DAI: 0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa The contract main functions: - claim: we claims random tokens from pool by burning WANT tokens [amount] times - deposit: we add a supported token to the pool. - getPayout: return the expected WANT tokens we can have by putting some amount of tokens to the pool. - getTokenDecimals: get decimals of an erc20 token. - ownedTokenAmount: get the amount of an erc20 token we have in the pool. Contract Events: we have Claim and Deposit, more information can be found in contracts/WANT.sol. The front end is built in Vue.js and has: - A form to select a list of supported tokens and the ability to input the amount of tokens to put into the pool - A button to redeem a single WANT token - After a transaction, we update the display of token balances