> For the complete documentation index, see [llms.txt](https://docs.drops.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drops.co/nft-price-oracle/probable-outliers-removal.md).

# Probable outliers removal

Next, we remove sales which are improbable outliers range - ranges are created using the standard deviation. Additionally, sales that are lower than 75% of the moving average and below the standard deviation band are removed (whichever is value is lower).

### Calculating the Truncated Mean (Average Price)

We define the Truncated Mean as the factor that's used to calculate the average over prices. It's obtained by taking the 50 previous sales (excluding the current sale and outliers), ordering by sale size, discarding the top and bottom three sales, then taking the mean of the 44 middle values.

### Minimum Lower Bound Range

The minimum lower bound range is used to prevent cases when a lower standard deviation range gets too close to the truncated mean and no longer reflects downward market movement.&#x20;

75% of the mean for the lower band has been backtested with the most liquid collections and has shown to be sufficient enough to react to downward price swings.

### Setting Ranges with the Standard Deviation

The [Sample Standard Deviation](https://en.wikipedia.org/wiki/Standard_deviation) is used to find out a price ranges at which sales have the highest chance of occurrence.&#x20;

These ranges will be later used to validate whether a new sale is within the possible range. \
\
Truncated Mean values are used in the formula:

![Sample Standard Deviation formula](/files/gzvpCZ6SaMpgil2x1VlO)

<table data-header-hidden><thead><tr><th width="150"></th><th width="508.7142857142857"></th></tr></thead><tbody><tr><td><img src="https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_s.svg" alt="s"></td><td>sample standard deviation</td></tr><tr><td><img src="https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_N.svg" alt="N"></td><td>the number of observations (valid sales)</td></tr><tr><td><img src="https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_x1x2ldotsxN.svg" alt="x_i"></td><td>the observed values of a sample item (sale amount)</td></tr><tr><td><img src="https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_overlinex.svg" alt="\overline {x}"></td><td>the truncated mean value of the observations (valid sales)</td></tr></tbody></table>

### Check if the Sale is Within the Range

Next. we're setting the range in which sale is not an outlier.

*Mean -X\**![s](https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_s.svg) *≤  NewSalePrice  ≤  Mean + X\**![s](https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_s.svg)\
\
*where*\
Mean = truncated mean\
![s](https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_s.svg) = sample standard deviation\
X = ![s](https://www.gstatic.com/education/formulas2/397133473/en/sample_standard_deviation_s.svg) quanitity

NewSalePrice is then checked whether it is within the range. If it's outside, set as outlier and it will not be included in further calculations.

If the sale is valid, it will be checked whether it is a floor value or not.


---

# 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://docs.drops.co/nft-price-oracle/probable-outliers-removal.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.
