API

Developers > API

Authentication

For authentication, users need to use the Bearer authentication scheme by adding the following header to their request: Authorization -> Bearer <token>.

To request full access to the APIs please fill out this form.

Network endpoints

Idle's smart contracts are deployed on multiple networks, hence users should use the appropriate endpoint to retrieve the information needed

  • Ethereum mainnet https://api.idle.finance

  • Polygon zkEVM https://api-zkevm.idle.finance

  • OP mainnet: https://api-optimism.idle.finance

Endpoints

pools

GET api.idle.finance

Return all the network pools for both BY and YTs.

Headers

NameTypeDescription

<token>*

Authentication using Bearer token

tvls

GET api.idle.finance

Return the total value locked (TVL) per underlying token

Headers

NameTypeDescription

<token>*

String

Authentication using Bearer token

rates

GET api.idle.finance

Return historical daily data for Senior Best Yield vaults in a given calendar range.

Path Parameters

NameTypeDescription

<address>*

String

Underlying token address

Query Parameters

NameTypeDescription

<params>

String

Params to filter data

frequency

86400

Seconds in one day

Headers

NameTypeDescription

<token>*

String

Authentication using Bearer token

junior-rates

GET api.idle.finance

Return historical daily data for Junior Best Yield vaults in a given calendar range.

Path Parameters

NameTypeDescription

<address>*

String

Underlying token address

Query Parameters

NameTypeDescription

<params>

String

Params to filter data

frequency

86400

Seconds in one day

Headers

NameTypeDescription

<token>*

String

Authentication using Bearer token

The query string params are:

  • start: filter results from a specific timestamp

  • end: filter results to a specific timestamp

  • isRisk (true/false): if true returns only result for risk-adjusted strategy (deprecated), if false returns only result for Best Yield vaults

  • frequency: seconds between two records

  • order (asc/desc): order results by timestamp

  • limit: limit results

Request examples

  • Return historical daily data for the Senior Best Yield DAI vault from 22 July 2020 to 24 July 2020 in descending order.

https://api.idle.finance/rates/0x6b175474e89094c44da98b954eedeac495271d0f?start=1595412616&end=1595581466&isRisk=false&frequency=86400&order=desc
  • Return the latest data for Senior Best Yield DAI vault.

https://api.idle.finance/rates/0x6b175474e89094c44da98b954eedeac495271d0f?isRisk=false&order=desc&limit=1
  • Return the available Yield Tranches on Optimism

cURL
curl -H "Authorization: Bearer YOUR_TOKEN" "https://api-zkevm.idle.finance/pools"
Axios
const data = await axios
  .get("https://api-zkevm.idle.finance/pools", {
    headers:{ Authorization: `Bearer YOUR_TOKEN` }
  })
  .catch(err => {
    // Handle request error
  });
Request
const request = require('request');

const apiUrl = 'https://api-zkevm.idle.finance/pools';
const accessToken = 'YOUR_TOKEN';

const options = {
  url: apiUrl,
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${accessToken}`
  },
};

request(options, (error, response, body) => {
  if (error) {
    console.error(error);
  } else {
    console.log(response.statusCode);
    console.log(body);
  }
});

Last updated