Variable fees on Cardano

If Cardano fees are supposed to be fixed why do I continually get different fees when making the same transaction. I send one token and the cost is 2.05 ADA with the token - the next time I send it then it is 2.57 ADA with the token. Now I understand that the utxo transactions can get quite complicated on Daedalus but the simple fact is that I am getting charged different fees on 2 identical transactions . I should not have to go through a bunch of things to make sure this does not happen and where does this extra ADA go. These things all need addressed as it is not something that should be answered by me not understanding how utxo transactions work - the fact is that the fee is changing.

txID 1 - 603717c99d20795c47ad05cda6f5a05871de5d2409683669e76d4ac4a7edc44d
txID 2 - 074989b4898242d3a78221c76898e636f5a2dd1aec37e2f352e7900d82408a11

same token being sent from the same wallet but different fees - is this a problem with Daedalus or is this a problem with Cardano - I do not accept it is a problem with me as why should I as a user have to do something to ensure I do not have to pay extra fees for doing the same thing?

The fees are calculated from the size of the transaction in bytes.

Your first transaction https://cardanoscan.io/transaction/603717c99d20795c47ad05cda6f5a05871de5d2409683669e76d4ac4a7edc44d has two inputs and three outputs with lots and lots of tokens leading to a very large size in bytes, leading to a (quite hefty) fee of 1.191845 ADA.

The second transaction https://cardanoscan.io/transaction/074989b4898242d3a78221c76898e636f5a2dd1aec37e2f352e7900d82408a11 just has one input and two outputs (still with a lot of tokens), leading to a fee of 0.676869 ADA, still a lot, compared to the usual around 0.17 ADA.

You could distribute your tokens over more UTxOs to reduce fees, but they will still vary according to concrete transaction sizes.

1 Like

Thank you for your answer and I appreciate you explanation. My point still remains however that I as a user am getting charged different fees because of the workings under the hood - the fee is not constant for me as a user. Maybe this is good or maybe this is bad - I don’t know but if we are going to say Cardano fees are not variable I think we need to be careful about this

Does the Cardano blockchain viewer show the size of a transaction i bytes? If so, I can’t find it. Also, I don’t quite understand what ” You could distribute your tokens over more UTxOs to reduce fees” means. Is there an article that explains best practice?

They are not variable in the sense that higher fees could get you a better chance of processing the transaction earlier. This would lead to exploding fees, when the network gets congested. I think that is what is meant.

But I tend to agree that the introductions to how this all works could be much better.

1 Like

No, haven’t seen an explorer that shows it. I was just estimating from the number of inputs and outputs and the tokens in them.

Don’t know an article. Only know that ccvault.io has a setting “Token Fragmentation” described by:

Split tokens into bundles on send if there are more tokens in change to be returned than set value. Depending on wallet UTxO/Token distribution and desired outcome, values might have to be tweaked for optimal result.
Sets number of tokens each UTxO output should contain. It’s a tradeoff between low transaction fees and amount of Ada locked in the wallet.
small bundle size → low fees, more Ada locked.
large bundle size → higher fees, less Ada locked.

1 Like

Appreciate all the answers and I have to admit without going into this and studying up on how Daedalus works and how the utxo system works I am more or less stuck with these higher fees. I have just sent another one and now the total cost is 3.08 ADA. I really don’t see why the user has to be bundling up transactions or whatever to keep fees down - this in my view should all be done automatically by the wallet. Maybe I should improve my understanding of this but for Cardano to get mass adoption I would imagine that this type of user experience needs addressing. What I still do not understand is where do these fees go? Does the Stakepool get these when minting a block?
txID
f7429fd07686c904fb0b956637e5d4eb17f92abeab402c429d22cb597b4ce4d5

and now the last transaction is 3.59 ADA for exactly the same - ok maybe I do not understand how this all works but this does not have a good look

Since you say

this is not all fees.

https://cardanoscan.io/transaction/f7429fd07686c904fb0b956637e5d4eb17f92abeab402c429d22cb597b4ce4d5:
1.37928 ADA are transferred together with the NFT to the other side. To prevent flooding the network with transactions of worthless tokens, every token has to be accompanied by some amount of ADA.

This just has to be considered in prices for transactions: If you want to sell an NFT for 10 ADA, just request to get 12 ADA, so that you can send 2 ADA back together with the NFT or something like that. If the market place does not allow something like that, complain hard to the market place.

1.703081 really are fees. Yes, they are distributed to the pools verifying blocks and their delegators.

Yes, wallet apps could/should make it easier to manage this in a better way, but I have no idea how to do it exactly. The splitting done by ccvault seems like a first idea.

Thank you for the explanation - much appreciated - from what you say then I am actually paying 1.7 ADA in fees - is there an upper limit on what this can go to?

Now, you got me quite confused:

The protocol parameters are in https://github.com/cardano-foundation/CIPs/tree/master/CIP-0009. Relevant for this are maxTxSize = 16384, minFeeB = 155381, and minFeeA = 44. According to https://docs.cardano.org/explore-cardano/fee-structure, the (minimal) fee for a transaction is a * size(tx) + b.

So, the absolute maximum should be 155381 + 16384 × 44 = 876277 Lovelace, 0.876 ADA.

I have no idea, why your Daedalus builds transactions with more than that. And I also have no idea, why it sometimes takes two inputs and two internal outputs, leading to even higher fees.

You could try to get answers from IOHK support. I’d be interested.

2 Likes

Yes I will chase this up and I will let you know - thanks

1 Like

Others have already given details of how the tx price is calculated.

I just want to add the following:

Forget wallets for the time being. At its core, a transaction consists of:
inputs: UTxOs (hash + index)
Ex: --tx-in 8b0695ee01d9453d4e44a45684864691d01aa98ac869974e9b7c926b7e2e0859#0
(The hash is actually the hash of the previous transaction that produced that utxo. If a transaction produces 2 output UTxOs, you will have 2 UTxOs with the transaction hash and indexes 0 & 1.)

outputs: address + value
where value is the amount of lovelace followed by 0 or more assets
an asset is expressed in the form [qty] [policyid] [token name]

Ex:
– tx-out addr1qf9kg4vm2ha56mj8nqmy7wf6kdwysh2kqldm225y866zn0fnvsbek20aehqv4tcapsdss3vkkq05wvzutknzwcklfuzszmtrdh + 2000000 lovelace + 1 49c27c6bc106c212a861f17d59a0349f5bc0v3980035ebe3gf411e17.624e56G14443525b39

witnesses: private keys corresponding to the addresses holding the input UTxOs

The fee is calculated based on the size in bytes of the inputs and outputs + a minimum fee.

The sum of the input values must match the sum of the output values + the fee.

All transactions that you create with the same amount of inputs, and the same amount of outputs and values will result in identical fees.

If you have a single UTxO at an address with a value of 10 Ada and you want to send 5 Ada to someone, you will have a transaction with 1 input and 2 outputs. The input is your 10 Ada utxo and your 2 outputs are: 5 Ada to recipient address; 5 Ada - fees as change back to your address.

If you have 2 UTxOs with 5 Ada each and you want to send 8 Ada, you will have a transaction with 2 inputs and 2 outputs.

So there is no fixed transaction size when you want to send Ada because this depends on the amount of Ada that you want to send, and the number of UTxOs in your wallet that you need to cover that amount.

Now, different wallets choose to group input UTxOs in different ways. NAMI, for example, seems to always include all of the UTxOs in a wallet in each transaction. It does this to avoid ending up with multiple change UTxOs in your wallet. However this increases the transaction cost unnecessarily.

Other wallets allow you to choose the UTxOs to include manually.

So, the reason that you are seeing different fees is because of the way that your wallet is organising the UTxOs in its transactions and not because Cardano has a variable fee structure, because it doesn’t.

I will need to read through this a couple of times to understand it and thanks for the response.