> For the complete documentation index, see [llms.txt](https://docs.trendle.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trendle.fi/product/trading-engine/fees.md).

# Fees

> This section explains how costs are assessed when you trade on Trendle. Fees are simple by design: you pay a one-time charge **only when opening** a position; closing a position or canceling an unfilled order does **not** incur entry fees. All charges are computed from your opening notional *(collateral × leverage)* so that P\&L from index movements remains transparent and comparable across positions.

### <mark style="color:yellow;">Entry fees (one-time at open)</mark>

$$
\text{EntryFee}
\= \big(\text{TradingFee%}+\text{ImbalanceFee%}\big)\times\big(\text{Collateral}\times\text{Leverage}\big)
$$

* <mark style="color:yellow;">Where it goes:</mark> sent to the treasury.
* <mark style="color:yellow;">When it’s charged:</mark> **only once** when your order executes to open a position.
* <mark style="color:yellow;">Not charged:</mark> on **close** OR if an order is created and later canceled.
* <mark style="color:yellow;">**Accounting:**</mark> the entry fee is taken immediately as a realized loss on the position, but does not change future P\&L math. Price P\&L is always computed off&#x20;

**Position Size = Collateral × Leverage** *(fees excluded)*

### <mark style="color:yellow;">Trading fee</mark>

* <mark style="color:yellow;">Type:</mark> fixed % of (Collateral × Leverage) at open.
* <mark style="color:yellow;">Set by:</mark> contract admin.

### <mark style="color:yellow;">Imbalance fee</mark>

* <mark style="color:yellow;">Purpose:</mark> discourage crowding, charged ONLY when opening on the prevailing side
* <mark style="color:yellow;">Scope:</mark> computed per token/index pair.
* <mark style="color:yellow;">OI definition:</mark> open interest uses margin × leverage *(opening notional)*
* <mark style="color:yellow;">Prospective sizing:</mark> the new position’s size is included when evaluating the imbalance.
* <mark style="color:yellow;">Virtual liquidity:</mark> by default, each side has 1k virtual dollar, and these are included when calculating the ratio of the sides.
* <mark style="color:yellow;">Schedule:</mark> linear between two points:
  * starts at 0.4&#x35;**%** when **OI ratio = 3:2 (1.5×)**,
  * increases linearly to &#x33;**%** at **OI ratio = 10:1**.
  * Below 3:2, the imbalance fee is **0%**.
* <mark style="color:yellow;">Charged:</mark> once at **open** *(part of Entry fees)*

### <mark style="color:yellow;">Leverage</mark>

* <mark style="color:yellow;">Range:</mark> fractional value from **1×** (no leverage) to **5×** (max).
* <mark style="color:yellow;">Effect:</mark> multiplies price P\&L, entry fees, and funding PnL proportionally
  * Example: with 3× leverage, both your gains/losses from index moves and your fees/funding scale by 3×

### <mark style="color:yellow;">Quick example</mark>

* Collateral = 1,000; Leverage = 3× → Position Size = 3,000
* Trading fee 0.20% → 6.00
* If market is long-heavy at a 4:2 OI ratio (≥ 3:2) and you open a long: suppose Imbalance fee = 3.0% → 90.00
* EntryFee total = 96.00, taken immediately. Your future price P\&L still references the full 3,000 position size
