🐄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

NameTypeDescription

protocol*

String

slug of the protocol

Query Parameters

NameTypeDescription

network*

String

network

[
   {
      "id":"hop-polygon-0x7bceda1db99d64f25efa279bb11ce48e15fda427",
      "network":{
         "name":"POLYGON",
         "logo":"https://static.defitrack.io/images/networks/polygon.png",
         "chainId":137
      },
      "protocol":{
         "name":"HOP",
         "logo":"https://static.defitrack.io/images/protocols/hop.jpg",
         "slug":"hop"
      },
      "name":"Hop ETH LP Token Staking Rewards",
      "stakedToken":{
         "address":"0x971039bf0a49c8d8a675f839739ee7a42511ec91",
         "name":"Hop ETH LP Token",
         "decimals":18,
         "symbol":"HOP-LP-ETH",
         "logo":null,
         "type":"HOP"
      },
      "reward":[
         {
            "address":"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
            "name":"Wrapped Matic",
            "decimals":18,
            "symbol":"WMATIC",
            "logo":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png",
            "type":"SINGLE"
         }
      ],
      "contractAddress":"0x7bceda1db99d64f25efa279bb11ce48e15fda427",
      "vaultType":"hop-staking-rewards",
      "marketSize":0.0,
      "apr":null
   }
]

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

NameTypeDescription

protocol*

String

slug of the protocol

Query Parameters

NameTypeDescription

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

[
   {
      "id":"hop-polygon-0x7bceda1db99d64f25efa279bb11ce48e15fda427",
      "network":{
         "name":"POLYGON",
         "logo":"https://static.defitrack.io/images/networks/polygon.png",
         "chainId":137
      },
      "protocol":{
         "name":"HOP",
         "logo":"https://static.defitrack.io/images/protocols/hop.jpg",
         "slug":"hop"
      },
      "name":"Hop ETH LP Token Staking Rewards",
      "stakedToken":{
         "address":"0x971039bf0a49c8d8a675f839739ee7a42511ec91",
         "name":"Hop ETH LP Token",
         "decimals":18,
         "symbol":"HOP-LP-ETH",
         "logo":null,
         "type":"HOP"
      },
      "reward":[
         {
            "address":"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
            "name":"Wrapped Matic",
            "decimals":18,
            "symbol":"WMATIC",
            "logo":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/polygon/assets/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270/logo.png",
            "type":"SINGLE"
         }
      ],
      "contractAddress":"0x7bceda1db99d64f25efa279bb11ce48e15fda427",
      "vaultType":"hop-staking-rewards",
      "marketSize":0.0,
      "apr":null
   }
]

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

NameTypeDescription

id*

String

id of the lending market

Query Parameters

NameTypeDescription

network*

String

network we want to work on

Request Body

NameTypeDescription

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.

{
  "transactions": [
    {
      "to": "0x78AB636351c1C5f117C1442B82d14aB3a92F8464",
      "encodedFunction": "0xa0712d68000000000000000000000000000000000000000000000000000862601baa25ad"
    }
  ]
}

Last updated