Fuji's Borrowing Vault accepts absolute debt amount only in payback.
Lending providers charge interest per block, so between the time you submit a transaction and the time it gets processed, the debt will have increased by some small margin, especially on L2s. On L1s, it is also not guaranteed that you will land in the same block; there is always some latency. This prevents someone from paying off their total debt, and there will always be some leftover dust.
Recommended remediation
Ask users to pass the unit max as the amount in payback if they want to repay their total debt, then define the amount as the user's current debt inside payback. AAVE does the same.
Description
Fuji's Borrowing Vault accepts absolute debt amount only in
payback
.Lending providers charge interest per block, so between the time you submit a transaction and the time it gets processed, the debt will have increased by some small margin, especially on L2s. On L1s, it is also not guaranteed that you will land in the same block; there is always some latency. This prevents someone from paying off their total debt, and there will always be some leftover dust.
Recommended remediation
payback
if they want to repay their total debt, then define the amount as the user's current debt insidepayback
. AAVE does the same.payback
in terms of shares.