0.0.3 • Published 4 years ago
@mcdex/mai-tp.js v0.0.3
Tokenized Position for mai protocol v2
Mai Tokenized Position (TP) is used to convert a long position of Mai Protocol v2 - Perpetual into ERC20 token. A long position can be kept fully collateralized automatically, so it is possible to make a long position leave the Perpetual and enter the public Ethereum ecosystem.
For example: An ETH-PERP inverse perpetual is collteralized with ETH. So the short position (The short position is from a human perspective. In the contract it is still a long position) is a synthetic USD. A BTC-USDT-PERP vanilla perpetual is collteralized with USDT. So the long position is a synthetic BTC. etc.
Design Details
Check the "tokenized-position" part of our documents to get more information.
Develop
- Deploy a mai protocol v2 by running
truffle migrate
in that project - Do not forget to create the AMM by running
truffle exec scripts/create_pool_for_test_eth.js
- Deploy the TP by running
npx oz deploy -k upgradable
. When prompting init(), enter "eUSD" and 18 decimals - Do not forget to add the TP into perpetual whitelist.
await perp.globalConfig.addComponent(perp.perpetual.address, tokenizer.address)