@aiaiaichain/agent 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/GMGN.md ADDED
@@ -0,0 +1,116 @@
1
+ # GMGN Integration
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ # CLI
7
+ aiaiai gmgn setup
8
+
9
+ # TUI
10
+ /gmgn setup
11
+ ```
12
+
13
+ This saves `GMGN_API_KEY` to `~/.config/gmgn/.env`.
14
+
15
+ ## Token Research
16
+
17
+ ### Price + Market Cap
18
+ ```bash
19
+ aiaiai gmgn token info --chain sol --address <address>
20
+ ```
21
+
22
+ ### Security Check
23
+ ```bash
24
+ aiaiai gmgn token security --chain sol --address <address>
25
+ # Shows: honeypot, taxes, rug ratio, holder concentration
26
+ ```
27
+
28
+ ### Holders
29
+ ```bash
30
+ aiaiai gmgn token holders --chain sol --address <address> --limit 20
31
+ ```
32
+
33
+ ### Traders
34
+ ```bash
35
+ aiaiai gmgn token traders --chain sol --address <address> --limit 20
36
+ # --tag smart_degen → filter by smart money
37
+ # --tag renowned → filter by KOLs
38
+ ```
39
+
40
+ ## Market Data
41
+
42
+ ### Kline / Candlestick
43
+ ```bash
44
+ aiaiai gmgn market kline --chain sol --address <address> --resolution 1h
45
+ # --from <unix_ts> --to <unix_ts>
46
+ ```
47
+
48
+ ### Trending Tokens
49
+ ```bash
50
+ aiaiai gmgn market trending --chain sol --interval 1h
51
+ # --order-by volume --limit 20
52
+ # --platform Pump.fun --platform letsbonk
53
+ # --filter renounced --filter frozen
54
+ ```
55
+
56
+ ### Trenches (New Tokens)
57
+ ```bash
58
+ aiaiai gmgn market trenches --chain sol --type new_creation
59
+ aiaiai gmgn market trenches --chain sol --type near_completion
60
+ aiaiai gmgn market trenches --chain sol --type completed
61
+ # --filter-preset safe
62
+ # --filter-preset smart-money
63
+ # --min-smart-degen-count 1
64
+ ```
65
+
66
+ ### Signals
67
+ ```bash
68
+ aiaiai gmgn market signal --chain sol
69
+ # --signal-type 12 → smart money buys
70
+ # --signal-type 6 → price spikes
71
+ # --mc-min 50000
72
+ ```
73
+
74
+ ## Smart Money Tracking
75
+
76
+ ### KOL Activity
77
+ ```bash
78
+ aiaiai gmgn track kol --chain sol --limit 20
79
+ # --side buy
80
+ ```
81
+
82
+ ### Smart Money Activity
83
+ ```bash
84
+ aiaiai gmgn track smartmoney --chain sol --limit 20
85
+ # --side sell
86
+ ```
87
+
88
+ ### Followed Wallet Trades
89
+ ```bash
90
+ aiaiai gmgn track follow-wallet --chain sol
91
+ # --wallet <address>
92
+ # --side buy --min-amount-usd 100
93
+ ```
94
+
95
+ ### Followed Tokens
96
+ ```bash
97
+ aiaiai gmgn track follow-tokens --chain sol --wallet <address>
98
+ ```
99
+
100
+ ## Agent Tool
101
+
102
+ The agent can use GMGN via the `gmgn` tool. Examples:
103
+
104
+ ```
105
+ "Research this token" → gmgn tool with subcommand: "token info"
106
+ "Show me trending" → gmgn tool with subcommand: "market trending"
107
+ "What are KOLs buying?" → gmgn tool with subcommand: "track kol"
108
+ ```
109
+
110
+ ## Rate Limits
111
+
112
+ GMGN uses a leaky-bucket limiter (20 requests burst). The agent handles 429s gracefully.
113
+
114
+ ## IPv6 Issue
115
+
116
+ GMGN only works over IPv4. If you get 401/403, disable IPv6 on your network interface.
@@ -0,0 +1,71 @@
1
+ # Provider Registry
2
+
3
+ ## 29 AI Model Providers
4
+
5
+ | # | Provider | Env Var | Has Model API |
6
+ |---|----------|---------|---------------|
7
+ | 1 | OpenRouter | `OPENROUTER_API_KEY` | ✅ |
8
+ | 2 | Anthropic | `ANTHROPIC_API_KEY` | ✅ |
9
+ | 3 | OpenAI | `OPENAI_API_KEY` | ✅ |
10
+ | 4 | Google Gemini | `GOOGLE_API_KEY` | ✅ |
11
+ | 5 | DeepSeek | `DEEPSEEK_API_KEY` | ✅ |
12
+ | 6 | Groq | `GROQ_API_KEY` | ✅ |
13
+ | 7 | Mistral | `MISTRAL_API_KEY` | ✅ |
14
+ | 8 | Together AI | `TOGETHER_API_KEY` | ✅ |
15
+ | 9 | Fireworks | `FIREWORKS_API_KEY` | ✅ |
16
+ | 10 | Cerebras | `CEREBRAS_API_KEY` | ✅ |
17
+ | 11 | Amazon Bedrock | `AWS_ACCESS_KEY_ID` | ❌ |
18
+ | 12 | Google Vertex AI | `GOOGLE_APPLICATION_CREDENTIALS` | ❌ |
19
+ | 13 | Azure OpenAI | `AZURE_OPENAI_API_KEY` | ❌ |
20
+ | 14 | Hugging Face | `HUGGINGFACE_API_KEY` | ✅ |
21
+ | 15 | NVIDIA NIM | `NVIDIA_NIM_API_KEY` | ✅ |
22
+ | 16 | xAI | `XAI_API_KEY` | ✅ |
23
+ | 17 | Moonshot AI | `MOONSHOT_API_KEY` | ✅ |
24
+ | 18 | Moonshot AI China | `MOONSHOT_CHINA_API_KEY` | ✅ |
25
+ | 19 | MiniMax | `MINIMAX_API_KEY` | ✅ |
26
+ | 20 | MiniMax China | `MINIMAX_CHINA_API_KEY` | ✅ |
27
+ | 21 | Kimi For Coding | `KIMI_API_KEY` | ✅ |
28
+ | 22 | Ant Ling | `ANTLING_API_KEY` | ❌ |
29
+ | 23 | Cloudflare AI Gateway | `CF_API_KEY` | ❌ |
30
+ | 24 | Cloudflare Workers AI | `CF_API_KEY` | ❌ |
31
+ | 25 | Vercel AI Gateway | `VERCEL_API_KEY` | ❌ |
32
+ | 26 | OpenCode Go | `OPENCODE_API_KEY` | ❌ |
33
+ | 27 | OpenCode Zen | `OPENCODE_ZEN_API_KEY` | ❌ |
34
+ | 28 | Xiaomi MiMo | `XIAOMI_API_KEY` | ❌ |
35
+ | 29 | Xiaomi MiMo Token Plan | `XIAOMI_TOKEN_API_KEY` | ❌ |
36
+
37
+ ## Adding Keys
38
+
39
+ ### CLI
40
+ ```bash
41
+ aiaiai keys
42
+ # Select a number, paste your key
43
+ ```
44
+
45
+ ### TUI
46
+ ```
47
+ /keys
48
+ # Select a number, paste your key
49
+ ```
50
+
51
+ ### Direct
52
+ ```bash
53
+ # Edit ~/.aiaiai/.env
54
+ OPENROUTER_API_KEY=sk-or-...
55
+ ANTHROPIC_API_KEY=sk-...
56
+ ```
57
+
58
+ ## Model Tiers
59
+
60
+ Models are auto-classified into 4 tiers:
61
+
62
+ | Tier | Description | Example |
63
+ |------|-------------|---------|
64
+ | ⭐ Orchestrator | Best reasoning, highest cost | GPT-4o, Claude 3.5 Sonnet |
65
+ | 🔬 Analyst | Mid-range capable | GPT-4o-mini, Gemini 2.0 Flash |
66
+ | ⚡ Worker | Fast, cheap | Llama 3.1 8B, Mistral 7B |
67
+ | 🆓 Free | Free tier models | Various |
68
+
69
+ ## Auto-Fetch Models
70
+
71
+ When you add a provider key, the agent automatically fetches available models from that provider's API. Models appear in `/models` and the model selector (`/model`).
package/docs/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # AIAIAI Chain Agent
2
+
3
+ ## What is AIAIAI?
4
+
5
+ AIAIAI Chain Agent is a Solana-native AI agent that runs entirely in your terminal. It buys and burns `$AIAIAI` tokens, tracks on-chain activity, researches tokens via GMGN, and manages 29 AI model providers — all through a beautiful Ink TUI.
6
+
7
+ **Ticker:** `$AIAIAI`
8
+ **Contract:** `AVPJS61gZmWKtaEpb7qYPKo8Fk2xQUsayYQxPiPMpump`
9
+ **Chain:** Solana (primary)
10
+ **License:** MIT
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install -g @aiaiaichain/agent
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```bash
21
+ # 1. Configure (requires OpenRouter API key)
22
+ aiaiaichain setup
23
+
24
+ # 2. Start the agent
25
+ aiaiaichain
26
+
27
+ # 3. Or check $AIAIAI price directly
28
+ aiaiaichain price
29
+ ```
30
+
31
+ ## Architecture
32
+
33
+ ```
34
+ Your machine
35
+ ├── aiaiaichain (CLI)
36
+ │ ├── Ink TUI ← streaming terminal UI with sidebar
37
+ │ ├── AgentRunner ← model loop + tool dispatcher
38
+ │ ├── SwarmRouter ← parallel sub-agent orchestration
39
+ │ ├── PriceFeed ← DexScreener price data
40
+ │ ├── NewsFeed ← crypto news + sentiment
41
+ │ ├── TechnicalAnalysis ← RSI, MACD, Bollinger, ATR
42
+ │ ├── MarketSentiment ← Fear & Greed, funding, TVL
43
+ │ ├── AgentWallet ← cold + action + deposit wallets
44
+ │ ├── ActionFeed ← buy/burn tracking
45
+ │ ├── GoalManager ← persistent goals
46
+ │ ├── AgentScheduler ← cron/price-triggered tasks
47
+ │ ├── ModelRegistry ← 29 AI providers, tiered pools
48
+ │ ├── GMGN Integration ← token research + smart money tracking
49
+ │ └── MCPServer ← Model Context Protocol
50
+
51
+ ├── ~/.aiaiai/
52
+ │ ├── .env ← API keys
53
+ │ ├── config/ ← settings
54
+ │ ├── memory/ ← long-term memory
55
+ │ ├── checkpoints/ ← agent state
56
+ │ └── sessions/ ← task contexts
57
+
58
+ ├── ~/.config/gmgn/
59
+ │ └── .env ← GMGN_API_KEY
60
+
61
+ └── Outbound only (no inbound):
62
+ ├── openrouter.ai ← AI models
63
+ ├── api.dexscreener.com ← prices
64
+ ├── api.binance.com ← OHLCV
65
+ ├── api.alternative.me ← Fear & Greed
66
+ ├── api.llama.fi ← DeFi TVL
67
+ ├── mempool.space ← BTC mempool
68
+ ├── cryptopanic.com ← news
69
+ └── gmgn.ai ← token research
70
+ ```
71
+
72
+ ## Wallets
73
+
74
+ | Role | Address | Purpose |
75
+ |------|---------|---------|
76
+ | Cold | `A11iZoqEt6hU7HyggqC67ee4AtYmaJjwKCvJLerJRV2J` | Treasury |
77
+ | Action | `BygDYM1ZXLQNC1HXLhnd1rHZ7E5XjioqT3vPjJFfjnU2` | Buys + Burns |
78
+ | Deposit | `FBMDYpG9WXKy4SgxuATQdB2sCyzHsJWPrEr45z3TgL2e` | User deposits (SOL/USDC) |
79
+ | Signer | `GmFrDZT2cdrqykgTikVdXbe8EtCgzUDM9VsDhQnwsUsG` | Burn authority |
80
+
81
+ ## Outbound Connections
82
+
83
+ | Service | Purpose | Required Key |
84
+ |---------|---------|-------------|
85
+ | OpenRouter | AI model access | `OPENROUTER_API_KEY` |
86
+ | DexScreener | Token prices | None (public) |
87
+ | Binance API | OHLCV candles | None (public) |
88
+ | Alternative.me | Fear & Greed | None (public) |
89
+ | DeFiLlama | TVL data | None (public) |
90
+ | Mempool.space | BTC mempool | None (public) |
91
+ | CryptoPanic | Crypto news | None (public) |
92
+ | GMGN | Token research + tracking | `GMGN_API_KEY` |
93
+
94
+ ## Inbound Connections
95
+
96
+ **None.** The agent is 100% outbound. No ports are opened, no servers listen, no inbound connections are accepted. All data is pulled via HTTP GET/POST requests.
97
+
98
+ ## Security
99
+
100
+ - All API keys stored in `~/.aiaiai/.env` (chmod 600)
101
+ - GMGN key stored in `~/.config/gmgn/.env` (chmod 600)
102
+ - No keys leave your machine
103
+ - No inbound ports
104
+ - All outbound connections use HTTPS
package/docs/TOOLS.md ADDED
@@ -0,0 +1,81 @@
1
+ # Tools Reference
2
+
3
+ ## Price & Market
4
+ | Tool | Description |
5
+ |------|-------------|
6
+ | `get_aiaiai_price` | $AIAIAI price, liquidity, MCap, volume (DexScreener) |
7
+ | `get_token_price` | Any Solana token price data (DexScreener) |
8
+ | `get_news` | Crypto news with sentiment scoring |
9
+ | `get_candles` | OHLCV candles from Binance + full TA analysis |
10
+ | `analyze_ta` | RSI, MACD, Bollinger, ATR on price array |
11
+
12
+ ## Market Sentiment
13
+ | Tool | Description |
14
+ |------|-------------|
15
+ | `get_fear_greed` | Crypto Fear & Greed Index (7-day) |
16
+ | `get_funding_rates` | Binance perpetual funding rates |
17
+ | `get_btc_mempool` | BTC mempool stats + fees |
18
+ | `get_defi_tvl` | DeFiLlama TVL by chain |
19
+ | `get_solana_stats` | Solana epoch, slot, SOL price |
20
+
21
+ ## Wallet & Actions
22
+ | Tool | Description |
23
+ |------|-------------|
24
+ | `get_agent_balance` | Cold + action wallet balances |
25
+ | `get_deposit_balance` | Deposit wallet + instructions |
26
+ | `get_actions` | Recent buy/burn actions |
27
+ | `get_fees` | Accumulated fees (0.5% per action) |
28
+
29
+ ## AI Models
30
+ | Tool | Description |
31
+ |------|-------------|
32
+ | `list_models` | Search/filter models by provider/tier |
33
+ | `pick_model` | Find cheapest model in a tier |
34
+ | `model_summary` | Provider and tier breakdown |
35
+ | `cost_report` | Session/lifetime token usage |
36
+
37
+ ## Context & Goals
38
+ | Tool | Description |
39
+ |------|-------------|
40
+ | `set_goal` | Set persistent goal |
41
+ | `complete_goal` | Mark goal done |
42
+ | `list_goals` | List all goals |
43
+ | `add_goal_note` | Progress note |
44
+ | `set_goal` | Set goal |
45
+
46
+ ## Tasks & Schedule
47
+ | Tool | Description |
48
+ |------|-------------|
49
+ | `schedule_task` | Schedule recurring task |
50
+ | `list_schedule` | List scheduled tasks |
51
+ | `remove_schedule` | Remove task |
52
+ | `read_task_context` | Read saved task context |
53
+ | `list_tasks` | List task contexts |
54
+
55
+ ## GMGN Token Research
56
+ | Tool | Description |
57
+ |------|-------------|
58
+ | `gmgn` | Full GMGN access (token info, security, holders, traders, KOL, smart money, kline, trending, trenches, signals) |
59
+
60
+ ## Built-in Commands
61
+ | Command | Description |
62
+ |---------|-------------|
63
+ | `/help` | Show all commands |
64
+ | `/price` | $AIAIAI price |
65
+ | `/news` | Latest news |
66
+ | `/models` | List models |
67
+ | `/model` | Switch model |
68
+ | `/cost` | Token usage |
69
+ | `/wallet` | Agent wallets |
70
+ | `/deposit` | Deposit instructions |
71
+ | `/burn` | Burn instructions |
72
+ | `/actions` | Recent actions |
73
+ | `/fees` | Fee tracker |
74
+ | `/keys` | Provider key management |
75
+ | `/gmgn` | GMGN token research |
76
+ | `/update` | Check for updates |
77
+ | `/goals` | Goal management |
78
+ | `/schedule` | Task scheduler |
79
+ | `/memory` | Search memory |
80
+ | `/clear` | Clear chat |
81
+ | `/exit` | Exit |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiaiaichain/agent",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "AIAIAI Chain Agent — Solana-native AI agent for decentralized AI governance. Ticker: $AIAIAI",
5
5
  "author": "AIAIAI Foundation",
6
6
  "license": "MIT",
@@ -59,6 +59,7 @@
59
59
  "dist",
60
60
  "bin",
61
61
  "README.md",
62
+ "docs",
62
63
  "!dist/**/*.map"
63
64
  ]
64
65
  }