Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6743c54
feat(scenarios): add the Pyth Pro receiver price feed template
92Infinitus92 Oct 16, 2026
69b0a9e
ci: claude code review
failfmi Oct 7, 2026
3dfacb1
fix(scenarios): name the Pyth Pro collection in its load errors
92Infinitus92 Oct 19, 2026
5891b4e
refactor(scenarios): name the receiver template Pyth Core Compatible …
92Infinitus92 Oct 29, 2026
ac0be67
Merge feat/scenarios/override/pyth-pro-support into feat/scenarios/py…
92Infinitus92 Oct 29, 2026
691c529
fix(scenarios): scale the confidence with the price in the Pyth Core …
92Infinitus92 Oct 29, 2026
c9b77fc
Merge feat/scenarios/override/pyth-pro-support into feat/scenarios/py…
92Infinitus92 Nov 2, 2026
0df9576
docs(scenarios): call rec5 the Pyth Core receiver
92Infinitus92 Nov 3, 2026
78e23a4
Merge upstream/main into feat/scenarios/pyth-pro-receiver
92Infinitus92 Nov 6, 2026
8886ae1
feat(scenarios): keep Pyth price feeds published with keep-alive
92Infinitus92 Nov 9, 2026
49d1aec
Merge feat/scenarios/keep-alive-toggle into wip/pyth-core-compatible
92Infinitus92 Nov 9, 2026
ebea6b0
feat(scenarios): keep every loaded Pyth price of a receiver published…
92Infinitus92 Nov 9, 2026
7c1dbf7
docs(scenarios): say in each price template that it keeps every loade…
92Infinitus92 Nov 10, 2026
26d3eb0
Merge feat/scenarios/keep-alive-toggle into wip/pyth-core-compatible
92Infinitus92 Nov 10, 2026
8706557
docs(scenarios): tell the Pyth Core template's reader which protocols…
92Infinitus92 Nov 10, 2026
7cd2a68
docs(scenarios): explain how to keep one Pyth price stale while the o…
92Infinitus92 Nov 10, 2026
8a2d644
docs(scenarios): a Pyth publish_time or posted_slot value holds only …
92Infinitus92 Nov 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/core/src/scenarios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For Surfpool to understand how to serialize and deserialize account data, it nee
Protocols that are natively supported by Surfpool will have their IDLs included by default.

**Currently supported protocols:**
- **Pyth v2** - Price oracle with 4 price feed templates (SOL/USD, BTC/USD, ETH/BTC, ETH/USD)
- **Pyth v2** - Price oracle with a price feed template for the Pyth Core receiver (`pyth-price-feed-v2`) and one for the Pyth Core Compatible receiver (`pyth-core-compatible-price-feed-v2`); both keep the price they write published
- **Jupiter v6** - DEX aggregator with TokenLedger manipulation template
- **Switchboard On-Demand** - On-demand oracle with QuoteAccount override template
- **Kamino** – Lending (v1.23.0), Scope oracle, Farms, Swap/LIMO, Earn vaults and Liquidity, across six programs. See [protocols/kamino/README.md](./protocols/kamino/README.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Pyth Core Compatible

Pyth runs two price receivers on Solana, both deployments of the `pyth_solana_receiver` program, as
listed on [Pyth's Solana contract addresses](https://docs.pyth.network/price-feeds/contract-addresses/solana):

| Receiver | Program | Template |
|---|---|---|
| Pyth Core | `rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ` | `pyth-price-feed-v2` |
| Pyth Core Compatible | `rec2HHDDnjLfj4kE7VyEtFA1HPGQLK33259532cRyHp` | `pyth-core-compatible-price-feed-v2` |

They hold separate price accounts for the same feeds, and a consumer reads the accounts of one of
them. Take the price account from the consumer's own account that names it.

# Keep-alive

Nobody publishes Pyth prices on a surfnet, so both templates import a
[keep-alive](../../../../README.md#keep-alive): from the slot an override of a template plays until
the network is reset, Surfpool writes the Clock's unix seconds to `price_message.publish_time` and
the slot to `posted_slot` every slot, time travels included. It does so for every price account of
that template's receiver the surfnet has loaded, including feeds no override names and, from the
next slot, feeds a transaction loads later, so a liquidation that reads the borrower's other feeds
finds them fresh. The price, confidence and EMA fields keep their values. To keep one feed stale on
purpose, override it with `keepAlive: false`; it then ages against the Surfnet clock.

# IDL

`idl.json` is the IDL the program publishes in its Anchor IDL account
`raeUSn8gguFWVFs4iw3YathYM3mdb95W5Bfiu3tqE7F` (`pyth_solana_receiver` 0.2.1, legacy format, sha256
`9ec4718f66a71fc524ecdd533770ca5a8a3984f8e1fb603f01f5e31ff0ab0caa`), converted with
`anchor idl convert --program-id rec2HHDDnjLfj4kE7VyEtFA1HPGQLK33259532cRyHp` (anchor-cli 0.31.1,
output sha256 `29ab79ef705a3429b3ced2b1222e1b5efdcd4b40fed547177d31c16ebd8473fc`).

One change is made before the conversion: the account names `priceUpdateV2` and `twapUpdate` are
written `PriceUpdateV2` and `TwapUpdate`, as the program's Rust types are named. Anchor derives an
account's discriminator from its name, and only the capitalized names give the discriminator the
live price accounts carry.
Loading
Loading