> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stonkme.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Prices

> Where every price comes from, and how fresh it has to be.

Markets value positions and check fills against an oracle price. The program reads prices in **Pyth's `PriceUpdateV2` account format** and rejects any price older than **60 seconds**.

## On devnet: our relay

Pyth's tokenized-stock feeds need a paid plan, so on devnet the stock venue program has a `post_price` instruction that writes prices into accounts with Pyth's exact layout. The devnet config names the venue as the price owner; the trading program reads them unchanged.

| Source | Used for |
| - | - |
| **Hyperliquid trade.xyz** oracle prices | Almost every stock. They update 24/7, so markets keep moving outside US hours. |
| **Jupiter** mainnet xStocks prices | The S\&P 500, Nasdaq 100, gold and McDonald's, which have no trade.xyz market, and as a fallback for any stock Hyperliquid can't price. Only prices with at least \$100,000 of liquidity are used. |

The relay runs on the app's server and posts when the oldest price is more than 20 seconds old, eight stocks per transaction. The keeper refreshes prices before every step it takes.

## On mainnet

The price owner becomes the Pyth receiver and the relay goes away. Nothing in the trading program changes.

## Sparklines and day change

The app's charts use Hyperliquid's hourly candles for the last 24 hours, cached for five minutes per stock. The S\&P 500 and Nasdaq use Hyperliquid's index markets; gold uses its gold market.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.