UNPKG

@angleprotocol/sdk

Version:
148 lines 9.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.merklSubgraphALMEndpoints = exports.merklSubgraphAMMEndpoints = exports.getMerklSubgraphPrefix = exports.merklFallbackTGEndpoint = exports.swapsSubgraphsEndpoint = void 0; const constants_1 = require("../../types/constants"); const merkl_1 = require("../../types/merkl"); const sushiswapV3SubgraphPrefix = 'https://api.thegraph.com/subgraphs/name/sushi-v3/v3-'; exports.swapsSubgraphsEndpoint = { [constants_1.ChainId.ARBITRUM]: { [merkl_1.AMMType.SushiSwapV3]: sushiswapV3SubgraphPrefix + 'arbitrum', [merkl_1.AMMType.UniswapV3]: 'https://api.thegraph.com/subgraphs/name/ianlapham/arbitrum-minimal', [merkl_1.AMMType.Camelot]: 'https://api.thegraph.com/subgraphs/name/camelotlabs/camelot-amm-v3', [merkl_1.AMMType.Horiza]: 'https://subgraph-prod.goerli.horiza.io/subgraphs/name/retro-arbitrum-one-uniswap-v3', }, [constants_1.ChainId.MAINNET]: { [merkl_1.AMMType.SushiSwapV3]: sushiswapV3SubgraphPrefix + 'ethereum', [merkl_1.AMMType.UniswapV3]: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3', [merkl_1.AMMType.PancakeSwapV3]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-eth', }, [constants_1.ChainId.OPTIMISM]: { [merkl_1.AMMType.SushiSwapV3]: sushiswapV3SubgraphPrefix + 'optimism', [merkl_1.AMMType.UniswapV3]: 'https://api.thegraph.com/subgraphs/name/ianlapham/optimism-post-regenesis', }, [constants_1.ChainId.POLYGON]: { [merkl_1.AMMType.SushiSwapV3]: sushiswapV3SubgraphPrefix + 'polygon', [merkl_1.AMMType.UniswapV3]: 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswap-v3-polygon', [merkl_1.AMMType.Retro]: 'https://api.thegraph.com/subgraphs/name/ruvlol/univ3-test', }, [constants_1.ChainId.POLYGONZKEVM]: { [merkl_1.AMMType.PancakeSwapV3]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest', }, [constants_1.ChainId.BASE]: { [merkl_1.AMMType.SushiSwapV3]: 'https://api.studio.thegraph.com/query/32073/v3-base/version/latest', [merkl_1.AMMType.BaseSwap]: 'https://api.thegraph.com/subgraphs/name/baseswapfi/v3-base', [merkl_1.AMMType.Horiza]: 'https://subgraph.goerli.horiza.io/subgraphs/name/base-uniswap-v3', }, }; const merklFallbackSubgraphPrefix = 'https://api.thegraph.com/subgraphs/name/angleprotocol/back-merkl-'; const merklFallbackSubgraphPrefixUniswapV3 = `${merklFallbackSubgraphPrefix}uniswapv3-`; const merklFallbackSubgraphPrefixSushiswapV3 = `${merklFallbackSubgraphPrefix}sushiswapv3-`; const merklFallbackSubgraphPrefixRetro = `${merklFallbackSubgraphPrefix}retro-`; exports.merklFallbackTGEndpoint = { [constants_1.ChainId.ARBITRUM]: { [merkl_1.AMMType.Retro]: merklFallbackSubgraphPrefixRetro + 'arb', [merkl_1.AMMType.SushiSwapV3]: merklFallbackSubgraphPrefixSushiswapV3 + 'arb', [merkl_1.AMMType.UniswapV3]: merklFallbackSubgraphPrefixUniswapV3 + 'arb', }, [constants_1.ChainId.MAINNET]: { [merkl_1.AMMType.Retro]: merklFallbackSubgraphPrefixRetro + 'eth', [merkl_1.AMMType.SushiSwapV3]: merklFallbackSubgraphPrefixSushiswapV3 + 'eth', [merkl_1.AMMType.UniswapV3]: merklFallbackSubgraphPrefixUniswapV3 + 'eth', [merkl_1.AMMType.PancakeSwapV3]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-eth', }, [constants_1.ChainId.OPTIMISM]: { [merkl_1.AMMType.Retro]: merklFallbackSubgraphPrefixRetro + 'opt', [merkl_1.AMMType.SushiSwapV3]: merklFallbackSubgraphPrefixSushiswapV3 + 'opt', [merkl_1.AMMType.UniswapV3]: merklFallbackSubgraphPrefixUniswapV3 + 'opt', }, [constants_1.ChainId.POLYGON]: { [merkl_1.AMMType.Retro]: merklFallbackSubgraphPrefixRetro + 'pol', [merkl_1.AMMType.SushiSwapV3]: merklFallbackSubgraphPrefixSushiswapV3 + 'pol', [merkl_1.AMMType.UniswapV3]: merklFallbackSubgraphPrefixUniswapV3 + 'pol', }, [constants_1.ChainId.POLYGONZKEVM]: { [merkl_1.AMMType.PancakeSwapV3]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest', }, [constants_1.ChainId.BASE]: { [merkl_1.AMMType.SushiSwapV3]: 'https://api.studio.thegraph.com/query/32073/v3-base/version/latest' }, }; const merklSubgraphPrefix = 'https://api.thegraph.com/subgraphs/name/angleprotocol/'; const merklSubgraphPrefixStudio = 'https://api.studio.thegraph.com/query/12694/'; const getMerklSubgraphPrefix = (env, isHostedService = true) => { return isHostedService ? merklSubgraphPrefix + (env !== 'prod' ? 'test-merkl-' : 'merkl-') : merklSubgraphPrefixStudio + (env !== 'prod' ? 'test-merkl-' : 'merkl-'); }; exports.getMerklSubgraphPrefix = getMerklSubgraphPrefix; const merklSubgraphAMMEndpoints = (env) => { return { [constants_1.ChainId.ARBITRUM]: { [merkl_1.AMMType.SushiSwapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-arb', [merkl_1.AMMType.UniswapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-arb', [merkl_1.AMMType.Camelot]: (0, exports.getMerklSubgraphPrefix)(env) + 'camelot-arb', [merkl_1.AMMType.Horiza]: (0, exports.getMerklSubgraphPrefix)(env) + 'horiza-arb', }, [constants_1.ChainId.MAINNET]: { [merkl_1.AMMType.SushiSwapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-eth', [merkl_1.AMMType.UniswapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-eth', [merkl_1.AMMType.PancakeSwapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'pancakeswapv3-eth', }, [constants_1.ChainId.OPTIMISM]: { [merkl_1.AMMType.SushiSwapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-opt', [merkl_1.AMMType.UniswapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-opt', }, [constants_1.ChainId.POLYGON]: { [merkl_1.AMMType.Retro]: (0, exports.getMerklSubgraphPrefix)(env) + 'retro-pol', [merkl_1.AMMType.SushiSwapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'sushiswapv3-pol', [merkl_1.AMMType.UniswapV3]: (0, exports.getMerklSubgraphPrefix)(env) + 'uniswapv3-pol', }, [constants_1.ChainId.POLYGONZKEVM]: { [merkl_1.AMMType.PancakeSwapV3]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'pancakeswapv3-zkevm/version/latest', }, [constants_1.ChainId.BASE]: { [merkl_1.AMMType.SushiSwapV3]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'sushiswapv3-base/version/latest', [merkl_1.AMMType.BaseSwap]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'basex-base/version/latest', [merkl_1.AMMType.Horiza]: (0, exports.getMerklSubgraphPrefix)(env, false) + 'horiza-base/version/latest', }, }; }; exports.merklSubgraphAMMEndpoints = merklSubgraphAMMEndpoints; const merklSubgraphALMEndpoints = (env) => { return { [constants_1.ChainId.ARBITRUM]: { [merkl_1.ALMType.Arrakis]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-arb', [merkl_1.ALMType.ArrakisV2]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakisv2-arb', [merkl_1.ALMType.Gamma]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-arb', [merkl_1.ALMType.DefiEdge]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-arb', [merkl_1.ALMType.Range]: (0, exports.getMerklSubgraphPrefix)(env) + 'range-arb', [merkl_1.ALMType.Steer]: (0, exports.getMerklSubgraphPrefix)(env) + 'steer-arb', [merkl_1.ALMType.Unipilot]: (0, exports.getMerklSubgraphPrefix)(env) + 'unipilot-arb', }, [constants_1.ChainId.MAINNET]: { [merkl_1.ALMType.Arrakis]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-eth', [merkl_1.ALMType.Gamma]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-eth', [merkl_1.ALMType.DefiEdge]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-eth', [merkl_1.ALMType.Ichi]: (0, exports.getMerklSubgraphPrefix)(env) + 'ichi-eth', [merkl_1.ALMType.Range]: (0, exports.getMerklSubgraphPrefix)(env) + 'range-eth', }, [constants_1.ChainId.OPTIMISM]: { [merkl_1.ALMType.Arrakis]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-opt', [merkl_1.ALMType.Gamma]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-opt', [merkl_1.ALMType.DefiEdge]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-opt', [merkl_1.ALMType.Steer]: (0, exports.getMerklSubgraphPrefix)(env) + 'steer-opt', }, [constants_1.ChainId.POLYGON]: { [merkl_1.ALMType.Arrakis]: (0, exports.getMerklSubgraphPrefix)(env) + 'arrakis-pol', [merkl_1.ALMType.Gamma]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-pol', [merkl_1.ALMType.DefiEdge]: (0, exports.getMerklSubgraphPrefix)(env) + 'defiedge-pol', [merkl_1.ALMType.Ichi]: (0, exports.getMerklSubgraphPrefix)(env) + 'ichi-pol', [merkl_1.ALMType.Steer]: (0, exports.getMerklSubgraphPrefix)(env) + 'steer-pol', [merkl_1.ALMType.Range]: (0, exports.getMerklSubgraphPrefix)(env) + 'range-pol', }, [constants_1.ChainId.POLYGONZKEVM]: {}, [constants_1.ChainId.BASE]: { [merkl_1.ALMType.Gamma]: (0, exports.getMerklSubgraphPrefix)(env) + 'gamma-base', }, }; }; exports.merklSubgraphALMEndpoints = merklSubgraphALMEndpoints; //# sourceMappingURL=endpoints.js.map