# Funding and Pricing

**funding** **mark**

* `ImpactMid = (avgImpactBid(ImpactNotional) + avgImpactAsk(ImpactNotional)) / 2`
  * computed every `TickInterval`
    * set to `5` seconds
  * `avgImpactBid`, `avgImpactAsk` are average cost per contract when buying/selling `ImpactNotional` worth of contracts
    * `ImpactNotional` is in the base asset (usually USDB)
      * for large pairs set to `$10,000` to `$100,000`
      * for small pairs set to `$1,000` to `$10,000`
* `FundingMark = ema(ImpactMids, Weight)`
  * computed every `TickInterval`
  * `ema` is exponential moving average
    * `Weight` is the EMA weighting
      * set to `2 / 7`
    * `ImpactMids` is list of previous `ImpactMid` every `TickInterval`

**funding rate**

* `Premium = (twap(FundingMarks) - twap(Indexs)) / Index`
  * computed every `SettleInterval`
    * set to `1` hour
  * `Index` is oracle price
    * stork oracle
    * for prelaunch perpetuals, it is a computed value
  * `twap` is time weighted average price
    * `FundingMarks` is list of previous `FundingMark` over the last `SettleInterval`
    * `Indexs` is list of previous `Index` over the last `SettleInterval`
  * `Premium` is considered as an amount per `FundingInterval`
    * set to `8` hours
* `FundingRate = BaseRate + clamp(Premium / (FundingInterval / SettleInterval), -Clamp, Clamp)`
  * computed every `SettleInterval`
  * `BaseRate` is underlying interest rate of perpetual future per `SettleInterval`
    * set to `0`
  * `clamp(a, y, z)` clamps `a` between `y` and `z`
    * defined as
      * `a` if `y < a < z`
      * `y` if `a ≤ y`
      * `z` if `z ≤ a`
  * `Clamp` is maximum magnitude funding can take (before underlying interest) per `SettleInterval`
    * set to `0.005 = 0.5%`
  * `FundingRate` is considered as an amount per `SettleInterval`

**funding amount**

* `FundingAmount = FundingRate * Index`
  * computed every `SettleInterval`
  * the `FundingAmount` is the notional amount longs pay shorts per contract per `SettleInterval`

Note: Funding settlement occurs every `SettleInterval`. No settlement occurs at open/close of positions.


---

# Agent Instructions: 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:

```
GET https://docs.100x.finance/100x-exchange/funding-and-pricing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
