description |
---|
Developers > API |
For authentication, users need to use the Bearer authentication scheme by adding the following header to their request: Authorization -> Bearer <token>
.
{% hint style="info" %} To request full access to the APIs please fill out this form. {% endhint %}
Idle's smart contracts are deployed on multiple networks, hence users should use the appropriate endpoint to retrieve the information needed
- Ethereum
https://api.idle.finance
- Polygon zkEVM
https://api-zkevm.idle.finance
- Optimism
https://api-optimism.idle.finance
GET
api.idle.finance
return all the network pools for both Best Yield and Yield Tranches vaults.
Name | Type | Description |
---|---|---|
<token>* | Authentication using Bearer token |
GET
api.idle.finance
return the total value locked (TVL) per underlying token.
Name | Type | Description |
---|---|---|
<token>* | String | Authentication using Bearer token |
GET
api.idle.finance
return historical daily data for Best Yield vaults in a given calendar range.
Name | Type | Description |
---|---|---|
<address>* | String | Underlying token address |
Name | Type | Description |
---|---|---|
<params> | String | Params to filter data |
frequency | 86400 | Seconds in one day |
Name | Type | Description |
---|---|---|
<token>* | String | Authentication using Bearer token |
{% tabs %} {% tab title="" %} The query string params are:
start
: filter results from a specific timestampend
: filter results to a specific timestampisRisk
(true/false): if true returns only results for risk-adjusted strategy (deprecated), if false returns only results for Best Yield vaultsfrequency
: seconds between two recordsorder
(asc/desc): order results by timestamplimit
: limit results {% endtab %}
{% tab title="
" %} Represents the underlying token address:- DAI:
0x6b175474e89094c44da98b954eedeac495271d0f
- USDC:
0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
- USDT:
0xdac17f958d2ee523a2206206994597c13d831ec7
- WETH:
0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
{% endtab %} {% endtabs %}
- Return historical daily data for the Best Yield DAI vault from 22 July 2020 to 24 July 2020 in descending order.
{% code overflow="wrap" %}
https://api.idle.finance/rates/0x6b175474e89094c44da98b954eedeac495271d0f?start=1595412616&end=1595581466&isRisk=false&frequency=86400&order=desc
{% endcode %}
- Return the latest data for Best Yield DAI vault.
https://api.idle.finance/rates/0x6b175474e89094c44da98b954eedeac495271d0f?isRisk=false&order=desc&limit=1
- Return the available Yield Tranches on Polygon zkEVM
{% code title="cURL" overflow="wrap" %}
curl -H "Authorization: Bearer YOUR_TOKEN" "https://api-zkevm.idle.finance/pools"
{% endcode %}
{% code title="Axios" %}
const data = await axios
.get("https://api-zkevm.idle.finance/pools", {
headers:{ Authorization: `Bearer YOUR_TOKEN` }
})
.catch(err => {
// Handle request error
});
{% endcode %}
{% code title="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);
}
});
{% endcode %}