Skip to content

mcxross/yafe

Repository files navigation

Self-hosted DeepBook Workstation

A self-hosted & themeable DeepBook trading workstation.

Included

  • Surflux market data integration:
    • GET /pools
    • GET /pool
    • GET /pool-depth
    • GET /recent-trades
    • GET /ohlcv
  • SufFlux stream architecture in surflux package:
    • one PoolStream per pool
    • shared/multiplexed subscribers
    • reconnect backoff
    • idle teardown
    • per-pool status reporting
  • DeepBook v3 transaction signing/execution for:
    • limit orders
    • market orders
    • limit order cancellation
    • auto-creating and funding a BalanceManager inline when needed (single PTB)
  • Theme + font settings (neutral-first, fully themeable; includes Geist Pixel options)

Run

bun install
cp packages/surflux/.env.example packages/surflux/.env
cp .env.example .env
bun run dev:surflux
# in another terminal:
bun run dev

Configuration

Surflux runs as its own local service in packages/surflux and the frontend calls it.

Frontend .env (root)

SURFLUX_SERVICE_BASE_URL=http://localhost:8787

Optional frontend URL overrides:

SURFLUX_REST_BASE_URL=http://localhost:8787/api/surflux/deepbook
SURFLUX_STREAM_BASE_URL=http://localhost:8787/api/surflux

Surflux service .env (packages/surflux/.env)

SURFLUX_SERVICE_PORT=8787
SURFLUX_SERVICE_ALLOWED_ORIGIN=*
SURFLUX_REST_BASE_URL=https://api.surflux.dev
SURFLUX_STREAM_BASE_URL=https://flux.surflux.dev
SURFLUX_REST_API_KEY=...
SURFLUX_STREAM_API_KEY_DEFAULT=...
SURFLUX_STREAM_API_KEY__SUI_USDC=...
SURFLUX_STREAM_API_KEY__SUI_DBUSDC=...

Optional local overrides:

  • create packages/surflux/.env.local
  • values in .env.local override .env for bun run dev:surflux and bun run start

Per-pool stream key format:

  • prefix: SURFLUX_STREAM_API_KEY__
  • suffix: pool name in uppercase, e.g. SUI_USDC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages