DeFi Protocols Collateral Information
curl --request GET \
--url https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}import requests
url = "https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}', 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.diadata.org/v1/synthasset/{blockchain}/{protocol}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.diadata.org/v1/synthasset/{blockchain}/{protocol}"
req, _ := http.NewRequest("GET", url, nil)
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.diadata.org/v1/synthasset/{blockchain}/{protocol}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
// Response
}
DeFi Data
DeFi Protocols Collateral Information
The endpoint provides information on the health factor of DeFi protocols.
GET
/
v1
/
synthasset
/
{blockchain}
/
{protocol}
DeFi Protocols Collateral Information
curl --request GET \
--url https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}import requests
url = "https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}', 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.diadata.org/v1/synthasset/{blockchain}/{protocol}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.diadata.org/v1/synthasset/{blockchain}/{protocol}"
req, _ := http.NewRequest("GET", url, nil)
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.diadata.org/v1/synthasset/{blockchain}/{protocol}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diadata.org/v1/synthasset/{blockchain}/{protocol}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
// Response
}
It takes into consideration outstanding loans, contracts’ balance and compares it to synthetic token issuance. This helps to make sure that all assets are fully collateralized.
Currently only Aave V2 and Aave V3 are supported on Ethereum and Avalanche blockchains.
It is possible to receive collateral information for a single token by using token filter as in example below:
To receive all asset updates data during the selected period use
https://api.diadata.org/v1/synthasset/Avalanche/Aave-V3?address=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7
starttime and endtime filter parameters with timestamps as inputs. Here is an example:
https://api.diadata.org/v1/synthasset/Avalanche/Aave-V3?address=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7\&starttime=1664502770\&endtime=1664531570
Path Parameters
string
required
Ethereum or Avalanche
string
required
Aave
string
Token contract address. You can use either underlying token address or
synthetic token to receive the data
integer
Unix timestamp setting the start of the return array
integer
Unix timestamp setting the end of the return array
{
// Response
}
Was this page helpful?