Aggregator
Last updated
Was this helpful?
Last updated
Was this helpful?
The core contract is crucial for verifying the legitimacy and alignment of matched offers. The matchOffersV3()
function performs several checks, including ensuring that data from multiple orders are compatible. The caller of matchOffersV3
is rewarded with 15% of the fees charged to the borrower. Given that anyone can execute this function, it's essential that all conditions.
Ratio of lend and borrow orders
Validation of oracle prices
Verification of duration
Types of tokens involved
This thorough verification process ensures smooth and secure operations.
To ensure that the matching process respects the borrowing parameters, individual lending offers do not need to precisely match the conditions of the borrow order. Instead, the weighted average of parameters across all lending offers should align with the borrowing requirements, allowing for greater flexibility and optimization in matching offers.
matchOffersV3
Function Overview
The matchOffersV3
function facilitates the matching of lending orders with a borrow order. The core purpose is to ensure the lending offers meet the borrowing needs while maintaining specified financial ratios and limits, ensuring legitimacy and compliance with established loan and collateral parameters.
lendOrders: Array of addresses, each representing a lending offer.
lendAmountPerOrder: Array indicating the amount to be borrowed from each lending order.
porcentageOfRatioPerLendOrder: Array indicating the ratio percentage of collateral to principle that each lending order is offering.
borrowOrder: Address of the borrowing order.
principles: Array of principles the borrower intends to acquire.
indexForPrinciple_BorrowOrder: Array defining the index of each principle in the accepted principles of the borrow order.
indexForCollateral_LendOrder: Array defining the index of each collateral in the accepted collaterals of the lend order.
indexPrinciple_LendOrder: Array defining the index of each principle within the lend order's principles.