Lending Protocol Summary Metrics
curl --request GET \
--url https://api.amberdata.com/defi/lending/{protocolId}/metrics/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/defi/lending/{protocolId}/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/lending/{protocolId}/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/lending/{protocolId}/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/lending/{protocolId}/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/lending/{protocolId}/metrics/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/defi/lending/{protocolId}/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": {
"data": {
"metrics": [
{
"timestamp": "2023-04-15 23:59:59 999",
"totalDepositedUSD": 6222493181.885701,
"totalBorrowedUSD": 1823899948.8358312,
"cumulativeLiquidatedUSD": 1191296637.9286466,
"cumulativeProtocolRevenueUSD": 37393417.20677932,
"cumulativeInterestAccumulatedUSD": 306905185.2241058,
"intervalProtocolRevenueUSD": 19426.00786467653,
"intervalInterestAccumulatedUSD": 129690.42546114429,
"intervalNumberOfDeposits": 194,
"intervalNumberOfWithdraws": 167,
"intervalNumberOfRepays": 84,
"intervalNumberOfBorrows": 135,
"intervalNumberOfLiquidations": 0,
"intervalNumberOfUsers": 184,
"intervalDepositedUSD": 76866301.15099154,
"intervalWithdrawnUSD": 54899588.095887944,
"intervalRepaidUSD": 27420866.29421422,
"intervalBorrowedUSD": 30527102.567837324,
"intervalLiquidatedUSD": 0,
"intervalFlashLoanedUSD": 4162717.1348569775
}
]
}
}
}Lending - Metrics
Lending Protocol Summary Metrics
This API provides aggregated insights into the lending protocols.
GET
/
lending
/
{protocolId}
/
metrics
/
summary
Lending Protocol Summary Metrics
curl --request GET \
--url https://api.amberdata.com/defi/lending/{protocolId}/metrics/summary \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/defi/lending/{protocolId}/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/lending/{protocolId}/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/lending/{protocolId}/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/lending/{protocolId}/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/lending/{protocolId}/metrics/summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/defi/lending/{protocolId}/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": {
"data": {
"metrics": [
{
"timestamp": "2023-04-15 23:59:59 999",
"totalDepositedUSD": 6222493181.885701,
"totalBorrowedUSD": 1823899948.8358312,
"cumulativeLiquidatedUSD": 1191296637.9286466,
"cumulativeProtocolRevenueUSD": 37393417.20677932,
"cumulativeInterestAccumulatedUSD": 306905185.2241058,
"intervalProtocolRevenueUSD": 19426.00786467653,
"intervalInterestAccumulatedUSD": 129690.42546114429,
"intervalNumberOfDeposits": 194,
"intervalNumberOfWithdraws": 167,
"intervalNumberOfRepays": 84,
"intervalNumberOfBorrows": 135,
"intervalNumberOfLiquidations": 0,
"intervalNumberOfUsers": 184,
"intervalDepositedUSD": 76866301.15099154,
"intervalWithdrawnUSD": 54899588.095887944,
"intervalRepaidUSD": 27420866.29421422,
"intervalBorrowedUSD": 30527102.567837324,
"intervalLiquidatedUSD": 0,
"intervalFlashLoanedUSD": 4162717.1348569775
}
]
}
}
}Authorizations
Headers
[Optional] The id of the blockchain for which you want data from. Defaults to ethereum-mainnet if not specified. Use the Information Protocols API to view the supported protocol and blockchain id combinations.
Available options:
ethereum-mainnet, polygon-mainnet, avalanche-mainnet, arbitrum-mainnet, optimism-mainnet Path Parameters
Available options:
aavev2, aavev3, makerdao, compoundv2 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 before this date (exclusive).
[Formats] seconds | milliseconds | iso8601
[Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00
[Optional] Time format of the timestamps in the return payload.
Available options:
milliseconds, ms, iso, iso8601, hr, human_readable Was this page helpful?