mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Gas metrics tweaks for swaps failed and completed events (#9676)
* Change base of estimated_gas sent to analytics * Add suggested_gas_price and used_gas_price to analytics
This commit is contained in:
parent
10227266f9
commit
5cc40bff41
@ -860,7 +860,7 @@ export default class TransactionController extends EventEmitter {
|
||||
|
||||
const estimatedVsUsedGasRatio = `${
|
||||
(new BigNumber(txMeta.txReceipt.gasUsed, 16))
|
||||
.div(txMeta.swapMetaData.estimated_gas, 16)
|
||||
.div(txMeta.swapMetaData.estimated_gas, 10)
|
||||
.times(100)
|
||||
.round(2)
|
||||
}%`
|
||||
|
@ -23,7 +23,7 @@ import {
|
||||
import { AWAITING_SWAP_ROUTE, BUILD_QUOTE_ROUTE, LOADING_QUOTES_ROUTE, SWAPS_ERROR_ROUTE, SWAPS_MAINTENANCE_ROUTE } from '../../helpers/constants/routes'
|
||||
import { fetchSwapsFeatureLiveness } from '../../pages/swaps/swaps.util'
|
||||
import { calcGasTotal } from '../../pages/send/send.utils'
|
||||
import { decimalToHex, getValueFromWeiHex, hexMax, decGWEIToHexWEI, hexToDecimal, decEthToConvertedCurrency } from '../../helpers/utils/conversions.util'
|
||||
import { decimalToHex, getValueFromWeiHex, hexMax, decGWEIToHexWEI, hexToDecimal, decEthToConvertedCurrency, hexWEIToDecGWEI } from '../../helpers/utils/conversions.util'
|
||||
import { calcTokenAmount } from '../../helpers/utils/token-util'
|
||||
import {
|
||||
getFastPriceEstimateInHexWEI,
|
||||
@ -473,7 +473,9 @@ export const signAndSendTransactions = (history, metaMetricsEvent) => {
|
||||
other_quote_selected: usedQuote.aggregator !== getTopQuote(state)?.aggregator,
|
||||
other_quote_selected_source: usedQuote.aggregator === getTopQuote(state)?.aggregator ? '' : usedQuote.aggregator,
|
||||
gas_fees: formatCurrency(gasEstimateTotalInEth, 'usd')?.slice(1),
|
||||
estimated_gas: estimatedGasLimit.toString(16),
|
||||
estimated_gas: estimatedGasLimit.toString(10),
|
||||
suggested_gas_price: hexWEIToDecGWEI(usedGasPrice),
|
||||
used_gas_price: hexWEIToDecGWEI(fastGasEstimate),
|
||||
average_savings: averageSavings,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user