Veyronn Documentation

Architecture

How Veyronn's frontend, services, contracts, market data, and automation fit together.

Frontend

The Next.js application uses wagmi and viem for injected EVM wallets, chain switching, typed-data signatures, contract reads, transaction simulation, and Blockscout links. Browser requests remain on the Vercel origin; /api/* is proxied to the Railway BFF.

Contracts

Solidity contracts own margin, positions, markets, funding, sessions, intents, strategies, conditionals, oracle verification, and vault custody. The chain is authoritative for financial state and authorization.

BFF

The Railway-hosted Next.js BFF exposes app-ready reads and transaction builders. It can access Postgres and the keeper through private networking. Database credentials and keeper authentication are never browser variables.

Indexer

The indexer consumes Veyronn logs from the deployment block, waits for configured confirmations, stores checkpoints, rolls back reorged data, and materializes positions, trades, account activity, strategies, conditionals, sessions, and candles.

Keeper

The keeper is both automation executor and testnet price-report signer. It maintains a Hermes stream, validates source observations, signs short-lived EIP-712 reports, scans affected state, simulates actions, deduplicates submissions, and waits for receipts.

Failure boundaries

  • No fresh acceptable price: risk-increasing and automated price actions fail closed.
  • Indexer delayed: chain settlement still works; history can lag.
  • Keeper offline: direct wallet actions remain possible; delegated and conditional execution wait.
  • BFF unavailable: the hosted app cannot build server-assisted report transactions until service recovery.
  • Vercel unavailable: contracts and Railway workers continue; the public UI is unavailable.