> For the complete documentation index, see [llms.txt](https://torch-1.gitbook.io/litepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://torch-1.gitbook.io/litepaper/system-mechanics/local-confidence.md).

# Local confidence

Local confidence is a measure from 0 to 1 of how likely a given price range is to be correct at a specific time, based on the distribution of active, stake-weighted bets.

It answers the question: *"Given that a bet resolves at time x, what is the probability that the actual price will fall within a specific price range \[y1, y2]?"*

Local confidence is computed using the current market's kernel density estimate (KDE) of all outstanding bets, weighted by stake and linearly adjusted for decay (i.e. how long ago each bet was placed).

1. A vertical slice of the 2D KDE surface is taken at the desired time x.
2. This slice is normalized so that its total probability sums to 100% (i.e. the price must hit some value at time x).
3. The percentage of this probability mass that falls within the desired price range \[y1, y2] is summed: this is the Local confidence value.

Underlying math:

1. **Raw input data**\
   Each bet is defined by:
   * Resolution time `xᵢ`
   * Price center `yᵢ`
   * Stake size `sᵢ`
   * Time since placed `tᵢ`
2. **Decay-adjusted weight**\
   Each bet’s influence decays over time:\
   \
   $$w\_i = s\_i \cdot e^{-r\_i \cdot t\_i}$$

   \
   Where:

   * `sᵢ` is the stake
   * `rᵢ` is the decay rate (e.g. 1–10% daily)
   * `tᵢ` is time since placement in days
3. **Kernel density estimation**\
   To estimate the smooth probability surface P(x, y):\
   \
   $$P(x, y) = \frac{1}{Z} \sum\_{i=1}^{n} w\_i \cdot K(x - x\_i, y - y\_i)$$<br>

   Where:

   * `K()` is a 2D Gaussian kernel
   * `Z` is a normalization constant

   This gives us a continuous probability field over all time-price combinations.<br>
4. Local confidence formula\
   For a fixed time `x`, the Local confidence for a price range `[y₁, y₂]` is:\
   \
   $$\text{LocalConfidence}*{\[y\_1, y\_2]}(x) = \frac{\int*{y\_1}^{y\_2} P(x, y) , dy}{\int\_{-\infty}^{\infty} P(x, y) , dy}$$

Visually, local confidence looks like a heatmap style probability map as shown above.


---

# 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://torch-1.gitbook.io/litepaper/system-mechanics/local-confidence.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.
