Docs

How it works

Oracle

How Taper reads Pyth prices, the checks every price passes, and the fee after a fast move.

Pyth, posted in the same transaction

Each market reads one Pyth price feed. Whoever needs a price, whether the app opening a loan, an arbitrageur trading with the bands or a liquidator, fetches a signed update from Pyth and posts it through Pyth's Solana receiver in the same transaction. The receiver checks the update against Wormhole's guardian signatures, and Taper reads the account it writes.

Taper accepts only fully verified updates from the pinned receiver, rec2HHDDnjLfj4kE7VyEtFA1HPGQLK33259532cRyHp.

The checks

Every price passes all of these before the program uses it:

  • The account belongs to the pinned receiver and has Pyth's exact price-update layout.
  • Its verification level is Full.
  • Its feed ID is the market's feed.
  • The price is positive and its exponent is in range.
  • It is at most 30 seconds old, and not from the future.
  • Its confidence interval is at most 1% of the price.
  • It was published no earlier than the last price the market used, and a reused timestamp cannot carry a different price.

The last check matters most for arbitrage: nobody can pick a convenient old update to trade against the bands.

The price Taper uses

For health, borrowing and liquidation, the program uses the cautious end of the update: the price minus its confidence interval. For NVDAx it also applies the token's current multiplier, so the price is per token as it exists on chain. See NVDAx and trading sessions.

The jump fee

A single update can move the price several bands at once. If the bands traded at the new price instantly, an arbitrageur would take the whole move from them in one swap. So after a jump, band trades pay a higher fee that fades over two minutes:

jump fee = 1 − (lower price ÷ higher price)³ fee now = the largest of · the band fee, 0.20% · the jump fee of this update · the previous fee, fading to zero over 120 seconds

A 1% move sets the fee near 3%. A 10% move sets it at 27.1%, which halves in a minute and is gone after two.

0%13%25%0s30s60s90s120s150s
Right after the update
22.13%
A minute later
11.07%
After two minutes
0.20%
The fee a band trade pays after one oracle update moves the price, falling back to the market's 0.20% band fee over 120 seconds.

The fee starts fading only once a transaction records the new price. Any band trade does this, and so does the health instruction, which moves no funds. Keepers call it after a fast move so conversion can resume on schedule.

Price feeds

MarketPyth price feed ID
SOL0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d
JitoSOL0x67be9f519b95cf24338801051f9a808eff0a578ccb388db73b7f6fe1de019ffb
NVDAx0xb1073854ed24cbc755dc527418f52b7d271f6cc967bbf8d8129112b18860a593