Skip to content

Commit

Permalink
fix: op bridge estimation
Browse files Browse the repository at this point in the history
Signed-off-by: james-a-morris <[email protected]>
  • Loading branch information
james-a-morris committed Jul 22, 2024
1 parent ced6a50 commit 3e0f978
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/views/Bridge/hooks/useEstimatedRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ export function useEstimatedRewards(
return undefined;
}
const totalFeeInL1 = bridgeFee.add(gasFee);
const maximalFee = parseUnits("0.0025", token.decimals); // 25 bips parsed to the input amount decimals
const maximalFee = inputAmount
.mul(parseUnits("0.0025", 18)) // Cap fee at 25 basis points of input amount
.div(fixedPointAdjustment);

const cappedFee = min(totalFeeInL1, maximalFee);

const totalRewardInL1 = cappedFee
Expand Down Expand Up @@ -101,7 +104,6 @@ export function useEstimatedRewards(
gasFee,
rewardToken,
inputAmount,
token.decimals,
]);

const hasDepositReward = depositReward?.rewardAsL1.gt(0) ?? false;
Expand Down

0 comments on commit 3e0f978

Please sign in to comment.