# Fee Components

UTS provides a cost-efficient and transparent fee system for cross-chain transactions, ensuring users pay only for the resources required. Its optimized structure minimizes costs while maintaining reliable and secure token transfers.

## **Gas Fees**

Cross-chain transactions require gas fees on both source and destination networks, covering computational tasks like minting, burning, locking, and unlocking. Gas limits dynamically adjust to real-time network conditions to prevent overpayment.

* **Destination Gas Limit (dstGasLimit):** User-defined maximum gas for the destination network.
* **Destination Gas Price (dstGasPriceInWei):** Real-time gas price updated by UTS backend.
* **Native Token Prices:** Prices of source and destination native tokens (e.g., ETH, BNB) in USD are tracked for accurate fee estimation.

```plaintext
codebaseFeeAtCurrentNative = dstGasLimit * dstGasPriceInWei * (dstNativePriceInUSDe18 / curNativePriceInUSDe18)
```

## **Payload Fees**

Fees for transferring additional data, calculated based on the data size (in bytes) and destination gas price.

```plaintext
codepayloadPriceAtCurrentNative = payloadLength * dstPricePerByteInWei * (dstNativePriceInUSDe18 / curNativePriceInUSDe18)
```

## **Bridge Transaction Fees**

Protocol fees for managing token transfers, covering operational costs of the Entangle Bridge.

* **Source Network Execution:** Gas fees for burning or locking tokens.
* **Destination Network Execution:** Gas fees for minting or unlocking tokens.
* **Protocol Fee:** A flat fee deducted during the transaction.

## Fee Optimization

UTS minimizes on-chain workload by performing calculations off-chain. Backend services compute values like `dstGasPriceAtCurrentNative` and `dstPayloadPriceAtCurrentNative` before passing them to the contract, reducing unnecessary costs for users.
