graph TD
A[Start MemecoinDiscoveryAgent] --> B1[Fetch PumpFun Data]
A --> B2[Fetch GMGN Data]
B1 --> C[Data Validation]
B2 --> C
C --> D[Merge & Deduplicate]
D --> E[Contract Analysis Loop]
E --> F[Query Rugcheckxyz]
E --> G[Check Historical Data]
E --> H[Analyze Social Metrics]
F --> I[Aggregate Results]
G --> I
H --> I
I --> J[Apply Scoring Logic]
J --> K[Filter Based on Criteria]
K --> L[Generate Risk Scores]
L --> M{Pass Basic Checks?}
M -->|Yes| N[Add to Verified List]
M -->|No| O[Discard Token]
N --> P[Format Output Data]
O --> Q[Log Rejected Tokens]
P --> R[Final Memecoin Discovery List]
Q --> S[Update Blacklist]
subgraph Data Collection
B1
B2
C
D
end
subgraph Analysis Phase
E
F
G
H
I
end
subgraph Decision Making
J
K
L
M
end
subgraph Output Processing
N
O
P
Q
R
S
end