mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-04-29 13:25:30 +08:00
Add project nowswap
This commit is contained in:
25
projects/nowswap/index.js
Normal file
25
projects/nowswap/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const retry = require('../helper/retry')
|
||||
const axios = require("axios");
|
||||
const { GraphQLClient, gql } = require('graphql-request')
|
||||
|
||||
async function fetch() {
|
||||
|
||||
var endpoint = 'https://api.thegraph.com/subgraphs/name/curiosthoth/nowswap'
|
||||
var graphQLClient = new GraphQLClient(endpoint)
|
||||
|
||||
var query = gql`
|
||||
{
|
||||
nowswapFactories(first: 1) {
|
||||
totalLiquidityUSD
|
||||
totalLiquidityETH
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const results = await retry(async bail => await graphQLClient.request(query))
|
||||
return parseFloat(results.nowswapFactories[0].totalLiquidityUSD)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
fetch
|
||||
}
|
||||
Reference in New Issue
Block a user