Skip to content

Commit

Permalink
hotfix: set 9600 seconds of estimated time if a large deposit is quot…
Browse files Browse the repository at this point in the history
…ed from L1 -> ZKSync

Signed-off-by: james-a-morris <[email protected]>
  • Loading branch information
james-a-morris committed Jan 6, 2025
1 parent d5338f0 commit 4a54d0a
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions api/suggested-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { type, assert, Infer, optional, string, enums } from "superstruct";
import {
DEFAULT_SIMULATED_RECIPIENT_ADDRESS,
DEFAULT_QUOTE_BLOCK_BUFFER,
CHAIN_IDs,
} from "./_constants";
import { TypedVercelRequest } from "./_types";
import {
Expand Down Expand Up @@ -274,15 +275,30 @@ const handler = async (
));
}

// TODO: Remove after campaign is complete
/**
* Override estimated fill time for ZK Sync deposits.
* @todo Remove after campaign is complete
* @see Change in {@link ./limits.ts}
*/
const estimatedTimingOverride =
computedOriginChainId === CHAIN_IDs.MAINNET &&
destinationChainId === CHAIN_IDs.ZK_SYNC &&
amount.gte(limits.maxDepositShortDelay)
? 9600
: undefined;

const responseJson = {
estimatedFillTimeSec: amount.gte(maxDepositInstant)
? resolveRebalanceTiming(String(destinationChainId))
: resolveTiming(
String(computedOriginChainId),
String(destinationChainId),
inputToken.symbol,
amountInUsd
),
estimatedFillTimeSec:
estimatedTimingOverride ??
(amount.gte(maxDepositInstant)
? resolveRebalanceTiming(String(destinationChainId))
: resolveTiming(
String(computedOriginChainId),
String(destinationChainId),
inputToken.symbol,
amountInUsd
)),
capitalFeePct: relayerFeeDetails.capitalFeePercent,
capitalFeeTotal: relayerFeeDetails.capitalFeeTotal,
relayGasFeePct: relayerFeeDetails.gasFeePercent,
Expand Down

0 comments on commit 4a54d0a

Please sign in to comment.