diff --git a/packages/asset-swapper/src/utils/market_operation_utils/orders.ts b/packages/asset-swapper/src/utils/market_operation_utils/orders.ts index e37714d2a0..3a381e8680 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/orders.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/orders.ts @@ -21,6 +21,7 @@ import { GeistFillData, GenericRouterFillData, GMXFillData, + GMXSwapFillData, KyberDmmFillData, KyberFillData, LidoFillData, @@ -372,7 +373,7 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder break; case ERC20BridgeSource.GMX: const gmxFillData = (order as OptimizedMarketBridgeOrder).fillData; - bridgeData = encoder.encode([gmxFillData.reader, gmxFillData.vault, gmxFillData.tokenAddressPath]); + bridgeData = encoder.encode([gmxFillData.router,gmxFillData.reader,gmxFillData.vault, gmxFillData.tokenAddressPath]); break; default: diff --git a/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts b/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts index c970d5451b..fd88b922d4 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts @@ -1219,6 +1219,7 @@ export class SamplerOperations { }); } public getGMXSellQuotes( + router: string, reader: string, vault: string, tokenAddressPath: string[], @@ -1226,7 +1227,7 @@ export class SamplerOperations { ): SourceQuoteOperation { return new SamplerContractOperation({ source: ERC20BridgeSource.GMX, - fillData: {reader, vault, tokenAddressPath }, + fillData: {router, reader, vault, tokenAddressPath }, contract: this._samplerContract, function: this._samplerContract.sampleSellsFromGMX, params: [reader, vault, tokenAddressPath, takerFillAmounts], @@ -1627,9 +1628,10 @@ export class SamplerOperations { case ERC20BridgeSource.GMX: { return this.getGMXSellQuotes( + GMX_ROUTER_BY_CHAIN_ID[this.chainId], GMX_READER_BY_CHAIN_ID[this.chainId], GMX_VAULT_BY_CHAIN_ID[this.chainId], - [makerToken, takerToken], + [takerToken, makerToken], takerFillAmounts, ); } diff --git a/packages/asset-swapper/src/utils/market_operation_utils/types.ts b/packages/asset-swapper/src/utils/market_operation_utils/types.ts index 6f614d9ee5..ae8726f7d9 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/types.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/types.ts @@ -229,10 +229,15 @@ export interface GMXQuoteFillData extends FillData { vault: string; } export interface GMXFillData extends FillData { + router: string; reader: string; vault: string; tokenAddressPath: string[]; } +export interface GMXSwapFillData extends FillData { + router: string; + tokenAddressPath: string[]; +} export interface ShellFillData extends FillData { poolAddress: string;