이더넷 DEX GraphQL API 및 예제
15447 단어 producttutorialbitqueryapis
몇 가지 예를 보여 드리기 전에 다음과 같은 몇 가지 주의해야 할 중요한 사항이 있습니다.
최상위 DEX 프로토콜
다음 조회는 거래 수량에 따라 top DEX 프로토콜을 반환합니다.
View this gist on GitHub
결실
{
"data": {
"ethereum": {
"dexTrades": [
{
"protocol": "Uniswap v2",
"started": "2020-05-05",
"trades": 24836192
},
{
"protocol": "IDEX",
"started": "2017-09-27",
"trades": 11819652
},
{
"protocol": "EtherDelta",
"started": "2016-07-09",
"trades": 7441188
},
{
"protocol": "Uniswap",
"started": "2018-10-27",
"trades": 4011690
},
{
"protocol": "Zerox Exchange v2",
"started": "2018-09-18",
"trades": 2437436
},
...
...
...
DEX 계약의 최신 거래
다음 쿼리에서는 모든 DEX 프로토콜에 대한 최신 거래를 가져오는 방법을 보여 줍니다.이 질의에서는 Uniswap V2 프로토콜을 예로 들 수 있습니다.
View this gist on GitHub
결실
{
"data": {
"ethereum": {
"dexTrades": [
{
"protocol": "Uniswap v2",
"buyCurrency": {
"symbol": "USDT",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
"buyAmount": 1842158918.313746,
"sellCurrency": {
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sellAmount": 4977863.830826052,
"trades": 379716
},
{
"protocol": "Uniswap v2",
"buyCurrency": {
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"buyAmount": 4920992.445139087,
"sellCurrency": {
"symbol": "USDT",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
"sellAmount": 1831207530.946584,
"trades": 368346
},
...
...
...
DEX 계약에 대한 특정 통화
현재 특정 화폐 쌍의 최신 거래를 원하시면 아래 조회를 사용하십시오.우리는 USDT의 최신 거래를 얻고 있다 — 이 질의의 Uniswap 프로토콜(V2)의 통화 쌍입니다.
보시다시피, 당신은 지폐의 최신 거래를 얻기 위해 지폐의 스마트 계약 주소를 전달해야 합니다.
여기서 우리는
0xdac17f958d2ee523a2206206994597c13d831ec7을 통해 buyCurrency을 얻을 것이다. 이것은 USDT 기호화폐의 주소이다.0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2은 sellCurrency을 대표하며 WETH 영패의 주소입니다.View this gist on GitHub
결실
{
"data": {
"ethereum": {
"dexTrades": [
{
"block": {
"height": 11067734,
"timestamp": {
"iso8601": "2020-10-16T15:21:58Z"
}
},
"transaction": {
"hash": "0xa71a2c54355fb04b93d891a0750d4006238d8960da19db39e33d15c43debe08b"
},
"tradeIndex": "8",
"buyCurrency": {
"symbol": "USDT",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
"buyAmount": 472.192504,
"sellCurrency": {
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sellAmount": 1.2889359336599604,
"maker": {
"address": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
"annotation": "Router 2, Uniswap, Router"
},
"taker": {
"address": "0x0b7ded783106803dc03197028d26c86e548910a5",
"annotation": null
},
"protocol": "Uniswap v2",
"smartContract": {
"address": {
"address": "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852",
"annotation": null
},
"contractType": "DEX"
}
},
...
...
...
DEX의 통화 쌍 OHLC 데이터
(OHLC라고도 함)은 OHLC 도표를 만드는 데 사용되는 데이터로 이 도표는 Open-high-low-close의 가격이 시간에 따라 변화하는 것을 나타낸다.
다음 쿼리를 사용하면 DEX 계약의 모든 통화 쌍에 대한 OHLC 데이터를 얻을 수 있습니다.
이 조회에서, 우리는 5분 간격으로 USDT-WETH 화폐 쌍의 OHLC 데이터를 얻을 것이다.
우리는 아래의 시간 간격 단위를 지원한다.
timeInterval {
minute(count: 5)
}
timeInterval {
day(count: 1)
}
다음은 Uniswap 프로토콜에서 USDT-WETH 통화 쌍의 5분 OHLC 데이터를 검색한 것입니다.financial instrument
View this gist on GitHub
결실
{
"data": {
"ethereum": {
"dexTrades": [
{
"timeInterval": {
"minute": "2020-10-10 00:00:00"
},
"buyCurrency": {
"symbol": "USDT",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
"buyAmount": 15094.490436,
"sellCurrency": {
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sellAmount": 41.44903367094046,
"trades": 15,
"maximum_price": 0.002746776341103444,
"minimum_price": 0.002737048849470252,
"open_price": "0.002738970885840717",
"close_price": "0.002746681535948033"
},
{
"timeInterval": {
"minute": "2020-10-10 00:05:00"
},
"buyCurrency": {
"symbol": "USDT",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
"buyAmount": 20978.805418,
"sellCurrency": {
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sellAmount": 57.611814558084596,
"trades": 25,
"maximum_price": 0.002746774536198633,
"minimum_price": 0.002738320503436713,
"open_price": "0.002739092079021605",
"close_price": "0.002746774536198633"
},
...
...
...
특정 토큰의 월간 DEX 거래량
다음 쿼리에서는 모든 DEX 계약에 명시된 토큰의 총 거래량을 제공합니다.예를 들어 아래의 조회에서 우리는 모든 DEX에서 USDT 기호화폐의 거래량을 얻었다.
참고: 아래 조회의 데이터를 얻기 위해 USDT 토큰의 계약 주소
0xdac17f958d2ee523a2206206994597c13d831ec7을 전달하고 있습니다.우리의 조회는 영패 이름을 식별할 수 없습니다.그것들은 스마트 계약 주소만 식별한다.따라서 다른 기호화폐의 거래량을 얻고 싶으면 해당 기호화폐의 계약 주소를 사용하세요.View this gist on GitHub
결실
{
"data": {
"ethereum": {
"dexTrades": [
{
"date": {
"date": "2018-08"
},
"amount": 195789.099416,
"currency": {
"symbol": "USDT"
}
},
{
"date": {
"date": "2018-09"
},
"amount": 304211.822172,
"currency": {
"symbol": "USDT"
}
},
...
...
...
블록체인 조사에 대한 질문이나 도움이 필요하시면 저희
을 클릭하십시오.또한 블록체인 데이터 API를 찾고 있다면 알려 주십시오.다음에도 관심을 가질 수 있습니다.
Bitquery 정보
은 하나의 소프트웨어 도구로 통일된 방식으로 블록 체인 네트워크 해석, 인덱스, 방문, 검색과 사용 정보를 통일하는 데 사용된다.Dell 제품은 다음과 같습니다.
제품에 대해 궁금한 사항이 있으면 DEX API으로 문의하거나 이메일 Telegram channel으로 문의하십시오.또한 아래의 시사통신을 구독해 주십시오. 저희는 귀하께 암호화폐 분야의 최신 정보를 제공할 것입니다.
게시물 [email protected]이 Ethereum DEX GraphQL APIs with Examples에 가장 먼저 올라왔다.
Reference
이 문제에 관하여(이더넷 DEX GraphQL API 및 예제), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/coinmonks/ethereum-dex-graphql-apis-with-examples-5ceo텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)