Skip to content

Commit

Permalink
add log by reading from profit client
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed Dec 16, 2024
1 parent 2d845a6 commit 391f408
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/relayer/Relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
TransactionResponse,
ZERO_ADDRESS,
Profiler,
convertFromWei,
} from "../utils";
import { RelayerClients } from "./RelayerClientHelper";
import { RelayerConfig } from "./RelayerConfig";
Expand Down Expand Up @@ -1375,12 +1376,14 @@ export class Relayer {
.mul(fixedPointAdjustment)
.div(deposit.inputAmount);
const totalFeePct = formatFeePct(_totalFeePct);
const totalGasCosts = this.clients.profitClient.getGasCostsForChain(deposit.destinationChainId);
const gasPriceGwei = convertFromWei(totalGasCosts.gasPrice.toString(), 9)
const { symbol: outputTokenSymbol, decimals: outputTokenDecimals } =
this.clients.hubPoolClient.getTokenInfoForAddress(deposit.outputToken, deposit.destinationChainId);
const _outputAmount = createFormatFunction(2, 4, false, outputTokenDecimals)(deposit.outputAmount.toString());
msg +=
` and output ${_outputAmount} ${outputTokenSymbol}, with depositor ${depositor}.` +
` Realized LP fee: ${realizedLpFeePct}%, total fee: ${totalFeePct}%.`;
` Realized LP fee: ${realizedLpFeePct}%, total fee: ${totalFeePct}%. Gas price: ${gasPriceGwei} Gwei.`;

return msg;
}
Expand Down

0 comments on commit 391f408

Please sign in to comment.