Orderbook
Overview
The Orderbook
contains modified order-book functionality, matching lenders to borrower within the BloomPool
.
Contract API
openDepth
openDepth
function openDepth(uint256 amount) external;
Returns the current total depth of open orders in terms of asset
tokens.
amountOpen
amountOpen
function amountOpen(address account) external view returns (uint256);
Returns the total amount of underlying asset
s in open orders for a users account
.
lendOrder
lendOrder
function lendOrder(uint256 amount) external;
Opens a lend order for a user.
Assets will be transferred to the BloomPool
contract when executing this function, but no receipt token will be given. TBY
s are only minted after orders have been matched and market makers have performed their swaps.
killOpenOrder
killOpenOrder
function killOpenOrder(uint256 amount) external;
Allows users to cancel their open lend order and withdraw their underlying assets.
matchedDepth
matchedDepth
function matchedDepth() external view returns (uint256);
Returns the current total depth of matched orders.
amountMatched
amountMatched
function amountMatched(address account) external view returns (uint256 amount);
Returns the total amount
of underlying assets in matched orders for a users account
.
matchedOrder
matchedOrder
function matchedOrder(address account, uint256 index) external view returns (MatchOrder memory);
Returns the matched order details for a users account
in the form of a MatchOrder
struct.
/**
* @notice Struct to store the details of a lend order that has been matched.
* @param lCollateral The amount of underlying assets the lender used as collateral.
* @param bCollateral The amount of underlying assets the borrower used as collateral.
* @param borrower The address of the borrower who filled the order.
*/
struct MatchOrder {
uint128 lCollateral;
uint128 bCollateral;
address borrower;
}
matchedOrderCount
matchedOrderCount
function matchedOrderCount(address account) external view returns (uint256);
Returns the number of matched orders for a users account
.
killMatchOrder
killMatchOrder
function killMatchOrder(uint256 amount) external returns (uint256 totalRemoved);
Allows users to cancel their match lend orders and withdraw their underlying assets.
Returns the totalRemoved
amount in terms of asset
tokens.
killBorrowerMatch
killBorrowerMatch
function killBorrowerMatch(address lender) external returns (uint256 lenderAmount, uint256 borrowerReturn);
Allows borrowers to cancel their match orders and withdraw their underlying assets
Returns the lenderAmount
and borrowerReturn
in terms of underlying assets that were returned to the various users.
fillOrder
fillOrder
function fillOrder(address account, uint256 amount) external returns (uint256 filled);
Allows borrowers to fill a single account
s lend order with a specified amount
of underlying assets.
Returns the amount of liquidity filled in terms of asset
tokens.
fillOrders
fillOrders
function fillOrders(address[] calldata accounts, uint256 amount) external returns (uint256 filled);
Allows borrowers to fill a multiple account
s lend orders with a specified amount
of underlying assets.
Returns the amount of liquidity filled in terms of asset
tokens.
idleCapital
idleCapital
function idleCapital(address account) external view returns (uint256);
Returns the idle capital of the borrower.
withdrawIdleCapital
withdrawIdleCapital
function withdrawIdleCapital(uint256 amount) external;
Allows borrowers to withdraw idle capital from the system.
Last updated