# Heavily discounted bid (R058)

The percentage difference between the winning bid and the second-lowest valid bid is a high outlier.

:::{seealso}
{doc}`024`
:::

## Methodology

For each contracting process, the **difference** is calculated as $(secondLowestValidBidAmount - winningBidAmount) \over winningBidAmount$.

A contracting process is flagged if the difference is greater than or equal to the **upper fence** of $Q_3 + 1.5(IQR)$, where $Q_3$ is the third quartile and $IQR$ is the interquartile range for the set of differences.

The winner is also flagged.

:::{admonition} Example
:class: seealso

In 25% ($Q_1$) of contracting processes in Atlantis, the second-lowest valid bid is at most 5% greater than the winning bid. In 75% ($Q_3$) of contracting processes, it is at most 7% greater. This yields an upper fence of 10% (`0.1`).

In a contracting process, Lemon Industries won with a bid of \$100,000, and FairDeal Enterprises lost with the second-lowest bid of \$115,000. The difference is 15% (`0.15`). This is greater than the upper fence of 10%. Therefore, the process is flagged.
:::

:::{admonition} Why is this a red flag?
:class: hint

An unethical bidder can offer defective goods ("lemons") if the buyer has inadequate quality criteria.
:::

<small>Based on "The price offered by the winning bidder is significantly lower than the price offered by the rest of the bidders" in [*Fraud in Public Procurement: A collection of Red Flags and Best Practices*](https://ec.europa.eu/sfc/system/files/documents/sfc-files/fraud-public-procurement-final-20122017-ares20176254403.pdf), "Difference between lowest and second lowest bid prices" in [*Assessing the potential for detecting collusion in Swedish public procurement*](https://www.govtransparency.eu/wp-content/uploads/2021/08/Fazekas-Toth_SE_PPcartel_detection_20161115.pdf), and [*The Market for "Lemons": Quality Uncertainty and the Market Mechanism*](https://www.sfu.ca/~wainwrig/Econ400/akerlof.pdf).</small>

## Output

The indicator's value for the contracting process is the **difference**, as a decimal.

The indicator's value for the tenderer is always 0.0.

If the ``--map`` command-line flag is set, the ``Maps`` key contains:

ocid_tenderer_r058
: The flagged tenderers for each flagged `ocid`.

## Configuration

All configuration is optional. To override the default **upper fence**, add to your settings file, as a decimal:

```ini
[R058]
threshold = 0.50
```

:::{seealso}
`no_price_comparison_procurement_methods` and `price_comparison_procurement_methods` in {ref}`global-configuration`
:::

## Exclusions

A contracting process is excluded if:

- An award's status is pending or invalid.
- The winning bid is not the lowest bid.
- There are multiple active awards (a.k.a. winning bids). [#14](https://github.com/open-contracting/cardinal-rs/issues/14)
- A bid is submitted by multiple tenderers. [#17](https://github.com/open-contracting/cardinal-rs/issues/17)
- An award is made to multiple suppliers. [#17](https://github.com/open-contracting/cardinal-rs/issues/17)

:::{note}
Do you want to eliminate an exclusion? Please contributed to the linked GitHub issue.
:::

## Assumptions

This indicator assumes that the tenderer of the winning bid didn't submit another valid bid.

## Demonstration

*Input*

:::{literalinclude} ../../../examples/R/058.jsonl
:language: json
:::

*Output*

```console
$ ocdscardinal indicators --settings docs/examples/settings.ini --no-meta docs/examples/R/058.jsonl
{"OCID":{"F":{"R058":99.0}},"Tenderer":{"W":{"R058":0.0}}}

```
