Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: suggested-fees min amounts #1196

Merged
merged 6 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions api/suggested-fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,14 @@ const handler = async (
gasPrice
);

const skipAmountLimitEnabled = skipAmountLimit === "true";
const isAmountTooLow =
relayerFeeDetails.isAmountTooLow ||
BigNumber.from(amountInput).lt(limits.minDeposit);

if (!skipAmountLimitEnabled && relayerFeeDetails.isAmountTooLow)
const skipAmountLimitEnabled = skipAmountLimit === "true";
if (!skipAmountLimitEnabled && isAmountTooLow) {
throw new InputError("Sent amount is too low relative to fees");
}

// Across V3's new `deposit` function requires now a total fee that includes the LP fee
const totalRelayFee = BigNumber.from(relayerFeeDetails.relayFeeTotal).add(
Expand Down Expand Up @@ -312,7 +316,7 @@ const handler = async (
timestamp: isNaN(parsedTimestamp)
? quoteTimestamp.toString()
: parsedTimestamp.toString(),
isAmountTooLow: relayerFeeDetails.isAmountTooLow,
isAmountTooLow,
quoteBlock: quoteBlockNumber.toString(),
exclusiveRelayer,
exclusivityDeadline,
Expand Down
Loading