Orderbook
Overview
The Orderbook contains modified order-book functionality, matching lenders to borrower within the BloomPool .
Contract API
openDepth
openDepthfunction openDepth(uint256 amount) external;Returns the current total depth of open orders in terms of asset tokens.
amountOpen
amountOpenfunction amountOpen(address account) external view returns (uint256);Returns the total amount of underlying assets in open orders for a users account.
lendOrder
lendOrderfunction 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. TBYs are only minted after orders have been matched and market makers have performed their swaps.
killOpenOrder
killOpenOrderfunction killOpenOrder(uint256 amount) external;Allows users to cancel their open lend order and withdraw their underlying assets.
matchedDepth
matchedDepthfunction matchedDepth() external view returns (uint256);Returns the current total depth of matched orders.
amountMatched
amountMatchedfunction amountMatched(address account) external view returns (uint256 amount);Returns the total amount of underlying assets in matched orders for a users account.
matchedOrder
matchedOrderfunction 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
matchedOrderCountfunction matchedOrderCount(address account) external view returns (uint256);Returns the number of matched orders for a users account.
killMatchOrder
killMatchOrderfunction 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
killBorrowerMatchfunction 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
fillOrderfunction fillOrder(address account, uint256 amount) external returns (uint256 filled);Allows borrowers to fill a single accounts lend order with a specified amount of underlying assets.
Returns the amount of liquidity filled in terms of asset tokens.
fillOrders
fillOrdersfunction fillOrders(address[] calldata accounts, uint256 amount) external returns (uint256 filled);Allows borrowers to fill a multiple accounts lend orders with a specified amount of underlying assets.
Returns the amount of liquidity filled in terms of asset tokens.
idleCapital
idleCapitalfunction idleCapital(address account) external view returns (uint256);Returns the idle capital of the borrower.
withdrawIdleCapital
withdrawIdleCapitalfunction withdrawIdleCapital(uint256 amount) external;Allows borrowers to withdraw idle capital from the system.
Last updated
