DISCLAIMER: This project is work by assuming the price of $DOLLY is EQUAL USD only.
git clone https://github.com/nanmcpe/dopple-synthetic.git
cd dopple-synthetic
yarn install
- Dolly address (to deploy, run
hh deploy --tags Dolly
) - Synthetic asset address (to deploy, run
hh deploy --tags DoppleSyntheticTokenFactory
) - Band oracle reference address click here for more details
- Create
.secret
file and provide credential following
{
"infuraProjectId": "",
"alchemyProjectId": "",
"privateKey": [
DEPLOYER_PRIVATE_KEY,
MINTER_PRIVATE_KEY,
LIQUIDATOR_PRIVATE_KEY,
DEVELOPER_PRIVATE_KEY
],
"etherApiKey": "",
"bscApiKey": ""
}
- Run
hh deploy
- Run
hh test
(some tests are required "Kovan network forked" to get Oracle price).
- Can mint synthetic asset by provide 150% of collateral (adjustable). (e.g. provide $DOLLY -> receive $dTSLA)
- Can redeem (fully or partial) of synthetic asset to get collateral back. (e.g. repay $DOLLY -> burn $dTSLA)
- Can add more collateral by provide backed asset ($DOLLY) for extend liquidation ratio.
- Can remove some collateral whereas the collateral ratio still satisfy.
- Can liquidate open contract that hit the liquidation ratio.
- Liquidation fee will be transfered to dev address (optional).
- Can adjust some parameters e.g.
collateralRatio
,liquidationRatio
,liquidatorRewardRatio
,platfromFeeRatio
,remainingToMinterRatio
.
- ✅ Add reentrancy guard.
- ✅ Use factory pattern for synthetic asset contracts. From this issue.
- ✅ Fix this issue.
- ✅ Add function
addSynthetic()
andremoveSynthetic()
corresponding of user's collateral ratio. - ✅ Use SafeERC20 for transfer tokens.
- ⏰ Add more unit test!!
- ⏰ Gathering and monitor liquidation of minted asset (for liquidate bot).
- ⏰ Make simple UI.
- ⏰ Use Chainlink oracle for standby (or combine) mode.
- Get deploayed
Dolly
instance - Deploy
Synthetic
contract by givingDolly address
andBand oracle reference
- Verify
Synthetic
contract - Get deploayed
Synthetic Token
instance - call function
setPairsToAddress(string <Pairs>, address syntheticAsset)
toSynthetic
contract. - call function
setAddressToPairs(address syntheticAsset, string <Pairs>)
toSynthetic
contract. - call function
setPairsToQuote(string pairs, string[2] pairs)
toSynthetic
contract. TSLA/USD', ['TSLA', 'USD'] - call function
approve(address synthetic, uint256 amount)
toDolly
contract. for minting purpose. - call function
approve(address synthetic, uint256 amount)
toSynthetic Asset
contract. for redeeming purpose (burned by synthetic contract). - call function
setSyntheticAddress(address synthetic)
toSynthetic Asset
contract. for only Synthetic contract can mint synthetic asset.
- Dolly: 0x2a49FF95c52Abb5d0302Bd59877B7CF32134f4E8
- Synthetic: 0x45C205dF8fF7b1c3DBbB5de019a4C0F920Bbdd4d
- DoppleSyntheticToken: 0xe973CBf1b49d1A6c0939291C77F6423FF2426d84
- DoppleSyntheticTokenFactory: 0xD2f944c3Cc22072565acB5cB2f7aA8212908003C
- dTSLA: 0x89996f43332693396693D6aDC76094487E9FD26C
- dCOIN: 0xc7FCae6C7D442F0DAf1EB32b974d0a88Ef70d484
- dAAPL: 0xF21079fA8DE27bb19eEc08267Cec183784a6250E
- dQQQ: 0x0f674993EA085ce9ba8746cCc713f2042801b834
- dAMZN: 0xC65DB0723b409639b1F1031a6AD4879b0294c2e6
- dXAU: 0x755f7503E3BbFCCC1b8877fFeB8b00c25B3e5592
- Deployer: 0xad1F66Acea98733D63cd8FC522118e4014Cb3F79
- Minter: 0xa11cec4fF714C34775318544e97842344A9F3aDc
- Liquidator: 0xb0b38D35775d93eC72928d2Cf9619fb3291aD8D6
- Developer: 0xca101e15B0A9b091624122eEa12FC981Fee77523