Skip to content
Open Oracle
All posts

Release

Open Oracle v0.1: open-source tools for tokenized stocks

Seven repositories, 85 tests and full documentation: real reference prices, market hours and a swap hook that knows when the stock market is closed.

Tokenized stocks trade around the clock. The shares they track do not. When the exchange closes, the token keeps trading against a price that has stopped moving, and the first trader to react to after-hours news takes value from liquidity providers. During the session the opposite happens: a pool can drift away from the real price faster than arbitrage pulls it back.

Open Oracle is our answer: a small set of open-source tools that make the gap between a token and its real share visible, and let a pool act on it. Today we are publishing the first version, v0.1, under the MIT license.

What ships today

  • oracle-sdk: a TypeScript library for live Pyth equity prices, NYSE hours with holidays and half days, Uniswap pool prices, premium in basis points and fee quotes. 24 tests.
  • oracle-cli: the SDK in your terminal. oracle hours, oracle feed NVDA, oracle price, oracle fee. 9 tests.
  • stocks-monitor: a service that tracks tokens against their real price over HTTP and Server-Sent Events, with a Docker image. 6 tests.
  • oracle-alerts: a Telegram bot that tells you when a token drifts, and when the market opens or closes. 8 tests.
  • stockguard-hook: a Uniswap v4 hook that checks every swap against the real price and the market session, plus a Pyth oracle adapter and a deploy script. 34 tests.
  • equity-feeds: every Pyth equity feed (1,250+) with ids, symbols and trading hours as JSON, refreshed daily by a GitHub Action. 4 tests.
  • open-oracle-web: this website, including the StockGuard simulator.

How the hook decides

On every swap StockGuardHook runs four checks and either sets the fee or reverts:

  • Compliance (optional per pool): trusted router and allowlisted trader.
  • Freshness: while the market is open, the oracle price must be younger than 60 seconds.
  • Deviation: the pool must stay within 2% of the real price while the market is open, 5% while it is closed.
  • Dynamic fee: 0.30% while open, 1.00% while closed, plus a surcharge only when a swap pushes the pool further away from the real price. Trades that pull it back pay the base fee, so arbitrage stays cheap.

The SDK's quoteStockGuardFee mirrors the Solidity logic, so the fee you see off-chain is the fee the hook charges.

Try it in a minute

No key needed for market hours and feed lookups:

npm install -g github:openoracle-evm/oracle-cli
oracle hours --days 3
oracle feed NVDA
oracle fee --pool 184.2 --oracle 182.4

Or open the simulator, close the market, shock the price and watch the hook react. Live prices need a Pyth API key; the docs explain where to set it.

What is next

  • An external audit of StockGuardHook before any public deployment.
  • A hosted stocks-monitor endpoint with a public status page.
  • Market sessions beyond NYSE (Hong Kong, Japan, Europe) in the hook.
  • A Python client for the monitor API.

Everything is developed in the open. Read the documentation, open an issue on GitHub, or follow @openoraclecodes for updates.

StockGuardHook is not audited yet. Do not use it with real funds. Nothing here is financial advice.