Skip to content

Tester App

The Tester App is a frontend interface built with Next.js to interact with the Kaizen protocol.

Screenshots

Normal Mode (Control Panel)

Tester App - Control Panel

The default mode provides a full control panel with:

  • Drawing Tools: Select, Box, and Line tools for placing theses on the chart
  • Leverage Multiplier: Adjustable leverage (1x - 10x)
  • Balance Display: Current USDC balance
  • Mock Bridge (Faucet): Simulates USDC deposits
  • Recent Theses: History of placed theses with their outcomes

Degen Mode 🔥

Tester App - Degen Mode

Degen Mode is a streamlined, one-click trading experience:

  • Fixed Bet Amounts: Quick-select buttons (10, 25, 50, 100 USDC)
  • Auto Quote → Best Solver → Execute: Automated flow from drawing to execution
  • Enhanced Thesis Display: Shows margin, position size, and leverage badge
  • Visual Indicator: Fire theme and header badge

Overview

PropertyValue
Packageapps/tester
FrameworkNext.js, React, Tailwind CSS
State ManagementZustand
Web3Wagmi, RainbowKit
Default Port3000

Features

  • Real-time Charting: Visualizes price feeds with a smooth, scrolling canvas-based chart
  • Thesis Management: Interface to place Box theses via RFQ system
  • Bridge Integration: Deposit/withdraw USDC via mock bridge
  • Portfolio Tracking: Real-time updates of active theses, PnL, and settled positions
  • Theme Customization: 6 themes each for Normal Mode and Degen Mode

Running

# Development
pnpm --filter @kaizen-core/tester dev
 
# Or from apps/tester
cd apps/tester
pnpm dev

The application will be available at http://localhost:3000.

Docker

# Start with full stack
docker compose up -d tester
 
# Access
open http://localhost:3000

Environment Variables

VariableDescriptionDefault
NEXT_PUBLIC_KAIZEN_RPC_URLKaizen RPC endpointhttp://localhost:8546
NEXT_PUBLIC_KAIZEN_WS_URLKaizen WebSocket endpointws://localhost:8546/ws
NEXT_PUBLIC_BRIDGE_URLBridge service URLhttp://localhost:3002
NEXT_PUBLIC_SOLVER_URLSolver service URLhttp://localhost:3001

Architecture

The app uses a service layer pattern:

┌─────────────────────────────────────────┐
│              React UI                    │
│  (Chart, ThesisPanel, BridgeModal)      │
└────────────────┬────────────────────────┘

┌────────────────▼────────────────────────┐
│           Zustand Stores                 │
│  (wallet, thesis, settings, price)      │
└────────────────┬────────────────────────┘

┌────────────────▼────────────────────────┐
│         @kaizen-core/sdk                 │
│  (KaizenClient, WebSocket, Signer)      │
└────────────────┬────────────────────────┘

        ┌────────┴────────┐
        ▼                 ▼
┌───────────────┐ ┌───────────────┐
│  Kaizen Node  │ │    Solver     │
│   (RPC/WS)    │ │   (Quotes)    │
└───────────────┘ └───────────────┘

Key Components

ComponentDescription
Chart.tsxCanvas-based price chart with box drawing
ThesisPanel.tsxActive/history thesis list
BridgeModal.tsxDeposit/withdraw interface
SettingsModal.tsxURL and theme configuration
EnableConnectionModal.tsxAPI wallet setup flow