IRCLLenders

Methods

deposit

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

Deposit funds to the target rate tick

Parameters

Name
Type
Description

rate

uint256

Rate to which deposit funds

amount

uint256

Amount of funds to deposit

to

address

Receing address of the position

Returns

Name
Type
Description

positionId

uint256

ID of the newly minted position emits a {Deposited} event

detach

function detach(uint256 positionId) external nonpayable

Withdrawn the unborrowed part of a borrowed position

Parameters

Name
Type
Description

positionId

uint256

ID of the position emits a {Detached} event

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

Name
Type
Description

positionId

uint256

ID of the position

borrowedAmountToExit

uint256

Address of the fees controller emits a {Exited} event and one {ExitedAmountRedistributedInTick} event per recipient tick

optOut

function optOut(uint256 positionId) external nonpayable

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

Parameters

Name
Type
Description

positionId

uint256

The ID of the position emits a {OptedOut} event

updateRate

function updateRate(uint256 positionId, uint256 newRate) external nonpayable

Update the rate of a position

Parameters

Name
Type
Description

positionId

uint256

ID of the position

newRate

uint256

New rate of the position emits a {RateUpdated} event

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

Name
Type
Description

positionId

uint256

ID of the position

amountToWithdraw

uint256

Address of the fees controller emits a {Withdrawn} event

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

Name
Type
Description

positionId indexed

uint256

ID of the position

to

address

Receing address of the position

amount

uint256

Amount of funds to deposit

rate

uint256

Target deposit rate

epochId

uint256

Id of the deposit epoch

Detached

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

Emitted when the unborrowed part of a borrowed position is detached

Parameters

Name
Type
Description

positionId indexed

uint256

ID of the position

receivedAmount

uint256

Amount of funds received by the position owner

withdrawalFees

uint256

Amount of fees taken

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

Name
Type
Description

positionId indexed

uint256

ID of the position

isFullyExited

bool

True if the position is fully exited, false if it is partially exited

unborrowedAmount

uint256

Withdrawn unborrowed amount

borrowedAmountToExit

uint256

Amount of borrowed funds to exit

receivedAmount

uint256

Amount of funds received by the position owner

exitFees

uint256

Amount of fees taken

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

Name
Type
Description

positionId indexed

uint256

ID of the position

loanId

uint256

ID of the current loan after which the position will be opted out

RateUpdated

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

Emitted when a position's rate is updated

Parameters

Name
Type
Description

positionId indexed

uint256

ID of the position

newRate

uint256

New rate of the position

movedAmount

uint256

Amount moved to the new rate

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

Name
Type
Description

positionId indexed

uint256

ID of the position

amountToWithdraw

uint256

Amount of funds to be withdrawn

receivedAmount

uint256

Amount of funds received by the position owner

withdrawalFees

uint256

Amount of fees taken

Last updated