Skip to content

Commit

Permalink
disable adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Sep 29, 2023
1 parent 87854e1 commit 518343f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/dex/dexalot/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const DexalotConfig: DexConfigMap<DexParams> = {
};

export const Adapters: Record<number, AdapterMappings> = {
[Network.AVALANCHE]: {
[SwapSide.SELL]: [{ name: 'AvalancheAdapter02', index: 6 }],
[SwapSide.BUY]: [{ name: 'AvalancheBuyAdapter', index: 8 }],
},
// [Network.AVALANCHE]: {
// [SwapSide.SELL]: [{ name: 'AvalancheAdapter02', index: 6 }],
// [SwapSide.BUY]: [{ name: 'AvalancheBuyAdapter', index: 8 }],
// },
};
6 changes: 3 additions & 3 deletions src/dex/dexalot/dexalot-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ function testForNetwork(
const sideToContractMethods = new Map([
[SwapSide.SELL, [
ContractMethod.simpleSwap,
ContractMethod.megaSwap,
ContractMethod.multiSwap
// ContractMethod.megaSwap,
// ContractMethod.multiSwap
]],
[SwapSide.BUY, [
ContractMethod.simpleBuy,
ContractMethod.buy
// ContractMethod.buy
]],
]);

Expand Down
14 changes: 7 additions & 7 deletions src/dex/dexalot/dexalot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Network,
ETHER_ADDRESS,
CACHE_PREFIX,
NULL_ADDRESS,
} from '../../constants';
import * as CALLDATA_GAS_COST from '../../calldata-gas-cost';
import { getDexKeysWithNetwork, isAxiosError } from '../../utils';
Expand Down Expand Up @@ -60,8 +61,6 @@ import {
import { BI_MAX_UINT256 } from '../../bigint-constants';
import { ethers } from 'ethers';
import BigNumber from 'bignumber.js';
import { TokensMap } from '../swaap-v2/types';
import { normalizeTokenAddress } from '../swaap-v2/utils';

export class Dexalot extends SimpleExchange implements IDex<DexalotData> {
readonly isStatePollingDex = true;
Expand All @@ -77,7 +76,7 @@ export class Dexalot extends SimpleExchange implements IDex<DexalotData> {
private tokensAddrCacheKey: string;
private tokensCacheKey: string;
private blacklistCacheKey: string;
private tokensMap: TokensMap = {};
private tokensMap: TokenDataMap = {};

public static dexKeysWithNetwork: { key: string; networks: Network[] }[] =
getDexKeysWithNetwork(DexalotConfig);
Expand Down Expand Up @@ -217,7 +216,9 @@ export class Dexalot extends SimpleExchange implements IDex<DexalotData> {
}

getIdentifier(baseSymbol: string, quoteSymbol: string) {
return `${this.dexKey}_${baseSymbol}_${quoteSymbol}`.toLowerCase();
// return `${this.dexKey}_${baseSymbol}_${quoteSymbol}`.toLowerCase();
// To disable Dexalot in multi/mega routes
return this.dexKey;
}

async getPoolIdentifiers(
Expand Down Expand Up @@ -294,7 +295,7 @@ export class Dexalot extends SimpleExchange implements IDex<DexalotData> {

normalizeAddress(address: string): string {
return address.toLowerCase() === ETHER_ADDRESS
? ethers.constants.AddressZero.toLowerCase()
? NULL_ADDRESS
: address.toLowerCase();
}

Expand Down Expand Up @@ -672,8 +673,7 @@ export class Dexalot extends SimpleExchange implements IDex<DexalotData> {
}

getTokenFromAddress(address: Address): Token {
return this.tokensMap[normalizeTokenAddress(address)];

return this.tokensMap[this.normalizeAddress(address)];
}

getAdapterParam(
Expand Down

0 comments on commit 518343f

Please sign in to comment.