Skip to content

Commit

Permalink
improve: hone in the fees
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 Jan 10, 2025
1 parent 0a872bd commit a691c70
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/views/Bridge/hooks/useBridgeAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,13 @@ export function useBridgeAction(
// 4. We must construct a payload to send to HL's Bridge2 contract
// 5. The user must sign this signature

// For now let's assume a 2% loss in the amount
const amount = frozenDepositArgs.amount.mul(98).div(100);
// Estimated fee for this HL deposit. Sum of the relayer capital fee,
// the lp fee, and 2x the relayer gas fee.
const estimatedFee = frozenFeeQuote.relayerCapitalFee.total
.add(frozenFeeQuote.lpFee.total)
.add(frozenFeeQuote.relayerGasFee.total.mul(2));

const amount = frozenDepositArgs.amount.sub(estimatedFee);

// Build the payload
const hyperLiquidPayload = await generateHyperLiquidPayload(
Expand Down

0 comments on commit a691c70

Please sign in to comment.