fix: add tax amounts to swap quote received (#7299)
This commit is contained in:
parent
736e395cd7
commit
f71c781530
@ -86,7 +86,9 @@ function getQuoteMethod(trade: InterfaceTrade) {
|
||||
export const formatSwapQuoteReceivedEventProperties = (
|
||||
trade: InterfaceTrade,
|
||||
allowedSlippage: Percent,
|
||||
swapQuoteLatencyMs: number | undefined
|
||||
swapQuoteLatencyMs: number | undefined,
|
||||
inputTax: Percent,
|
||||
outputTax: Percent
|
||||
) => {
|
||||
return {
|
||||
...formatCommonPropertiesForTrade(trade, allowedSlippage),
|
||||
@ -95,5 +97,7 @@ export const formatSwapQuoteReceivedEventProperties = (
|
||||
token_in_amount_max: trade.maximumAmountIn(allowedSlippage).toExact(),
|
||||
token_out_amount_min: trade.minimumAmountOut(allowedSlippage).toExact(),
|
||||
quote_latency_milliseconds: swapQuoteLatencyMs,
|
||||
token_out_detected_tax: formatPercentNumber(outputTax),
|
||||
token_in_detected_tax: formatPercentNumber(inputTax),
|
||||
}
|
||||
}
|
||||
|
@ -552,10 +552,10 @@ export function Swap({
|
||||
if (!trade || prevTrade === trade) return // no new swap quote to log
|
||||
|
||||
sendAnalyticsEvent(SwapEventName.SWAP_QUOTE_RECEIVED, {
|
||||
...formatSwapQuoteReceivedEventProperties(trade, allowedSlippage, swapQuoteLatency),
|
||||
...formatSwapQuoteReceivedEventProperties(trade, allowedSlippage, swapQuoteLatency, inputTax, outputTax),
|
||||
...trace,
|
||||
})
|
||||
}, [prevTrade, trade, trace, allowedSlippage, swapQuoteLatency])
|
||||
}, [prevTrade, trade, trace, allowedSlippage, swapQuoteLatency, inputTax, outputTax])
|
||||
|
||||
const showDetailsDropdown = Boolean(
|
||||
!showWrap && userHasSpecifiedInputOutput && (trade || routeIsLoading || routeIsSyncing)
|
||||
|
Loading…
Reference in New Issue
Block a user