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 / answerChain: Ethereum
Rate feed: Chainlink
USD / ARS—description() == "USD / ARS", 8 decimals
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
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.
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^feedDecimalsfirst and divides by the answer at the end, so precision is not lost to an early truncation.Runtime band.
MIN_ANSWER/MAX_ANSWERbound 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_ASSETisaddress(0). The inversion produces USD directly and composes with nothing, so there is no base-asset leg to get wrong.
Last updated