Predictive Pricing Staking Vaults Simulation with Code

GM Pythians,

At Trebuchet, we are committed to advancing pricing consensus protocols through transparent and verifiable simulations that are accessible to all stakeholders within the Pyth network, including data publishers. In response to discussions surrounding the Community Integrity Pool (CIP), we propose a system where executable code can be run by anyone with access to Pyth RPC. This initiative is designed to deepen understanding and foster broader consensus among network participants.

Links for Reference:

Problem Statement

  1. With the latest quality score function introductions, the price is more “compressed,” and there is a penalty on the confidence score which discourages publishers from reporting higher variances. There is no incentive for alpha price deviations. How do we reward alpha? - audentes Fortuna iuvat

  2. How do we make publisher staking more interactive? - Panem et circenses

The proposed enhancements introduce complex dynamics with multiple variables, such as:

  • Determining the optimal predictive timeline for pricing accuracy.
  • Deciding the frequency of polling for publisher price submissions.
  • Deciding whether to use raw price submissions or their averages over time.

We are also evaluating different distribution mechanisms, either using centralized incentive pools or adopting closed-loop delegated stake vaults. Challenges include:

  • Designing an effective reward distribution scheme based on deviations from future prices.
  • Aligning rewards and penalties within a publisher-delegated staking system.
  • Addressing the absence of stakes for some data publishers.
  • Ensuring verifiability for all network participants and preventing potential publisher collusion, possibly through mechanisms like commit-and-reveal.
  • Managing the frequency of transactions between predictive staked vaults and addressing inactivity in publishing, including setting the allowable past duration for pricing submissions for reward or penalty determination.

Proposed Solution

As an initial step, we have developed Python code that interfaces with existing Pyth RPCs. This foundational tool aims to help us quickly achieve “Pythsensus” and support the development of a smart contract extension in Rust. The code’s functionality includes:

  1. Data Handling: Capturing snapshots of publisher data from the Pyth network every N seconds, establishing 50% LONG and 50% SHORT positions based on the median price.
  2. Simulation Process: Comparing the current median aggregate price against previous snapshots to simulate transactions after M periods (or MĂ—N seconds).
  3. Distribution Model: Handling distributions from a single address by sorting prices by deviation for incentive distributions from a centralized source.
  4. Staking Considerations: Introducing publisher staking significantly alters the dynamics. The script aims to balance ratios between these variables, proposing a closed-loop system where rewards are transferred between CIP publisher accounts, emulating delegated staking and enhancing user interaction on the Pyth network.

System Configuration and Operation

  • Tracking Length: The system captures and analyzes data over a fixed window of 15 updates or 60 seconds.
  • Interval Duration: Observations are made every 4 seconds.
  • Initial Stake: Each publisher starts with a stake of 100 units.
  • Symbol for Observation: The code in github specifically monitors the “Crypto.BTC/USD” symbol.

Initial results

We ran the system for 3 days (approx 55,000 data entries) and observed a min-max reward/penalty around 7% with the current penalty function, which does not consider the absolute deviation number, just the position in the sorted outlier array.

First Thoughts:
Most stable financial products do not show more than a 7% reward per month. Thus, adding a zero in the penalty exponent limit might make the limit number 7% per month, equating to a compounded 125% APR if the publisher is alpha all year long. This could be more aligned with standard DEFI products.

Or maybe we can come up with a better penalty/reward function? We have some brilliant people here on the forum
@CMS @XBTO @ed_pyth @TheDetective @guibescos @abwrld @RealPythGod @Munoz @Auros @Stan

def exponential_penalty_function(outlier_number,total_price_components):
    a = 0.0000001
    b = 10 ** (2 / total_price_components)
    y = a * (b ** (outlier_number - 1))
    return y

Invitation for Collaboration

Following a great conversation with Michael and Jayant, we concluded it is best to run this by the community. We value your feedback and invite the community to engage with this proposal and contribute to refining this crucial infrastructure.

Questions for the Community:

  • What concerns might others see in terms of publisher behavior?
  • How can we refine the reward distribution scheme to align with the goals of transparency and accuracy?

Thank you for your attention. We look forward to your thoughts and contributions.

Best regards,
The Trebuchet Team

1 Like

Super cool idea. Indeed alpha (or predictive power of future prices) is not something that’s included in the current scorings mechanism.

Introducing such ideas might improve significantly the quality of the price feeds and even reduce the Pyth-CEX latency since the publishers are incentivized to publish “future” prices.

Then again, the devil is in the details, for example, what is the right prediction window (you seem to have decided it’s predicting the price 60 seconds into the future but my gut tells me it should be a couple seconds rather). If I were to iterate on this design I’d try to drastically reduce the number of parameters.

I also reviewed your code, I had one issue:

2 Likes

Thank you @guibescos for pointing that out! -1 has been turned to 0.
Exactly that’s why we have a lot of smart people here.

with -1 the code was doing exactly what you wanted, 4 seconds future intervals instead of 60 seconds lol :rofl: (predictive bugs)

the case study is unaffected by this bug, since it is using slightly different version of the code

2 Likes

1 month since OIS started and i think we might want to revisit this topic soon.

as of 30th of October, 10 out of 98 Publishers staked their Pyth, and maybe with this proposal we might have a better participation from the Publishers.

i do understand that big institutions are probably just slower and we might see more participation in a few months but this proposal might push it up their priority list.