Author(s): Samyak Jain, Luis Schliesske
Contributors: Samyak Jain, Luis Schliesske
Status: Formal Submission
Date Proposed: 2021-1-4
Instadapp and Gelato have worked together to create refinance automation functionality into Instadapp’s DeFi Smart Account (DSA). Defi Smart Accounts are permissionless and non-custodial. Users will be able to set up refinance automation functionality in case of liquidation for ETH-A vaults into Aave, ETH-B or Compound. One of the Instadapp Gelato Automation smart contracts - ConditionMakerVaultUnsafe.sol (Edit: as @gitpusha mentioned in the comments - ConditionMakerVaultUnsafeOSM) - requires access to the Maker Oracle feed so that it may acquire and verify price data. This oracle will be used to facilitate automation on behalf of DSA users.
The process of refinancing will be prioritized as follows (in case of ETH-A liquidation):-
- Aave, but if no DAI liquidity then
- ETH-B vault, but if ceiling reached then
- Automation without oracle data: User selects a ratio at which they would want their ETH-A vaults to refinance.
- Automation with oracle data: ETH-A will only get refinanced if the ETH-A vault is about to get liquidated.
The contract to be whitelisted does neither return nor store the ETH/USD price. It reads and processes the price in-memory. Based on that in-place data processing it will only return either the string “OK”, if the inputted maker vault is about to get liquidated, or “NOT OK”, if the inputted maker vault is still safe. If the contract returns “OK”, the Gelato bots will automatically refinance the debt position.
Therefore, no other contract can access the raw price data from the Maker Oracle via ConditionMakerVaultUnsafe. The oracle data is inherently permission only to the latter and thus we are confident that it meets all the requirements for whitelisting.
ConditionMakerVaultUnsafe.sol – 0x3b50336E3E1E618FE74DF351966ebaD2B12cD24a
For each customer address to be whitelisted:
· Is the contract source code verified on etherscan? Yes
· Is the Oracle data used in a permission manner that would prevent parasitic behaviour? Yes
· Is Oracle data written to storage? No
· If Oracle data is stored, is it stored in a private variable? n/a
· If Oracle data is stored, is the value accessible on-chain exclusively by the protocol? n/a
In accordance with the Responsible Oracle Migration Proposal, fees are waived for the first year and determined by MKR Governance after that.