blog icon indicating copy to clipboard operation
blog copied to clipboard

How to calculate Solana transaction fee

Open onmyway133 opened this issue 3 years ago • 0 comments

A simple way is to use a fixed fee of 0.000005

For example from https://solscan.io/tx/5DkApvwTYuMqCiA94MhUVKJoLn8MGma9gAWXhreRJKqAs395P5CqEK3R84m3MWjcTKMem53XcLwYErGkaJAbQC2h?cluster=testnet

And call some exchange API, like Coingecko https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd and show the price in USD

{
  "solana": {
    "usd": 114.13
  }
}

onmyway133 avatar Feb 10 '22 20:02 onmyway133