> ## Documentation Index
> Fetch the complete documentation index at: https://etherspot.fyi/llms.txt
> Use this file to discover all available pages before exploring further.

# Show gas fee in fiat

With account abstraction we want to give users who are
new to blockchain as simple a user experience as possible.

Showing the gas fee in USD rather than the native token will
make it a lot easier to understand for newer users, and we
can do this in a couple of simple steps.

First we start by estimating the current batch of [UserOps](/account-abstraction/userops).
This will be the units of gas used.

```typescript theme={null}
const estimation = await primeSdk.estimate();
```

Then we want to get the gas in wei for this batch.

```typescript theme={null}
const totalGas = await primeSdk.totalGasEstimated(estimation);
```

And multiply this by the current gas fees on the network.

<Info>
  [gas = units of gas used \* (base fee + priority fee)](https://ethereum.org/en/developers/docs/gas/#:~:text=A%20standard%20ETH%20transfer%20requires,get%20back%20the%20remaining%2029%2C000.)
</Info>

```typescript theme={null}
const gas = totalGas.mul(estimation.maxFeePerGas as BigNumberish);
```

Next fix the formatting using the formatEther from ethers.

```typescript theme={null}
const gasInMatic = ethers.utils.formatEther(gas);
```

Then get the current price of the native token to the network.

```typescript theme={null}
const rateData = await primeSdk.fetchExchangeRates({tokens: [ethers.constants.AddressZero], chainId: 137});
```

Finally, multiply the current token price by the gas in the token to get the gas price in USD for this transaction.

```typescript theme={null}
const priceInUsd = usdRate.usd * (+gasInMatic);
```
