hifi-finance / hifi

Monorepo implementing the Hifi fixed-rate, fixed-term lending protocol
https://app.hifi.finance
Other
106 stars 15 forks source link

[flash-swap] Repay the 0.3% Uniswap V2 in USDC #62

Closed scorpion9979 closed 3 years ago

scorpion9979 commented 3 years ago

An implication of https://github.com/hifi-finance/hifi/pull/60 being merged is that the flash-swap contract will have to contain collateral tokens to ensure it's able to pay the 0.3% Uniswap fee in some edge cases where the entire liquidated collateral is not enough to repay the flash swap. Instead of having the flash-swap contain multiple token balances, it would be better to only contain the token shared by all pairs, which is the underlying (USDC), and use it to pay the swap fee when those edge cases are met. This would make liquidation a lot easier to manage.

PaulRBerg commented 3 years ago

This has been addressed in https://github.com/hifi-finance/hifi/pull/64.