The fair-price layer for xStocks.
Anchor helps people buy tokenized US stocks on Solana without blindly accepting the pool price. Before a wallet signs, Anchor compares the live xStock quote with the real US-listed share and turns the difference into one clear verdict.
xStocks trade around the clock; US exchanges do not. At night and on weekends, the token can drift away from the share it represents. Anchor makes that hidden premium visible, adjusts for market conditions, and records the decision with the trade.
Quick start
Anchor is designed to answer a single question before every buy: is this token fairly priced right now?
- 01Choose an xStock
Open Markets and select one of the supported stocks or ETFs.
- 02Read the tether
Compare the token price, fair range, market session, and current verdict.
- 03Request a quote
Enter a USDC amount. Anchor checks the exact Jupiter route—not an indicative price.
- 04Review and sign
Confirm the dollar cost. A Wait verdict requires an extra acknowledgement.
The price tether
A raw token price alone is not enough. Anchor measures the logarithmic premium between an executable xStock price and the corresponding real share, corrected for the token's dividend multiplier.
The result is expressed in basis points. Anchor then asks whether this premium is normal for the asset and the current US market session. The visual tether is the live relationship between those two prices—not a promise that they will always match.
How the guard decides
Read the real share
Anchor reads the Pyth Equity.US.<TICKER>/USD price account on Solana, including the publisher confidence interval and the age of the latest price.
Price the token from both sides
A reference xStock price is the geometric midpoint of a live $100 Jupiter buy quote and the matching sell quote. This removes the bid/ask bounce found in pool last-trade data.
Adjust for reinvested dividends
xStocks use Token-2022's ScaledUiAmount extension. Anchor reads the mint multiplier so one raw token is compared with the correct number of underlying shares.
Build a normal range
Thirty days of hourly token and equity history create separate regular-hours and extended-hours baselines. The center is the median; dispersion uses a robust MAD-based scale so one bad print cannot dominate the model.
Respect a sleeping market
When the US market is closed, the last equity price becomes stale. The allowed range widens with the square root of hours closed, while live oracle confidence adds another uncertainty term.
Four verdicts
The model is intentionally asymmetric for a buyer: an unusually low price is useful information; an unusually high price is a cost that deserves friction.
z ≤ −2−2 < z < 22 ≤ z < 3z ≥ 3Thresholds describe the current prototype. They are decision aids—not predictions that a token's price will rise, fall, or converge.
Guarded buy
The market card is only the first check. Anchor evaluates the user's exact Jupiter quote again before building the transaction, separating the market premium from route spread and price impact.
Request a live USDC → xStock route.
Compare execution price with the guard.
Compose swap and guard memo together.
The connected wallet signs one v0 transaction.
Anchor does not sign for the user or custody funds. The server prepares an unsigned transaction; the connected Solana wallet reviews and signs it.
On-chain receipts
Every completed Anchor buy includes a Solana memo in the same transaction as the Jupiter swap. That makes the guard's decision public, durable, and tied to the exact execution moment.
vFinal verdict after execution costszHow unusual the observed premium waspremMarket premium in basis pointsexecAll-in execution premium in basis pointssessUS market session at evaluationrefageAge of the equity referenceThe Activity page queries the connected wallet's recent Solana signatures and reconstructs its Anchor receipts directly from these memos.
Data sources
| Input | Source | How Anchor uses it |
|---|---|---|
| Real stock / live | Pyth on Solana | Price, confidence interval, update time |
| xStock / live | Jupiter | Two-sided executable quote midpoint |
| Shares per token | Token-2022 mint | ScaledUiAmount dividend multiplier |
| xStock / history | GeckoTerminal | 30-day hourly pool averages |
| Equity / history | Yahoo Finance | 30-minute bars, aggregated hourly |
| Swap execution | Jupiter | Quote, routing and swap instructions |
| Receipts | Solana RPC | Wallet signatures and memo records |
Historical snapshots bundled with the app are fallback data only. Live sources are fetched server-side and cached briefly to reduce rate pressure.
Architecture
Anchor is a Next.js application deployed on Vercel. Market data and transaction assembly run server-side; wallet connection and signing stay in the browser.
src/lib/guard.ts statistical model and verdicts
src/lib/pyth.ts Pyth account decoding
src/lib/sources.ts live and historical market data
src/lib/trade.ts guarded Jupiter transaction + memo
src/app/api/* server-side data and transaction routesAPI overview
These routes power the current web client. Responses are JSON; live routes are dynamic.
/api/guardCurrent verdicts for all supported assets/api/guard/:tickerOne guard, 31-day chart series and baseline summary/api/quote?ticker=SPY&usdc=100Guarded Jupiter quote for a specific order/api/swapUnsigned v0 swap transaction with guard memo/api/sendBroadcast a wallet-signed transaction and await confirmation/api/audit?wallet=…Anchor memo receipts for a wallet/api/balance?wallet=…SOL, USDC and supported xStock balancesThe API is public implementation detail for the hackathon app, not a versioned external developer API. Routes and schemas may change.
Limits & risks
- Mainnet only. xStocks do not exist on Solana devnet, so swap flows use mainnet assets and real funds.
- Availability. Pyth, Jupiter, Solana RPC and historical data services can be stale, unavailable or rate-limited.
- Model risk. A statistical normal range cannot guarantee fair value or predict future convergence.
- Market risk. Tokenized equities add issuer, liquidity, tracking, smart-contract and regulatory risk.
- Eligibility. xStocks are not available to US persons. Users must check their own local eligibility.
- Prototype status. Anchor is hackathon software, not audited financial infrastructure or investment advice.
What comes next
The following items are planned directions, not live product capabilities.
A weekly order that waits within a set window for Fair or Discount.
A short risk flow leading to a diversified xStock basket.
A gentler first-run experience without requiring a seed phrase.
Notify a user when a watched xStock returns to its normal range.
Built for the Solana Stocklana hackathon.