-
Notifications
You must be signed in to change notification settings - Fork 1
Price Feed Publishing
How witnesses calculate and publish the PXA/PXS exchange rate.
Pixa Supra (PXS) holds a stable value because witnesses keep it pegged to the Big Mac Index. This is not automated — there is no oracle, no smart contract, no price bot running the show. Witnesses manually assess economic data and publish a price feed that tells the blockchain what 1 PXS should be worth in PXA.
This guide explains the full process: where to get the data, how to calculate the rate, how to publish it, and what happens if you get it wrong.
A price feed is a value published by a witness that states: "1 PXS is currently worth X PXA."
The protocol collects feeds from all top witnesses and computes a 3.5-day rolling median. This median becomes the official exchange rate used for all PXA ↔ PXS conversions on the internal market.
| Component | Role |
|---|---|
| Individual witness feed | One data point in the set |
| Rolling 3.5-day median | The protocol's official rate |
Automated price oracles (like Chainlink on Ethereum) pull data from exchanges and APIs. Pixa's peg is different — it tracks purchasing power, not a live market price. The Big Mac Index is published periodically by The Economist, not streamed in real time. Interpreting it requires human judgment.
Witnesses must consider:
- The latest published Big Mac Index data
- Changes in local economies that affect the index
- The current market price of PXA on exchanges
- General economic conditions
This makes the feed a judgment call, not a mechanical operation.
Publishing a price feed is an act of economic assessment, not data forwarding.
The Big Mac Index is published by The Economist and tracks the price of a Big Mac in dozens of countries. The global average of these prices is the baseline for PXS.
| Data point | Source |
|---|---|
| Big Mac prices by country | The Economist Big Mac Index |
| Global average price | Calculated from country data |
Witnesses should supplement the Big Mac Index with broader economic indicators to fine-tune their assessment:
| Source | What it provides |
|---|---|
| Consumer Price Index (CPI) | Tracks general inflation trends |
| Exchange rate data | Reflects currency movements that affect purchasing power |
| Commodity prices | Food and energy costs that influence the Big Mac price |
| PXA market data | Current trading price of PXA on external exchanges |
The calculation has two parts: determining the value of 1 PXS in real-world terms, then expressing it in PXA.
The target value of 1 PXS is the average global cost of a Big Mac. If the latest Big Mac Index data shows a global average of approximately $5.50, then:
1 PXS ≈ $5.50 in purchasing power
You need the current market price of PXA. If PXA is trading at $0.06 on exchanges, then:
1 PXS = $5.50 ÷ $0.06 ≈ 91.67 PXA
This is the value you publish as your price feed.
PXS/PXA rate = (Average Big Mac price in USD) ÷ (PXA market price in USD)
| Input | Value |
|---|---|
| Global average Big Mac price | $5.50 |
| Current PXA market price | $0.06 |
| Published feed | 1 PXS = 91.67 PXA |
At minimum, once per day. During periods of high PXA price volatility, more frequent updates keep the peg accurate.
| Market condition | Recommended frequency |
|---|---|
| Stable PXA price | Once daily |
| Moderate volatility | 2–3 times daily |
| High volatility or major economic news | Every few hours |
Stale feeds — those not updated for multiple days — reduce the accuracy of the median and erode your credibility as a witness.
Publishing is done through a feed_publish operation broadcast to the blockchain. This requires your active key.
| Field | Content |
|---|---|
| Exchange rate | Your calculated PXS/PXA ratio |
| Publisher | Your witness account name |
The exact implementation depends on your tooling — command-line tools, scripts, or witness management software. Many witnesses automate the broadcast while manually updating the rate when data changes.
The protocol does not use your feed directly. Instead, it collects feeds from all active top witnesses and computes a median.
The average is sensitive to outliers. If 19 witnesses publish a rate of 90 PXA and one publishes 900 PXA (by mistake or malice), the average jumps to 128.5 PXA — a significant distortion.
The median ignores extremes. In the same scenario, the median remains close to 90 PXA — the correct value.
| Scenario | Average | Median |
|---|---|---|
| 19 feeds at 90, 1 feed at 900 | 128.5 | ~90 |
| 19 feeds at 90, 1 feed at 0 | 85.7 | ~90 |
The median is not calculated from a single snapshot. It rolls over a 3.5-day window, smoothing out short-term fluctuations and ensuring no single moment disproportionately affects the rate.
The median of many honest feeds over 3.5 days produces a stable, manipulation-resistant exchange rate. That's the entire design.
If your feed is slightly off, the median absorbs it harmlessly. One outlier among 20 feeds has minimal impact.
If your feeds are consistently wrong — due to bad data, incorrect calculation, or negligence — stakeholders will notice. The consequences:
| Consequence | Trigger |
|---|---|
| Community criticism | Visible divergence from other witnesses' feeds |
| Loss of voter confidence | Stakeholders withdraw their witness votes |
| Loss of position | Dropping below top 20 stops block production and income |
Deliberately publishing false feeds to manipulate the PXA/PXS rate is a form of witness misconduct. The median makes this ineffective (you'd need to corrupt a majority of witnesses), and the transparency of on-chain feeds makes it immediately detectable.
Your feeds are your reputation. Every one is permanently recorded on-chain for anyone to audit.
Good practice: compare your published feed with those of other top witnesses regularly.
| Check | What to look for |
|---|---|
| Spread among top 20 | Your feed should fall within the cluster, not at an extreme |
| Deviation from median | Large deviations suggest a calculation error on your part |
| Update frequency | Your feed should be at least as fresh as the median witnesses |
If you notice your feed diverging significantly, re-check your data sources and calculation before publishing the next update.
Partially. Many witnesses use scripts that:
- Fetch PXA market price from exchange APIs
- Pull Big Mac Index data from saved references
- Calculate the PXS/PXA rate
- Broadcast the
feed_publishtransaction on a schedule
However, the interpretation — deciding whether the Big Mac Index has shifted, whether an economic event warrants adjustment, whether the data sources are reliable — requires human judgment. Full automation without oversight risks publishing stale or incorrect feeds.
| Component | Automatable | Requires judgment |
|---|---|---|
| Fetching PXA price | Yes | No |
| Fetching Big Mac Index | Partially (not real-time) | Yes — data is periodic |
| Calculating the rate | Yes | No |
| Deciding when to update | Partially | Yes — market conditions vary |
| Broadcasting the transaction | Yes | No |
Automate the mechanics. Apply judgment to the inputs.
| Step | Action | Frequency |
|---|---|---|
| Gather Big Mac Index data | Check The Economist and supplementary sources | When new data is published |
| Check PXA market price | Query exchanges for current trading price | Before each feed |
| Calculate PXS/PXA rate | Divide Big Mac average by PXA price | Before each feed |
| Publish the feed | Broadcast feed_publish with active key |
At least daily |
| Verify against peers | Compare your feed with other witnesses | After each publication |
Price feed publishing is one of the most consequential duties a witness performs. Your feeds directly determine the exchange rate between PXA and PXS — the stable foundation of the Pixa marketplace. Accuracy, frequency, and transparency are not optional. They are the standard by which the community will judge your fitness to serve.