mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
* ic * revert package lock change * bump version --------- Co-authored-by: 0xngmi <0xngmi@protonmail.com>
26 lines
607 B
JavaScript
26 lines
607 B
JavaScript
const sdk = require("@defillama/sdk");
|
|
const { toUSDTBalances } = require("../helper/balances");
|
|
const { request, gql } = require("graphql-request");
|
|
|
|
async function tvlFromGraph() {
|
|
const graphUrl =
|
|
sdk.graph.modifyEndpoint('BRUJ3Y4Fpq4VuvoCAi4p9qv1SxZ6ghVtMK1Rg8igfxmi');
|
|
const graphQuery = gql`
|
|
query {
|
|
positionManagerFactories(first: 1) {
|
|
protocolTVL
|
|
}
|
|
}
|
|
`;
|
|
|
|
const res = await request(graphUrl, graphQuery);
|
|
const tvl = res.positionManagerFactories[0].protocolTVL;
|
|
return toUSDTBalances(tvl);
|
|
}
|
|
|
|
module.exports = {
|
|
polygon: {
|
|
tvl: tvlFromGraph,
|
|
},
|
|
};
|