> For the complete documentation index, see [llms.txt](https://sodex.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sodex.com/documentation/for-developers/developers/valuechain-evm/gas-and-fees.md).

# Gas & Fees

Gas is native SOSO (18 decimals), not ETH. Native SOSO has no ERC-20 address. WSOSO and other ERC-20 balances cannot pay gas. A native SOSO balance is required to submit a transaction yourself. For sponsored submission, see [Relayer](/documentation/for-developers/developers/valuechain-evm/relayer.md).

## Fee model

EIP-1559 is enabled. The base fee and the priority fee both go to the block builder; the base fee is not burned. Legacy, access-list, and EIP-1559 transactions (types 0–2) are accepted; type-3 blob transactions are not. See [Differences from Ethereum](/documentation/for-developers/developers/valuechain-evm/differences-from-ethereum.md).

For type-2 transactions, `maxFeePerGas` caps the total price per gas and `maxPriorityFeePerGas` caps the tip. These are limits, not a fixed charge:

```
effectiveGasPrice = min(maxFeePerGas, baseFeePerGas + maxPriorityFeePerGas)
```

`maxFeePerGas` must be at least the current `baseFeePerGas`, or the node rejects the transaction. Type-0 transactions use `gasPrice` instead of the two EIP-1559 fields.

The gas limit caps execution gas. The receipt records `gasUsed` and `effectiveGasPrice`.

## Quote a price

Prices are wei per gas, not a total fee. Read the current base fee from the latest block (or [`eth_feeHistory`](/documentation/for-developers/api-reference/json-rpc/eth-feehistory.md)) and a suggested tip from [`eth_maxPriorityFeePerGas`](/documentation/for-developers/api-reference/json-rpc/eth-maxpriorityfeepergas.md):

```bash
curl -sS https://mainnet.valuechain.xyz \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["latest",false]}'

curl -sS https://mainnet.valuechain.xyz \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_maxPriorityFeePerGas","params":[]}'
```

Use the block's `baseFeePerGas` with the suggested tip to set `maxFeePerGas` and `maxPriorityFeePerGas`. [`eth_gasPrice`](/documentation/for-developers/api-reference/json-rpc/eth-gasprice.md) returns a single suggested price per gas (typically about base fee plus tip) for type-0 `gasPrice` or as a rough cap.

```bash
curl -sS https://mainnet.valuechain.xyz \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_gasPrice","params":[]}'
```

Recent mainnet suggestions have been on the order of `0xf4240` wei (base / tip) and `0x1e8480` wei (`eth_gasPrice`). Read the RPCs; do not hardcode these values.

## Estimate execution gas

Call [`eth_estimateGas`](/documentation/for-developers/api-reference/json-rpc/eth-estimategas.md) with the same `from`, `to`, `value`, and `data` that will be submitted. The result is a gas quantity, not an amount of SOSO. `value` is a hex amount in wei (`0x0` for a plain call with no value):

```bash
curl -sS https://mainnet.valuechain.xyz \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"YOUR_SENDER_ADDRESS","to":"YOUR_DESTINATION_ADDRESS","value":"0x0","data":"0x"}]}'
```

Check for a JSON-RPC `error` before using the result. An estimate reflects the current state; a later transaction can still fail if balances, allowances, or contract state change.

## Calculate the execution fee

Use the mined receipt's `gasUsed` and `effectiveGasPrice`:

```
execution fee in wei  = gasUsed × effectiveGasPrice
execution fee in SOSO = execution fee in wei / 10^18
```

For example, `21,000` gas at `2,000,000` wei per gas (`0x1e8480`) costs `42,000,000,000` wei (`0.000000042 SOSO`). That price is the same order of magnitude as a recent `eth_gasPrice`, not a quote. Use integer arithmetic. An included transaction that reverts still consumes gas.

## Sponsored transactions

For sponsored contract calls, see [Relayer](/documentation/for-developers/developers/valuechain-evm/relayer.md). Gas sponsorship does not supply the application tokens or approvals required by the contract call.
