IRCLLenders
Methods
deposit
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
Withdrawn the unborrowed part of a borrowed position
Parameters
Name | Type | Description |
---|---|---|
positionId | uint256 | ID of the position emits a {Detached} event |
exit
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
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
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
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
Emitted when a deposit is made on the pool
Parameters
Name | Type | Description |
---|---|---|
positionId | 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
Emitted when the unborrowed part of a borrowed position is detached
Parameters
Name | Type | Description |
---|---|---|
positionId | uint256 | ID of the position |
receivedAmount | uint256 | Amount of funds received by the position owner |
withdrawalFees | uint256 | Amount of fees taken |
Exited
Emitted when a position is fully exited
Partial exits are only possible for fully matched positions
Parameters
Name | Type | Description |
---|---|---|
positionId | 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
Emitted when a borrowed position is signalling its intention to not be a part of the next loan
Parameters
Name | Type | Description |
---|---|---|
positionId | uint256 | ID of the position |
loanId | uint256 | ID of the current loan after which the position will be opted out |
RateUpdated
Emitted when a position's rate is updated
Parameters
Name | Type | Description |
---|---|---|
positionId | uint256 | ID of the position |
newRate | uint256 | New rate of the position |
movedAmount | uint256 | Amount moved to the new rate |
Withdrawn
Emitted when a position is withdrawn
amountToWithdraw set to type(uint256).max means a full withdraw
Parameters
Name | Type | Description |
---|---|---|
positionId | 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