-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atomic curve creation/seeding & ctdl/wbtc curve pool address set into oracles #198
base: main
Are you sure you want to change the base?
Conversation
@petrovska-petro, according to CI there seems to be Linting/compiling errors. Also, will create a ticket to add tests for this asap. |
compiling errors should be resolved now with latest commits. linting seems not to get sorted despite of running |
src/AtomicLaunch.sol
Outdated
|
||
function _setCurvePoolInOracles(address _ctdlWbtcCurvePool) internal { | ||
for (uint256 i = 0; i < _oracles.length(); i++) { | ||
IMedianOracleProvider(_oracles.at(i)).setCurvePool( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is setCurvePool
implemented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The premise here was to allow the setting of the curve pool after creation, so the contracts can be deployed before this process. Due to the benefits of immutables, I suggest moving to a Factory pattern where this contract deploys the oracles itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the end in the latest commits we decided for the contract itself to deploy the oracles using the curve pool address directly. So we did not end up adding this new method
Maybe I'm missing something, but why don't we just deploy the oracles after the pool has been deployed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Ayush Shukla <shuklaayush247@gmail.com>
Co-authored-by: Ayush Shukla <shuklaayush247@gmail.com>
Co-authored-by: Ayush Shukla <shuklaayush247@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed chainlink feed addresses:
wBTC/BTC: https://data.chain.link/ethereum/mainnet/crypto-other/wbtc-btc
BTC/ETH: https://data.chain.link/ethereum/mainnet/crypto-eth/btc-eth
ETH/USD: https://data.chain.link/ethereum/mainnet/crypto-usd/eth-usd
FRAX/USD: https://data.chain.link/ethereum/mainnet/stablecoins/frax-usd
FRAX/ETH: https://data.chain.link/ethereum/mainnet/crypto-eth/frax-eth
USDC/ETH: https://data.chain.link/ethereum/mainnet/stablecoins/usdc-eth
USDC/USD: https://data.chain.link/ethereum/mainnet/stablecoins/usdc-usd
BADGER/ETH: https://data.chain.link/ethereum/mainnet/crypto-eth/badger-eth
BADGER/USD: https://data.chain.link/ethereum/mainnet/crypto-usd/badger-usd
CVX/ETH: https://data.chain.link/ethereum/mainnet/crypto-eth/cvx-eth
CVX/USD: https://data.chain.link/ethereum/mainnet/crypto-usd/cvx-usd
wBTC/USD: https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd (Actually BTC/USD - Should be safe imo)
Example of inital price calc with latest feed:
(2088673700000 * 1e18) / (1e8) / 21 = 99460652380952380952 (994.6 CTDL buys 1 wBTC) - LGTM
Oracle deployment funtions LGTM
Atomic launch test was adapted to use the newly introduced contract ofr the curve pool launch setup.
@Fatimanaz, as a separate test, the deployed oracles should also be checked. The test should ensure that oracles were deployed correctly witht the right parameters, that they can be integrated to the infra and that the adapters produce the correct results. Will create a separate ticket for this as this test will live better in a separate test suite anyway.
Note: Linter doesn't detect any errors locally so the failing CI is likely due to env issues.
LGTM
Tackles #196
Context
For the atomic launch, we have the blocker of not having the curve pool address. This contract should resolve it in the following way.
Idea, it is from the gov msig to call the launch(uint256 citadelToLiquidty, uint256 wbtcToLiquidity), prior the initial supply have being mined and also gov msig have the KRs funds. So, over the msig the amounts to seed the pool are calculated and passed as arguments and also do a direct transfer into this contract to be able to exec all the steps.