Skip to content

fix: update oracle tutorial for Pragma's v14 oracle deployment#201

Open
Keinberger wants to merge 1 commit into
mainfrom
kbg/chore/oracle-tutorial-pragma-v14
Open

fix: update oracle tutorial for Pragma's v14 oracle deployment#201
Keinberger wants to merge 1 commit into
mainfrom
kbg/chore/oracle-tutorial-pragma-v14

Conversation

@Keinberger
Copy link
Copy Markdown
Collaborator

Overview

This PR updates the "Consuming On-Chain Price Data from the Pragma Oracle"
tutorial so it works against Pragma's v14 oracle. Pragma recently redeployed
their Miden oracle for the v14 protocol, which changed both the deployment
addresses and the consumer-facing interface. The earlier v14 tutorial
migration (#186) only updated the SDK API surface, so the tutorial still
pointed at the dead pre-v14 deployment and failed at runtime.

Changes

  • MASM (oracle_reader.masm)get_price calls get_median with the
    v14 FPI ABI: 16 foreign-procedure inputs carrying the BTC/USD faucet pair
    (prefix 1, suffix 0), the new get_median procedure root, and the new
    oracle account ID.
  • Rust (oracle_data_query.rs) — publishers are discovered from the
    oracle's pragma::oracle::publishers storage map (the old value-slot
    heuristic doesn't match the v14 layout), and each publisher's
    pragma::publisher::entries proof is requested keyed by the faucet-pair word.
  • Docs (oracle_tutorial.md) — embedded code blocks synced to the runnable
    files; prose, addresses, and example output updated for the v14
    [is_tracked, median_price, amount] return layout.

Closes #200
Closes #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the Pragma oracle tutorial for the v14 oracle redeployment Issues at Oracle Tutorial (Rust Client)

2 participants