🐄Farming Markets
Defitrack tries to track various farming 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.
Our definition of farming is any one of the following:
Staking
Vaults
Liquidity Mining
General Farming
Fetching all supported markets for a specific protocol
Return a list of Farming Markets, which contain information about which tokens can be put in a vault/farm on a specific platform. It often returns the APR, which is the rate you get for providing your assets to the farming pool. Depending on the type of pool (autocompounding like Beefy Finance), the APR is the APY.
Fetches all staking markets for a specific protocol on a specific network.
GET
https://api.decentri.fi/{protocol}/staking/all-markets?network={network}
Path Parameters
Name | Type | Description |
---|---|---|
protocol* | String | slug of the protocol |
Query Parameters
Name | Type | Description |
---|---|---|
network* | String | network |
Fetch all farming markets pertaining to a specific token and network
Return a list of Farming markets on a specific network for a specific token. This can be used to search for a lending market on a specific protocol (like Beefy Finance) using DAI as your asset to be put in the specific farm or vault.
Fetch staking markets for a specific protocol, token and network
GET
https://api.decentri.fi/{protocol}/staking/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 Farming Market
When fetching farming 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 a specificf 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