> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onebalance.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Fees & Monetization

> Understand OneBalance's fee and monetization model, including how fees are calculated and how apps earn revenue through OneBalance transactions.

## Overview

OneBalance enables applications to monetize their services through transparent and flexible fee structures. This page explains how fees work, who pays them, and how to configure them for your application.

<Info>
  User pays **one consolidated fee** to the app, Toolkit helps app to handle the underlying gas & paymaster costs.
</Info>

## Fee Types and Responsibilities

| **Category** | **Fee Type**                               | **Who Pays**             | **Description**                                                                                                                                |
| :----------- | :----------------------------------------- | :----------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------- |
| Gas Fees     | Cross-Chain Source or same chain execution | Application => Paymaster | The app pays for the inclusion to the paymaster service in USD                                                                                 |
| Gas Fees     | Cross-Chain Destination                    | User=>Solver             | This fee is included in the quote the solver provides for execution                                                                            |
| Monetization | Swaps & Transfers                          | User=>App                | App configures the fees and collects them to a dedicated address. The fee is paid in the input token and delivered with every user transaction |
| Monetization | Function Calls                             | User=>App                | App calculates the fee it is willing to take and encodes this into the desired calldata to be executed as a transfer                           |

## Monetization for Swaps and Transfers

Our transactional API lets you monetize every on-chain action initiated by your end users. Each time an end user sends a transaction through your application **one transparent service fee** is calculated, composed of:

1. **Percentage fee** - a fixed percentage of the asset amount
2. **Flat fee** - a per-chain USD-denominated amount that offsets per-chain operational costs

### Example of Flat Fee Configuration

The following table shows a config example of base costs for different chains.

| **Chain**                                                                                                                                                                                                                             | **CAIP-2 ID**  | **Base Cost (USD)** |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------- | :------------------ |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/1.svg" width="24" height="24" alt="Ethereum" className="rounded-sm m-0" />     Ethereum Mainnet </div> | `eip155:1`     | \$3.00              |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/43114.svg" width="24" height="24" alt="Avalanche" className="rounded-sm m-0" />     Avalanche </div>   | `eip155:43114` | \$0.20              |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/56.svg" width="24" height="24" alt="BSC" className="rounded-sm m-0" />     BNB Smart Chain </div>      | `eip155:56`    | \$0.10              |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/59144.svg" width="24" height="24" alt="Linea" className="rounded-sm m-0" />     Linea </div>           | `eip155:59144` | \$0.5               |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/8453.svg" width="24" height="24" alt="Base" className="rounded-sm m-0" />     Base </div>              | `eip155:8453`  | \$0.02              |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/42161.svg" width="24" height="24" alt="Arbitrum" className="rounded-sm m-0" />     Arbitrum </div>     | `eip155:42161` | \$0.02              |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/137.svg" width="24" height="24" alt="Polygon" className="rounded-sm m-0" />     Polygon PoS </div>     | `eip155:137`   | \$0.02              |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/81457.svg" width="24" height="24" alt="Blast" className="rounded-sm m-0" />     Blast </div>           | `eip155:81457` | \$0.02              |
| <div className="flex flex-row items-center gap-2">  <img src="https://storage.googleapis.com/onebalance-public-assets/networks/10.svg" width="24" height="24" alt="Optimism" className="rounded-sm m-0" />     Optimism </div>        | `eip155:10`    | \$0.02              |

### Percentage and benificiary parameters

| **Field**       | **Type** | **Description**                                                                                               |
| :-------------- | :------- | :------------------------------------------------------------------------------------------------------------ |
| `percentageBps` | `uint16` | Fee in basis points (1 bp = 0.01%)                                                                            |
| `beneficiary`   | `string` | The EVM address that collects the fees. Once non-EVM chains are supported, additional addresses will be added |

### How Fees Are Calculated

| **Component**         | **Formula**                                                     |
| :-------------------- | :-------------------------------------------------------------- |
| **Percent component** | `percentFee = (amount × percentageBps) / 10,000`                |
| **USD component**     | `usdFee = Σ(chainCostUsd[chain])`                               |
| **Conversion**        | USD fee is converted to the input asset using a live price feed |
| **Total fee**         | `totalFee = percentFee + usdFeeAssetEquivalent`                 |

### Example Calculation

**1 ETH to USDC Swap on Arbitrum**

Given:

* `percentageBps` = 30 (0.3%)
* `1 ETH = 2,500 USDC`

```typescript theme={null}
percentFee = 1 ETH × 0.3% = 0.003 ETH
flatFee    = 0.03 USD × 1 = 0.03 USD → 0.000012 ETH
------------------------------------------------
totalFee   = 0.003012 ETH
```

## Fee Settlement

* Fees are transferred to the `beneficiary` address in the same token used for the transaction
* For bridge + swap operations, network fees are summed across all chains involved

## Managing Fee Configuration

1. Fee configuration updates are necessary to reflect significant shifts in gas prices or native token values.
2. To update the configuration app needs to contact OneBalance team.

## Coming Soon

1. **Dynamic Fee Adjustment** - Fees will automatically adjust to market shifts based on average gas prices and native token prices in real-time
2. **Self-Service Updates** - Configuration will be updatable via APIs or through the admin dashboard UI

<Note>
  **Custom Fee Structures**: Need specialized pricing models or volume discounts? [Contact our sales team](mailto:sales@onebalance.io) to discuss custom fee arrangements for your business.
</Note>
