OrderBookV3FlashLender
Inherits: IERC3156FlashLender
Implements IERC3156FlashLender for OrderBook. Based on the
reference implementation by Alberto Cuesta Cañada found at
https://eips.ethereum.org/EIPS/eip-3156#flash-loan-reference-implementation
Functions
flashLoan
Initiate a flash loan.
function flashLoan(IERC3156FlashBorrower receiver, address token, uint256 amount, bytes calldata data)
external
override
returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
receiver | IERC3156FlashBorrower | The receiver of the tokens in the loan, and the receiver of the callback. |
token | address | The loan currency. |
amount | uint256 | The amount of tokens lent. |
data | bytes | Arbitrary data structure, intended to contain user-defined parameters. |
flashFee
The fee to be charged for a given loan.
function flashFee(address, uint256) external pure override returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
<none> | address | |
<none> | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The amount of token to be charged for the loan, on top of the returned principal. |
maxFlashLoan
There's no limit to the size of a flash loan from Orderbook other than
the current tokens deposited in Orderbook. If there is an active debt
then loans are disabled so the max becomes 0 until after repayment.
The amount of currency available to be lent.
function maxFlashLoan(address token) external view override returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The loan currency. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The amount of token that can be borrowed. |