Stablecoins in DeFi Lending - Aggregate Insights
curl --request GET \
--url https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 200,
"title": "OK",
"description": "Successful request",
"payload": {
"metadata": {
"blockchainId": "avalanche-mainnet",
"protocols": [
"aavev2"
]
},
"data": {
"metrics": [
{
"timestamp": 1685145599999,
"depositedUSD": 12245600.841895984,
"borrowedUSD": 111607.91129839412,
"withdrawnUSD": 8063459.152456514,
"repaidUSD": 214781.74953266996,
"liquidatedUSD": 0,
"liquidatedProfitUSD": 0,
"flashLoanedUSD": 55544.3264730185,
"interestEarnedUSD": 2590.714350187115,
"interestPaidUSD": 287.8571500207906,
"numberOfDeposits": 186,
"numberOfBorrows": 37,
"numberOfWithdraws": 191,
"numberOfRepays": 26,
"numberOfLiquidations": 0,
"depositRatio": 0.8472260491461453,
"borrowRatio": 0.01629069721658102,
"withdrawRatio": 1.176971865549357,
"liquidationRatio": 0,
"totalDepositedUSD": 63039186.64521183,
"totalCollateralUSD": 159364840.70693165,
"totalBorrowedUSD": 39488498.24221587,
"cumulativeLiquidatedUSD": 25058036.913995497,
"cumulativeLiquidatedProfitUSD": 1130173.4298008725,
"cumulativeInterestEarnedUSD": 28758573.133691713,
"totalUtilizationRatio": 0.6264119247676753,
"totalDepositConcentration": 0.18215099394158993,
"totalBorrowConcentration": 0.37577326222343804
}
]
}
}
}Stablecoins
Stablecoins in DeFi Lending - Aggregate Insights
Easily analyze a stablecoin’s metrics across multiple DeFi lending protocols.
GET
/
stablecoins
/
{assetSymbol}
/
lending
/
metrics
/
summary
Stablecoins in DeFi Lending - Aggregate Insights
curl --request GET \
--url https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/defi/stablecoins/{assetSymbol}/lending/metrics/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 200,
"title": "OK",
"description": "Successful request",
"payload": {
"metadata": {
"blockchainId": "avalanche-mainnet",
"protocols": [
"aavev2"
]
},
"data": {
"metrics": [
{
"timestamp": 1685145599999,
"depositedUSD": 12245600.841895984,
"borrowedUSD": 111607.91129839412,
"withdrawnUSD": 8063459.152456514,
"repaidUSD": 214781.74953266996,
"liquidatedUSD": 0,
"liquidatedProfitUSD": 0,
"flashLoanedUSD": 55544.3264730185,
"interestEarnedUSD": 2590.714350187115,
"interestPaidUSD": 287.8571500207906,
"numberOfDeposits": 186,
"numberOfBorrows": 37,
"numberOfWithdraws": 191,
"numberOfRepays": 26,
"numberOfLiquidations": 0,
"depositRatio": 0.8472260491461453,
"borrowRatio": 0.01629069721658102,
"withdrawRatio": 1.176971865549357,
"liquidationRatio": 0,
"totalDepositedUSD": 63039186.64521183,
"totalCollateralUSD": 159364840.70693165,
"totalBorrowedUSD": 39488498.24221587,
"cumulativeLiquidatedUSD": 25058036.913995497,
"cumulativeLiquidatedProfitUSD": 1130173.4298008725,
"cumulativeInterestEarnedUSD": 28758573.133691713,
"totalUtilizationRatio": 0.6264119247676753,
"totalDepositConcentration": 0.18215099394158993,
"totalBorrowConcentration": 0.37577326222343804
}
]
}
}
}Authorizations
Headers
[Optional] The id of the blockchain for which you want data from. Defaults to ethereum-mainnet if not specified.
Available options:
ethereum-mainnet, avalanche-mainnet, arbitrum-mainnet, optimism-mainnet Path Parameters
Available options:
USDC, USDT, DAI, BUSD, TUSD Query Parameters
[Optional] Payload only includes data after this date (inclusive).
[Formats] seconds | milliseconds | iso8601
[Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00
[Optional] Payload only includes data after this date (inclusive).
[Formats] seconds | milliseconds | iso8601
[Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00
Determines whether the metrics are aggregated by hour or by day.
Available options:
days, hours Drill down into the stablecoin's metrics by specifying a protocol.
Available options:
aavev2, aavev3, makerdao, compoundv2, compoundv3 [Optional] Time format of the timestamps in the return payload.
Available options:
milliseconds, ms, iso, iso8601, hr, human_readable Was this page helpful?