Repay
How to close a position on the Sovryn Protocol.
Last updated
How to close a position on the Sovryn Protocol.
Last updated
closeWithDeposit closes a loan partially or completely by depositing loan tokens to the Sovryn Protocol. Note: It is also possible to close with a swap, see .
Arguments
loanId
bytes32
The id of the loan.
receiver
address
The receiver of the remainder.
depositAmount
uint256
Defines how much of the position should be closed. It is denominated in loan tokens. If depositAmount > principal, the complete loan will be closed.
Returns
the amount of the loan which was closed, the amount of the collateral token which was withdrawn to the receiver, the collateral token address of the loan