<p>Your formula is correct if no Plutus script is executed in the transaction. If a Plutus script validates the transaction, then one needs to add the cost of the most costly possible Plutus script. Here is a recipe: <a href="https://github.com/input-output-hk/marlowe-cardano/blob/b1ef6295e1a566d70fdf3ac07796b858686b5aca/marlowe-runtime/tx/Language/Marlowe/Runtime/Transaction/Constraints.hs#L417-L428" rel="nofollow noreferrer">Language.Marlowe.Runtime.Transaction.Constraints.maximumFee</a>.</p>
<p>The <code>collateralPercentage</code> procotol parameter will tell you how much greater than the fee the collateral requirement is. <a href="https://cexplorer.io/params" rel="nofollow noreferrer">Currently it is 150%.</a>.</p>

CC BY-SA 4.0
2023-08-03T15:18:22.847Z
2023-08-03T15:18:22.847Z
B W Bush
<p>As per my understanding, the formula to calculate for the transaction fees is <code>a * tx' + b</code> where <code>tx'</code> is the size of the transaction (in bytes).</p>
<p>Now the current value of <code>a</code> &amp; <code>b</code> is <code>44</code> &amp; <code>155381</code> respectively and bounding <code>tx'</code> by <code>16384</code>, I get that fees is always <code>&lt;= 0.876277</code> ada. And therefore the ada only balance needed as collateral should always be <code>&lt;= ⌈1.5 * 0.876277⌉ = 1.314416</code> ada (collateral percentage is set to 150 inside current protocol parameters).</p>
<p>Is the above formulation correct?</p>

<fee>
Maximum transaction fees possible & maximum ada needed for collateral as per current protocol parameters
# Maximum transaction fees possible & maximum ada needed for collateral as per current protocol parameters

(Asked by: username_0 on 2023-07-24)

As per my understanding, the formula to calculate for the transaction fees is `a * tx' + b` where `tx'` is the size of the transaction (in bytes).

Now the current value of `a` & `b` is `44` & `155381` respectively and bounding `tx'` by `16384`, I get that fees is always `<= 0.876277` ada. And therefore the ada only balance needed as collateral should always be `<= ⌈1.5 * 0.876277⌉ = 1.314416` ada (collateral percentage is set to 150 inside current protocol parameters).

Is the above formulation correct?

**Tags:** fee

---

## 1 answers

### Answer by username_1 on 2023-08-03. Score: 1 | Accepted answer

Your formula is correct if no Plutus script is executed in the transaction. If a Plutus script validates the transaction, then one needs to add the cost of the most costly possible Plutus script. Here is a recipe: [Language.Marlowe.Runtime.Transaction.Constraints.maximumFee](https://github.com/input-output-hk/marlowe-cardano/blob/b1ef6295e1a566d70fdf3ac07796b858686b5aca/marlowe-runtime/tx/Language/Marlowe/Runtime/Transaction/Constraints.hs#L417-L428).

The `collateralPercentage` procotol parameter will tell you how much greater than the fee the collateral requirement is. [Currently it is 150%.](https://cexplorer.io/params).


---

