> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/infrastructure/onchain-accounting/price-feeds/wars.md).

# wARS

Prices wARS by INVERTING a Chainlink USD/ARS feed — the only feed direction available for the asset.

Prices **wARS** ("Peso Argentino") by **inverting** a Chainlink `USD / ARS` feed:

```
price = 1e8 × 10^feedDecimals / answer
```

* **Chain:** Ethereum
* **Rate feed:** Chainlink `USD / ARS` — `description() == "USD / ARS"`, 8 decimals
* **Source:** [`InvertedChainlinkCustomPriceFeed.sol`](https://github.com/karpatkey/onchain-accounting/blob/main/src/prices/protocols/InvertedChainlinkCustomPriceFeed.sol)

This is a **generic inverter**, not a wARS-specific contract: use it for any asset whose only Chainlink coverage is quoted the wrong way round.

***

## Why an inverting contract is necessary

{% hint style="danger" %}
A `USD / X` feed is the **reciprocal** of what the NAV expects. Every primary feed registered here must answer *"USD per one asset"*; this feed answers *"how many ARS per one USD"* — roughly `1583` at the time of writing.

Registering it directly as a `type: "Chainlink"` primary would value 1 wARS at about **$1,583 instead of about $0.00063** — an over-report of roughly **2.5 million×** (1583²).

**Nothing in the config schema encodes feed direction, and no preflight guard checks it.** That is why the inversion has to live in a contract rather than in configuration: there is no place for "this feed is backwards" to be expressed as data, and no gate that would catch it if it were wrong.
{% endhint %}

**There is more than one ARS feed on mainnet.** An earlier revision of this contract's own documentation asserted that the inverted feed was the only one; that was false and was caught in review. A direct `ARS / USD` feed also exists. The inverted feed is the one KPK uses, and the choice is deliberate rather than forced — recorded here because the stronger claim is the kind that gets repeated.

***

## Safety properties

* **Division last.** The inversion computes `1e8 × 10^feedDecimals` first and divides by the answer at the end, so precision is not lost to an early truncation.
* **Runtime band.** `MIN_ANSWER` / `MAX_ANSWER` bound the raw feed answer. An answer outside the band is rejected rather than inverted — without it, an answer near zero would invert to an unbounded price.
* **Feed shape re-checked per read.** The feed's unit and decimals are cached at construction and re-asserted on every read, so a feed that changes shape underneath the contract fails closed.
* **`BASE_ASSET` is `address(0)`.** The inversion produces USD directly and composes with nothing, so there is no base-asset leg to get wrong.


---

# 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.kpk.io/funds/infrastructure/onchain-accounting/price-feeds/wars.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.
