@@ -2,9 +2,7 @@ import { Trans } from '@lingui/macro'
22import { Currency , Percent , TradeType } from '@uniswap/sdk-core'
33import { useWeb3React } from '@web3-react/core'
44import { ElementName , Event , EventName } from 'components/AmplitudeAnalytics/constants'
5- import { Trace } from 'components/AmplitudeAnalytics/Trace'
65import { TraceEvent } from 'components/AmplitudeAnalytics/TraceEvent'
7- import { formatPercentInBasisPointsNumber , getNumberFormattedToDecimalPlace } from 'components/AmplitudeAnalytics/utils'
86import AnimatedDropdown from 'components/AnimatedDropdown'
97import Card , { OutlineCard } from 'components/Card'
108import { AutoColumn } from 'components/Column'
@@ -13,15 +11,13 @@ import Row, { RowBetween, RowFixed } from 'components/Row'
1311import { MouseoverTooltipContent } from 'components/Tooltip'
1412import { SUPPORTED_GAS_ESTIMATE_CHAIN_IDS } from 'constants/chains'
1513import { darken } from 'polished'
16- import { useEffect , useState } from 'react'
14+ import { useState } from 'react'
1715import { ChevronDown , Info } from 'react-feather'
1816import { InterfaceTrade } from 'state/routing/types'
1917import styled , { keyframes , useTheme } from 'styled-components/macro'
2018import { HideSmall , ThemedText } from 'theme'
21- import { computeRealizedLPFeePercent } from 'utils/prices'
2219
2320import { AdvancedSwapDetails } from './AdvancedSwapDetails'
24- import { getPriceImpactPercent } from './AdvancedSwapDetails'
2521import GasEstimateBadge from './GasEstimateBadge'
2622import { ResponsiveTooltipContainer } from './styleds'
2723import SwapRoute from './SwapRoute'
@@ -124,29 +120,6 @@ interface SwapDetailsInlineProps {
124120 allowedSlippage : Percent
125121}
126122
127- const formatAnalyticsEventProperties = ( trade : InterfaceTrade < Currency , Currency , TradeType > ) => {
128- const lpFeePercent = trade ? computeRealizedLPFeePercent ( trade ) : undefined
129- return {
130- token_in_symbol : trade . inputAmount . currency . symbol ,
131- token_out_symbol : trade . outputAmount . currency . symbol ,
132- token_in_address : trade . inputAmount . currency . isToken ? trade . inputAmount . currency . address : undefined ,
133- token_out_address : trade . outputAmount . currency . isToken ? trade . outputAmount . currency . address : undefined ,
134- price_impact_basis_points : lpFeePercent
135- ? formatPercentInBasisPointsNumber ( getPriceImpactPercent ( lpFeePercent , trade ) )
136- : undefined ,
137- estimated_network_fee_usd : trade . gasUseEstimateUSD
138- ? getNumberFormattedToDecimalPlace ( trade . gasUseEstimateUSD , 2 )
139- : undefined ,
140- chain_id :
141- trade . inputAmount . currency . chainId === trade . outputAmount . currency . chainId
142- ? trade . inputAmount . currency . chainId
143- : undefined ,
144- token_in_amount : getNumberFormattedToDecimalPlace ( trade . inputAmount , trade . inputAmount . currency . decimals ) ,
145- token_out_amount : getNumberFormattedToDecimalPlace ( trade . outputAmount , trade . outputAmount . currency . decimals ) ,
146- // TODO(lynnshaoyu): Implement quote_latency_milliseconds.
147- }
148- }
149-
150123export default function SwapDetailsDropdown ( {
151124 trade,
152125 syncing,
@@ -158,11 +131,6 @@ export default function SwapDetailsDropdown({
158131 const theme = useTheme ( )
159132 const { chainId } = useWeb3React ( )
160133 const [ showDetails , setShowDetails ] = useState ( false )
161- const [ isFirstPriceFetch , setIsFirstPriceFetch ] = useState ( true )
162-
163- useEffect ( ( ) => {
164- if ( isFirstPriceFetch && syncing ) setIsFirstPriceFetch ( false )
165- } , [ isFirstPriceFetch , syncing ] )
166134
167135 return (
168136 < Wrapper >
@@ -206,18 +174,11 @@ export default function SwapDetailsDropdown({
206174 ) }
207175 { trade ? (
208176 < LoadingOpacityContainer $loading = { syncing } >
209- < Trace
210- name = { EventName . SWAP_QUOTE_RECEIVED }
211- element = { ElementName . SWAP_TRADE_PRICE_ROW }
212- properties = { formatAnalyticsEventProperties ( trade ) }
213- shouldLogImpression = { ! loading && ! syncing && isFirstPriceFetch }
214- >
215- < TradePrice
216- price = { trade . executionPrice }
217- showInverted = { showInverted }
218- setShowInverted = { setShowInverted }
219- />
220- </ Trace >
177+ < TradePrice
178+ price = { trade . executionPrice }
179+ showInverted = { showInverted }
180+ setShowInverted = { setShowInverted }
181+ />
221182 </ LoadingOpacityContainer >
222183 ) : loading || syncing ? (
223184 < ThemedText . DeprecatedMain fontSize = { 14 } >
0 commit comments