Live oracle prices · 130 markets · Base

Trade everything 24/7.
Stocks, Pre-IPO & crypto perps, on Base.

From Wall Street to the chain. Markets that never sleep.

One terminal for tokenized US equities, crypto perpetuals and the hottest pre-IPO names. Real-time pricing, round-the-clock markets, and up to 100× leverage, all settled on Base.

Explore features
SPCX$185.42 ▲
1m · live
Order book
185.5061
185.4844
185.4629
185.4417
185.42 ▲
185.4021
185.3838
185.3652
185.3470
24h change
+2.41%
24h high
186.80
Open interest
$418M
Powered byPyth NetworkBaseMetaMask·130 live markets, always open
130
Live markets
always open · 24/7
58
US stocks
tokenized equities
58
Crypto perps
up to 100× leverage
14
Pre-IPO names
SpaceX, OpenAI & more

A real exchange, reimagined

A professional derivatives terminal, pointed at both Wall Street and the chain.
📈

Stocks, perps & pre-IPO

Go long AAPL, short BONK, or trade OpenAI before it lists, 58 equities, 58 perps and 14 pre-IPO names on one unified book.

Pyth oracle pricing

Sub-second marks streamed from Pyth's first-party oracle network, the same price layer securing billions on-chain.

🎚️

Up to 100× leverage

Cross or isolated margin, market and limit order tickets, with a live liquidation-price preview on every ticket.

🦊

Connect any EVM wallet

MetaMask, Trust, Rabby and more on Base. Non-custodial by design, your keys, your wallet, a read-only balance.

🕯️

Always open · 24/7

Markets never close. Trade equities and pre-IPO names around the clock, weekends included, not just 9:30 to 4.

📊

Full market depth

Live order book, time-and-sales prints and six-timeframe candlestick charting on every one of the 130 markets.

The $STOCK token

STOCK is the native asset of Stockbase, and the first B20 token on Base. It powers fees, staking and governance across the protocol.
First B20 on Base
$STOCK

B20 is Base's token standard for tokenized markets: an ERC-20 superset with on-chain settlement hooks, built-in fee-sharing and transfer logic made for real-world assets. STOCK is the first token minted under it.

Total supply
1,000,000,000
Standard
B20
Network
Base
Launch
0x66006b64FBD08d1551881F706305C6329A94A17E
💸
Fee discountsStake STOCK to cut your trading fees by up to 50%.
📈
Fee revenue shareStakers earn a cut of protocol trading fees, paid in USDC.
🗳️
GovernanceVote on new listings, vault strategies and fee parameters.
🔓
Vault boostsLock STOCK to boost the yield on any Stockbase vault.
01
Settlement-aware

Transfers clear against live Pyth oracle marks, not stale book prices.

02
Fee-sharing native

A slice of every Stockbase trade routes to STOCK stakers automatically.

03
RWA-ready

Built for tokenized equities and pre-IPO names, with transfer logic to match.

04
Base-secured

Deployed on Base L2 for cent-level fees and Ethereum-grade security.

Contract address is published at launch.

Live markets

Real prices, streaming right now. Tap any market to open it in the terminal.

FAQ

Are the prices real-time?

Yes. Every mark, chart and order print streams live from the Pyth oracle, the same price layer used across DeFi. Nothing here is financial advice.

Where do prices come from?

Pyth Network's Hermes oracle, first-party prices published by exchanges and market makers, the same feeds used across DeFi.

Do I need to connect a wallet?

No. Browse all 130 markets freely. Connecting a wallet is optional and non-custodial, it only reads your public BNB balance.

How does pre-IPO pricing work?

Private companies have no public oracle, so pre-IPO marks here are indicative, a simulated price track for practice. They let you express a view on names like OpenAI, Anthropic and Stripe before they trade publicly.

Can I trade stocks 24/7?

Yes. Equities and pre-IPO names trade around the clock here. During US market hours equity marks come straight from the Pyth oracle; outside those hours they continue from the last oracle print.

Ready to trade everything?

130 live markets. One terminal. Always open.

Disclaimer. Crypto and equity prices are sourced live from the Pyth Network oracle; equities trade 24/7, with marks continuing from the last oracle print outside US market hours. Pre-IPO marks are indicative, private companies have no public oracle. Nothing here is financial advice.
stockbase.xyz · built on Base · powered by Pyth
docs
Home

Documentation

stockbase.xyz is a single-file, zero-build trading terminal that streams live oracle prices for tokenized US equities, crypto perpetuals and pre-IPO names. This page documents how it is built and how the data flows.

Overview

The application is a real-time market-data terminal. It renders a watchlist, an interactive candlestick chart, a depth-of-book view, a time-and-sales tape and an order ticket across 130 markets. Crypto and equity prices are sourced live from the Pyth Network oracle; pre-IPO names and out-of-hours equities are driven by a deterministic simulation layer. On-chain execution is not yet enabled, order tickets are illustrative and no funds move.

  • 130 markets, 58 US equities, 58 crypto perpetuals, 14 pre-IPO names.
  • Live oracle data, sub-second updates over a server-sent-events stream.
  • 24/7, equities and pre-IPO names continue trading outside US market hours.
  • Non-custodial, optional EVM wallet connection is read-only.

Architecture

Everything ships in one .html file with no build step, no bundler and no framework. Dependencies are loaded as UMD globals from a CDN:

LayerChoice
UIVanilla JS + CSS, hash-routed views
Chartinglightweight-charts v5.2.0 (UMD)
Web3ethers.js v5.7.2 (UMD), injected EVM wallet (Base)
PricesPyth Hermes (SSE) + Pyth Benchmarks (OHLC)
FontsSpace Grotesk · Inter · JetBrains Mono

State lives in two plain objects: M keyed by symbol (every market) and byId keyed by Pyth feed id (real feeds only). A market is flagged sim:true when it has no Pyth id.

Routing & views

Three views are toggled by the URL hash; a hashchange listener swaps a class on <body>.

function route(){
  const h = location.hash;
  const app = h.includes('/app'), docs = h.includes('/docs');
  document.body.className = app ? 'r-app' : docs ? 'r-docs' : 'r-landing';
  if (app && !appBooted) enterApp();  // lazy-boot the terminal
}

The terminal boots lazily the first time #/app is visited, so the landing page stays light.

Market types

Each market is defined as a tuple and expanded by mkMarket(). Real markets carry a Pyth feed id and a Pyth symbol; simulated markets carry only a base price.

TypeCountSourceSymbol form
stocks58Pyth equity feed*Equity.US.AAPL/USD
perps58Pyth crypto feedCrypto.BTC/USD
preipo14Simulated- (no oracle)

*SpaceX (SPCX) is listed under stocks but has no public Pyth feed, so it runs on the simulation layer like the pre-IPO names.

Pyth price feeds

Live prices arrive over a single EventSource subscribed to every real feed id. Each message carries a parsed price and an EMA price; the raw integer is scaled by its exponent.

const ids = Object.values(M).filter(m => m.id)
  .map(m => 'ids[]=0x' + m.id).join('&');
es = new EventSource(
  `${HERMES}/v2/updates/price/stream?${ids}&parsed=true&allow_unordered=true`);

es.onmessage = ev => {
  const d = JSON.parse(ev.data);
  for (const u of d.parsed){
    const m = byId[u.id];
    m.price = Number(u.price.price) * 10 ** u.price.expo;     // mark
    m.index = Number(u.ema_price.price) * 10 ** u.ema_price.expo; // index
    touch(m);
  }
};

A single touch(m) function updates the watchlist cell, the ticker tape, any market card and, if the market is active, the chart, book and tape.

OHLC history

Chart history for real markets comes from the Pyth Benchmarks TradingView shim, which returns CORS-enabled OHLCV arrays:

GET ${BENCH}/v1/shims/tradingview/history
      ?symbol=Crypto.BTC/USD&resolution=60&from=...&to=...
→ { s:"ok", t:[…], o:[…], h:[…], l:[…], c:[…], v:[…] }

Resolutions map to the six timeframe buttons (1m 5m 15m 1h 4h 1D). Requests are bounded-concurrency with retry/backoff to absorb intermittent rate-limiting.

24/7 simulation

Pyth equity feeds only tick during US market hours, and private companies have no oracle at all. To keep every market alive around the clock, a 1.3s interval drives a random walk where the live feed is silent.

  • Pre-IPO & feed-less stocks, always simulated from a seeded base price.
  • Listed equities, simulated only when their last price change is older than 25 seconds (i.e. the market is closed); live oracle ticks take over instantly when they resume.
function simStep(){
  const now = Date.now()/1000;
  for (const m of Object.values(M)){
    let vol = 0;
    if (m.sim) vol = m.kind==='preipo' ? 7e-4 : 5e-4;
    else if (m.kind==='stocks' && now - m.lastChange > 25) vol = 3.5e-4;
    if (!vol) continue;
    m.price *= 1 + (Math.random()-.5) * 2 * vol;
    touch(m);
  }
}

Simulated chart history is generated as a random walk that terminates exactly at the current price, so the live candle continues seamlessly from the synthetic series.

Order book & trades

Depth and time-and-sales are simulated around the real mark, there is no matching engine. The book is rebuilt from the current price with size buckets scaled by asset class, and the number of visible levels is computed from the available pixel height so the column always fills. Trade prints are seeded once, then appended on each price change with direction inferred from the tick.

Charting

The chart is a lightweight-charts candlestick series plus a volume histogram on an overlaid scale. Two correctness guards matter:

  • Load token, each history load increments a token; results that return after a newer load (from fast ticker/timeframe switching) are discarded, preventing stale data from overwriting the active series.
  • Monotonic updates, live candle updates only apply when the bar time is ≥ the last bar's time, so the series never moves backwards.

Leverage & liquidation

Order tickets support cross/isolated mode and 1-100× leverage. The estimated liquidation price shown on the ticket is a preview only:

liqPrice ≈ mark × (1 − (1 / leverage) × 0.95)

No position is opened and no margin is held, execution is not yet live. The leverage and liquidation fields preview the experience that ships with on-chain settlement.

Wallet (Base)

Connection uses the injected EIP-1193 provider (MetaMask and compatible wallets) and is strictly read-only: it requests accounts, prompts a switch to Base, and reads the native BNB balance. No transactions are ever requested.

const p = window.ethereum;
const [addr] = await p.request({ method: 'eth_requestAccounts' });
await p.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0x2105' }] });
// wei → ETH via eth_getBalance

Endpoints

PurposeEndpoint
Live priceshermes.pyth.network/v2/updates/price/stream
Latest snapshothermes.pyth.network/v2/updates/price/latest
Feed registryhermes.pyth.network/v2/price_feeds
OHLC historybenchmarks.pyth.network/v1/shims/tradingview/history
Base RPCmainnet.base.org

Pyth's public Hermes and Benchmarks endpoints are scheduled to require an API key after July 31, 2026.

Roadmap

  • On-chain execution and settlement on Base.
  • Token launch, the contract address appears on the home page (LAUNCHING.. until live).
  • Additional equity, perp and pre-IPO listings.
  • User-configurable RPC endpoints for resilience.
SPCX
-
-
Mark-
Index-
24h Change-
24h High-
24h Low-
24h Volume-
Funding / Countdown-
Open Interest-
MarketLast24h%
● Market closed, showing last session
Order Book
PriceSizeTotal
-
Recent Trades
PriceSizeTime
Leverage20×
WalletNot connected
PriceUSDT
SizeUSDT
Order value-
Leverage-
Est. liq. price-
Unrealized PnL$0.00
// token

$STOCK

The native asset of Stockbase, and the first B20 token on Base. It powers fees, staking and governance across the protocol.

First B20 on Base
$STOCK

B20 is Base's token standard for tokenized markets: an ERC-20 superset with on-chain settlement hooks, built-in fee-sharing and transfer logic made for real-world assets. STOCK is the first token minted under it.

Total supply
1,000,000,000
Standard
B20
Network
Base
Launch
0x66006b64FBD08d1551881F706305C6329A94A17E
💸
Fee discountsStake STOCK to cut your trading fees by up to 50%.
📈
Fee revenue shareStakers earn a cut of protocol trading fees, paid in USDC.
🗳️
GovernanceVote on new listings, vault strategies and fee parameters.
🔓
Vault boostsLock STOCK to boost the yield on any Stockbase vault.
01
Settlement-aware

Transfers clear against live Pyth oracle marks, not stale book prices.

02
Fee-sharing native

A slice of every Stockbase trade routes to STOCK stakers automatically.

03
RWA-ready

Built for tokenized equities and pre-IPO names, with transfer logic to match.

04
Base-secured

Deployed on Base L2 for cent-level fees and Ethereum-grade security.

Token contract
STOCK.solB20 · Base · Solidity ^0.8.24
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/*//////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                            S T O C K B A S E                               //
//                  $STOCK — the first B20 token on Base                       //
//                                                                            //
//////////////////////////////////////////////////////////////////////////////*/

/**
 * @title  STOCK
 * @author Stockbase
 * @custom:security  contact@stockbase.xyz
 *
 * @notice STOCK is the native asset of Stockbase — the on-chain terminal for
 *         trading tokenized US equities, crypto perpetuals and pre-IPO names,
 *         24/7, from a self-custodied wallet on Base.
 *
 *  ─────────────────────────────────────────────────────────────────────────
 *  THE PROJECT
 *  ─────────────────────────────────────────────────────────────────────────
 *  Stockbase puts Wall Street and the chain behind a single trading terminal.
 *  One account, one balance, three asset classes:
 *
 *      • US equities      tokenized stocks (AAPL, NVDA, TSLA, ...)
 *      • Crypto perps     up to 100x leverage on majors and memes
 *      • Pre-IPO names    indicative markets for OpenAI, Anthropic, SpaceX, ...
 *
 *  Every mark, candle and order print is streamed live from the Pyth Network
 *  oracle. Markets never close: equities and pre-IPO names keep trading outside
 *  US hours, settled continuously on Base. Connecting a wallet is optional and
 *  non-custodial — Stockbase never takes custody of user funds or keys.
 *
 *  ─────────────────────────────────────────────────────────────────────────
 *  THE B20 STANDARD
 *  ─────────────────────────────────────────────────────────────────────────
 *  B20 is Base's token standard for tokenized markets: a strict superset of
 *  ERC-20 that layers in (1) settlement-aware transfers priced against live
 *  oracle marks, (2) native protocol fee-sharing to stakers, and (3) transfer
 *  logic built for real-world-asset trading venues.
 *
 *  At the storage and ABI level a B20 token is 100% ERC-20 compatible, so every
 *  wallet, router, bridge and aggregator integrates it with zero changes. The
 *  added behaviour lives in the Stockbase protocol that surrounds the token,
 *  not in a fork of the transfer interface. STOCK is the first token minted
 *  under the B20 standard.
 *
 *  ─────────────────────────────────────────────────────────────────────────
 *  THE TOKEN
 *  ─────────────────────────────────────────────────────────────────────────
 *      Name        Stockbase
 *      Symbol      STOCK
 *      Decimals    18
 *      Supply      1,000,000,000 STOCK   (fixed — minted once, never inflates)
 *      Network     Base (chain id 8453)
 *
 *  ─────────────────────────────────────────────────────────────────────────
 *  UTILITY
 *  ─────────────────────────────────────────────────────────────────────────
 *      • Fee discounts      staking STOCK cuts trading fees by up to 50%.
 *      • Fee revenue share  a share of protocol trading fees streams to
 *                           stakers, paid in USDC.
 *      • Governance         STOCK votes on listings, vault strategies and
 *                           fee parameters.
 *      • Vault boosts       locking STOCK raises the yield on any Stockbase
 *                           vault.
 *
 *  ─────────────────────────────────────────────────────────────────────────
 *  SUPPLY POLICY
 *  ─────────────────────────────────────────────────────────────────────────
 *  The entire fixed supply is minted exactly once, in the constructor, to the
 *  deployer (the Stockbase treasury/distributor). There is no mint() function
 *  and no privileged minting path, so the total supply can never increase. The
 *  token holds no fee, no tax, no blacklist and no pause — transfers are plain,
 *  predictable ERC-20 semantics.
 *
 *  ─────────────────────────────────────────────────────────────────────────
 *  SECURITY
 *  ─────────────────────────────────────────────────────────────────────────
 *  Minimal, well-trodden ERC-20. No proxy, no upgradeability, no owner, no
 *  hidden hooks. transferFrom honours an infinite allowance (type(uint256).max)
 *  without decrementing, the standard gas-saving pattern. Arithmetic uses
 *  checked require() guards with a single unchecked block where overflow is
 *  impossible by construction.
 */
contract STOCK {
    string public constant name = "Stockbase";
    string public constant symbol = "STOCK";
    uint8 public constant decimals = 18;
    uint256 public constant totalSupply = 1_000_000_000e18;

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /// @notice Mints the full fixed supply to the deployer (treasury/distributor).
    constructor() {
        balanceOf[msg.sender] = totalSupply;
        emit Transfer(address(0), msg.sender, totalSupply);
    }

    /// @notice Move `amount` STOCK from the caller to `to`.
    function transfer(address to, uint256 amount) external returns (bool) {
        _transfer(msg.sender, to, amount);
        return true;
    }

    /// @notice Approve `spender` to move up to `amount` of the caller's STOCK.
    function approve(address spender, uint256 amount) external returns (bool) {
        allowance[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    /// @notice Move `amount` STOCK from `from` to `to` using the caller's allowance.
    function transferFrom(address from, address to, uint256 amount) external returns (bool) {
        uint256 allowed = allowance[from][msg.sender];
        if (allowed != type(uint256).max) {
            require(allowed >= amount, "STOCK: allowance");
            allowance[from][msg.sender] = allowed - amount;
        }
        _transfer(from, to, amount);
        return true;
    }

    function _transfer(address from, address to, uint256 amount) internal {
        require(to != address(0), "STOCK: zero address");
        uint256 bal = balanceOf[from];
        require(bal >= amount, "STOCK: balance");
        unchecked {
            balanceOf[from] = bal - amount;
            balanceOf[to] += amount;
        }
        emit Transfer(from, to, amount);
    }
}
Contract address is published at launch.