From 102433e7a75b01b31626ba185d4fff06b5acee81 Mon Sep 17 00:00:00 2001 From: slasher125 <74533329+slasher125@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:20:55 +0400 Subject: [PATCH] graphql-migration (#10635) * ic * revert package lock change * bump version --------- Co-authored-by: 0xngmi <0xngmi@protonmail.com> --- liquidations/aave-v2/index.ts | 5 +- liquidations/benqi/index.ts | 3 +- liquidations/compound/index.ts | 3 +- liquidations/euler/index.ts | 3 +- liquidations/mimo-protocol/index.ts | 7 +-- liquidations/trader-joe-lend/index.ts | 3 +- liquidations/venus/index.ts | 3 +- package-lock.json | 6 +-- projects/aktionariat/index.js | 5 +- projects/altr-lend/index.js | 3 +- projects/contango-v2/index.js | 11 ++-- projects/defiplaza.js | 3 +- projects/enzyme/index.js | 5 +- projects/ethalend/index.js | 3 +- projects/factor-leverage-vault/index.js | 3 +- projects/factor/index.js | 3 +- projects/horizon/collateral.js | 3 +- projects/keep.js | 5 +- projects/mmo/helper/helper.js | 2 +- projects/olympus/index.js | 3 +- projects/orbit/index.js | 3 +- projects/origami/index.js | 5 +- projects/ottopia/index.js | 3 +- projects/pacman/index.js | 3 +- projects/platypus-finance/index.js | 3 +- projects/podsfinance/constants.js | 7 +-- projects/pooltogether/v3.js | 13 ++--- projects/prime-protocol/index.js | 3 +- projects/quickswap/index.js | 3 +- projects/ren/index.js | 10 ++-- projects/rift-finance/networks.js | 5 +- projects/rubicon/index.js | 5 +- projects/sablier-v2/index.js | 9 ++-- projects/sentiment/index.js | 3 +- projects/soulswap/underworld-lending.js | 4 +- projects/steer/index.js | 15 +++--- projects/sudoswap/index.js | 3 +- projects/superfluid.js | 16 +++--- projects/sushiswap-bentobox/helper.js | 64 +++++++++++------------ projects/sushiswap-furo/furo.js | 22 ++++---- projects/sushiswap-kashi/kashi-lending.js | 11 ++-- projects/sushiswap-trident/trident.js | 11 ++-- projects/sushiswap/api.js | 3 +- projects/swaap-earn/index.js | 3 +- projects/swaap/index.js | 3 +- projects/synthetix/api.js | 3 +- projects/synthetix/apiCache.js | 3 +- projects/timeswap/index.js | 3 +- projects/unbound/index.js | 5 +- projects/unifarm/helper.js | 7 +-- projects/vela-exchange/index.js | 5 +- projects/venus-isolated-pools/index.js | 5 +- projects/zksynth/index.js | 3 +- 53 files changed, 196 insertions(+), 150 deletions(-) diff --git a/liquidations/aave-v2/index.ts b/liquidations/aave-v2/index.ts index c546df97ec3..cc80860cb01 100644 --- a/liquidations/aave-v2/index.ts +++ b/liquidations/aave-v2/index.ts @@ -1,3 +1,4 @@ +import * as sdk from "@defillama/sdk"; import { gql, request } from "graphql-request"; import { Liq } from "../utils/types"; import { getPagedGql } from "../utils/gql"; @@ -75,14 +76,14 @@ const rc: { [chain in Chains]: AaveAdapterResource } = { name: "aave", chain: Chains.ethereum, usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", - subgraphUrl: "https://api.thegraph.com/subgraphs/name/aave/protocol-v2", + subgraphUrl: sdk.graph.modifyEndpoint('8wR23o1zkS4gpLqLNU4kG3JHYVucqGyopL5utGxP2q1N'), explorerBaseUrl: "https://etherscan.io/address/", }, // [Chains.polygon]: { // name: "aave", // chain: Chains.polygon, // usdcAddress: "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", - // subgraphUrl: "https://api.thegraph.com/subgraphs/name/aave/aave-v2-matic", + // subgraphUrl: sdk.graph.modifyEndpoint('H1Et77RZh3XEf27vkAmJyzgCME2RSFLtDS2f4PPW6CGp'), // explorerBaseUrl: "https://polygonscan.com/address/", // }, }; diff --git a/liquidations/benqi/index.ts b/liquidations/benqi/index.ts index 4b3e2b70b4b..ec14a98cc0f 100644 --- a/liquidations/benqi/index.ts +++ b/liquidations/benqi/index.ts @@ -1,3 +1,4 @@ +import * as sdk from "@defillama/sdk"; import { gql } from "graphql-request"; import { getPagedGql } from "../utils/gql"; import BigNumber from "bignumber.js"; @@ -12,7 +13,7 @@ import { totalCollateralValueInUsd, } from "../utils/compound-helpers"; -const subgraphUrl = "https://api.thegraph.com/subgraphs/name/yhayun/benqi"; +const subgraphUrl = sdk.graph.modifyEndpoint('HcTvZi3fwucvRJvVmtFzNDTnomvMBk64xCLNQQg6GPAV'); const accountsQuery = gql` query accounts($lastId: ID, $pageSize: Int) { diff --git a/liquidations/compound/index.ts b/liquidations/compound/index.ts index d87100ba7bc..e646fd6a796 100644 --- a/liquidations/compound/index.ts +++ b/liquidations/compound/index.ts @@ -1,3 +1,4 @@ +import * as sdk from "@defillama/sdk"; import { gql } from "graphql-request"; import { getPagedGql } from "../utils/gql"; import BigNumber from "bignumber.js"; @@ -12,7 +13,7 @@ import { totalCollateralValueInUsd, } from "../utils/compound-helpers"; -const subgraphUrl = "https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2"; +const subgraphUrl = sdk.graph.modifyEndpoint('AAva7YSZBLar4MaxQ3MqdJDFXkkHEaCDeibKTnraex1x'); const accountsQuery = gql` query accounts($lastId: ID, $pageSize: Int) { diff --git a/liquidations/euler/index.ts b/liquidations/euler/index.ts index 5ef58aa3ad4..d0cac4c0d7c 100644 --- a/liquidations/euler/index.ts +++ b/liquidations/euler/index.ts @@ -1,9 +1,10 @@ +import * as sdk from "@defillama/sdk"; import { gql } from "graphql-request"; import { getPagedGql } from "../utils/gql"; import BigNumber from "bignumber.js"; import { Liq } from "../utils/types"; -const subgraphUrl = "https://api.thegraph.com/subgraphs/name/euler-xyz/euler-mainnet"; +const subgraphUrl = sdk.graph.modifyEndpoint('EQBXhrF4ppZy9cBYnhPdrMCRaVas6seNpqviih5VRGmU'); const accountsQuery = gql` query accounts($lastId: ID, $pageSize: Int) { diff --git a/liquidations/mimo-protocol/index.ts b/liquidations/mimo-protocol/index.ts index 9d0bc72c796..30945758a38 100644 --- a/liquidations/mimo-protocol/index.ts +++ b/liquidations/mimo-protocol/index.ts @@ -1,3 +1,4 @@ +import * as sdk from "@defillama/sdk"; import axios from "axios"; import { gql } from "graphql-request"; import BigNumber from "bignumber.js"; @@ -49,16 +50,16 @@ const getSubgraphUrl = (chain: Chain) => { switch (chain) { case Chain.ethereum: { - subgraphUrl = "https://api.thegraph.com/subgraphs/name/m19/titan"; + subgraphUrl = sdk.graph.modifyEndpoint('FV3Dw1zMs97LpVPegWZKJv4bsbsZdrob2EqLCPxdcoDS'); break; } case Chain.polygon: { - subgraphUrl = "https://api.thegraph.com/subgraphs/name/m19/titanpolygon"; + subgraphUrl = sdk.graph.modifyEndpoint('EfFLqiwngmmtE5su2t1EsFoEttoj8KWervocfab1ofYT'); break; } // case Chain.fantom: { // subgraphUrl = - // "https://api.thegraph.com/subgraphs/name/rayxpub/titanfantom"; + // sdk.graph.modifyEndpoint('DkSQLWkkiNfeNG43NJnHsW9hfih8hDt4SHFTNMQgPHJH'); // break; // } } diff --git a/liquidations/trader-joe-lend/index.ts b/liquidations/trader-joe-lend/index.ts index d922f5c9999..2e947509797 100644 --- a/liquidations/trader-joe-lend/index.ts +++ b/liquidations/trader-joe-lend/index.ts @@ -1,9 +1,10 @@ +import * as sdk from "@defillama/sdk"; import { gql } from "graphql-request"; import { getPagedGql } from "../utils/gql"; import BigNumber from "bignumber.js"; import { Liq } from "../utils/types"; -const subgraphUrl = "https://api.thegraph.com/subgraphs/name/traderjoe-xyz/lending"; +const subgraphUrl = sdk.graph.modifyEndpoint('JB5EdQqbddMjawMLYe3C5ifmhN9WKYvLdgAKoUy1CyYy'); const accountsQuery = gql` query accounts($lastId: ID, $pageSize: Int) { diff --git a/liquidations/venus/index.ts b/liquidations/venus/index.ts index b654f3312c9..703a3c635ce 100644 --- a/liquidations/venus/index.ts +++ b/liquidations/venus/index.ts @@ -1,3 +1,4 @@ +import * as sdk from "@defillama/sdk"; import { gql } from "graphql-request"; import { getPagedGql } from "../utils/gql"; import BigNumber from "bignumber.js"; @@ -15,7 +16,7 @@ import { } from "../utils/compound-helpers"; const sdk = require("@defillama/sdk"); -const subgraphUrl = "https://api.thegraph.com/subgraphs/name/venusprotocol/venus-subgraph"; +const subgraphUrl = sdk.graph.modifyEndpoint('7h65Zf3pXXPmf8g8yZjjj2bqYiypVxems5d8riLK1DyR'); const accountsQuery = gql` query accounts($lastId: ID, $pageSize: Int) { diff --git a/package-lock.json b/package-lock.json index 911a406bb5b..bce92f99678 100644 --- a/package-lock.json +++ b/package-lock.json @@ -886,9 +886,9 @@ } }, "node_modules/@defillama/sdk": { - "version": "5.0.67", - "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-5.0.67.tgz", - "integrity": "sha512-gOJACkDuPyNicL2zs0J93LkbDOkcviSaNQAvRH/wQkeXcdo7tHwN5YH59sFFE6Ge6gsCgcI0KnyuO6E0yjmo8g==", + "version": "5.0.69", + "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-5.0.69.tgz", + "integrity": "sha512-IYdT4P5vG9xt14tM9RuT1+uBUyD8oL6fdTWC3iwOlwATjWKA1kwOhucCXNFE8sc2KKugwTUfQuGp8Q3fHDxAfw==", "dependencies": { "@aws-sdk/client-s3": "^3.400.0", "@elastic/elasticsearch": "^8.13.1", diff --git a/projects/aktionariat/index.js b/projects/aktionariat/index.js index 206de03205a..aa124060512 100644 --- a/projects/aktionariat/index.js +++ b/projects/aktionariat/index.js @@ -1,8 +1,9 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const graphs = { - ethereum: "https://api.thegraph.com/subgraphs/name/aktionariat/brokerbot", - optimism: "https://api.thegraph.com/subgraphs/name/aktionariat/brokerbot-optimism", + ethereum: sdk.graph.modifyEndpoint('2ZoJCp4S7YP7gbYN2ndsYNjPeZBV1PMti7BBoPRRscNq'), + optimism: sdk.graph.modifyEndpoint('3QfEXbPfP23o3AUzcmjTfRtUUd4bfrFj3cJ4jET57CTX'), } function tvlPaged(chain) { diff --git a/projects/altr-lend/index.js b/projects/altr-lend/index.js index 7da6e46a0ba..6ae0ea96e5d 100644 --- a/projects/altr-lend/index.js +++ b/projects/altr-lend/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); // const LendingContract = "0xdc93413cbe690a1643d285c9f075b271372c9b36" const { graphQuery } = require('../helper/http') const ADDRESSES = require('../helper/coreAssets.json') @@ -9,7 +10,7 @@ async function borrowed(api) { } }` - const { loans } = await graphQuery("https://api.thegraph.com/subgraphs/name/lucidao-developer/altr-lend", query); + const { loans } = await graphQuery(sdk.graph.modifyEndpoint('AVmBsxjouEH6wvG2HCGPCNNt9eDeX2esaRZ7L7jJaTnD'), query); api.add(ADDRESSES.polygon.USDT, loans.map(i => i.amount)); return api.getBalances() } diff --git a/projects/contango-v2/index.js b/projects/contango-v2/index.js index 8cd411efc68..cf64a0e03be 100644 --- a/projects/contango-v2/index.js +++ b/projects/contango-v2/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { blockQuery } = require("../helper/http"); const { cachedGraphQuery } = require("../helper/cache"); @@ -8,27 +9,27 @@ const config = { arbitrum: { contango: CONTANGO_PROXY, contango_lens: CONTANGO_LENS_PROXY, - grapUrl: "https://api.thegraph.com/subgraphs/name/contango-xyz/v2-arbitrum", + grapUrl: sdk.graph.modifyEndpoint('BmHqxUxxLuMoDYgbbXU6YR8VHUTGPBf9ghD7XH6RYyTQ'), }, optimism: { contango: CONTANGO_PROXY, contango_lens: CONTANGO_LENS_PROXY, - grapUrl: "https://api.thegraph.com/subgraphs/name/contango-xyz/v2-optimism", + grapUrl: sdk.graph.modifyEndpoint('PT2TcgYqhQmx713U3KVkdbdh7dJevgoDvmMwhDR29d5'), }, ethereum: { contango: CONTANGO_PROXY, contango_lens: CONTANGO_LENS_PROXY, - grapUrl: "https://api.thegraph.com/subgraphs/name/contango-xyz/v2-mainnet", + grapUrl: sdk.graph.modifyEndpoint('FSn2gMoBKcDXEHPvshaXLPC1EJN7YsfCP78swEkXcntY'), }, polygon: { contango: CONTANGO_PROXY, contango_lens: CONTANGO_LENS_PROXY, - grapUrl: "https://api.thegraph.com/subgraphs/name/contango-xyz/v2-polygon", + grapUrl: sdk.graph.modifyEndpoint('5t3rhrAYt79iyjm929hgwyiaPLk9uGxQRMiKEasGgeSP'), }, xdai: { contango: CONTANGO_PROXY, contango_lens: CONTANGO_LENS_PROXY, - grapUrl: "https://api.thegraph.com/subgraphs/name/contango-xyz/v2-gnosis", + grapUrl: sdk.graph.modifyEndpoint('9h1rHUKJK9CGqztdaBptbj4Q9e2zL9jABuu9LpRQ1XkC'), }, base: { contango: CONTANGO_PROXY, diff --git a/projects/defiplaza.js b/projects/defiplaza.js index d915d241e95..ad7b2b6948b 100644 --- a/projects/defiplaza.js +++ b/projects/defiplaza.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('./helper/cache'); const { sumTokens, queryAddresses } = require('./helper/chain/radixdlt'); @@ -5,7 +6,7 @@ const { getConfig } = require('./helper/cache'); const { get } = require('./helper/http'); const sdk = require('@defillama/sdk'); -const graphUrl = 'https://api.thegraph.com/subgraphs/name/omegasyndicate/defiplaza'; +const graphUrl = sdk.graph.modifyEndpoint('4z9FBF12CrfoQJhAkWicqzY2fKYN9QRmuzSsizVXhjKa'); module.exports = { ethereum: { diff --git a/projects/enzyme/index.js b/projects/enzyme/index.js index cb3128d075f..121fe8240fd 100644 --- a/projects/enzyme/index.js +++ b/projects/enzyme/index.js @@ -1,9 +1,10 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const { sumTokens2 } = require('../helper/unwrapLPs') const config = { - polygon: { endpoint: 'https://api.thegraph.com/subgraphs/name/enzymefinance/enzyme-core-polygon' }, - ethereum: { endpoint: 'https://api.thegraph.com/subgraphs/name/enzymefinance/enzyme-core' }, + polygon: { endpoint: sdk.graph.modifyEndpoint('GCAHDyqvZBLMwqdb9U7AqWAN4t4TSwR3aXMHDoUUFuRV') }, + ethereum: { endpoint: sdk.graph.modifyEndpoint('9DLBBLep5UyU16kUQRvxBCMqko4q9XzuE4XsMMpARhKK') }, } const query = `query get_accounts($lastId: String!) { vaults( diff --git a/projects/ethalend/index.js b/projects/ethalend/index.js index 79d7fe5394f..6fbff372750 100644 --- a/projects/ethalend/index.js +++ b/projects/ethalend/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const sdk = require('@defillama/sdk') const abi = require('./abi.json') @@ -49,7 +50,7 @@ async function avaxTvl(_, _block, cb) { async function tvl(chain, block, chainId) { const balances = {} if (chain === 'polygon') { - const globalData = (await request("https://api.thegraph.com/subgraphs/name/ethalend/etha-v1", globalDataQuery, { block: block - 100 })).globalDatas + const globalData = (await request(sdk.graph.modifyEndpoint('3fJ6wwsbCeMUrsohMRsmzgzrWwRMWnEac8neYkYQuJaz'), globalDataQuery, { block: block - 100 })).globalDatas await Promise.all(globalData.filter(v => v.type === "lending").map(async v => { if (v.address === "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee") { v.address = ADDRESSES.polygon.WMATIC_2 diff --git a/projects/factor-leverage-vault/index.js b/projects/factor-leverage-vault/index.js index 33853aebb3a..88dfcb90d41 100644 --- a/projects/factor-leverage-vault/index.js +++ b/projects/factor-leverage-vault/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { blockQuery } = require('../helper/http') const queryBlock = `query data($block: Int){ @@ -11,7 +12,7 @@ const queryBlock = `query data($block: Int){ }` const SUBGRAPH_URL = - "https://api.thegraph.com/subgraphs/name/dimasriat/factor-leverage-vault"; + sdk.graph.modifyEndpoint('BZhGLLFicmKB9N9oMgDEAP8HmhVxTTjjxQA3ctGewAFc'); async function tvl(api) { const { leverageVaultPairStates } = await blockQuery(SUBGRAPH_URL, queryBlock, { api }) diff --git a/projects/factor/index.js b/projects/factor/index.js index 03023d259db..7e161dfc937 100644 --- a/projects/factor/index.js +++ b/projects/factor/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { staking } = require("../helper/staking"); const { sumTokens2 } = require('../helper/unwrapLPs'); const { cachedGraphQuery } = require('../helper/cache'); @@ -6,7 +7,7 @@ const FCTR = "0x6dD963C510c2D2f09d5eDdB48Ede45FeD063Eb36" const veFCTR = "0xA032082B08B2EF5A6C3Ea80DaEac58300F68FB73" async function tvl(api) { - const endpoint = 'https://api.thegraph.com/subgraphs/name/yanuar-ar/factor-arbitrum' + const endpoint = sdk.graph.modifyEndpoint('2ZavYD1JPYUy8HMheuYcyKCswHR5djpEq2xuWs7PzPRe') const res = await cachedGraphQuery('factor-v1', endpoint, `{vaultGeneses { id }}`) const indices = res.vaultGeneses.map(v => v.id) const uBalances = await api.multiCall({ abi: 'uint256[]:underlyingAssetsBalance', calls: indices }) diff --git a/projects/horizon/collateral.js b/projects/horizon/collateral.js index 55544343ac6..a346db5e07d 100644 --- a/projects/horizon/collateral.js +++ b/projects/horizon/collateral.js @@ -1,7 +1,8 @@ +const sdk = require("@defillama/sdk"); const { request, gql } = require("graphql-request"); const { getBlock } = require('../helper/http'); -const graph_endpoint = 'https://api.thegraph.com/subgraphs/name/rout-horizon/bsc15-issuance' +const graph_endpoint = sdk.graph.modifyEndpoint('3URCfxZm32CHDYikF3eu93YCVpDKQyofm42FUh7KkRY9') const graphQuery = gql` query get_tvl($block: Int) { snxholders(orderBy:collateral,orderDirection:desc,block: { number: $block },first:1000,skip:0, where: {initialDebtOwnership_gt: 0, debtEntryAtIndex_gt: 0}) { diff --git a/projects/keep.js b/projects/keep.js index 83c6c879fe0..00479af2c8b 100644 --- a/projects/keep.js +++ b/projects/keep.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { GraphQLClient, } = require('graphql-request') const utils = require('./helper/utils'); const sdk = require('@defillama/sdk') @@ -13,7 +14,7 @@ async function tvl() { } } `; - var endpoint = 'https://api.thegraph.com/subgraphs/name/suntzu93/tbtc'; + var endpoint = sdk.graph.modifyEndpoint('8vQM7kTwPoW37U5FWgZLRpcoMyYKExMcHr5JGgnvzxk5'); var graphQLClient = new GraphQLClient(endpoint) const results2 = await graphQLClient.request(q2) var ethStaked = parseFloat(results2.totalBondedECDSAKeeps[0].totalBonded) + parseFloat(results2.totalBondedECDSAKeeps[0].totalAvailable); @@ -39,7 +40,7 @@ async function staking() { } `; - var endpoint = 'https://api.thegraph.com/subgraphs/name/suntzu93/keepnetwork'; + var endpoint = sdk.graph.modifyEndpoint('Pg2cbxfPGJtqRBwMutR69oapbodKmcXuQRsxPRaK57S'); var graphQLClient = new GraphQLClient(endpoint) const results = await graphQLClient.request(q1) const keepPoolStaked = await utils.returnBalance('0x85Eee30c52B0b379b046Fb0F85F4f3Dc3009aFEC', '0xCf916681a6F08fa22e9EF3e665F2966Bf3089Ff1') diff --git a/projects/mmo/helper/helper.js b/projects/mmo/helper/helper.js index f92dee6d7d1..2c7c59ff279 100644 --- a/projects/mmo/helper/helper.js +++ b/projects/mmo/helper/helper.js @@ -14,7 +14,7 @@ const MtrollerABI = { async function fetch(query) { var endpoint = - "https://api.thegraph.com/subgraphs/name/ohan8/mmo-finance-active-loans"; + sdk.graph.modifyEndpoint('DUQF7Lhwu1dzz2GwyNi3eRvjZeUnMNCDFjQRA8BYpoRJ'); var graphQLClient = new GraphQLClient(endpoint); const results = await graphQLClient.request(query) diff --git a/projects/olympus/index.js b/projects/olympus/index.js index d7b4f374a62..6dc387b3ce9 100644 --- a/projects/olympus/index.js +++ b/projects/olympus/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const { blockQuery } = require("../helper/http"); const { getEnv } = require("../helper/env"); @@ -94,7 +95,7 @@ const subgraphUrls = { arbitrum: "2XQDRQ9AXhp5us6PsNyRM5BxKWeXhy3BNQLynA6YmmjA", fantom: - "https://api.thegraph.com/subgraphs/name/olympusdao/protocol-metrics-fantom", + sdk.graph.modifyEndpoint('3qSJTWdWJETFzht814HVV9rVafwRLQp3k9mZhCF39bYd'), polygon: "JCVMW1dbqectgaSLRuKSen6FKe9RPMJRQhNYZa4iTgFb", }; diff --git a/projects/orbit/index.js b/projects/orbit/index.js index 50bb44ba684..a94248dcc8d 100644 --- a/projects/orbit/index.js +++ b/projects/orbit/index.js @@ -1,9 +1,10 @@ +const sdk = require("@defillama/sdk"); const { toUSDTBalances } = require("../helper/balances"); const { request, gql } = require("graphql-request"); async function tvlFromGraph() { const graphUrl = - "https://api.thegraph.com/subgraphs/name/riccardogalbusera/orbit-subgraph"; + sdk.graph.modifyEndpoint('BRUJ3Y4Fpq4VuvoCAi4p9qv1SxZ6ghVtMK1Rg8igfxmi'); const graphQuery = gql` query { positionManagerFactories(first: 1) { diff --git a/projects/origami/index.js b/projects/origami/index.js index c92c4889f5b..22e1c67a613 100644 --- a/projects/origami/index.js +++ b/projects/origami/index.js @@ -1,8 +1,9 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const GRAPH_URLS = { - ethereum: "https://api.thegraph.com/subgraphs/name/templedao/origami-mainnet", // ethereum - arbitrum: "https://api.thegraph.com/subgraphs/name/templedao/origami-arb", // arbitrum + ethereum: sdk.graph.modifyEndpoint('GGN8RoYQBiw2Ui6wUeaKcHsBBSrQzQoryYi2feoTKwPX'), // ethereum + arbitrum: sdk.graph.modifyEndpoint('AHT1ffJhw7NWdeH3XYbWzMmy5USbB22K3ecVDu8azGuF'), // arbitrum } module.exports = { diff --git a/projects/ottopia/index.js b/projects/ottopia/index.js index 003956ae96a..0a07f498cda 100644 --- a/projects/ottopia/index.js +++ b/projects/ottopia/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { GraphQLClient, gql } = require("graphql-request"); const { staking } = require("../helper/staking"); @@ -5,7 +6,7 @@ const CLAM = "0xC250e9987A032ACAC293d838726C511E6E1C029d"; const PearlBank = "0x845EB7730a8D37e8D190Fb8bb9c582038331B48a"; async function tvl({timestamp}, block, chainBlocks) { - let endpoint = "https://api.thegraph.com/subgraphs/name/otterclam/otterclam"; + let endpoint = sdk.graph.modifyEndpoint('CejrrsnSQAxHJBpkgiBrLHQZ7h2MkK9QArM8bJvN9GuQ'); let graphQLClient = new GraphQLClient(endpoint); let query = gql` query tvl($start: BigInt!, $end: BigInt!) { diff --git a/projects/pacman/index.js b/projects/pacman/index.js index 6d2c762d539..cf82ad1db31 100644 --- a/projects/pacman/index.js +++ b/projects/pacman/index.js @@ -1,6 +1,7 @@ +const sdk = require("@defillama/sdk"); const { graphQuery } = require('../helper/http') -const subgraphUrl = "https://api.thegraph.com/subgraphs/name/pacmanfinance/pacman-arbitrum"; +const subgraphUrl = sdk.graph.modifyEndpoint('9xteTELUdzjii1yLASJm6CxSpYuS1bmE6DGWMMhgkq2k'); const vaultsQuery = ` query { diff --git a/projects/platypus-finance/index.js b/projects/platypus-finance/index.js index de552307874..cf16de413e2 100644 --- a/projects/platypus-finance/index.js +++ b/projects/platypus-finance/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { staking } = require("../helper/staking"); const { sumTokens2 } = require("../helper/unwrapLPs"); const { cachedGraphQuery } = require('../helper/cache') @@ -13,7 +14,7 @@ const query = `{ async function tvl(api) { if (api.timestamp > +new Date("2023-02-17") / 1e3) blacklistedTokens.push("0xdaCDe03d7Ab4D81fEDdc3a20fAA89aBAc9072CE2") // USP was hacked - const { pools } = await cachedGraphQuery("platypus-finance", "https://api.thegraph.com/subgraphs/name/platypus-finance/platypus-dashboard", query) + const { pools } = await cachedGraphQuery("platypus-finance", sdk.graph.modifyEndpoint('Bu5QPRWGnZB6NxU4S7kAKQZJpY4pHmAq3TV69V1W2Qqw'), query) console.log(pools) const tokensAndOwners = pools.map(i => i.assetsList.map(v => [v.token.id, v.id])).flat() return sumTokens2({ api, tokensAndOwners, blacklistedTokens }); diff --git a/projects/podsfinance/constants.js b/projects/podsfinance/constants.js index f9a95a18217..70cd0e2e3a3 100644 --- a/projects/podsfinance/constants.js +++ b/projects/podsfinance/constants.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') module.exports = { ADDRESS_ZERO: ADDRESSES.null, @@ -7,16 +8,16 @@ module.exports = { NETWORK_POLYGON: { id: 137, name: 'polygon', - subgraph: 'https://api.thegraph.com/subgraphs/name/pods-finance/pods-matic' + subgraph: sdk.graph.modifyEndpoint('5yQETkt77T9htftwDSW4WJpoGkPH9KBQzQLzPnuyZ8ti') }, NETWORK_MAINNET: { id: 1, name: 'ethereum', - subgraph: 'https://api.thegraph.com/subgraphs/name/pods-finance/pods' + subgraph: sdk.graph.modifyEndpoint('9qiAuWa5ryYeTj1gLy9BGiiVkfgkXnsN25wkYQSfyaws') }, NETWORK_ARBITRUM: { id: 42161, name: 'arbitrum', - subgraph: 'https://api.thegraph.com/subgraphs/name/pods-finance/pods-arbitrum' + subgraph: sdk.graph.modifyEndpoint('5Qz4mWABKaCfr9uGnteAAwmWmBAyQtRDYgB3ydU556HX') } } diff --git a/projects/pooltogether/v3.js b/projects/pooltogether/v3.js index 9d55942b04e..2d8964857dc 100644 --- a/projects/pooltogether/v3.js +++ b/projects/pooltogether/v3.js @@ -1,15 +1,16 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const abi = require('./abi.json') const GRAPH_URLS = { ethereum: [ - 'https://api.thegraph.com/subgraphs/name/pooltogether/pooltogether-v3_1_0', - 'https://api.thegraph.com/subgraphs/name/pooltogether/pooltogether-v3_3_2', - 'https://api.thegraph.com/subgraphs/name/pooltogether/pooltogether-v3_3_8', - 'https://api.thegraph.com/subgraphs/name/pooltogether/pooltogether-v3_4_3' + sdk.graph.modifyEndpoint('DpnLpjCKyyQ8TZnD2V6VNyx4JR7bGrCfGaLbrrsn5r7s'), + sdk.graph.modifyEndpoint('6SXRM2pyUiLKgNvXU6fiSF1E3dDDFGGAFiMurbZhZew8'), + sdk.graph.modifyEndpoint('6fBV3gC2fjdPsKvnmhi2SNzp74RYZj3tS1AiWFGHapyX'), + sdk.graph.modifyEndpoint('C12o8EA9X9EKjjDoxKGUiM9YniNT4RVCiV6jGuYWwwZX') ], - celo: ['https://api.thegraph.com/subgraphs/name/pooltogether/celo-v3_4_5'], - bsc: ['https://api.thegraph.com/subgraphs/name/pooltogether/bsc-v3_4_3'] + celo: [sdk.graph.modifyEndpoint('7RqWfG27PACLZEvSMGtcK87qnV1DJCQfYjNdqwHDQdTe')], + bsc: [sdk.graph.modifyEndpoint('9Qmsc7YBLy2sdbEAcGv8vkpaqdGm3YMYoqiWLCid64MN')] } const GRAPH_QUERY = ` query GET_POOLS { diff --git a/projects/prime-protocol/index.js b/projects/prime-protocol/index.js index 850504ce073..a2d45b103b3 100644 --- a/projects/prime-protocol/index.js +++ b/projects/prime-protocol/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const sdk = require('@defillama/sdk'); const { sumTokens2, } = require('../helper/unwrapLPs'); const { cachedGraphQuery } = require('../helper/cache'); @@ -17,7 +18,7 @@ const PRIME_SATELLITE_NETWORKS = { // filecoin: 314 }; -const primeSubgraphUrl = 'https://api.thegraph.com/subgraphs/name/prime-protocol/liquidity-incentives'; +const primeSubgraphUrl = sdk.graph.modifyEndpoint('6LrvPGTZeMZfEQh4p9DvDBBv4G8cjhLs4v3mdiUycERp'); const primeMarketsQuery = `{ markets { address chainId } diff --git a/projects/quickswap/index.js b/projects/quickswap/index.js index e3f0619628f..fd961c2af72 100644 --- a/projects/quickswap/index.js +++ b/projects/quickswap/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const { getChainTvl } = require('../helper/getUniSubgraphTvl'); const { staking } = require('../helper/staking'); @@ -8,7 +9,7 @@ module.exports = { polygon:{ staking: staking("0x958d208Cdf087843e9AD98d23823d32E17d723A1", ADDRESSES.polygon.QUICK), tvl: getChainTvl({ - polygon: 'https://api.thegraph.com/subgraphs/name/sameepsi/quickswap06' + polygon: sdk.graph.modifyEndpoint('FUWdkXWpi8JyhAnhKL5pZcVshpxuaUQG8JHMDqNCxjPd') })('polygon') }, hallmarks:[ diff --git a/projects/ren/index.js b/projects/ren/index.js index 659535bdb40..e52debcd52b 100644 --- a/projects/ren/index.js +++ b/projects/ren/index.js @@ -3,15 +3,15 @@ const { request, gql } = require("graphql-request"); const sdk = require("@defillama/sdk"); const { getTokenSupply } = require('../helper/solana') -const ethGraphUrl = "https://api.thegraph.com/subgraphs/name/renproject/renvm"; +const ethGraphUrl = sdk.graph.modifyEndpoint('AJaQdD8DUunuwHCbAsZk5h62AfyNG1etRtK9EcDH7gwH'); const bscGraphUrl = - "https://api.thegraph.com/subgraphs/name/renproject/renvm-binance-smart-chain"; + sdk.graph.modifyEndpoint('6UCMxzH5LPvZrLhcpSVrSDhoKRYJchvHM7vnTUo2bBp2'); const avalancheGraphUrl = - "https://api.thegraph.com/subgraphs/name/renproject/renvm-avalanche"; + sdk.graph.modifyEndpoint('GBRcEpUZTHMyjmtkPsHMYmHuPtcLFqnU5SPvpaLdfmau'); const fantomGraphUrl = - "https://api.thegraph.com/subgraphs/name/renproject/renvm-fantom"; + sdk.graph.modifyEndpoint('2TV9sKK7fLvfsbnUox6irt3XbiHAzw1fvbh9j8vnBXmH'); const polygonGraphUrl = - "https://api.thegraph.com/subgraphs/name/renproject/renvm-polygon"; + sdk.graph.modifyEndpoint('GQCGcDW16JfawMXegTemUte8PPyJQVvtF6kACvMYwX8V'); const graphQuery = gql` { assets { diff --git a/projects/rift-finance/networks.js b/projects/rift-finance/networks.js index c86af1ab9f9..4b2c0cbee46 100644 --- a/projects/rift-finance/networks.js +++ b/projects/rift-finance/networks.js @@ -1,14 +1,15 @@ +const sdk = require("@defillama/sdk"); module.exports = { aurora: { coreAddress: "0x40A01A4064b690cA33FA52d315ec02015eF5287E", startBlock: 58983267, graphUrl: - "https://api.thegraph.com/subgraphs/name/recursive-research/rift-subgraph-aurora", + sdk.graph.modifyEndpoint('GkqMC7XyPQFceCjT7rdqc62nzfF5WsVCn6HA9q17VBW'), }, ethereum: { coreAddress: "0x5D7e616B2c0bf268494A482e315a60814F97dBC8", startBlock: 14845882, graphUrl: - "https://api.thegraph.com/subgraphs/name/recursive-research/rift-subgraph", + sdk.graph.modifyEndpoint('44q7UpeVu33BTDwHd1iHJnEYXwcF9NM6HRd5oSVdLFDQ'), }, }; diff --git a/projects/rubicon/index.js b/projects/rubicon/index.js index 1a4c4844056..88f57564a40 100644 --- a/projects/rubicon/index.js +++ b/projects/rubicon/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const { sumTokens2 } = require('../helper/unwrapLPs') @@ -17,7 +18,7 @@ module.exports = { const config = { optimism: { - endpoint: 'https://api.thegraph.com/subgraphs/name/denverbaumgartner/rubiconmetricsoptimism', + endpoint: sdk.graph.modifyEndpoint('AUcAkUd4sJutFD3hYQfvB6uvXrEdYP26qiZwZ5qyrgTw'), owners: [ RUBICON_MARKET_OPTIMISM, // Rubicon Market "0xB0bE5d911E3BD4Ee2A8706cF1fAc8d767A550497", // bathETH @@ -30,7 +31,7 @@ const config = { ] }, arbitrum: { - endpoint: 'https://api.thegraph.com/subgraphs/name/jossduff/rubiconmetricsarbitrum', + endpoint: sdk.graph.modifyEndpoint('B4cTJXyWHMLkxAcpLGK7dJfArJdrbyWukCoCLPDT1f7n'), owners: [RUBICON_MARKET_ARBITRUM,] } } diff --git a/projects/sablier-v2/index.js b/projects/sablier-v2/index.js index 547f0c15041..63ee4894707 100644 --- a/projects/sablier-v2/index.js +++ b/projects/sablier-v2/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { isWhitelistedToken } = require('../helper/streamingHelper') const { cachedGraphQuery } = require('../helper/cache') @@ -33,11 +34,11 @@ const config = { ethereum: { endpoints: ['5EgaXheiBXZBCkepyGUYAu8pN31Dkbh7bpGtnLPqaT5m'], }, arbitrum: { endpoints: ['AR77w8PwmkAG7c9DJSsfW6yTrC5UdvdQ1Hz5ZTCuaUWz'], }, bsc: { endpoints: ['BVyi15zcH5eUg5PPKfRDDesezMezh6cAkn8LPvh7MVAF'], }, - xdai: { endpoints: ['https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-gnosis'], }, - optimism: { endpoints: ['https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-optimism'], }, + xdai: { endpoints: [sdk.graph.modifyEndpoint('EXhNLbhCbsewJPx4jx5tutNXpxwdgng2kmX1J7w1bFyu')], }, + optimism: { endpoints: [sdk.graph.modifyEndpoint('6e6Dvs1yDpsWDDREZRqxGi54SVdvTNzUdKpKJxniKVrp')], }, polygon: { endpoints: ['J8XJaFtxcz7xowzVJ5LwZhi35N5Lbtwfrt4sea6G1ysJ'], }, - avax: { endpoints: ['https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-avalanche'], }, - base: { endpoints: ['https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-base'], }, + avax: { endpoints: [sdk.graph.modifyEndpoint('FdVwZuMV43yCb1nPmjnLQwmzS58wvKuLMPzcZ4UWgWAc')], }, + base: { endpoints: [sdk.graph.modifyEndpoint('HS6B8Wi9ZY7D9bjHEuJwDqHa5eCMX5d6H59YyGVnQ5QP')], }, blast: { endpoints: ['https://api.studio.thegraph.com/query/57079/sablier-v2-blast/version/latest'], }, } diff --git a/projects/sentiment/index.js b/projects/sentiment/index.js index e4ab49ad0ad..7e6184be993 100644 --- a/projects/sentiment/index.js +++ b/projects/sentiment/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const { cachedGraphQuery } = require('../helper/cache') @@ -8,7 +9,7 @@ async function tvl(api) { api.addTokens(assets, totalAssets) // const userAccounts = await api.call({ target: "0x17b07cfbab33c0024040e7c299f8048f4a49679b", abi: "address[]:getAllAccounts", }) - const data = await cachedGraphQuery('sentiment', 'https://api.thegraph.com/subgraphs/name/r0ohafza/sentiment', query, { fetchById: true, }) + const data = await cachedGraphQuery('sentiment', sdk.graph.modifyEndpoint('H4hxkyy4kLmFsZZCatedvHpWT1ZvqKcfv2FFYXLxDm9W'), query, { fetchById: true, }) const userAccounts = data.map(i => i.id) const [equity, borrows] = await Promise.all([ api.multiCall({ target: "0xc0ac97A0eA320Aa1E32e9DEd16fb580Ef3C078Da", calls: userAccounts, abi: "function getBalance(address account) view returns (uint256)", permitFailure: true, }), diff --git a/projects/soulswap/underworld-lending.js b/projects/soulswap/underworld-lending.js index eead9b86937..b1c9f3f9550 100644 --- a/projects/soulswap/underworld-lending.js +++ b/projects/soulswap/underworld-lending.js @@ -4,8 +4,8 @@ const { BigNumber } = require('bignumber.js'); // https://thegraph.com/hosted-service/subgraph/soulswapfantom/coffinbox const graphUrls = { - 'fantom': 'https://api.thegraph.com/subgraphs/name/soulswapfinance/fantom-coffinbox', - 'avax': 'https://api.thegraph.com/subgraphs/name/soulswapfinance/coffinbox-avalanche', + 'fantom': sdk.graph.modifyEndpoint('FhS8cRWsTPZwXfmn7b8YGvKii2h2ghr2v7ah5T8oiDmo'), + 'avax': sdk.graph.modifyEndpoint('6WonmxWbw3MSVXVR5P4VhC8jWBEG5RkipWzxhAA67hoP'), } const coffinboxQuery = gql` diff --git a/projects/steer/index.js b/projects/steer/index.js index 39ef515ba7f..615bdc660ab 100644 --- a/projects/steer/index.js +++ b/projects/steer/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const { stakings } = require("../helper/staking"); @@ -5,25 +6,25 @@ const { stakings } = require("../helper/staking"); const supportedChains = [ { name: 'Polygon', - subgraphEndpoint: 'https://api.thegraph.com/subgraphs/name/steerprotocol/steer-protocol-polygon', + subgraphEndpoint: sdk.graph.modifyEndpoint('uQxLz6EarmJcr2ymRRmTnrRPi8cCqas4XcPQb71HBvw'), chainId: 137, identifier: 'polygon' }, { name: 'Arbitrum', - subgraphEndpoint: 'https://api.thegraph.com/subgraphs/name/steerprotocol/steer-protocol-arbitrum', + subgraphEndpoint: sdk.graph.modifyEndpoint('HVC4Br5yprs3iK6wF8YVJXy4QZWBNXTCFp8LPe3UpcD4'), chainId: 42161, identifier: 'arbitrum' }, { name: 'Optimism', - subgraphEndpoint: 'https://api.thegraph.com/subgraphs/name/steerprotocol/steer-protocol-optimism', + subgraphEndpoint: sdk.graph.modifyEndpoint('GgW1EwNARL3dyo3acQ3VhraQQ66MHT7QnYuGcQc5geDG'), chainId: 10, identifier: 'optimism' }, { name: 'Binance', - subgraphEndpoint: 'https://api.thegraph.com/subgraphs/name/steerprotocol/steer-protocol-bsc', + subgraphEndpoint: sdk.graph.modifyEndpoint('GLDP56fPGDz3MtmhtfTkz5CxWiqiNLACVrsJ9RqQeL4U'), chainId: 56, identifier: 'bsc' }, @@ -35,7 +36,7 @@ const supportedChains = [ }, { name: 'Avalanche', - subgraphEndpoint: 'https://api.thegraph.com/subgraphs/name/steerprotocol/steer-protocol-avalanche', + subgraphEndpoint: sdk.graph.modifyEndpoint('GZotTj3rQJ8ZqVyodtK8TcnKcUxMgeF7mCJHGPYbu8dA'), chainId: 43114, identifier: 'avax' }, @@ -101,7 +102,7 @@ const supportedChains = [ }, { name: 'Fantom', - subgraphEndpoint: 'https://api.thegraph.com/subgraphs/name/rakeshbhatt10/steer-protocol-fantom-test', + subgraphEndpoint: sdk.graph.modifyEndpoint('8k6x2Uho5PEqjxHx5SeSE334MEaxSZqMZhH6p5XYvqjM'), chainId: 250, identifier: 'fantom' }, @@ -143,7 +144,7 @@ const supportedChains = [ }, // { // name: 'Celo', - // subgraphEndpoint: 'https://api.thegraph.com/subgraphs/name/rakeshbhatt10/steer-test-celo', + // subgraphEndpoint: sdk.graph.modifyEndpoint('DDwt4z55qLHPNmasiQXFH3nRjgCBrBhsiz3uEqKRJoa'), // chainId: 42220, // identifier: 'celo' // }, diff --git a/projects/sudoswap/index.js b/projects/sudoswap/index.js index 59c1aa00f3e..c51821cee7f 100644 --- a/projects/sudoswap/index.js +++ b/projects/sudoswap/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { graphFetchById, } = require('../helper/cache') const { ART_BLOCKS, sumArtBlocks } = require('../helper/nft') const sdk = require('@defillama/sdk') @@ -34,7 +35,7 @@ module.exports = { ethereum: { tvl: async (api) => { const data = await graphFetchById({ - endpoint: 'https://api.thegraph.com/subgraphs/name/zeframlou/sudoswap', + endpoint: sdk.graph.modifyEndpoint('5ZEPsiros7UhV5noPBHHkzy1rfSBFRP2d2ghHZHHCugd'), query, api, options: { diff --git a/projects/superfluid.js b/projects/superfluid.js index 1e3099bdeaf..95f64ca96e5 100644 --- a/projects/superfluid.js +++ b/projects/superfluid.js @@ -6,8 +6,8 @@ const { transformBalances } = require('./helper/portedTokens') // Superfluid Supertokens can be retrieved using GraphQl API - cannot use block number to retrieve historical data at the moment though // TheGraph URL before being deprecated, before 2021-12-23 -// const polygonGraphUrl = 'https://api.thegraph.com/subgraphs/name/superfluid-finance/superfluid-matic' -// const xdaiGraphUrl = 'https://api.thegraph.com/subgraphs/name/superfluid-finance/superfluid-xdai' +// const polygonGraphUrl = sdk.graph.modifyEndpoint('BoiJR4mfVpVthWjTcansrCUFCjKY9MfDxgTfzkf4YpAN') +// const xdaiGraphUrl = sdk.graph.modifyEndpoint('A3LhWnFQR13mxQPFGUZML9vyBrLLKhLJBhfFsrdShxBU') const supertokensQuery = ` query get_supertokens($block: Int) { @@ -99,12 +99,12 @@ async function retrieveSupertokensBalances(chain, block, isVesting, ts, graphUrl } const config = { - avax: { graph: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-v1-avalanche-c', }, - polygon: { graph: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-v1-matic', }, - xdai: { graph: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-v1-xdai', }, - optimism: { graph: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-v1-optimism-mainnet', }, - arbitrum: { graph: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-v1-arbitrum-one', }, - bsc: { graph: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-v1-bsc-mainnet', }, + avax: { graph: sdk.graph.modifyEndpoint('CtYR3ng4ED64HVEzDo49eKQgEf78RERiC8mDUtwLxda'), }, + polygon: { graph: sdk.graph.modifyEndpoint('7d9iBvDoM43SZiZhRR2pnpW8z3ujSEy9nC6RuqnufRU9'), }, + xdai: { graph: sdk.graph.modifyEndpoint('DE6fybqxjXLNvqGpd4QLAD92kAZNEmha1ZfKvS2qM376'), }, + optimism: { graph: sdk.graph.modifyEndpoint('S48f1C3KhNB2YbEMDxYHPzZ3FYt27fQZdruKfSTeEdZ'), }, + arbitrum: { graph: sdk.graph.modifyEndpoint('ES5GNHtiaqP6jFydhUyD9R4RackYrbGr6LEL1ZDauktd'), }, + bsc: { graph: sdk.graph.modifyEndpoint('FzYUiDH968QKbjURULGE5Pwh1ZRvcBNjDcut5YSiMYnj'), }, } module.exports = { diff --git a/projects/sushiswap-bentobox/helper.js b/projects/sushiswap-bentobox/helper.js index 36c37f5e904..eba23cee887 100644 --- a/projects/sushiswap-bentobox/helper.js +++ b/projects/sushiswap-bentobox/helper.js @@ -24,23 +24,23 @@ const toAmountAbi = const bentoSubgraphs = { ethereum: - "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-ethereum", - polygon: "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-polygon", - fantom: "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-fantom", - bsc: "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-bsc", - avax: "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-avalanche", + sdk.graph.modifyEndpoint('8HYeoDopVqqvb5RJEV2TtSzFsouYPz8cownnG3mbhiGy'), + polygon: sdk.graph.modifyEndpoint('6kJg5kFoQY8B8Ge2hqswHMqZDcmsR1TLUUz7AKov69fy'), + fantom: sdk.graph.modifyEndpoint('2KqXx6dGw7T4mZeGKyzQ9m9iyuCMjPR8PntLB9Gn9AEK'), + bsc: sdk.graph.modifyEndpoint('BggyE3r5snDsjx19jgZcbiBH7cbtrkpjvyGLFHMdXekd'), + avax: sdk.graph.modifyEndpoint('EhYaJodF1WQjKgxx1ZC63goeCwp5swD4AQRdaKXBm2xk'), arbitrum: - "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-arbitrum", + sdk.graph.modifyEndpoint('JZFyMKR4jnsFQ58q7dT6nbXenTzNgE176zTejc6Gf8Z'), optimism: - "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-optimism", - xdai: "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-gnosis", - harmony: "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-harmony", + sdk.graph.modifyEndpoint('8b4Hy4Kn7jCNAf9JFrqHb24LsqmapG4HrAsCrwdJf9Nu'), + xdai: sdk.graph.modifyEndpoint('9jn9kA6SKCNxXQSqb93zZPLdLaru4FeZBwLNWAK4nfZ2'), + harmony: sdk.graph.modifyEndpoint('Bioj7N3Rf2n7iBq9PVoaMie3WiuzPze9NMi7aSye7LFc'), moonbeam: - "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-moonbeam", + sdk.graph.modifyEndpoint('7wA5gqWNP4E1dPWBsTYvz5eQSDbtYDFgyU5BGdHr2UKp'), moonriver: - "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-moonriver", + sdk.graph.modifyEndpoint('73XEV6UQKpPSJn68WZBAYTwALcZtFJkFYn58ZoZUb7tn'), //metis: "", - celo: "https://api.thegraph.com/subgraphs/name/sushiswap/bentobox-celo", + celo: sdk.graph.modifyEndpoint('5DwkvjxPGVFFaWEMM68g1yztDdhCgJEYAxS6FuhkajzR'), //kava: "", }; @@ -60,23 +60,23 @@ const bentoQuery = gql` const furoSubgraphs = { ethereum: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-ethereum", + sdk.graph.modifyEndpoint('D8vYJpKN5SEHUkUWKSuorsL6FRt7hAQMnywnC4e93ygf'), polygon: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-polygon", - fantom: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-fantom", - bsc: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-bsc", - avax: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-avalanche", + sdk.graph.modifyEndpoint('4KsDNsyJjKX6bjwVNJQmJ7Dm3wovYXSX37UR39rNaMX4'), + fantom: sdk.graph.modifyEndpoint('E98zSR5UZBGBgQe2SSLZ5R6yj5GPqKDJcQJNDHTeV3cS'), + bsc: sdk.graph.modifyEndpoint('2wBYezghRA3hEJLQB4njUZGDNxCdU3u2gsLP5yVvBqKk'), + avax: sdk.graph.modifyEndpoint('8LVoX3JPEVAak8T8GoEfdJudMoP2bsGwd9tszJxo3Rnx'), arbitrum: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-arbitrum", + sdk.graph.modifyEndpoint('8eHhPeKDr646JH5KUBBcabAJzkWmLfu6pqBtpXQHa37F'), optimism: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-optimism", - xdai: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-gnosis", + sdk.graph.modifyEndpoint('8KnsmppMf9k6Qvyixxwmny7dYugTV7XT4htHTfyq3d69'), + xdai: sdk.graph.modifyEndpoint('5ToxB5xubMh9osdEDeX98JBAyzUVwkReGXAT1CzQhZCB'), harmony: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-harmony", + sdk.graph.modifyEndpoint('9D9C3ppoDE1zuZk5adznngKomLYS8NnC9zxniSS8vzgH'), moonbeam: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-moonbeam", + sdk.graph.modifyEndpoint('HJxpcsmaPV3L6PsqGFBHLczeMnL7bEgmL1D65edGx8pf'), moonriver: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-moonriver", + sdk.graph.modifyEndpoint('9ZqdKjfu7o9dX1RThXHDV9EqMn5CTvgpsPKKbpANg8yC'), }; const furoQuery = gql` @@ -97,11 +97,11 @@ const furoQuery = gql` `; const kashiSubgraphs = { - ethereum: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-ethereum", - polygon: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-polygon", - arbitrum: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-arbitrum", - bsc: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-bsc", - avax: "https://api.thegraph.com/subgraphs/name/sushiswap/kashi-avalanche", + ethereum: sdk.graph.modifyEndpoint('6Kf5cPeXUMVzfGCtzBnSxDU849w2YM2o9afn1uiPpy2m'), + polygon: sdk.graph.modifyEndpoint('5F3eB4Cm5mxorArsyrbs2a1TDxctmk3znpDZ4LEzqrBJ'), + arbitrum: sdk.graph.modifyEndpoint('G3rbmaF7w2ZLQjZgGoi12BzPeL9z4MTW662iVyjYmtiX'), + bsc: sdk.graph.modifyEndpoint('D1TGHRKx2Q54ce2goyt9hbtKNuT94FDBsuPwtGg5EzRw'), + avax: sdk.graph.modifyEndpoint('BHeJByyVoNuVtqufK3Nk7YYmFkBs43boYpKv8z6hQ5Q1'), }; const kashiQuery = gql` @@ -124,15 +124,15 @@ const kashiQuery = gql` const tridentSubgraphs = { polygon: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-polygon", - optimism: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-optimism", + optimism: sdk.graph.modifyEndpoint('FEgRuH9zeTRMZgpVv5YavoFEcisoK6KHk3zgQRRBqt51'), kava: "https://pvt.graph.kava.io/subgraphs/name/sushi-v2/trident-kava", metis: "https://andromeda.thegraph.metis.io/subgraphs/name/sushi-v2/trident-metis", bittorrent: "https://subgraphs.sushi.com/subgraphs/name/sushi-v2/trident-bttc", - arbitrum: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-arbitrum", - bsc: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-bsc", - avax: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-avalanche", + arbitrum: sdk.graph.modifyEndpoint('4x8H6ZoGfJykyZqAe2Kx2g5afsp17S9pn8GroRkpezhx'), + bsc: sdk.graph.modifyEndpoint('9TQaBw1sU3wi2kdevuygKhfhjP3STnwBe1jUnKxmNhmn'), + avax: sdk.graph.modifyEndpoint('NNTV3MgqSGtHMBGdMVLXzzDbKDKmsY87k3PsQ2knmC1'), }; const tridentQuery = gql` diff --git a/projects/sushiswap-furo/furo.js b/projects/sushiswap-furo/furo.js index cfecc8d7bd2..a299c787c64 100644 --- a/projects/sushiswap-furo/furo.js +++ b/projects/sushiswap-furo/furo.js @@ -5,23 +5,23 @@ const { isWhitelistedToken } = require('../helper/streamingHelper') const graphUrls = { ethereum: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-ethereum", + sdk.graph.modifyEndpoint('D8vYJpKN5SEHUkUWKSuorsL6FRt7hAQMnywnC4e93ygf'), polygon: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-polygon", - fantom: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-fantom", - bsc: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-bsc", - avax: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-avalanche", + sdk.graph.modifyEndpoint('4KsDNsyJjKX6bjwVNJQmJ7Dm3wovYXSX37UR39rNaMX4'), + fantom: sdk.graph.modifyEndpoint('E98zSR5UZBGBgQe2SSLZ5R6yj5GPqKDJcQJNDHTeV3cS'), + bsc: sdk.graph.modifyEndpoint('2wBYezghRA3hEJLQB4njUZGDNxCdU3u2gsLP5yVvBqKk'), + avax: sdk.graph.modifyEndpoint('8LVoX3JPEVAak8T8GoEfdJudMoP2bsGwd9tszJxo3Rnx'), arbitrum: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-arbitrum", + sdk.graph.modifyEndpoint('8eHhPeKDr646JH5KUBBcabAJzkWmLfu6pqBtpXQHa37F'), optimism: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-optimism", - xdai: "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-gnosis", + sdk.graph.modifyEndpoint('8KnsmppMf9k6Qvyixxwmny7dYugTV7XT4htHTfyq3d69'), + xdai: sdk.graph.modifyEndpoint('5ToxB5xubMh9osdEDeX98JBAyzUVwkReGXAT1CzQhZCB'), harmony: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-harmony", + sdk.graph.modifyEndpoint('9D9C3ppoDE1zuZk5adznngKomLYS8NnC9zxniSS8vzgH'), moonbeam: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-moonbeam", + sdk.graph.modifyEndpoint('HJxpcsmaPV3L6PsqGFBHLczeMnL7bEgmL1D65edGx8pf'), moonriver: - "https://api.thegraph.com/subgraphs/name/sushi-subgraphs/furo-moonriver", + sdk.graph.modifyEndpoint('9ZqdKjfu7o9dX1RThXHDV9EqMn5CTvgpsPKKbpANg8yC'), }; const bentoboxes = { diff --git a/projects/sushiswap-kashi/kashi-lending.js b/projects/sushiswap-kashi/kashi-lending.js index 2b1498f35af..5fce7a57300 100644 --- a/projects/sushiswap-kashi/kashi-lending.js +++ b/projects/sushiswap-kashi/kashi-lending.js @@ -1,12 +1,13 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const { blockQuery } = require("../helper/http"); const graphUrls = { - ethereum: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-ethereum", - polygon: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-polygon", - arbitrum: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-arbitrum", - bsc: "https://api.thegraph.com/subgraphs/name/sushi-labs/kashi-bsc", - avax: "https://api.thegraph.com/subgraphs/name/sushiswap/kashi-avalanche", + ethereum: sdk.graph.modifyEndpoint('6Kf5cPeXUMVzfGCtzBnSxDU849w2YM2o9afn1uiPpy2m'), + polygon: sdk.graph.modifyEndpoint('5F3eB4Cm5mxorArsyrbs2a1TDxctmk3znpDZ4LEzqrBJ'), + arbitrum: sdk.graph.modifyEndpoint('G3rbmaF7w2ZLQjZgGoi12BzPeL9z4MTW662iVyjYmtiX'), + bsc: sdk.graph.modifyEndpoint('D1TGHRKx2Q54ce2goyt9hbtKNuT94FDBsuPwtGg5EzRw'), + avax: sdk.graph.modifyEndpoint('BHeJByyVoNuVtqufK3Nk7YYmFkBs43boYpKv8z6hQ5Q1'), }; const bentoboxes = { diff --git a/projects/sushiswap-trident/trident.js b/projects/sushiswap-trident/trident.js index ce68092fa4f..d30085dd2b7 100644 --- a/projects/sushiswap-trident/trident.js +++ b/projects/sushiswap-trident/trident.js @@ -1,18 +1,19 @@ +const sdk = require("@defillama/sdk"); const { blockQuery } = require('../helper/http') const graphUrls = { polygon: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-polygon", polygonOldRouter: - "https://api.thegraph.com/subgraphs/name/sushi-0m/trident-polygon", - optimism: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-optimism", + sdk.graph.modifyEndpoint('5LBvcUQthQDZTMe6cyJ7DbeokFkYeVpYYBZruHPUjMG5'), + optimism: sdk.graph.modifyEndpoint('FEgRuH9zeTRMZgpVv5YavoFEcisoK6KHk3zgQRRBqt51'), kava: "https://pvt.graph.kava.io/subgraphs/name/sushi-v2/trident-kava", metis: "https://andromeda.thegraph.metis.io/subgraphs/name/sushi-v2/trident-metis", bittorrent: "https://subgraphs.sushi.com/subgraphs/name/sushi-v2/trident-bttc", - arbitrum: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-arbitrum", - bsc: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-bsc", - avax: "https://api.thegraph.com/subgraphs/name/sushi-v2/trident-avalanche", + arbitrum: sdk.graph.modifyEndpoint('4x8H6ZoGfJykyZqAe2Kx2g5afsp17S9pn8GroRkpezhx'), + bsc: sdk.graph.modifyEndpoint('9TQaBw1sU3wi2kdevuygKhfhjP3STnwBe1jUnKxmNhmn'), + avax: sdk.graph.modifyEndpoint('NNTV3MgqSGtHMBGdMVLXzzDbKDKmsY87k3PsQ2knmC1'), }; const tridentQueryWithBlock = ` diff --git a/projects/sushiswap/api.js b/projects/sushiswap/api.js index 2c3e0c53af6..4f9445c4842 100644 --- a/projects/sushiswap/api.js +++ b/projects/sushiswap/api.js @@ -1,8 +1,9 @@ +const sdk = require("@defillama/sdk"); const { toUSDTBalances } = require('../helper/balances'); const { blockQuery } = require('../helper/http') const { getUniTVL } = require("../helper/unknownTokens") -const graphUrl = 'https://api.thegraph.com/subgraphs/name/zippoxer/sushiswap-subgraph-fork' +const graphUrl = sdk.graph.modifyEndpoint('8TXwDMLemg6p4eicVuixKk7Mw9aNxpod1PQQFdSvFj6H') const graphQuery = ` query get_tvl($block: Int) { uniswapFactory( diff --git a/projects/swaap-earn/index.js b/projects/swaap-earn/index.js index 1cff804f379..175ecf3a11c 100644 --- a/projects/swaap-earn/index.js +++ b/projects/swaap-earn/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const query = `query FundsTVL{ funds { id } }` @@ -6,7 +7,7 @@ module.exports = { } const config = { - arbitrum: { endpoint: 'https://api.thegraph.com/subgraphs/name/borelien/swaap-earn-arbitrum-test', }, + arbitrum: { endpoint: sdk.graph.modifyEndpoint('DHZvo3KRhryqHH9zj9sK8n9sjXvg3ddmDoVdLZcZQMJg'), }, } Object.keys(config).forEach(chain => { diff --git a/projects/swaap/index.js b/projects/swaap/index.js index 83cb7a77a24..6415219340e 100644 --- a/projects/swaap/index.js +++ b/projects/swaap/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { sumTokens2 } = require('../helper/unwrapLPs') const { cachedGraphQuery } = require('../helper/cache') @@ -6,7 +7,7 @@ const configV1 = { startBlock: 29520285, blockDelay: 30, theGraph: { - endpoint: 'https://api.thegraph.com/subgraphs/name/swaap-labs/swaapv1', + endpoint: sdk.graph.modifyEndpoint('A1ibaGVUkqdLeBG7VeeSB8jm9QNmS8phSz8iooXR8puv'), query: `pools: pools(orderBy: liquidity, orderDirection: desc) { id tokens { diff --git a/projects/synthetix/api.js b/projects/synthetix/api.js index 1850690eed1..4912de250c4 100644 --- a/projects/synthetix/api.js +++ b/projects/synthetix/api.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const sdk = require('@defillama/sdk'); const BigNumber = require('bignumber.js'); @@ -27,7 +28,7 @@ const synthetixs = { } const snxGraphEndpoints = { ethereum: 'https://api.thegraph.com/subgraphs/name/0xngmi/snx-lite-ethereum', - optimism: 'https://api.thegraph.com/subgraphs/name/0xngmi/snx-lite-optimism-regenesis' + optimism: sdk.graph.modifyEndpoint('5NQi9n4ztd8M6EEDFKA6gwcCnbLdmzZRymiDbPkbjEWN') } const ethStaking = "0xc1aae9d18bbe386b102435a8632c8063d31e747c" const weth = ADDRESSES.ethereum.WETH diff --git a/projects/synthetix/apiCache.js b/projects/synthetix/apiCache.js index 735e61a8fd1..c9a52f1ef5a 100644 --- a/projects/synthetix/apiCache.js +++ b/projects/synthetix/apiCache.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const sdk = require('@defillama/sdk'); const BigNumber = require('bignumber.js'); @@ -30,7 +31,7 @@ const synthetixs = { } const snxGraphEndpoints = { ethereum: 'https://api.thegraph.com/subgraphs/name/0xngmi/snx-lite-ethereum', - optimism: 'https://api.thegraph.com/subgraphs/name/0xngmi/snx-lite-optimism-regenesis' + optimism: sdk.graph.modifyEndpoint('5NQi9n4ztd8M6EEDFKA6gwcCnbLdmzZRymiDbPkbjEWN') } const ethStaking = "0xc1aae9d18bbe386b102435a8632c8063d31e747c" const weth = ADDRESSES.ethereum.WETH diff --git a/projects/timeswap/index.js b/projects/timeswap/index.js index 19acc60107b..45b9d2f993b 100644 --- a/projects/timeswap/index.js +++ b/projects/timeswap/index.js @@ -1,9 +1,10 @@ +const sdk = require("@defillama/sdk"); const { sumTokens2 } = require('../helper/unwrapLPs') const { cachedGraphQuery } = require('../helper/cache') const GRAPH_URLS = { polygon: - "https://api.thegraph.com/subgraphs/name/timeswap-labs/timeswap-defi-llama", + sdk.graph.modifyEndpoint('CjoTTVotweY5YZYjGbskVMZvJi8oD6urLnP1N7rWVFun'), }; function chainTvl(chain) { diff --git a/projects/unbound/index.js b/projects/unbound/index.js index be951d9483e..fa320ce92aa 100644 --- a/projects/unbound/index.js +++ b/projects/unbound/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { GraphQLClient, gql } = require('graphql-request') const { staking } = require("../helper/staking"); @@ -10,7 +11,7 @@ const UNB_POLY = '0xD81F558b71A5323e433729009D55159955F8A7f9' async function ethTvl() { - var endpoint = 'https://api.thegraph.com/subgraphs/name/unbound-finance/unbound' + var endpoint = sdk.graph.modifyEndpoint('8hYGnnqzaQ98ikvhi9uZ5GRmYjd7C2ykopeNpbA3DXUh') var graphQLClient = new GraphQLClient(endpoint) var query = gql` @@ -40,7 +41,7 @@ async function ethTvl() { } async function polyTvl() { - var endpoint = 'https://api.thegraph.com/subgraphs/name/unbound-finance/unbound-polygon' + var endpoint = sdk.graph.modifyEndpoint('EtpUNR2s35iZNRGfQ5vqCSayGf72THHd1duUtkxKreGU') var graphQLClient = new GraphQLClient(endpoint) var query = gql` diff --git a/projects/unifarm/helper.js b/projects/unifarm/helper.js index c15e19c096c..7cc92129724 100644 --- a/projects/unifarm/helper.js +++ b/projects/unifarm/helper.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const { graphQuery, } = require('../helper/http') const { sleep, log } = require('../helper/utils') @@ -78,9 +79,9 @@ query MyQuery { `; const v2EndPoints = { - ethereum: "https://api.thegraph.com/subgraphs/name/themohitmadan/unifarm-eth", - polygon: "https://api.thegraph.com/subgraphs/name/themohitmadan/unifarm-polygon", - bsc: "https://api.thegraph.com/subgraphs/name/themohitmadan/unifarm-bsc", + ethereum: sdk.graph.modifyEndpoint('Cquw1hbmvNrSvUjaqoRhu9nWv7AX1Mz2gEb9sapYdMA5'), + polygon: sdk.graph.modifyEndpoint('Ami8CcwigwYViJsUrwqK8DWwDPtFVAKbeYfii6ANahax'), + bsc: sdk.graph.modifyEndpoint('EsA5LyABgi7ibZJGNr5PQsQ2L8QDPZxNdDvd5qPs5CJj'), } const getV1Calls = async (chain) => { diff --git a/projects/vela-exchange/index.js b/projects/vela-exchange/index.js index 89124b09399..e7652239c76 100644 --- a/projects/vela-exchange/index.js +++ b/projects/vela-exchange/index.js @@ -1,11 +1,12 @@ +const sdk = require("@defillama/sdk"); const ADDRESSES = require('../helper/coreAssets.json') const { staking } = require("../helper/staking") const { graphQuery } = require('../helper/http') const VELA = '0x088cd8f5eF3652623c22D48b1605DCfE860Cd704' -const arbitrumEndpoint = "https://api.thegraph.com/subgraphs/name/velaexchange/vela-exchange-official" -const baseEndpoint = "https://api.thegraph.com/subgraphs/name/velaexchange/vela-exchange-official-base" +const arbitrumEndpoint = sdk.graph.modifyEndpoint('6H9PEiNPZgwXfpbijjesZh96LFBzUvkHmEutMoYQ9fvp') +const baseEndpoint = sdk.graph.modifyEndpoint('2qsbZ4X5TJM7NupC2eRJv167kBDFCDBd37KnK7PQtdga') async function staking_arbitrum_(api) { const query = ` diff --git a/projects/venus-isolated-pools/index.js b/projects/venus-isolated-pools/index.js index d3fb595a04c..3d8b21c4d7b 100644 --- a/projects/venus-isolated-pools/index.js +++ b/projects/venus-isolated-pools/index.js @@ -1,13 +1,14 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const sdk = require('@defillama/sdk') const { compoundExports2 } = require('../helper/compound') const config = { bsc: { - endpoint: 'https://api.thegraph.com/subgraphs/name/venusprotocol/venus-isolated-pools', + endpoint: sdk.graph.modifyEndpoint('H2a3D64RV4NNxyJqx9jVFQRBpQRzD6zNZjLDotgdCrTC'), corePools: ['0xfd36e2c2a6789db23113685031d7f16329158384'], }, ethereum: { - endpoint: 'https://api.thegraph.com/subgraphs/name/venusprotocol/venus-isolated-pools-ethereum', + endpoint: sdk.graph.modifyEndpoint('Htf6Hh1qgkvxQxqbcv4Jp5AatsaiY5dNLVcySkpCaxQ8'), corePools: ['0x67aA3eCc5831a65A5Ba7be76BED3B5dc7DB60796'], } } diff --git a/projects/zksynth/index.js b/projects/zksynth/index.js index cb3cfa07247..e9098e0d099 100644 --- a/projects/zksynth/index.js +++ b/projects/zksynth/index.js @@ -1,3 +1,4 @@ +const sdk = require("@defillama/sdk"); const { cachedGraphQuery } = require('../helper/cache') const { sumTokens2 } = require('../helper/unwrapLPs') @@ -11,7 +12,7 @@ const query = `{ }` async function tvl(api) { - const { pools } = await cachedGraphQuery('zksynth', 'https://api.thegraph.com/subgraphs/name/prasad-kumkar/zksynth-mainnet', query) + const { pools } = await cachedGraphQuery('zksynth', sdk.graph.modifyEndpoint('CWgPgHm4zz4pijQaEsi2oniuzvdwqasBczTgBRMgg1EL'), query) const tokensAndOwners = pools.map(i => i.collaterals).flat().map(i => [i.token.id, i.pool.id]) return sumTokens2({ api, tokensAndOwners }) }