> For the complete documentation index, see [llms.txt](https://docs.onyx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onyx.org/developer-guide/network-fees.md).

# Network Fees

Onyx network fees are paid in native **XCN**. The network assigns USD-denominated costs to transaction resources, converts those costs into XCN using the current network conversion rate, and exposes wallet-compatible gas values through JSON-RPC.

The XCN amount can change as the conversion rate changes, even when the intended USD cost is broadly stable. Always obtain a fresh gas estimate and gas price immediately before signing.

This page focuses on EVM transactions submitted through the public JSON-RPC endpoint. Native service transactions can include additional resource-based charges; use the final transaction record or explorer entry for the amount actually charged.

## Current fee snapshot

The following values were verified against Onyx Mainnet on **July 21, 2026 at 19:38 UTC**:

| Item                                 |                 Current value |
| ------------------------------------ | ----------------------------: |
| Wallet gas price from `eth_gasPrice` | **620 Gwei** (`0x905ae13800`) |
| Wallet gas price in native units     |        **62 tinyXCN per gas** |
| Wallet gas price in XCN              |    **0.00000062 XCN per gas** |
| Network conversion rate              |          **$0.00477 per XCN** |
| Approximate USD cost per gas         |          **$0.0000000029574** |

The raw EVM network fee estimate was **54 tinyXCN per gas** at the same snapshot. The public RPC gas price included the network's current 15% safety margin and rounded the result to 62 tinyXCN. This margin helps prevent a transaction from becoming underpriced if the XCN conversion changes between estimation and submission.

At this snapshot, the wallet-facing calculation was:

```
raw network price = 54 tinyXCN per gas
safety margin = round(54 x 15%) = 8 tinyXCN per gas
wallet gas price = 54 + 8 = 62 tinyXCN per gas
```

These are dated values, not permanent constants. Query the live RPC before every transaction.

## How the fee is calculated

For an executed EVM transaction:

```
network fee in XCN = gas used x effective gas price / 10^18
network fee in USD = network fee in XCN x current USD-per-XCN conversion rate
```

The gas limit is a maximum execution allowance, not necessarily the amount charged:

```
maximum gas budget = gas limit x maximum fee per gas
final execution charge = gas used x effective gas price
```

Unused gas is not charged. A reverted or otherwise unsuccessful transaction can still consume gas and incur a fee for the work performed.

### Example costs at the current snapshot

| Gas used |  Fee in XCN | Approximate fee in USD |
| -------: | ----------: | ---------------------: |
|   21,000 | 0.01302 XCN |             $0.0000621 |
|  100,000 |   0.062 XCN |              $0.000296 |
|  800,000 |   0.496 XCN |               $0.00237 |

A transfer to an existing account may use 21,000 gas. A transfer that creates its destination account can require substantially more. Use the actual transaction with `eth_estimateGas`; do not select a gas limit from this table. See [Lazy Account Creation](/developer-guide/lazy-create-gas.md).

## XCN, tinyXCN, Gwei, and USD

Native XCN settles at 8-decimal ledger precision while EVM JSON-RPC uses 18-decimal wallet units:

```
1 XCN = 100,000,000 tinyXCN
1 tinyXCN = 10,000,000,000 EVM wallet units = 10 Gwei
620 Gwei = 62 tinyXCN = 0.00000062 XCN
```

For the snapshot above, the network conversion rate represented **30,000 XCN as 14,310 cents**, or:

```
$143.10 / 30,000 XCN = $0.00477 per XCN
```

USD figures are estimates for understanding the network's fee denomination. The transaction is charged in XCN, not USD, and a wallet or exchange may display a different market conversion.

## Obtain the live values

Read the wallet-facing gas price from the public RPC:

```bash
curl -sS https://rpc.onyx.org \
  -H 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}'
```

Read the current network conversion rate and raw EVM fee schedule:

```bash
curl -sS https://api.onyx.org/api/v1/network/exchangerate
curl -sS https://api.onyx.org/api/v1/network/fees
```

Applications should use `eth_estimateGas` for gas units and `eth_gasPrice` for the wallet-facing price. Onyx does not currently use Ethereum's dynamic congestion base fee: `baseFeePerGas` is zero, while `eth_maxPriorityFeePerGas` returns the same current value as `eth_gasPrice`. Do not copy fee settings from another network.

## Network fees versus application fees

Network gas is separate from fees charged by an application or protocol:

* **Bridge fees** are quoted by the bridge and can vary by asset and direction.
* **Swap fees and price impact** are determined by the selected liquidity pool and trade.
* **Staking protocol fees** are governed by the staking contract's current parameters.

A transaction can include both a network fee and an application-level fee. Review both before confirming.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.onyx.org/developer-guide/network-fees.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
