You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Test showing that settting Emode does not affect getReserveConfigurationData
* Start adjusting StrategyExtension test to switcht to wsteth/eth pair
* Fixing tests
* Fix test
* First test case for rebalancing in e-mode
* Fix handling of emode ltv / liquidationThreshold
* Add test case for wrong repay threshold
* Fix tests
* Remove subtraction of unutilizedLeveragePercentage when delevering
* Add test for targetLeverageRatio verification
* Add verification step for targetLeverageRatio >= 1
* Switch div / mul order in _calculateMinRepayUnits
* Switch div / mul order in calculateChunkRebalanceNotional
* Switch to latestRoundData on chainlink call
* Add check for maximum oracle price age
* Add tests for outdated price response from oracle
* Fix tests
* Add method to override noRebalanceInProgress modifier
* Fix tests
* Use AaveOracle instead of configured chainlink oracles
* Get AaveOracle address from AddressProvider instead of deploy argument
* Change to get aaveOracle address on the fly from addressProvider
* Clean up and additional code comments
* fix(dependencies): Add post audit Aave V3 dependencies (#145)
update post audit contracts for integration tests
Co-authored-by: Pranav Bhardwaj <[email protected]>
* Updates to test (#146)
* remove test filter on FlashMintLeveraged.
* chore: update current block
* test: updates to deployment of leverage module.
* Fix failing tests for AaveV3LeverageStrategyExtension (#147)
* Fix failing tests
* Adjust test message for ripcord test
---------
Co-authored-by: christn <[email protected]>
* remove .only from test
* test: fix issues with updating block.
Made deadline on uniswap router swaps less brittle.
---------
Co-authored-by: pblivin0x <[email protected]>
Co-authored-by: Pranav Bhardwaj <[email protected]>
Co-authored-by: SnakePoison <[email protected]>
require(_methodology.targetLeverageRatio >=1 ether, "Target leverage ratio must be >= 1e18");
187
+
}
188
+
189
+
/**
190
+
* Derive the min repay units from collateral units for delever. Units are calculated as target collateral rebalance units multiplied by slippage tolerance
191
+
* and pair price (collateral oracle price / borrow oracle price). Output is measured in borrow unit decimals.
192
+
*
193
+
* return uint256 Min position units to repay in borrow asset
194
+
*/
195
+
function _calculateMinRepayUnits(uint256_collateralRebalanceUnits, uint256_slippageTolerance, ActionInfo memory_actionInfo)
196
+
internal
197
+
override
198
+
pure
199
+
returns(uint256)
200
+
{
201
+
return _collateralRebalanceUnits
202
+
.preciseMul(_actionInfo.collateralPrice)
203
+
.preciseMul(PreciseUnitMath.preciseUnit().sub(_slippageTolerance)) // Changed order of mul / div here
204
+
.preciseDiv(_actionInfo.borrowPrice);
205
+
}
206
+
207
+
/**
208
+
* Calculate total notional rebalance quantity and chunked rebalance quantity in collateral units.
209
+
*
210
+
* return uint256 Chunked rebalance notional in collateral units
211
+
* return uint256 Total rebalance notional in collateral units
212
+
*/
213
+
function _calculateChunkRebalanceNotional(
214
+
LeverageInfo memory_leverageInfo,
215
+
uint256_newLeverageRatio,
216
+
bool_isLever
217
+
)
218
+
internal
219
+
view
220
+
override
221
+
returns (uint256, uint256)
222
+
{
223
+
// Calculate absolute value of difference between new and current leverage ratio
0 commit comments