Loan Endpoints
The endpoints below allow you to interact with Loan.
Contract Name
ApproveTrade
Mainnet Addresses
Network | Contract Address |
Arbitrum |
|
Base |
|
Ethereum |
|
Polygon |
|
Bitlayer |
|
BSC |
|
Smart Contract Interface
1. Get the Nonce of the User's Order
Fetch the nonce of the order created by the user.
Function:
nonces(address maker) returns (uint256)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Creator Address |
Response Parameter
Parameter Name | Type | Description |
|
| User order nonce |
2. Calculate the Hash of the Order
Calculate the hash of an order, required when creating the order.
Function:
hashOrder(Order memory order) returns (bytes32)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order details |
Response Parameter
Parameter Name | Type | Description |
|
| User order hash |
3. Lend Funds Using the Signed Order Information
Use the borrower's signed order to lend funds.
Function:
loan(Order memory loanOrder)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order information from centralized interface |
Order Structure
Parameter Name | Required | Type | Description |
| Yes |
| Borrower Address |
| Yes |
| Lender address (use 0 address) |
| Yes |
| List of collateral assets |
| Yes |
| Funding token address |
| Yes |
| Loan amount |
| Yes |
| Fundraising deadline |
| Yes |
| Loan duration |
| Yes |
| Interest accrued per second after loan |
| Yes |
| Redemption deadline (use 0 if not applicable) |
| Yes |
| Signed transaction data |
4. Repay Principal and Interest to Redeem Asset
Allows the borrower to repay the principal and interest to reclaim the collateral.
Function:
redeem(bytes32 orderHash)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order hash (from interface) |
5. Liquidate Overdue Orders
Allows the lender to liquidate an overdue order and claim the collateral.
Function:
liquidate(bytes32 orderHash)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order hash (from interface) |
6. Cancel Order
Allows the creator to cancel an order.
Function:
cancelOrder(Order memory order)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order information from centralized interface |
7. Cancel Multiple Orders
Allows the creator to cancel multiple orders in one call.
Function:
cancelMultipleOrders(Order[] memory orders)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| List of order information (from interface) |
8. Cancel All Orders
Allows the creator to cancel all orders they have created.
Function:
cancelAllOrders()
Request Parameters
This function does not take any parameters.
9. Buy Assets Using Signed Order
Allows a buyer to purchase assets using the seller's signed order.
Function:
buy(Order memory sellOrder)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order information from centralized interface |
10. Sell Assets Using Buyer's Signed Order
Allows a seller to sell assets using the buyer's signed order.
Function:
sell(Order memory buyOrder)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order information from centralized interface |
11. Get Platform Loan Fee Rate
Returns the platform commission ratio for loans.
Function:
feeRate() returns (uint256)
Response Parameter
Parameter Name | Type | Description |
|
| Platform commission ratio (divide by 10,000) |
12. Get Platform Repayment Interest Fee Rate
Returns the platform commission rate for repayment interest.
Function:
interestFeeRate() returns (uint256)
Response Parameter
Parameter Name | Type | Description |
|
| Interest commission ratio (divide by 10,000) |
13. Get Minimum Repayment Interest Ratio
Returns the minimum interest rate for repayment.
Function:
interestFeeRate() returns (uint256)
Response Parameter
Parameter Name | Type | Description |
|
| Minimum interest rate (divide by 10,000) |
Last updated