Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions HLD_DIAGRAM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
```mermaid
graph TB
%% --- User Layer ---
User((👤 User))

%% --- Frontend System ---
subgraph Frontend ["🖥️ Agentropolis Frontend (Next.js 14 + Phaser 3)"]
direction TB
Landing[Landing Page]
Game[Game Canvas]

subgraph GameScenes ["🎮 Game Scenes"]
City[City View (Isometric)]
Council[Council Room (Roundtable)]
end

subgraph CoreComponents ["🧩 Core Components"]
Session[Session Provider]
Wallet[Wallet Provider]
Swap[Swap Handler]
end

subgraph IntegrationLibs ["📚 Integration Libraries"]
YellowLib[Yellow (State Channels)]
ENS_Lib[ENS (Identity)]
ERC8004_Lib[ERC-8004 (Registry)]
x402_Lib[x402 (Micropayments)]
UniExecutor[Uniswap Executor]
ClankerLib[Clanker SDK]
end
end

%% --- Backend / AI Layer ---
subgraph AI_Layer ["🧠 AI & Backend Layer"]
Groq[Groq LLM API]

subgraph Agents ["🤖 AI Council Agents"]
Alpha[🎯 Alpha Hunter]
Risk[🛡️ Risk Sentinel]
Macro[🔮 Macro Oracle]
Devil[😈 Devil's Advocate]
Clerk[📋 Council Clerk]
end

ExternalAgent[🌐 External Agent (BYOA)]
end

%% --- Blockchain Layer ---
subgraph Blockchain ["⛓️ Base Sepolia & On-Chain"]
subgraph Registries ["Infrastructure"]
Registry[ERC-8004 Registry]
ENSReg[ENS Registry]
end

subgraph Execution ["DeFi Execution"]
UniversalRouter[Uniswap Universal Router]
PoolManager[Pool Manager]
end

subgraph Hooks ["🪝 Custom Uniswap Hooks"]
FeeHook[CouncilFeeHook]
SentinelHook[SentimentOracleHook]
GuardHook[SwapGuardHook]
end
end

%% --- Connections ---
User -->|Connects| Wallet
User -->|Interacts| Game

Game --> City
City -->|Click Council| Council

%% Deploy Flow
City -->|Query Agents| ERC8004_Lib
ERC8004_Lib -->|Read| Registry
City -->|Micropayment| YellowLib

%% Deliberation Flow
Council -->|Prompt| Agents
Agents -->|Inference| Groq
Agents -->|Consult| ExternalAgent
ExternalAgent -.->|Payment| x402_Lib

%% Execution Flow
Agents -->|Consensus Proposal| Clerk
Clerk -->|Synthesized Plan| Swap
Swap -->|Execute| UniExecutor
UniExecutor -->|V4_SWAP| UniversalRouter
UniversalRouter --> PoolManager
PoolManager --> FeeHook
PoolManager --> SentinelHook
PoolManager --> GuardHook

%% Styling
classDef frontend fill:#e1f5fe,stroke:#01579b,stroke-width:2px;
classDef backend fill:#f3e5f5,stroke:#4a148c,stroke-width:2px;
classDef blockchain fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px;
classDef user fill:#fff9c4,stroke:#fbc02d,stroke-width:2px;

class Frontend,GameScenes,CoreComponents,IntegrationLibs frontend;
class AI_Layer,Agents,Groq,ExternalAgent backend;
class Blockchain,Registries,Execution,Hooks blockchain;
class User user;
```
9 changes: 9 additions & 0 deletions SIMPLE_EXPLANATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# What Problem Does Agentropolis Solve?

The problem with Decentralized Finance (DeFi) today is that it’s overwhelmingly complex and lonely. Imagine trying to make investment decisions while staring at confusing charts, cryptic codes, and endless spreadsheets, knowing a single wrong click could cost you money. It feels like piloting a spaceship without a manual. Most people want to participate but are scared off by the technical jargon and lack of guidance. They don't have a team of financial experts to double-check their logic or explain risks in plain English.

# How Agentropolis Works (The "SimCity for Finance" Solution)

Agentropolis transforms this intimidating experience into a friendly, city-building game. Instead of navigating confusing menus, you simply **build a digital city and hire a team of AI assistants** who live there. Think of them as your personal financial council. You walk your character into a "Council Room" where cute, animated characters (like a cautious "Risk Manager" or an ambitious "Profit Hunter") are sitting around a table. You just ask them a simple question like, *"How should I invest $100 safely?"*

The magic happens next: The AI agents **debate your question in real-time**. You watch them discuss the pros and cons—your Risk Manager might say, *"Wait, the market is too volatile right now!"* while the Profit Hunter argues, *"But the potential returns are high!"* They simplify complex data into a clear conversation you can understand. Once they agree on a plan, they present it to you. You simply click **"Approve,"** and the game handles all the complicated technical steps securely in the background. It turns finance from a solitary, stressful task into a collaborative, gamified experience where you always have a team of experts by your side.
Loading