IRCLLenders

Methods

deposit

function deposit(uint256 rate, uint256 amount, address to) external nonpayable returns (uint256 positionId)

Deposit funds to the target rate tick

Parameters

Returns

detach

function detach(uint256 positionId) external nonpayable

Withdrawn the unborrowed part of a borrowed position

Parameters

exit

function exit(uint256 positionId, uint256 borrowedAmountToExit) external nonpayable

Exit a position from the current loan

will reallocate the borrowed part of the position as well as realized accrualas, and withdraw the unborrowed part of the positionborrowedAmountToExit set to type(uint256).max means a full exitpartial exits are only possible for fully matched positionsfull exits will burn the position and need pool approval to transfer itExitedAmountRedistributedInTick event is declared in LenderLogic library

Parameters

optOut

function optOut(uint256 positionId) external nonpayable

Opt out a borrowed position from a loan and remove it from the borrowable funds

Parameters

updateRate

function updateRate(uint256 positionId, uint256 newRate) external nonpayable

Update the rate of a position

Parameters

withdraw

function withdraw(uint256 positionId, uint256 amountToWithdraw) external nonpayable

Withdraw funds from the order book

amountToWithdraw set to type(uint256).max means a full withdrawamountToWithdraw must be set between 0 and positionCurrentValuefull withdrawals need the pool approval to transfer the positiona successful full withdraw will burn the position

Parameters

Events

Deposited

event Deposited(uint256 indexed positionId, address to, uint256 amount, uint256 rate, uint256 epochId)

Emitted when a deposit is made on the pool

Parameters

Detached

event Detached(uint256 indexed positionId, uint256 receivedAmount, uint256 withdrawalFees)

Emitted when the unborrowed part of a borrowed position is detached

Parameters

Exited

event Exited(uint256 indexed positionId, bool isFullyExited, uint256 unborrowedAmount, uint256 borrowedAmountToExit, uint256 receivedAmount, uint256 exitFees)

Emitted when a position is fully exited

Partial exits are only possible for fully matched positions

Parameters

OptedOut

event OptedOut(uint256 indexed positionId, uint256 loanId)

Emitted when a borrowed position is signalling its intention to not be a part of the next loan

Parameters

RateUpdated

event RateUpdated(uint256 indexed positionId, uint256 newRate, uint256 movedAmount)

Emitted when a position's rate is updated

Parameters

Withdrawn

event Withdrawn(uint256 indexed positionId, uint256 amountToWithdraw, uint256 receivedAmount, uint256 withdrawalFees)

Emitted when a position is withdrawn

amountToWithdraw set to type(uint256).max means a full withdraw

Parameters

Last updated