diff --git a/src/config.ts b/src/config.ts index 4741b30e8..167135fd7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -34,6 +34,7 @@ type BaseConfig = { swaapV2AuthToken?: string; dexalotAuthToken?: string; forceRpcFallbackDexs: string[]; + spookySwapSubgraphAuthToken?: string; }; const baseConfigs: { [network: number]: BaseConfig } = { @@ -249,6 +250,9 @@ const baseConfigs: { [network: number]: BaseConfig } = { multicallV2Address: '0xdC6E2b14260F972ad4e5a31c68294Fba7E720701', privateHttpProvider: process.env.HTTP_PROVIDER_250, hashFlowAuthToken: process.env.API_KEY_HASHFLOW_AUTH_TOKEN || '', + smardexSubgraphAuthToken: process.env.API_KEY_SMARDEX_SUBGRAPH || '', + spookySwapSubgraphAuthToken: process.env.API_KEY_SPOOKY_SWAP_SUBGRAPH || '', + hashFlowDisabledMMs: process.env[`HASHFLOW_DISABLED_MMS_250`]?.split(',') || [], augustusV6Address: '0x000dB803A70511E09dA650D4C0506d0000100000', @@ -459,6 +463,7 @@ export function generateConfig(network: number): Config { dexalotAuthToken: baseConfig.dexalotAuthToken, hashFlowDisabledMMs: baseConfig.hashFlowDisabledMMs, forceRpcFallbackDexs: baseConfig.forceRpcFallbackDexs, + spookySwapSubgraphAuthToken: baseConfig.spookySwapSubgraphAuthToken, }; } diff --git a/src/dex/uniswap-v2/config.ts b/src/dex/uniswap-v2/config.ts index 24b81cc6c..d149e9964 100644 --- a/src/dex/uniswap-v2/config.ts +++ b/src/dex/uniswap-v2/config.ts @@ -472,8 +472,7 @@ export const UniswapV2Config: DexConfigMap = { }, SpookySwap: { [Network.FANTOM]: { - subgraphURL: - 'https://api.thegraph.com/subgraphs/name/eerieeight/spookyswap', + subgraphURL: 'https://gateway-arbitrum.network.thegraph.com/api/', factoryAddress: '0x152ee697f2e276fa89e96742e9bb9ab1f2e61be3', initCode: '0xcdf2deca40a0bd56de8e3ce5c7df6727e5b1bf2ac96f283fa9c4b3e6b42ea9d2', diff --git a/src/dex/uniswap-v2/uniswap-v2.ts b/src/dex/uniswap-v2/uniswap-v2.ts index fd183e089..3a7042bad 100644 --- a/src/dex/uniswap-v2/uniswap-v2.ts +++ b/src/dex/uniswap-v2/uniswap-v2.ts @@ -1,7 +1,7 @@ import { AbiCoder, Interface } from '@ethersproject/abi'; import { pack } from '@ethersproject/solidity'; import _ from 'lodash'; -import { AsyncOrSync, DeepReadonly } from 'ts-essentials'; +import { AsyncOrSync, DeepReadonly, assert } from 'ts-essentials'; import erc20ABI from '../../abi/erc20.json'; import { StatefulEventSubscriber } from '../../stateful-event-subscriber'; import { @@ -269,6 +269,17 @@ export class UniswapV2 ) { super(dexHelper, dexKey); this.logger = dexHelper.getLogger(dexKey); + if (dexKey === 'SpookySwap' && network === Network.FANTOM) { + const token = dexHelper.config.data.spookySwapSubgraphAuthToken; + assert( + token !== undefined, + 'Spooky subgraph token is not specified with env variable', + ); + this.subgraphURL = + this.subgraphURL + + token + + '/subgraphs/id/HyhMfT7gehNHMBmFiExqeg3pDtop9UikjvBPfAXT3b21'; + } this.factory = new dexHelper.web3Provider.eth.Contract( uniswapV2factoryABI as any, diff --git a/src/dex/uniswap-v3/config.ts b/src/dex/uniswap-v3/config.ts index 24f6bdc33..0503bdf68 100644 --- a/src/dex/uniswap-v3/config.ts +++ b/src/dex/uniswap-v3/config.ts @@ -315,7 +315,7 @@ export const UniswapV3Config: DexConfigMap = { initHash: '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54', subgraphURL: - 'https://api.thegraph.com/subgraphs/name/0xalucard/ftm-spooky-v3', + `https://gateway-arbitrum.network.thegraph.com/api/` + process.env.API_KEY_SPOOKY_SWAP_SUBGRAPH + `/subgraphs/id/6WBxx3gYia4oCLsYMFTZs6HLEnEqVMdpeZDCABnM1tj2`, }, }, Retro: { diff --git a/src/types.ts b/src/types.ts index 305f04f3d..9926ae201 100644 --- a/src/types.ts +++ b/src/types.ts @@ -304,6 +304,7 @@ export type Config = { swaapV2AuthToken?: string; dexalotAuthToken?: string; forceRpcFallbackDexs: string[]; + spookySwapSubgraphAuthToken?: string; }; export type BigIntAsString = string;