# gensyn-ai/gensyn-delphi-skills architecture

> Architecture diagram of the GitHub repository gensyn-ai/gensyn-delphi-skills, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gensyn-ai/gensyn-delphi-skills
- Repository: https://github.com/gensyn-ai/gensyn-delphi-skills

## Overview

Delphi is a TypeScript CLI/toolkit for Gensyn information markets, with a distinct agent-competition network. Its principal workflow is to discover markets, inspect current prices, calculate an agent-vs-market edge, then quote or execute trades and manage resulting positions. The read-only Agent TUI combines SDK snapshots with local edge and event logs. README capabilities also include history, redemptions, liquidation, allowances, balances and funding bridges. Links below rely on excerpts, source-index references, or README statements; unsampled implementations are represented by their exact scripts paths, without asserting unverified internal calls.

Main entry points: [`scripts/client.ts`](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/client.ts) (SDK client and networks), [`scripts/agent-tui/app.tsx`](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/app.tsx) (Dashboard shell), [`scripts/compute-edge.ts`](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/compute-edge.ts) (Compute edge), [`scripts/agent-tui/screens.tsx`](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/screens.tsx) (Dashboard screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market_research["Market research"]
  node_market_browsing["Browse markets<br/>[list-markets.ts]"]
  node_market_details["Market details<br/>[get-market.ts]"]
  node_trade_quotes["Trade quotes<br/>[quote-buy.ts]"]
  node_edge_compute["Compute edge<br/>[compute-edge.ts]"]
end

subgraph group_trading_positions["Trading and positions"]
  node_trade_execution["Buy and sell<br/>[buy-shares.ts]"]
  node_allowances["Token approval<br/>[token-approval.ts]"]
  node_portfolio["Positions<br/>[list-positions.ts]"]
  node_trade_history["Trade history"]
  node_settlement["Redeem winnings<br/>[redeem.ts]"]
  node_liquidation["Liquidate positions<br/>[liquidate.ts]"]
  node_client_config["SDK client and networks<br/>[client.ts]"]
end

subgraph group_agent_dashboard["Agent dashboard"]
  node_tui_entry["Dashboard entry<br/>[index.tsx]"]
  node_tui_app["Dashboard shell<br/>[app.tsx]"]
  node_snapshot_data["Snapshot and metrics<br/>[data.ts]"]
  node_dashboard_screens["Dashboard screens<br/>[screens.tsx]"]
  node_dashboard_ui["UI components<br/>[ui.tsx]"]
  node_formatting["Display formatting<br/>[format.ts]"]
  node_edge_store[("Agent edge log<br/>[edges.ts]")]
  node_event_store[("Agent event log<br/>[events.ts]")]
  node_event_logger["Log agent event<br/>[log-event.ts]"]
end

subgraph group_wallet_funding["Wallet and funding"]
  node_wallet_balances["Wallet balances"]
  node_funding_bridges["Testnet and mainnet bridges"]
  node_faucet["Testnet faucet<br/>[testnet-faucet.ts]"]
end

node_user(("Agent or user"))
node_delphi_sdk{{"Delphi SDK and chain"}}

node_user -->|"browse"| node_market_browsing
node_user -->|"inspect"| node_market_details
node_user -->|"request quote"| node_trade_quotes
node_user -->|"assess edge"| node_edge_compute
node_user -->|"trade"| node_trade_execution
node_user -->|"view positions"| node_portfolio
node_user -->|"browse history"| node_trade_history
node_user -->|"redeem"| node_settlement
node_user -->|"liquidate"| node_liquidation
node_user -->|"launch"| node_tui_entry
node_user -->|"check balances"| node_wallet_balances
node_user -->|"fund wallet"| node_funding_bridges
node_market_browsing -->|"uses client"| node_client_config
node_market_details -->|"uses client"| node_client_config
node_trade_quotes -->|"uses client"| node_client_config
node_trade_execution -->|"uses client"| node_client_config
node_allowances -->|"uses client"| node_client_config
node_portfolio -->|"uses client"| node_client_config
node_trade_history -->|"uses client"| node_client_config
node_settlement -->|"uses client"| node_client_config
node_liquidation -->|"uses client"| node_client_config
node_client_config -->|"configures"| node_delphi_sdk
node_edge_compute -->|"reads market"| node_client_config
node_edge_compute -->|"appends edge"| node_edge_store
node_tui_entry -->|"starts"| node_tui_app
node_tui_app -->|"loads snapshot"| node_snapshot_data
node_tui_app -->|"reads edges"| node_edge_store
node_tui_app -->|"reads events"| node_event_store
node_tui_app -.->|"renders"| node_dashboard_screens
node_dashboard_screens -->|"uses components"| node_dashboard_ui
node_dashboard_screens -->|"formats values"| node_formatting
node_snapshot_data -->|"joins edge data"| node_edge_store
node_event_logger -->|"appends events"| node_event_store
node_wallet_balances -->|"uses client"| node_client_config
node_funding_bridges -->|"gets signer"| node_client_config
node_faucet -->|"uses client"| node_client_config

click node_market_browsing "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/list-markets.ts"
click node_market_details "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/get-market.ts"
click node_trade_quotes "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/quote-buy.ts"
click node_edge_compute "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/compute-edge.ts"
click node_trade_execution "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/buy-shares.ts"
click node_allowances "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/token-approval.ts"
click node_portfolio "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/list-positions.ts"
click node_trade_history "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/list-recent-trades.ts"
click node_settlement "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/redeem.ts"
click node_liquidation "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/liquidate.ts"
click node_client_config "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/client.ts"
click node_tui_entry "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/index.tsx"
click node_tui_app "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/app.tsx"
click node_snapshot_data "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/data.ts"
click node_dashboard_screens "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/screens.tsx"
click node_dashboard_ui "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/ui.tsx"
click node_formatting "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/format.ts"
click node_edge_store "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/edges.ts"
click node_event_store "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/events.ts"
click node_event_logger "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/log-event.ts"
click node_wallet_balances "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/get-wallet-balances.ts"
click node_funding_bridges "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/bridge-usdc-to-gensyn-mainnet.ts"
click node_faucet "https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/testnet-faucet.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_market_browsing,node_market_details,node_trade_quotes,node_edge_compute,node_user toneBlue
class node_trade_execution,node_allowances,node_portfolio,node_trade_history,node_settlement,node_liquidation,node_client_config toneAmber
class node_tui_entry,node_tui_app,node_snapshot_data,node_dashboard_screens,node_dashboard_ui,node_formatting,node_edge_store,node_event_store,node_event_logger toneMint
class node_wallet_balances,node_funding_bridges,node_faucet toneRose
class node_delphi_sdk toneIndigo
```

## Components

### Market research

- [Browse markets](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/list-markets.ts): `scripts/list-markets.ts`
- [Market details](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/get-market.ts): `scripts/get-market.ts`
- [Trade quotes](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/quote-buy.ts): `scripts/quote-buy.ts`
- [Compute edge](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/compute-edge.ts): `scripts/compute-edge.ts`

### Trading and positions

- [Buy and sell](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/buy-shares.ts): `scripts/buy-shares.ts`
- [Token approval](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/token-approval.ts): `scripts/token-approval.ts`
- [Positions](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/list-positions.ts): `scripts/list-positions.ts`
- [Trade history](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/list-recent-trades.ts): `scripts/list-recent-trades.ts`
- [Redeem winnings](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/redeem.ts): `scripts/redeem.ts`
- [Liquidate positions](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/liquidate.ts): `scripts/liquidate.ts`
- [SDK client and networks](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/client.ts): `scripts/client.ts`

### Agent dashboard

- [Dashboard entry](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/index.tsx): `scripts/agent-tui/index.tsx`
- [Dashboard shell](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/app.tsx): `scripts/agent-tui/app.tsx`
- [Snapshot and metrics](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/data.ts): `scripts/agent-tui/data.ts`
- [Dashboard screens](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/screens.tsx): `scripts/agent-tui/screens.tsx`
- [UI components](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/ui.tsx): `scripts/agent-tui/ui.tsx`
- [Display formatting](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/format.ts): `scripts/agent-tui/format.ts`
- [Agent edge log](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/edges.ts): `scripts/agent-tui/edges.ts`
- [Agent event log](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/agent-tui/events.ts): `scripts/agent-tui/events.ts`
- [Log agent event](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/log-event.ts): `scripts/log-event.ts`

### Wallet and funding

- [Wallet balances](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/get-wallet-balances.ts): `scripts/get-wallet-balances.ts`
- [Testnet and mainnet bridges](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/bridge-usdc-to-gensyn-mainnet.ts): `scripts/bridge-usdc-to-gensyn-mainnet.ts`
- [Testnet faucet](https://github.com/gensyn-ai/gensyn-delphi-skills/blob/main/scripts/testnet-faucet.ts): `scripts/testnet-faucet.ts`

### Other components

- **Agent or user**
- **Delphi SDK and chain**

## Connections

- Agent or user → Browse markets: browse (evidence: `README.md`)
- Agent or user → Market details: inspect (evidence: `README.md`)
- Agent or user → Trade quotes: request quote (evidence: `README.md`)
- Agent or user → Compute edge: assess edge (evidence: `README.md`)
- Agent or user → Buy and sell: trade (evidence: `README.md`)
- Agent or user → Positions: view positions (evidence: `README.md`)
- Agent or user → Trade history: browse history (evidence: `README.md`)
- Agent or user → Redeem winnings: redeem (evidence: `README.md`)
- Agent or user → Liquidate positions: liquidate (evidence: `README.md`)
- Agent or user → Dashboard entry: launch (evidence: `README.md`)
- Agent or user → Wallet balances: check balances (evidence: `README.md`)
- Agent or user → Testnet and mainnet bridges: fund wallet (evidence: `README.md`)
- Browse markets → SDK client and networks: uses client (evidence: `scripts/list-markets.ts`)
- Market details → SDK client and networks: uses client (evidence: `scripts/get-market.ts`)
- Trade quotes → SDK client and networks: uses client (evidence: `scripts/quote-buy.ts`)
- Buy and sell → SDK client and networks: uses client (evidence: `scripts/buy-shares.ts`)
- Token approval → SDK client and networks: uses client (evidence: `README.md`)
- Positions → SDK client and networks: uses client (evidence: `scripts/list-positions.ts`)
- Trade history → SDK client and networks: uses client (evidence: `scripts/list-recent-trades.ts`)
- Redeem winnings → SDK client and networks: uses client (evidence: `scripts/redeem.ts`)
- Liquidate positions → SDK client and networks: uses client (evidence: `scripts/liquidate.ts`)
- SDK client and networks → Delphi SDK and chain: configures (evidence: `scripts/client.ts`)
- Compute edge → SDK client and networks: reads market (evidence: `scripts/compute-edge.ts`)
- Compute edge → Agent edge log: appends edge (evidence: `scripts/compute-edge.ts`)
- Dashboard entry → Dashboard shell: starts (evidence: `scripts/agent-tui/index.tsx`)
- Dashboard shell → Snapshot and metrics: loads snapshot (evidence: `scripts/agent-tui/app.tsx`)
- Dashboard shell → Agent edge log: reads edges (evidence: `scripts/agent-tui/app.tsx`)
- Dashboard shell → Agent event log: reads events (evidence: `scripts/agent-tui/app.tsx`)
- Dashboard shell → Dashboard screens: renders
- Dashboard screens → UI components: uses components (evidence: `scripts/agent-tui/screens.tsx`)
- Dashboard screens → Display formatting: formats values (evidence: `scripts/agent-tui/screens.tsx`)
- Snapshot and metrics → Agent edge log: joins edge data (evidence: `scripts/agent-tui/data.ts`)
- Log agent event → Agent event log: appends events (evidence: `scripts/log-event.ts`)
- Wallet balances → SDK client and networks: uses client (evidence: `scripts/get-wallet-balances.ts`)
- Testnet and mainnet bridges → SDK client and networks: gets signer (evidence: `scripts/bridge-usdc-to-gensyn-mainnet.ts`)
- Testnet faucet → SDK client and networks: uses client (evidence: `README.md`)
