🏦Lending Markets
Defitrack tries to track various lending markets across various chains. We try to maintain an up to date database of active and inactive markets in order to locate user funds, as well as locate opportunities.
Lending Markets
Fetching all supported markets for a specific protocol
Return a list of Lending Markets, which contain information about which tokens can be lent out on a specific platform. It often returns the APR, which is the rate you get for providing your assets to the lending pool.
Fetches all lending markets for a specific protocol.
GET
https://api.decentri.fi/{protocol}/lending/all-markets
Path Parameters
Name | Type | Description |
---|---|---|
protocol* | String | slug of the protocol |
Fetch all lending markets pertaining to a specific token and network
Return a list of Lending markets on a specific network for a specific token. This can be used to search for a lending market on a specific protocol (like compound) using DAI as your asset to be lent out.
Fetch lending markets for a specific protocol, token and network
GET
https://api.decentri.fi/{protocol}/lending/markets?token={token}&network={network}
Path Parameters
Name | Type | Description |
---|---|---|
protocol* | String | slug of the protocol |
Query Parameters
Name | Type | Description |
---|---|---|
token* | String | address of the token we want to find a lending market for |
network* | String | network we want to find a lending market on |
Prepare an investment transaction for a Lending Market
When fetching Lending Markets, the field prepareInvestmentSupported is returned. This indicates whether or not Defitrack supports preparation of transactions for the underlying market. In order to create an investment transaction to the underlying protocol, the following endpoint can be used.
The result of this endpoint can be used to construct and sign transaction, without having to know the ABI. The encoded function and contract address are returned.
Prepare investment transaction for lending market
POST
https://api.defitrack.io/{protocol}/lending/markets/{id}?network={network}
Has to be sent in JSON format. Returns a list transactions that need to be signed and submitted in order.
Path Parameters
Name | Type | Description |
---|---|---|
id* | String | id of the lending market |
Query Parameters
Name | Type | Description |
---|---|---|
network* | String | network we want to work on |
Request Body
Name | Type | Description |
---|---|---|
user* | String | address of the user |
amount | BigInteger | can be left empty. If empty, all available balance of the required token will be used to construct the transaction. |
Last updated