mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
refacto
This commit is contained in:
parent
597b23d6e2
commit
24604e94fe
|
@ -59,13 +59,15 @@ contract ConditionDestVaultWillBeSafe is GelatoConditionsStandard {
|
|||
) public view returns (string memory) {
|
||||
uint256 wDaiToBorrow =
|
||||
_getRealisedDebt(_getMakerVaultDebt(_fromVaultId));
|
||||
uint256 route = _getFlashLoanRoute(DAI, wDaiToBorrow);
|
||||
uint256 gasCost = _getGasCostMakerToMaker(_destVaultId == 0, route);
|
||||
uint256 gasFeesPaidFromCol = _getGelatoProviderFees(gasCost);
|
||||
uint256 wColToDeposit =
|
||||
sub(
|
||||
_getMakerVaultCollateralBalance(_fromVaultId),
|
||||
gasFeesPaidFromCol
|
||||
_getGelatoProviderFees(
|
||||
_getGasCostMakerToMaker(
|
||||
_destVaultId == 0,
|
||||
_getFlashLoanRoute(DAI, wDaiToBorrow)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user