@@ -14,12 +14,13 @@ import { decode, fromWords } from 'bech32';
1414import bs58 from 'bs58' ;
1515import { encodeFunctionData , type Hex } from 'viem' ;
1616import type { EntryPointVersion , SmartAccountImplementation } from 'viem/account-abstraction' ;
17- import { avalanche } from 'viem/chains' ;
17+ import { avalanche , mainnet } from 'viem/chains' ;
1818
1919import config from '../config' ;
2020import {
2121 dydxChainId ,
2222 entryPoint ,
23+ ETH_USDC_QUANTUM ,
2324 ethDenomByChainId , usdcAddressByChainId ,
2425} from '../lib/smart-contract-constants' ;
2526import { getAddress , publicClients } from './alchemy-helpers' ;
@@ -44,6 +45,7 @@ export async function buildUserAddresses(
4445 ) ;
4546}
4647const nobleForwardingModule = 'https://api.noble.xyz/noble/forwarding/v1/address/channel' ;
48+ const ethereumGoFastFreeMinimumUSDC = config . ETHEREUM_GO_FAST_FREE_MINIMUM * ETH_USDC_QUANTUM ;
4749const skipMessagesTimeoutSeconds = '60' ;
4850const dydxNobleChannel = 33 ;
4951const slippageTolerancePercent = config . SKIP_SLIPPAGE_TOLERANCE_PERCENTAGE ;
@@ -60,6 +62,12 @@ export async function getSkipCallData(
6062 if ( amount . startsWith ( '0x' ) ) {
6163 amountToUse = parseInt ( amount , 16 ) . toString ( ) ;
6264 }
65+
66+ let goFast = true ;
67+ if ( chainId === mainnet . id . toString ( ) &&
68+ parseInt ( amountToUse , 10 ) < ethereumGoFastFreeMinimumUSDC ) {
69+ goFast = false ;
70+ }
6371 const routeResult = await route ( {
6472 amountIn : amountToUse , // Desired amount in smallest denomination (e.g., uatom)
6573 sourceAssetDenom,
@@ -73,7 +81,7 @@ export async function getSkipCallData(
7381 evmSwaps : true , // needed for native eth bridging.
7482 } ,
7583 allowUnsafe : false ,
76- goFast : true ,
84+ goFast,
7785 } ) ;
7886 logger . info ( {
7987 at : 'skip-helper#getSkipCallData' ,
0 commit comments