-
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
Sdai adapter and substream #102
base: main
Are you sure you want to change the base?
Conversation
…tion, buy function
Sdai adapter sdk integration
…n due to a bug in runPoolBehaviour with constant price pools.
…nt_tx(tx, &sdai_address)
…apter-and-substream Sdk implementation/sdai adapter and substream
90) / | ||
100; | ||
limits[1] = savingsDai.previewDeposit(limits[0]); | ||
limits[0] = 3 * (10 ** 24); |
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.
Can you explain this value it seems very arbitrary.
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.
@kayibal It is the DAI total supply value approx., and we need to use static values due to the incompatibility issue between substreams and external calls
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.
We can overwrite the token's totalSupply
so ideally we should track this via attributes
Currently, DAI supply is 1000 times bigger than this number.
limits[0] = 3 * (10 ** 24); | ||
limits[1] = limits[0]; | ||
} else { | ||
uint256 totalAssets = savingsDai.totalAssets(); |
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.
@kayibal I think this is not possible with the current Simulation module, as we override the tokens, right?
Maybe we can change it to ignore the token overrides when executing functions that are not price
and swap
- but that would still require us to track this token's storage.
|
||
[dependencies] | ||
ethabi = "17" | ||
hex-literal.workspace = true |
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.
Workspace dependencies are deprecated, please update
# A comma separated list of args to be passed to the constructor of the Adapter contract | ||
adapter_build_args: "0x83F20F44975D03b1b09e64809B757c47f942BEeA,0x6B175474E89094C44Da98b954EedeAC495271d0F" | ||
# Whether or not the testing script should skip checking balances of the protocol components. | ||
# If set to `true` please always add a reason why it's skipped. |
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.
Please provide a reason why it's skipped
- "0x6B175474E89094C44Da98b954EedeAC495271d0F" # dai | ||
- "0x83F20F44975D03b1b09e64809B757c47f942BEeA" # sDai | ||
creation_tx: "0xa2f51048265f2fe9ffaf69b94cb5a2a4113be49bdecd2040d530dd6f68facc42" | ||
skip_simulation: false |
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.
Missing swap simulation tests
// Ethereum | ||
match vault_address { | ||
// sDai | ||
hex!("83F20F44975D03b1b09e64809B757c47f942BEeA") => { |
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.
Hardcoded address - it won't work on other chains. I think you can get this value from the constructor?
|
||
let tx_protocol_components = deployment_tx | ||
.map(|tx| { | ||
let protocol_component = ProtocolComponent::at_contract(&vault_address, &tx.into()) |
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.
We're missing the tracking of contracts where state is relevant for simulation. From sDAI's code, looks like pot
contract (https://etherscan.io/address/0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7#code) is necessary.
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.
We could even add DAI and pot
addresses from params - as we
expect to be only one sDAI per-chain.
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.
We're missing the tracking of contracts where state is relevant for simulation. From sDAI's code, looks like
pot
contract (https://etherscan.io/address/0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7#code) is necessary.
Hey @tvinagre could you please be more specific regarding why pot
is relevant for the simulation since it does not hold balance?
component_id: address_hex.as_bytes().to_vec(), | ||
}, | ||
]); | ||
substreams::log::debug!( |
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.
pls remove logs before final version
Please also rebase from |
No description provided.