Skip to content

Repository files navigation

Tenor

🏆 Won Solana Blitz v7
Private multi-dealer FX venue on MagicBlock Ephemeral Rollups + Solana.

Five dealers quote USD/INR blind inside a Private Ephemeral Rollup. Matching commits through Magic Actions to public settlement: USDC moves and a FillRecord lands on Explorer. Losing quotes are never written. Cross-dealer reads fail with CrossReadDenied (6013).

Compete blind. Settle atomic. Win on price.

Program ID (devnet) 5xsrELGbx1bTEmrBAfqGBFxyYmL9eaDffcMc2WrJvBxc
Venue PDA venuePda() → seeds ["venue"] in app/lib/tenor.ts
GitHub https://github.com/Shaurya2k06/tenor
  1. Blind multi-dealer RFQ — five makers quote USD/INR inside a MagicBlock Private ER; none can see each other.
  2. Privacy is the product — quote confidentiality is the mechanism that compresses spreads.
  3. Atomic settlement — private match → Magic Actions → public FillRecord + USDC on Solana.
  4. No last look — quotes are binding; 6013 enforces dealer-only quote reads.
  5. Losers never exist — only the winning fill is public.

Live demo

cp .env.example .env   # key paths under .keys/ (gitignored)
yarn
yarn oracle:sync
yarn fund:usdc
yarn demo:worker       # bots + settle crank (prefer a private SOLANA_RPC_URL)
yarn dev               # http://localhost:3000/demo

Open /demo: one request → live quotes → FillRecord + Explorer tape → Attack console (6013) → losing quotes empty.

Also: /trade · /dealer · /spectator · /race · landing /.

Program & tests

yarn build:program

yarn test:day2   # initialize / register / post / delegate
yarn test:day3   # close_window + contract surface
yarn test:day4   # match + USDC conservation
yarn test:day5   # bots + crank + race surface
yarn test:day6   # clean runs, cancel_expired, cross-read 6013
yarn test:day7   # 20 clean runs + reset_demo
yarn test:unit
yarn test:integration
yarn test:all

yarn crank
yarn bots
yarn reset-demo

Toolchain aligned with MagicBlock examples: Agave 3.1.9, Anchor 1.0.2, OrbStack Docker, @magicblock-labs/ephemeral-validator.

Client contract

Import:

  • app/lib/tenor.ts — types + program calls (postRequest, probeCrossRead, FillRecord helpers, …)
  • app/lib/er.ts — base / TEE ER connections + authorizeDealer

Integration coverage: tests/integration/day1_7.ts (request → quotes → 6013 → subscriptions → FillRecord + Explorer URL).

Lifecycle latency (post→settled, n=10): p50 7205ms / p95 7330ms / p99 7330ms — see docs/day6.md.

Oracle

Live Pyth Core USD/INR on Solana devnet (Hermes → Pyth Solana Receiver → venue pin).

yarn oracle:sync
yarn oracle:er
yarn fund:usdc && yarn oracle:sync && yarn e2e:tee
Feed ID 0x0ac0f9a2886fc2dd708bc66cc2cea359052ce89d324f45d95fadbc6c4fcf1809
Price-feed PDA 7WuwYK2AzuhN2xZL9EZvUmgstWFLJcx54kHnZcK4quCn
Product path docs/product-path.md
Ops docs/oracle-real.md

Set PYTH_PRICE_ACCOUNT in .env (from oracle:sync). Prefer a private/Helius RPC for demos.

Layout

  • programs/tenor-venue/ — Anchor program
  • app/ — Next.js UI (/demo cockpit, Trade, Dealer, Spectator, Race)
  • app/lib/ — TS integration contract
  • bots/, crank/, scripts/demo_worker.ts
  • tests/, docs/

Docs

About

Private multi-dealer FX venue on MagicBlock Ephemeral Rollups + Solana.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages