Repaying

All loans can be repaid at any point after issuance and before liquidation sale. Anyone can repay any loan (there is no restriction on the msg.sender). During a repay transaction the due amount is transferred from the caller wallet to kairos, and the NFT used as collateral is transferred to the original borrower. A debt is not transferrable in kairos (while supply positions are), which is why the NFT used as collateral is returned to the address that initialized the borrow action (which is not necessarly the original NFT owner). This address is msg.sender if borrow was called, operator (as specified in the onERC721Received specification of the ERC721 standard) if the borrow action resulted from an ERC721 safe transfer. So kairos supports the ability to repay 'on behalf' of another account. Repaying can only be done once per loan, only the full amount due can be repaid, and a loan can't be repaid if liquidated. The amount due is determined by the time between the loan start date and the the date of repay, and is due in the same token as lent. The amount to repay is never less than what was lent. The extra amount to repay on top of the principal of the loan accrues linearly according to the interest rate set at the loan issuance. This rate does not compounds. If the time between borrow and repayment is short, a minimal repayment amount per offer used in the loan applies. This is done as an anti-DDOS measure and the minimal amount due per offer for any given erc20 lent is set by governance.