starkfi 0.4.4 → 0.6.0
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/MCP.md +204 -27
- package/README.md +213 -106
- package/dist/index.js +259 -154
- package/package.json +15 -8
- package/skills/README.md +16 -5
- package/skills/balance/SKILL.md +2 -0
- package/skills/batch/SKILL.md +46 -13
- package/skills/confidential/SKILL.md +183 -0
- package/skills/config/SKILL.md +6 -4
- package/skills/dca/SKILL.md +133 -0
- package/skills/lending/SKILL.md +111 -17
- package/skills/multi-swap/SKILL.md +14 -11
- package/skills/portfolio/SKILL.md +78 -12
- package/skills/send/SKILL.md +1 -0
- package/skills/trade/SKILL.md +22 -18
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
A production-grade CLI, MCP server, and Telegram bot that gives both developers and AI agents full access to swaps, multi-swap, atomic batch transactions, staking, lending, portfolio management, and gasless transactions — all powered by the <a href="https://github.com/keep-starknet-strange/starkzap">Starkzap SDK</a>.
|
|
8
|
+
A production-grade CLI, MCP server, and Telegram bot that gives both developers and AI agents full access to swaps, multi-swap, atomic batch transactions, staking, lending, DCA (Dollar-Cost Averaging), confidential transfers, portfolio management, and gasless transactions — all powered by the <a href="https://github.com/keep-starknet-strange/starkzap">Starkzap SDK</a>.
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
@@ -23,7 +23,7 @@ npx starkfi@latest --help
|
|
|
23
23
|
|
|
24
24
|
Most DeFi tools are built for humans clicking buttons. StarkFi is built for **agents**.
|
|
25
25
|
|
|
26
|
-
- 🤖 **
|
|
26
|
+
- 🤖 **42 MCP tools** — Any AI assistant (Cursor, Claude, Antigravity) can execute DeFi operations autonomously
|
|
27
27
|
- ⚡ **Atomic Batching** — Combine swap + stake + lend + send into a single multicall transaction
|
|
28
28
|
- 💸 **Gas Abstraction Built-In** — Pay gas in STRK, ETH, USDC, USDT, or DAI via AVNU Paymaster, or let the developer sponsor gas entirely (gasfree mode)
|
|
29
29
|
- 📊 **Full Portfolio** — Unified view of balances, staking positions, and lending positions with USD values
|
|
@@ -35,36 +35,37 @@ Most DeFi tools are built for humans clicking buttons. StarkFi is built for **ag
|
|
|
35
35
|
## Architecture
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
|
|
39
|
-
│ StarkFi
|
|
40
|
-
│
|
|
41
|
-
│ ┌──────────┐ ┌────────────────┐ ┌────────────────┐ ┌─────────────────────────┐
|
|
42
|
-
│ │ CLI │ │ MCP Server │ │ Agent Skills │ │ Telegram Bot │
|
|
43
|
-
│ │ (
|
|
44
|
-
|
|
45
|
-
│
|
|
46
|
-
│
|
|
47
|
-
│
|
|
48
|
-
│
|
|
49
|
-
│
|
|
50
|
-
│
|
|
51
|
-
│ │
|
|
52
|
-
│ │
|
|
53
|
-
│ │ │
|
|
54
|
-
│ │
|
|
55
|
-
│ │
|
|
56
|
-
│ │
|
|
57
|
-
│ │
|
|
58
|
-
│ │
|
|
59
|
-
│ │
|
|
60
|
-
│ │
|
|
61
|
-
│
|
|
62
|
-
│
|
|
63
|
-
│
|
|
64
|
-
│
|
|
65
|
-
│ │
|
|
66
|
-
│
|
|
67
|
-
|
|
38
|
+
┌───────────────────────────────────────────────────────────────────────────────────────┐
|
|
39
|
+
│ StarkFi │
|
|
40
|
+
│ │
|
|
41
|
+
│ ┌──────────┐ ┌────────────────┐ ┌────────────────┐ ┌─────────────────────────┐ │
|
|
42
|
+
│ │ CLI │ │ MCP Server │ │ Agent Skills │ │ Telegram Bot │ │
|
|
43
|
+
│ │ (42+ │ │ (42 tools) │ │ (12 workflows) │ │ (BYOAI · Chat DeFi) │ │
|
|
44
|
+
|
|
45
|
+
│ │ commands)│ │ stdio transport│ │ npx starkfi │ │ OpenAI / Claude / │ │
|
|
46
|
+
│ └────┬─────┘ └──────┬─────────┘ └─────┬──────────┘ │ Gemini │ │
|
|
47
|
+
│ │ │ │ └───────────┬─────────────┘ │
|
|
48
|
+
│ └───────────────┼──────────────────┼─────────────────────────┘ │
|
|
49
|
+
│ ▼ ▼ │
|
|
50
|
+
│ ┌────────────────────────────────────────────────────────────────────────────────┐ │
|
|
51
|
+
│ │ Service Layer │ │
|
|
52
|
+
│ │ ┌────────┐ ┌────────┐ ┌──────┐ ┌─────┐ ┌────────┐ ┌─────────┐ ┌──────────────┐ │ │
|
|
53
|
+
│ │ │ DEX │ │Staking │ │ Vesu │ │ DCA │ │ Batch │ │Portfolio│ │ Confidential │ │ │
|
|
54
|
+
│ │ │ Swap │ │Lifecycl│ │ V2 │ │ │ │Multical│ │Dashboard│ │ Tongo Cash │ │ │
|
|
55
|
+
│ │ └────┬─────┘ └────┬─────┘ └───┬────┘ └───┬──┘ └────┬─────┘ └────┬─────┘ │ │
|
|
56
|
+
│ │ └─────────────┴────────────┴───────────┴──────────┴─────────────┘ │ │
|
|
57
|
+
│ │ │ │ │
|
|
58
|
+
│ │ ┌───────────┴───────────────────────────────┐ │ │
|
|
59
|
+
│ │ │ Starkzap SDK (starkzap v2.0.0) │ │ │
|
|
60
|
+
│ │ │ Wallet · TxBuilder · Tokens · Paymaster │ │ │
|
|
61
|
+
│ │ └─────────────┬─────────────────────────────┘ │ │
|
|
62
|
+
│ └───────────────────────┼────────────────────────────────────────────────────────┘ │
|
|
63
|
+
│ ▼ │
|
|
64
|
+
│ ┌──────────────────────────────────────┐ ┌──────────────────────┐ │
|
|
65
|
+
│ │ Auth Server (Hono + Privy TEE) │ │ AVNU Paymaster │ │
|
|
66
|
+
│ │ Email OTP · Wallet · Sign · Gas │ │ Gas Abstraction │ │
|
|
67
|
+
│ └──────────────────────────────────────┘ └──────────────────────┘ │
|
|
68
|
+
└───────────────────────────────────────────────────────────────────────────────────────┘
|
|
68
69
|
│
|
|
69
70
|
▼
|
|
70
71
|
┌──────────────────┐
|
|
@@ -80,25 +81,53 @@ StarkFi leverages **all core Starkzap modules**:
|
|
|
80
81
|
|
|
81
82
|
| Module | Usage in StarkFi |
|
|
82
83
|
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
83
|
-
| **Wallets** | `
|
|
84
|
+
| **Wallets** | `OnboardStrategy.Privy` + `argentXV050` preset for automated email-based wallet onboarding via Privy TEE |
|
|
84
85
|
| **Gasless Transactions (Paymaster)** | Paymaster integration with 5 gas tokens (STRK, ETH, USDC, USDT, DAI) + developer-sponsored gasfree mode |
|
|
85
86
|
| **Staking** | Multi-token staking lifecycle (STRK, WBTC, tBTC, SolvBTC, LBTC) — stake, claim, compound, unstake (2-step) |
|
|
86
|
-
| **
|
|
87
|
+
| **DCA** | Dollar-Cost Averaging via AVNU and Ekubo — create, preview, list, and cancel recurring buy orders |
|
|
88
|
+
| **TxBuilder** | Atomic multicall batching — combine swap + stake + supply + send + borrow + repay + withdraw + dca in one transaction |
|
|
89
|
+
| **Confidential (Tongo Cash)** | Privacy-preserving transfers via TongoConfidential — fund, transfer, withdraw, ragequit, rollover |
|
|
87
90
|
| **ERC-20 Tokens** | Token presets, balance queries, transfers, approvals |
|
|
88
91
|
|
|
89
92
|
---
|
|
90
93
|
|
|
91
94
|
## Features
|
|
92
95
|
|
|
93
|
-
### 🔄
|
|
96
|
+
### 🔄 Token Swap (Multi-Provider)
|
|
94
97
|
|
|
95
|
-
|
|
98
|
+
Swap tokens on Starknet via Fibrous (default), AVNU, or Ekubo — or use `--provider auto` to race all providers for the best price. Supports multi-pair batch swaps.
|
|
96
99
|
|
|
97
100
|
```bash
|
|
98
|
-
npx starkfi@latest trade 100 USDC ETH
|
|
101
|
+
npx starkfi@latest trade 100 USDC ETH # Swap via Fibrous (default)
|
|
102
|
+
npx starkfi@latest trade 100 USDC ETH --provider auto # Race all providers for best price
|
|
99
103
|
npx starkfi@latest multi-swap "100 USDC>ETH, 50 USDT>ETH"
|
|
100
104
|
```
|
|
101
105
|
|
|
106
|
+
### 📅 Dollar-Cost Averaging (DCA)
|
|
107
|
+
|
|
108
|
+
Set up recurring buy orders that automatically swap a fixed amount at regular intervals. Supports AVNU and Ekubo DCA providers.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npx starkfi@latest dca-preview 10 USDC ETH # Preview single cycle
|
|
112
|
+
npx starkfi@latest dca-create 1000 USDC ETH --per-cycle 10 --frequency P1D # Daily DCA
|
|
113
|
+
npx starkfi@latest dca-list --status ACTIVE # View orders
|
|
114
|
+
npx starkfi@latest dca-cancel <order_id> # Cancel order
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 🔒 Confidential Transfers (Tongo Cash)
|
|
118
|
+
|
|
119
|
+
Privacy-preserving transfers using ZK proofs via Tongo. Amounts are hidden on-chain; recipients are identified by elliptic curve public keys.
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npx starkfi@latest conf-setup --key <TONGO_KEY> --contract 0x… # One-time setup
|
|
123
|
+
npx starkfi@latest conf-balance # Check confidential balance
|
|
124
|
+
npx starkfi@latest conf-fund 100 --token USDC # Fund confidential account
|
|
125
|
+
npx starkfi@latest conf-transfer 50 --recipient-x 0x… --recipient-y 0x… # Private transfer
|
|
126
|
+
npx starkfi@latest conf-withdraw 100 # Withdraw to public balance
|
|
127
|
+
npx starkfi@latest conf-ragequit # Emergency full withdrawal
|
|
128
|
+
npx starkfi@latest conf-rollover # Activate pending balance
|
|
129
|
+
```
|
|
130
|
+
|
|
102
131
|
### ⚛️ Atomic Transaction Batching
|
|
103
132
|
|
|
104
133
|
Bundle multiple DeFi operations into a single Starknet multicall. Minimum 2 operations.
|
|
@@ -108,7 +137,9 @@ npx starkfi@latest batch \
|
|
|
108
137
|
--swap "100 USDC ETH" \
|
|
109
138
|
--stake "50 STRK karnot" \
|
|
110
139
|
--supply "200 USDC Prime" \
|
|
111
|
-
--send "10 STRK 0xAddr"
|
|
140
|
+
--send "10 STRK 0xAddr" \
|
|
141
|
+
--borrow "0.5 ETH 500 USDC Prime" \
|
|
142
|
+
--withdraw "200 USDC Prime"
|
|
112
143
|
```
|
|
113
144
|
|
|
114
145
|
### 🥩 Multi-Token Staking Lifecycle
|
|
@@ -136,6 +167,37 @@ npx starkfi@latest lend-status -p Prime --collateral-token STRK --borrow-token U
|
|
|
136
167
|
npx starkfi@latest lend-close -p Prime --collateral-token STRK --borrow-token USDC
|
|
137
168
|
```
|
|
138
169
|
|
|
170
|
+
### 🩺 Lending Agent (Health Monitoring)
|
|
171
|
+
|
|
172
|
+
Real-time health factor monitoring with risk classification and automated position rebalancing.
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npx starkfi@latest lend-monitor # Scan all positions
|
|
176
|
+
npx starkfi@latest lend-monitor -p Prime --collateral-token ETH --borrow-token USDC
|
|
177
|
+
npx starkfi@latest lend-auto -p Prime --collateral-token ETH --borrow-token USDC
|
|
178
|
+
npx starkfi@latest lend-auto -p Prime --collateral-token ETH --borrow-token USDC --simulate
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 🌐 Network Support (Mainnet + Sepolia)
|
|
182
|
+
|
|
183
|
+
Switch between Mainnet and Sepolia instantly — no re-login required. All token addresses resolve dynamically per-network.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npx starkfi@latest config set-network sepolia # Switch to testnet
|
|
187
|
+
npx starkfi@latest config set-network mainnet # Switch back
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
| Module | Network-Aware | Notes |
|
|
191
|
+
| --------------------- | ------------- | ------------------------------------------------------------ |
|
|
192
|
+
| **Lending (Vesu V2)** | ✅ | Pools, supply, borrow, monitor, auto-rebalance |
|
|
193
|
+
| **Staking** | ✅ | Multi-token — STRK, WBTC, tBTC, SolvBTC, LBTC |
|
|
194
|
+
| **Batch** | ✅ | All batch operations (supply, borrow, repay, withdraw, stake, send, dca) |
|
|
195
|
+
| **Portfolio** | ✅ | Balances, staking positions, lending positions |
|
|
196
|
+
| **Wallet (Send)** | ✅ | Token transfers and simulation |
|
|
197
|
+
| **Swap** | Mainnet only | Fibrous (default), AVNU, Ekubo — selectable via `--provider` |
|
|
198
|
+
| **Multi-Swap** | Mainnet only | Per-pair provider selection |
|
|
199
|
+
| **Rebalance** | Mainnet only | Uses swap routing for rebalance execution |
|
|
200
|
+
|
|
139
201
|
### 💸 Gas Abstraction
|
|
140
202
|
|
|
141
203
|
Users pay gas fees in their preferred ERC-20 token via AVNU Paymaster — no native STRK or ETH required. Alternatively, developers can sponsor gas entirely.
|
|
@@ -171,11 +233,20 @@ npx starkfi@latest portfolio
|
|
|
171
233
|
# → Token Balances (USD), Staking Positions, Lending Positions, Total Value
|
|
172
234
|
```
|
|
173
235
|
|
|
236
|
+
### 📈 Portfolio Optimization
|
|
237
|
+
|
|
238
|
+
Rebalance your portfolio to a target allocation via automated batch swaps.
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
npx starkfi@latest portfolio-rebalance --target "50 ETH, 30 USDC, 20 STRK"
|
|
242
|
+
npx starkfi@latest portfolio-rebalance --target "60 ETH, 40 STRK" --simulate
|
|
243
|
+
```
|
|
244
|
+
|
|
174
245
|
---
|
|
175
246
|
|
|
176
247
|
## AI Integration (MCP)
|
|
177
248
|
|
|
178
|
-
StarkFi exposes **
|
|
249
|
+
StarkFi exposes **42 MCP tools** via stdio transport, enabling AI assistants to execute DeFi operations.
|
|
179
250
|
|
|
180
251
|
```bash
|
|
181
252
|
# Start the MCP server
|
|
@@ -184,13 +255,16 @@ npx starkfi@latest mcp-start
|
|
|
184
255
|
|
|
185
256
|
### Tool Categories
|
|
186
257
|
|
|
187
|
-
| Category
|
|
188
|
-
|
|
|
189
|
-
| **Auth & Config**
|
|
190
|
-
| **Wallet**
|
|
191
|
-
| **Trade**
|
|
192
|
-
| **Staking**
|
|
193
|
-
| **Lending**
|
|
258
|
+
| Category | Tools | Count |
|
|
259
|
+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
260
|
+
| **Auth & Config** | `get_auth_status`, `config_action` | 2 |
|
|
261
|
+
| **Wallet** | `get_balance`, `get_portfolio`, `deploy_account`, `send_tokens`, `get_tx_status`, `rebalance_portfolio` | 6 |
|
|
262
|
+
| **Trade** | `get_swap_quote`, `swap_tokens`, `get_multi_swap_quote`, `multi_swap`, `batch_execute` | 5 |
|
|
263
|
+
| **Staking** | `list_validators`, `list_pools`, `get_staking_info`, `get_stake_status`, `stake_tokens`, `unstake_tokens`, `claim_rewards`, `compound_rewards` | 8 |
|
|
264
|
+
| **Lending** | `list_lending_pools`, `get_lending_position`, `supply_assets`, `withdraw_assets`, `borrow_assets`, `repay_debt`, `close_position`, `monitor_lending_position`, `auto_rebalance_lending` | 9 |
|
|
265
|
+
| **DCA** | `dca_preview`, `dca_create`, `dca_list`, `dca_cancel` | 4 |
|
|
266
|
+
| **Confidential** | `confidential_setup`, `confidential_balance`, `confidential_fund`, `confidential_transfer`, `confidential_withdraw`, `confidential_ragequit`, `confidential_rollover` | 7 |
|
|
267
|
+
| **Health (Lending)** | `lending_quote_health` | 1 |
|
|
194
268
|
|
|
195
269
|
### Example — AI Agent Workflow
|
|
196
270
|
|
|
@@ -224,14 +298,14 @@ For the complete tool registry and schemas, see [MCP Documentation](https://docs
|
|
|
224
298
|
|
|
225
299
|
## Agent Skills
|
|
226
300
|
|
|
227
|
-
StarkFi ships with **
|
|
301
|
+
StarkFi ships with **12 agent skills** — structured instruction sets that teach AI coding assistants how to use StarkFi without custom prompting.
|
|
228
302
|
|
|
229
|
-
| Category | Skills
|
|
230
|
-
| ---------------- |
|
|
231
|
-
| **Auth** | `authenticate-wallet`
|
|
232
|
-
| **Wallet Data** | `balance`, `portfolio`
|
|
233
|
-
| **Transactions** | `send`, `trade`, `multi-swap`, `batch`, `staking`, `lending` |
|
|
234
|
-
| **Utility** | `config`
|
|
303
|
+
| Category | Skills |
|
|
304
|
+
| ---------------- | ----------------------------------------------------------------------------------- |
|
|
305
|
+
| **Auth** | `authenticate-wallet` |
|
|
306
|
+
| **Wallet Data** | `balance`, `portfolio` |
|
|
307
|
+
| **Transactions** | `send`, `trade`, `multi-swap`, `batch`, `staking`, `lending`, `dca`, `confidential` |
|
|
308
|
+
| **Utility** | `config` |
|
|
235
309
|
|
|
236
310
|
```bash
|
|
237
311
|
# Install skills for your AI assistant
|
|
@@ -293,18 +367,39 @@ npx starkfi@latest trade 10 STRK ETH # Execute
|
|
|
293
367
|
| `send <amount> <token> <recipient> [--simulate] [--json]` | Transfer tokens |
|
|
294
368
|
| `portfolio [--json]` | Full DeFi portfolio |
|
|
295
369
|
|
|
296
|
-
### Trading
|
|
370
|
+
### Trading
|
|
371
|
+
|
|
372
|
+
| Command | Description |
|
|
373
|
+
| ------------------------------------------------------------------------------------------------------------- | --------------------------- |
|
|
374
|
+
| `trade <amount> <from> <to> [--provider <fibrous\|avnu\|ekubo\|auto>] [--slippage <%>] [--simulate] [--json]` | Swap tokens (via Fibrous) |
|
|
375
|
+
| `multi-swap "<pairs>" [--provider <name>] [--slippage <%>] [--simulate] [--json]` | Multi-pair swap (2-3 pairs) |
|
|
376
|
+
|
|
377
|
+
### DCA (Dollar-Cost Averaging)
|
|
297
378
|
|
|
298
|
-
| Command
|
|
299
|
-
|
|
|
300
|
-
| `
|
|
301
|
-
| `
|
|
379
|
+
| Command | Description |
|
|
380
|
+
| --------------------------------------------------------------------------------------------------------------------- | -------------------- |
|
|
381
|
+
| `dca-preview <amount> <sell> <buy> [--provider <avnu\|ekubo>] [--json]` | Preview single cycle |
|
|
382
|
+
| `dca-create <amount> <sell> <buy> --per-cycle <n> [--frequency <duration>] [--provider <name>] [--simulate] [--json]` | Create DCA order |
|
|
383
|
+
| `dca-list [--status <ACTIVE\|CLOSED\|INDEXING>] [--provider <name>] [--page <n>] [--json]` | List DCA orders |
|
|
384
|
+
| `dca-cancel <order_id> [--provider <name>] [--json]` | Cancel a DCA order |
|
|
385
|
+
|
|
386
|
+
### Confidential Transfers (Tongo Cash)
|
|
387
|
+
|
|
388
|
+
| Command | Description |
|
|
389
|
+
| ------------------------------------------------------------------------------ | ------------------------------------ |
|
|
390
|
+
| `conf-setup --key <key> --contract <address>` | Configure Tongo Cash credentials |
|
|
391
|
+
| `conf-balance [--json]` | Show confidential balance |
|
|
392
|
+
| `conf-fund <amount> [--token <symbol>] [--simulate] [--json]` | Fund confidential account |
|
|
393
|
+
| `conf-transfer <amount> --recipient-x <x> --recipient-y <y> [--simulate] [--json]` | Confidential transfer |
|
|
394
|
+
| `conf-withdraw <amount> [--to <address>] [--token <symbol>] [--simulate] [--json]` | Withdraw to public address |
|
|
395
|
+
| `conf-ragequit [--to <address>] [--json]` | Emergency full withdrawal |
|
|
396
|
+
| `conf-rollover [--json]` | Activate pending balance |
|
|
302
397
|
|
|
303
398
|
### Batching (Multicall)
|
|
304
399
|
|
|
305
400
|
| Command | Description |
|
|
306
401
|
| --------------------------------------------------------------------------- | ---------------------------- |
|
|
307
|
-
| `batch [--simulate] --swap "..." --stake "..." --supply "..." --send "..."` | Atomic multicall (min 2 ops) |
|
|
402
|
+
| `batch [--simulate] --swap "..." --stake "..." --supply "..." --send "..." --borrow "..." --repay "..." --withdraw "..." --dca-create "..." --dca-cancel "..."` | Atomic multicall (min 2 ops) |
|
|
308
403
|
|
|
309
404
|
### Staking
|
|
310
405
|
|
|
@@ -319,28 +414,37 @@ npx starkfi@latest trade 10 STRK ETH # Execute
|
|
|
319
414
|
|
|
320
415
|
### Lending (Vesu V2)
|
|
321
416
|
|
|
322
|
-
| Command
|
|
323
|
-
|
|
|
324
|
-
| `lend-pools [name]`
|
|
325
|
-
| `lend-supply <amount> -p <pool> -t <token
|
|
326
|
-
| `lend-withdraw <amount> -p <pool> -t <token
|
|
327
|
-
| `lend-borrow -p <pool> --collateral-amount <n> --collateral-token <t> --borrow-amount <n> --borrow-token <t> [--use-supplied]` | Borrow |
|
|
328
|
-
| `lend-repay <amount> -p <pool> -t <token> --collateral-token <t
|
|
329
|
-
| `lend-status [-p <pool> --collateral-token <t> [--borrow-token <t>]]`
|
|
330
|
-
| `lend-close -p <pool> --collateral-token <t> --borrow-token <t
|
|
417
|
+
| Command | Description |
|
|
418
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
419
|
+
| `lend-pools [name]` | List lending pools |
|
|
420
|
+
| `lend-supply <amount> -p <pool> -t <token> [--simulate]` | Supply assets |
|
|
421
|
+
| `lend-withdraw <amount> -p <pool> -t <token> [--simulate]` | Withdraw assets |
|
|
422
|
+
| `lend-borrow -p <pool> --collateral-amount <n> --collateral-token <t> --borrow-amount <n> --borrow-token <t> [--use-supplied] [--simulate]` | Borrow |
|
|
423
|
+
| `lend-repay <amount> -p <pool> -t <token> --collateral-token <t> [--simulate]` | Repay debt |
|
|
424
|
+
| `lend-status [-p <pool> --collateral-token <t> [--borrow-token <t>]]` | Position status (auto-scan if no args) |
|
|
425
|
+
| `lend-close -p <pool> --collateral-token <t> --borrow-token <t> [--simulate]` | Close position atomically |
|
|
426
|
+
| `lend-monitor [-p <pool> --collateral-token <t> --borrow-token <t>]` | Monitor health factors |
|
|
427
|
+
| `lend-auto -p <pool> --collateral-token <t> --borrow-token <t> [--strategy <type>] [--simulate]` | Auto-rebalance position |
|
|
428
|
+
|
|
429
|
+
### Portfolio
|
|
430
|
+
|
|
431
|
+
| Command | Description |
|
|
432
|
+
| ------------------------------------------------------------------------------------ | ------------------------------ |
|
|
433
|
+
| `portfolio [--json]` | Full DeFi dashboard |
|
|
434
|
+
| `portfolio-rebalance --target "<allocation>" [--slippage <%>] [--simulate] [--json]` | Rebalance to target allocation |
|
|
331
435
|
|
|
332
436
|
### Configuration
|
|
333
437
|
|
|
334
|
-
| Command | Description
|
|
335
|
-
| --------------------------------------- |
|
|
336
|
-
| `config list` | Show current configuration
|
|
337
|
-
| `config reset` | Reset all settings to defaults
|
|
338
|
-
| `config set-rpc <url>` | Set custom RPC endpoint
|
|
339
|
-
| `config get-rpc` | Show current RPC
|
|
340
|
-
| `config set-network <mainnet\|sepolia>` | Switch network
|
|
341
|
-
| `config set-gas-token <token\|reset>` | Set gas payment token
|
|
342
|
-
| `config set-gasfree <on\|off>` | Toggle developer-sponsored gas
|
|
343
|
-
| `tx-status <hash>` | Check transaction status
|
|
438
|
+
| Command | Description |
|
|
439
|
+
| --------------------------------------- | ---------------------------------------------------------- |
|
|
440
|
+
| `config list` | Show current configuration (with effective network source) |
|
|
441
|
+
| `config reset` | Reset all settings to defaults |
|
|
442
|
+
| `config set-rpc <url>` | Set custom RPC endpoint |
|
|
443
|
+
| `config get-rpc` | Show current RPC |
|
|
444
|
+
| `config set-network <mainnet\|sepolia>` | Switch network instantly (no re-login needed) |
|
|
445
|
+
| `config set-gas-token <token\|reset>` | Set gas payment token |
|
|
446
|
+
| `config set-gasfree <on\|off>` | Toggle developer-sponsored gas |
|
|
447
|
+
| `tx-status <hash>` | Check transaction status |
|
|
344
448
|
|
|
345
449
|
---
|
|
346
450
|
|
|
@@ -375,14 +479,16 @@ StarkFi has a dedicated **[Telegram bot](https://github.com/ahmetenesdur/starkfi
|
|
|
375
479
|
|
|
376
480
|
**BYOAI Model** — each user provides their own API key (OpenAI, Claude, or Gemini). No shared keys, no centralized billing.
|
|
377
481
|
|
|
378
|
-
| Feature
|
|
379
|
-
|
|
|
380
|
-
| **Swap**
|
|
381
|
-
| **Stake**
|
|
382
|
-
| **Lend**
|
|
383
|
-
| **
|
|
384
|
-
| **
|
|
385
|
-
| **
|
|
482
|
+
| Feature | Description |
|
|
483
|
+
| ----------------- | ------------------------------------------------------------------- |
|
|
484
|
+
| **Swap** | Token trading via Fibrous (default), AVNU, or Ekubo |
|
|
485
|
+
| **Stake** | Multi-token staking (STRK, WBTC, tBTC, SolvBTC, LBTC) |
|
|
486
|
+
| **Lend** | Supply, borrow, repay, withdraw, close on Vesu V2 |
|
|
487
|
+
| **DCA** | Dollar-Cost Averaging with recurring buy orders (AVNU, Ekubo) |
|
|
488
|
+
| **Confidential** | Privacy-preserving transfers via Tongo Cash (ZK proofs) |
|
|
489
|
+
| **Portfolio** | Balances with USD valuations and position health |
|
|
490
|
+
| **Batch** | Combine swap + stake + supply + send + borrow + repay + withdraw + DCA in one transaction |
|
|
491
|
+
| **Gas Modes** | Gasless (pay in ERC-20) and gasfree (developer-sponsored) |
|
|
386
492
|
|
|
387
493
|
```bash
|
|
388
494
|
git clone https://github.com/ahmetenesdur/starkfi-telegram-bot.git
|
|
@@ -398,31 +504,32 @@ See [`starkfi-telegram-bot/`](https://github.com/ahmetenesdur/starkfi-telegram-b
|
|
|
398
504
|
|
|
399
505
|
## Tech Stack
|
|
400
506
|
|
|
401
|
-
| Layer | Technology
|
|
402
|
-
| --------------- |
|
|
403
|
-
| **Core SDK** | [Starkzap](https://github.com/keep-starknet-strange/starkzap)
|
|
404
|
-
| **CLI** | [Commander.js](https://github.com/tj/commander.js) v14.0.3
|
|
405
|
-
| **MCP** | [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk) v1.27.1
|
|
406
|
-
| **Schema** | [Zod](https://zod.dev/) v4.3.6
|
|
407
|
-
| **Auth Server** | [Hono](https://hono.dev/) v4.12.7 + [Privy TEE](https://privy.io/)
|
|
408
|
-
| **DEX Routing** | [Fibrous](https://fibrous.finance/)
|
|
409
|
-
| **Lending** | [Vesu](https://vesu.io/) V2 Protocol
|
|
410
|
-
| **Gas** | [AVNU](https://avnu.fi/) Paymaster
|
|
507
|
+
| Layer | Technology |
|
|
508
|
+
| --------------- | ---------------------------------------------------------------------------------------------------- |
|
|
509
|
+
| **Core SDK** | [Starkzap](https://github.com/keep-starknet-strange/starkzap) v2.0.0 |
|
|
510
|
+
| **CLI** | [Commander.js](https://github.com/tj/commander.js) v14.0.3 |
|
|
511
|
+
| **MCP** | [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk) v1.27.1 |
|
|
512
|
+
| **Schema** | [Zod](https://zod.dev/) v4.3.6 |
|
|
513
|
+
| **Auth Server** | [Hono](https://hono.dev/) v4.12.7 + [Privy TEE](https://privy.io/) |
|
|
514
|
+
| **DEX Routing** | [Fibrous](https://fibrous.finance/) (default), [AVNU](https://avnu.fi/), [Ekubo](https://ekubo.org/) |
|
|
515
|
+
| **Lending** | [Vesu](https://vesu.io/) V2 Protocol |
|
|
516
|
+
| **Gas** | [AVNU](https://avnu.fi/) Paymaster |
|
|
411
517
|
|
|
412
518
|
---
|
|
413
519
|
|
|
414
520
|
## Error Handling
|
|
415
521
|
|
|
416
|
-
StarkFi implements a robust error handling system with a custom `StarkfiError` class and **
|
|
417
|
-
|
|
418
|
-
| Domain | Error Codes
|
|
419
|
-
| -------------- |
|
|
420
|
-
| **Auth** | `AUTH_REQUIRED`, `AUTH_FAILED`, `SESSION_EXPIRED`
|
|
421
|
-
| **Wallet** | `WALLET_NOT_DEPLOYED`, `WALLET_NOT_FOUND`, `INSUFFICIENT_BALANCE`
|
|
422
|
-
| **Network** | `NETWORK_ERROR`, `RATE_LIMITED`, `TX_FAILED`, `TX_NOT_FOUND`, `PAYMASTER_ERROR`
|
|
423
|
-
| **Validation** | `INVALID_CONFIG`, `INVALID_ADDRESS`, `INVALID_AMOUNT`
|
|
424
|
-
| **DeFi** | `SWAP_FAILED`, `NO_ROUTE_FOUND`, `SLIPPAGE_EXCEEDED`, `STAKING_FAILED`, `LENDING_FAILED`, `POOL_NOT_FOUND`, `EXIT_NOT_READY`, `VALIDATOR_NOT_FOUND` |
|
|
425
|
-
| **
|
|
522
|
+
StarkFi implements a robust error handling system with a custom `StarkfiError` class and **34 specific error codes** organized by domain:
|
|
523
|
+
|
|
524
|
+
| Domain | Error Codes |
|
|
525
|
+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
526
|
+
| **Auth** | `AUTH_REQUIRED`, `AUTH_FAILED`, `SESSION_EXPIRED` |
|
|
527
|
+
| **Wallet** | `WALLET_NOT_DEPLOYED`, `WALLET_NOT_FOUND`, `INSUFFICIENT_BALANCE` |
|
|
528
|
+
| **Network** | `NETWORK_ERROR`, `RATE_LIMITED`, `TX_FAILED`, `TX_NOT_FOUND`, `PAYMASTER_ERROR` |
|
|
529
|
+
| **Validation** | `INVALID_CONFIG`, `INVALID_ADDRESS`, `INVALID_AMOUNT`, `INVALID_ALLOCATION` |
|
|
530
|
+
| **DeFi** | `SWAP_FAILED`, `NO_ROUTE_FOUND`, `SLIPPAGE_EXCEEDED`, `PROVIDER_UNAVAILABLE`, `ALL_PROVIDERS_FAILED`, `STAKING_FAILED`, `LENDING_FAILED`, `DCA_FAILED`, `CONFIDENTIAL_FAILED`, `POOL_NOT_FOUND`, `EXIT_NOT_READY`, `VALIDATOR_NOT_FOUND`, `MONITOR_FAILED`, `REBALANCE_FAILED` |
|
|
531
|
+
| **Confidential** | `CONFIDENTIAL_NOT_CONFIGURED` |
|
|
532
|
+
| **System** | `SIMULATION_FAILED`, `BATCH_LIMIT_EXCEEDED`, `UNKNOWN` |
|
|
426
533
|
|
|
427
534
|
All network operations include **automatic retry with exponential backoff** (500ms base, max 2 retries). Parallel operations use a **sliding-window concurrency pool** to prevent RPC rate-limiting.
|
|
428
535
|
|