# pkhaan/argo architecture

> Architecture diagram of the GitHub repository pkhaan/argo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pkhaan/argo
- Repository: https://github.com/pkhaan/argo

## Overview

ARGO is a confidence-gated DeFi risk automation system: market and web intelligence feeds a specialist CrewAI analysis, whose verdict is checked and presented for approval before Sui execution. The dashboard also exposes market data, risk/trade details, action history, and on-chain events, with a wallet-signed DAO override. The README documents several capabilities whose implementations were not sampled; those links are cited to the README rather than presented as inspected code.

Main entry points: [`nextui-dashboard/pages/index.tsx`](https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/pages/index.tsx) (ARGO dashboard), [`main.py`](https://github.com/pkhaan/argo/blob/deploy/main.py) (Crew runner), [`tools`](https://github.com/pkhaan/argo/tree/deploy/tools) (Data tools), [`server.py`](https://github.com/pkhaan/argo/blob/deploy/server.py) (Job API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intelligence["Market intelligence"]
  node_data_tools["Data tools"]
end

subgraph group_analysis["Agent analysis"]
  node_crew_agents["Specialist agents<br/>[agents.py]"]
  node_crew_tasks["Analysis tasks<br/>[tasks.py]"]
  node_crew_runner["Crew runner<br/>[main.py]"]
  node_verdict_guards["Verdict guards<br/>[main.py]"]
end

subgraph group_backend["Job and verdict service"]
  node_api_service["Job API<br/>[server.py]"]
  node_job_store[("In-memory jobs<br/>[server.py]")]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["ARGO dashboard<br/>[index.tsx]"]
  node_analysis_hook["Analysis workflow"]
  node_market_widgets["Live market widgets"]
  node_risk_view["Risk and trade views<br/>[RiskScore.tsx]"]
  node_action_log["Action log<br/>[ActionLog.tsx]"]
  node_chain_log["On-chain event log<br/>[OnChainLog.tsx]"]
end

subgraph group_chain["Sui execution"]
  node_api_routes["Execution API routes"]
end

node_operator(("DAO operator"))
node_binance(("Binance market data"))
node_dune(("Dune Analytics"))
node_web(("Web search and news"))
node_wallet(("Connected Sui wallet"))
node_sui{{"Sui Move contract"}}
node_sui_rpc(("Sui RPC"))

node_binance -->|"supplies market data"| node_data_tools
node_dune -->|"supplies chain data"| node_data_tools
node_web -->|"supplies web signals"| node_data_tools
node_data_tools -->|"provides signals"| node_crew_agents
node_crew_agents -->|"perform tasks"| node_crew_tasks
node_crew_runner -->|"builds crew"| node_crew_agents
node_crew_runner -->|"builds tasks"| node_crew_tasks
node_crew_runner -->|"checks verdict"| node_verdict_guards
node_api_service -->|"runs analysis"| node_crew_runner
node_api_service -->|"updates jobs"| node_job_store
node_dashboard -->|"uses workflow"| node_analysis_hook
node_analysis_hook -->|"requests analysis"| node_api_service
node_dashboard -->|"renders widgets"| node_market_widgets
node_dashboard -->|"renders risk"| node_risk_view
node_dashboard -->|"renders activity"| node_action_log
node_dashboard -->|"renders events"| node_chain_log
node_dashboard -->|"requests execution"| node_api_routes
node_api_routes -->|"submits transactions"| node_sui
node_wallet -->|"signs override"| node_sui
node_sui -->|"emits events"| node_sui_rpc
node_chain_log -->|"reads events"| node_sui_rpc

click node_data_tools "https://github.com/pkhaan/argo/tree/deploy/tools"
click node_crew_agents "https://github.com/pkhaan/argo/blob/deploy/agents.py"
click node_crew_tasks "https://github.com/pkhaan/argo/blob/deploy/tasks.py"
click node_crew_runner "https://github.com/pkhaan/argo/blob/deploy/main.py"
click node_verdict_guards "https://github.com/pkhaan/argo/blob/deploy/main.py"
click node_api_service "https://github.com/pkhaan/argo/blob/deploy/server.py"
click node_job_store "https://github.com/pkhaan/argo/blob/deploy/server.py"
click node_dashboard "https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/pages/index.tsx"
click node_analysis_hook "https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/hooks/useAgentAnalysis.ts"
click node_market_widgets "https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/CryptoSparklineWidget.tsx"
click node_risk_view "https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/RiskScore.tsx"
click node_action_log "https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/ActionLog.tsx"
click node_chain_log "https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/OnChainLog.tsx"
click node_api_routes "https://github.com/pkhaan/argo/tree/deploy/nextui-dashboard/pages/api"

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_data_tools,node_wallet,node_sui,node_sui_rpc toneBlue
class node_crew_agents,node_crew_tasks,node_crew_runner,node_verdict_guards toneAmber
class node_api_service,node_job_store toneMint
class node_dashboard,node_analysis_hook,node_market_widgets,node_risk_view,node_action_log,node_chain_log toneRose
class node_api_routes,node_operator,node_binance,node_dune,node_web toneIndigo
```

## Components

### Market intelligence

- [Data tools](https://github.com/pkhaan/argo/tree/deploy/tools): `tools`

### Agent analysis

- [Specialist agents](https://github.com/pkhaan/argo/blob/deploy/agents.py): `agents.py`
- [Analysis tasks](https://github.com/pkhaan/argo/blob/deploy/tasks.py): `tasks.py`
- [Crew runner](https://github.com/pkhaan/argo/blob/deploy/main.py): `main.py`
- [Verdict guards](https://github.com/pkhaan/argo/blob/deploy/main.py): `main.py`

### Job and verdict service

- [Job API](https://github.com/pkhaan/argo/blob/deploy/server.py): `server.py`
- [In-memory jobs](https://github.com/pkhaan/argo/blob/deploy/server.py): `server.py`

### Dashboard

- [ARGO dashboard](https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/pages/index.tsx): `nextui-dashboard/pages/index.tsx`
- [Analysis workflow](https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/hooks/useAgentAnalysis.ts): `nextui-dashboard/hooks/useAgentAnalysis.ts`
- [Live market widgets](https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/CryptoSparklineWidget.tsx): `nextui-dashboard/components/arg/CryptoSparklineWidget.tsx`
- [Risk and trade views](https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/RiskScore.tsx): `nextui-dashboard/components/arg/RiskScore.tsx`
- [Action log](https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/ActionLog.tsx): `nextui-dashboard/components/arg/ActionLog.tsx`
- [On-chain event log](https://github.com/pkhaan/argo/blob/deploy/nextui-dashboard/components/arg/OnChainLog.tsx): `nextui-dashboard/components/arg/OnChainLog.tsx`

### Sui execution

- [Execution API routes](https://github.com/pkhaan/argo/tree/deploy/nextui-dashboard/pages/api): `nextui-dashboard/pages/api`

### Other components

- **DAO operator**
- **Binance market data**
- **Dune Analytics**
- **Web search and news**
- **Connected Sui wallet**
- **Sui Move contract**
- **Sui RPC**

## Connections

- Binance market data → Data tools: supplies market data
- Dune Analytics → Data tools: supplies chain data
- Web search and news → Data tools: supplies web signals
- Data tools → Specialist agents: provides signals (evidence: `agents.py`)
- Specialist agents → Analysis tasks: perform tasks
- Crew runner → Specialist agents: builds crew (evidence: `main.py`)
- Crew runner → Analysis tasks: builds tasks (evidence: `main.py`)
- Crew runner → Verdict guards: checks verdict (evidence: `main.py`)
- Job API → Crew runner: runs analysis (evidence: `server.py`)
- Job API → In-memory jobs: updates jobs (evidence: `server.py`)
- ARGO dashboard → Analysis workflow: uses workflow (evidence: `nextui-dashboard/pages/index.tsx`)
- Analysis workflow → Job API: requests analysis
- ARGO dashboard → Live market widgets: renders widgets (evidence: `nextui-dashboard/pages/index.tsx`)
- ARGO dashboard → Risk and trade views: renders risk (evidence: `nextui-dashboard/pages/index.tsx`)
- ARGO dashboard → Action log: renders activity (evidence: `nextui-dashboard/pages/index.tsx`)
- ARGO dashboard → On-chain event log: renders events (evidence: `nextui-dashboard/pages/index.tsx`)
- ARGO dashboard → Execution API routes: requests execution
- Execution API routes → Sui Move contract: submits transactions
- Connected Sui wallet → Sui Move contract: signs override
- Sui Move contract → Sui RPC: emits events
- On-chain event log → Sui RPC: reads events
