starkfi 0.1.0 → 0.2.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 +70 -0
- package/README.md +120 -58
- package/dist/commands/auth/login.js +2 -2
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/verify.d.ts.map +1 -1
- package/dist/commands/auth/verify.js +2 -2
- package/dist/commands/auth/verify.js.map +1 -1
- package/dist/commands/batch/batch.d.ts +3 -0
- package/dist/commands/batch/batch.d.ts.map +1 -0
- package/dist/commands/batch/batch.js +143 -0
- package/dist/commands/batch/batch.js.map +1 -0
- package/dist/commands/chain/tx-status.js +2 -2
- package/dist/commands/chain/tx-status.js.map +1 -1
- package/dist/commands/config/config.d.ts.map +1 -1
- package/dist/commands/config/config.js +14 -31
- package/dist/commands/config/config.js.map +1 -1
- package/dist/commands/lending/lending.d.ts +1 -0
- package/dist/commands/lending/lending.d.ts.map +1 -1
- package/dist/commands/lending/lending.js +187 -48
- package/dist/commands/lending/lending.js.map +1 -1
- package/dist/commands/portfolio/portfolio.d.ts +3 -0
- package/dist/commands/portfolio/portfolio.d.ts.map +1 -0
- package/dist/commands/portfolio/portfolio.js +76 -0
- package/dist/commands/portfolio/portfolio.js.map +1 -0
- package/dist/commands/staking/staking.d.ts +1 -1
- package/dist/commands/staking/staking.d.ts.map +1 -1
- package/dist/commands/staking/staking.js +142 -61
- package/dist/commands/staking/staking.js.map +1 -1
- package/dist/commands/trade/multi-swap.d.ts +3 -0
- package/dist/commands/trade/multi-swap.d.ts.map +1 -0
- package/dist/commands/trade/multi-swap.js +140 -0
- package/dist/commands/trade/multi-swap.js.map +1 -0
- package/dist/commands/trade/status.js +2 -2
- package/dist/commands/trade/status.js.map +1 -1
- package/dist/commands/trade/swap.d.ts.map +1 -1
- package/dist/commands/trade/swap.js +45 -10
- package/dist/commands/trade/swap.js.map +1 -1
- package/dist/commands/wallet/balance.d.ts.map +1 -1
- package/dist/commands/wallet/balance.js +19 -2
- package/dist/commands/wallet/balance.js.map +1 -1
- package/dist/commands/wallet/deploy.d.ts.map +1 -1
- package/dist/commands/wallet/deploy.js +2 -1
- package/dist/commands/wallet/deploy.js.map +1 -1
- package/dist/commands/wallet/send.d.ts.map +1 -1
- package/dist/commands/wallet/send.js +45 -8
- package/dist/commands/wallet/send.js.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/banner.d.ts +6 -0
- package/dist/lib/banner.d.ts.map +1 -0
- package/dist/lib/banner.js +78 -0
- package/dist/lib/banner.js.map +1 -0
- package/dist/lib/config.d.ts +0 -11
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +0 -20
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +2 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +2 -0
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/format.d.ts +43 -2
- package/dist/lib/format.d.ts.map +1 -1
- package/dist/lib/format.js +51 -5
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/retry.d.ts +15 -0
- package/dist/lib/retry.d.ts.map +1 -0
- package/dist/lib/retry.js +29 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/lib/validation.d.ts +0 -12
- package/dist/lib/validation.d.ts.map +1 -1
- package/dist/lib/validation.js +1 -23
- package/dist/lib/validation.js.map +1 -1
- package/dist/mcp/handlers/batch.d.ts +13 -0
- package/dist/mcp/handlers/batch.d.ts.map +1 -0
- package/dist/mcp/handlers/batch.js +33 -0
- package/dist/mcp/handlers/batch.js.map +1 -0
- package/dist/mcp/handlers/config.d.ts +1 -1
- package/dist/mcp/handlers/config.d.ts.map +1 -1
- package/dist/mcp/handlers/config.js +11 -12
- package/dist/mcp/handlers/config.js.map +1 -1
- package/dist/mcp/handlers/index.d.ts +3 -0
- package/dist/mcp/handlers/index.d.ts.map +1 -1
- package/dist/mcp/handlers/index.js +3 -0
- package/dist/mcp/handlers/index.js.map +1 -1
- package/dist/mcp/handlers/lending.d.ts +12 -1
- package/dist/mcp/handlers/lending.d.ts.map +1 -1
- package/dist/mcp/handlers/lending.js +67 -23
- package/dist/mcp/handlers/lending.js.map +1 -1
- package/dist/mcp/handlers/multi-swap.d.ts +27 -0
- package/dist/mcp/handlers/multi-swap.d.ts.map +1 -0
- package/dist/mcp/handlers/multi-swap.js +73 -0
- package/dist/mcp/handlers/multi-swap.js.map +1 -0
- package/dist/mcp/handlers/portfolio.d.ts +7 -0
- package/dist/mcp/handlers/portfolio.d.ts.map +1 -0
- package/dist/mcp/handlers/portfolio.js +11 -0
- package/dist/mcp/handlers/portfolio.js.map +1 -0
- package/dist/mcp/handlers/staking.d.ts +13 -1
- package/dist/mcp/handlers/staking.d.ts.map +1 -1
- package/dist/mcp/handlers/staking.js +18 -5
- package/dist/mcp/handlers/staking.js.map +1 -1
- package/dist/mcp/handlers/trade.d.ts +1 -0
- package/dist/mcp/handlers/trade.d.ts.map +1 -1
- package/dist/mcp/handlers/trade.js +23 -9
- package/dist/mcp/handlers/trade.js.map +1 -1
- package/dist/mcp/handlers/wallet.d.ts +1 -0
- package/dist/mcp/handlers/wallet.d.ts.map +1 -1
- package/dist/mcp/handlers/wallet.js +16 -1
- package/dist/mcp/handlers/wallet.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +102 -33
- package/dist/mcp/tools.js.map +1 -1
- package/dist/services/api/client.d.ts +0 -12
- package/dist/services/api/client.d.ts.map +1 -1
- package/dist/services/api/client.js +3 -8
- package/dist/services/api/client.js.map +1 -1
- package/dist/services/auth/session.d.ts +1 -7
- package/dist/services/auth/session.d.ts.map +1 -1
- package/dist/services/auth/session.js +20 -0
- package/dist/services/auth/session.js.map +1 -1
- package/dist/services/batch/batch.d.ts +36 -0
- package/dist/services/batch/batch.d.ts.map +1 -0
- package/dist/services/batch/batch.js +111 -0
- package/dist/services/batch/batch.js.map +1 -0
- package/dist/services/config/config.d.ts +4 -0
- package/dist/services/config/config.d.ts.map +1 -1
- package/dist/services/config/config.js +31 -1
- package/dist/services/config/config.js.map +1 -1
- package/dist/services/fibrous/config.d.ts +4 -0
- package/dist/services/fibrous/config.d.ts.map +1 -0
- package/dist/services/fibrous/config.js +4 -0
- package/dist/services/fibrous/config.js.map +1 -0
- package/dist/services/fibrous/health.js +1 -1
- package/dist/services/fibrous/health.js.map +1 -1
- package/dist/services/fibrous/route.d.ts +19 -6
- package/dist/services/fibrous/route.d.ts.map +1 -1
- package/dist/services/fibrous/route.js +64 -3
- package/dist/services/fibrous/route.js.map +1 -1
- package/dist/services/portfolio/portfolio.d.ts +35 -0
- package/dist/services/portfolio/portfolio.d.ts.map +1 -0
- package/dist/services/portfolio/portfolio.js +106 -0
- package/dist/services/portfolio/portfolio.js.map +1 -0
- package/dist/services/simulate/simulate.d.ts +18 -0
- package/dist/services/simulate/simulate.d.ts.map +1 -0
- package/dist/services/simulate/simulate.js +61 -0
- package/dist/services/simulate/simulate.js.map +1 -0
- package/dist/services/staking/staking.d.ts +5 -13
- package/dist/services/staking/staking.d.ts.map +1 -1
- package/dist/services/staking/staking.js +44 -52
- package/dist/services/staking/staking.js.map +1 -1
- package/dist/services/starkzap/client.d.ts.map +1 -1
- package/dist/services/starkzap/client.js +38 -18
- package/dist/services/starkzap/client.js.map +1 -1
- package/dist/services/starkzap/config.d.ts +6 -0
- package/dist/services/starkzap/config.d.ts.map +1 -0
- package/dist/services/starkzap/config.js +13 -0
- package/dist/services/starkzap/config.js.map +1 -0
- package/dist/services/tokens/balances.d.ts.map +1 -1
- package/dist/services/tokens/balances.js +26 -14
- package/dist/services/tokens/balances.js.map +1 -1
- package/dist/services/tokens/tokens.d.ts +2 -3
- package/dist/services/tokens/tokens.d.ts.map +1 -1
- package/dist/services/tokens/tokens.js +3 -8
- package/dist/services/tokens/tokens.js.map +1 -1
- package/dist/services/vesu/api.d.ts +28 -0
- package/dist/services/vesu/api.d.ts.map +1 -0
- package/dist/services/vesu/api.js +97 -0
- package/dist/services/vesu/api.js.map +1 -0
- package/dist/services/vesu/config.d.ts +9 -0
- package/dist/services/vesu/config.d.ts.map +1 -0
- package/dist/services/vesu/config.js +32 -0
- package/dist/services/vesu/config.js.map +1 -0
- package/dist/services/vesu/index.d.ts +2 -0
- package/dist/services/vesu/index.d.ts.map +1 -1
- package/dist/services/vesu/index.js +2 -0
- package/dist/services/vesu/index.js.map +1 -1
- package/dist/services/vesu/lending.d.ts +8 -1
- package/dist/services/vesu/lending.d.ts.map +1 -1
- package/dist/services/vesu/lending.js +171 -52
- package/dist/services/vesu/lending.js.map +1 -1
- package/dist/services/vesu/pools.d.ts +5 -11
- package/dist/services/vesu/pools.d.ts.map +1 -1
- package/dist/services/vesu/pools.js +11 -31
- package/dist/services/vesu/pools.js.map +1 -1
- package/package.json +88 -82
- package/skills/README.md +63 -0
- package/skills/authenticate-wallet/SKILL.md +119 -0
- package/skills/balance/SKILL.md +80 -0
- package/skills/batch/SKILL.md +118 -0
- package/skills/config/SKILL.md +144 -0
- package/skills/lending/SKILL.md +209 -0
- package/skills/multi-swap/SKILL.md +95 -0
- package/skills/portfolio/SKILL.md +82 -0
- package/skills/send/SKILL.md +82 -0
- package/skills/staking/SKILL.md +188 -0
- package/skills/trade/SKILL.md +92 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: config
|
|
3
|
+
description: View and modify StarkFi CLI configuration — set custom RPC URLs, switch networks, manage gas settings, and check transaction status. Use this skill when the user mentions RPC, rate limits, network settings, gas mode, gas token, configuration, or wants to check a transaction hash.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Node.js 18+ and npx.
|
|
6
|
+
metadata:
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
author: ahmetenesdur
|
|
9
|
+
category: utility
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash(npx starkfi@latest config *)
|
|
12
|
+
- Bash(npx starkfi@latest tx-status *)
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Configuration & Utilities
|
|
16
|
+
|
|
17
|
+
Manage local configuration for the StarkFi CLI and check transaction status on-chain. Configuration includes RPC endpoints, network selection, and gas payment settings.
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
- None for configuration commands (`config list`, `config set-*`, `config get-rpc`).
|
|
22
|
+
- Active session required for `tx-status` (it reads the network from the session).
|
|
23
|
+
|
|
24
|
+
## Configuration Commands
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# List all current settings
|
|
28
|
+
npx starkfi@latest config list
|
|
29
|
+
|
|
30
|
+
# Set custom RPC URL
|
|
31
|
+
npx starkfi@latest config set-rpc <url>
|
|
32
|
+
|
|
33
|
+
# Get current RPC URL
|
|
34
|
+
npx starkfi@latest config get-rpc
|
|
35
|
+
|
|
36
|
+
# Switch network
|
|
37
|
+
npx starkfi@latest config set-network <network>
|
|
38
|
+
|
|
39
|
+
# Toggle developer-sponsored gas (Gasfree mode)
|
|
40
|
+
npx starkfi@latest config set-gasfree <on|off>
|
|
41
|
+
|
|
42
|
+
# Set gas payment token (for Gasless mode)
|
|
43
|
+
npx starkfi@latest config set-gas-token <token>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Transaction Status
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx starkfi@latest tx-status <hash>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Gas Modes
|
|
53
|
+
|
|
54
|
+
StarkFi supports two gas abstraction modes:
|
|
55
|
+
|
|
56
|
+
| Mode | Who Pays | Command | Description |
|
|
57
|
+
| ----------- | ------------- | --------------------------- | ------------------------------------------------ |
|
|
58
|
+
| **Gasfree** | Developer | `config set-gasfree on` | Gas fees sponsored by StarkFi via AVNU Paymaster |
|
|
59
|
+
| **Gasless** | User (ERC-20) | `config set-gas-token STRK` | User pays gas in an ERC-20 token (default mode) |
|
|
60
|
+
|
|
61
|
+
Supported gas tokens: **ETH**, **STRK**, **USDC**, **USDT**, **DAI**
|
|
62
|
+
|
|
63
|
+
Gasfree and Gasless are mutually exclusive — enabling one disables the other.
|
|
64
|
+
|
|
65
|
+
> **Default:** Gasless mode with STRK as gas token. Gas is paid through the AVNU Paymaster, so the user does not need native ETH for gas — any supported ERC-20 works.
|
|
66
|
+
|
|
67
|
+
## Parameters
|
|
68
|
+
|
|
69
|
+
| Parameter | Type | Description | Required |
|
|
70
|
+
| --------- | ------ | --------------------------------------------- | -------- |
|
|
71
|
+
| `url` | string | Full HTTP(S) RPC endpoint URL | Yes |
|
|
72
|
+
| `network` | string | `mainnet` or `sepolia` | Yes |
|
|
73
|
+
| `on/off` | string | Enable or disable Gasfree mode | Yes |
|
|
74
|
+
| `token` | string | Gas token symbol or `reset` (reverts to STRK) | Yes |
|
|
75
|
+
| `hash` | string | Transaction hash (`0x...`) | Yes |
|
|
76
|
+
|
|
77
|
+
## Rules
|
|
78
|
+
|
|
79
|
+
1. **Rate Limits**: If any skill fails with "rate limit" or "429" errors, use `config set-rpc` to set a custom RPC endpoint.
|
|
80
|
+
2. **Persistence**: Settings are stored locally and persist across sessions.
|
|
81
|
+
3. Use `tx-status` AFTER every `send`, `trade`, `multi-swap`, `batch`, and staking/lending transaction to verify success.
|
|
82
|
+
4. Use `config get-rpc` to check the current RPC URL before changing it.
|
|
83
|
+
|
|
84
|
+
## Examples
|
|
85
|
+
|
|
86
|
+
**User:** "I'm getting rate limit errors"
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx starkfi@latest config get-rpc
|
|
90
|
+
npx starkfi@latest config set-rpc https://starknet-mainnet.g.alchemy.com/v2/<key>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**User:** "Show my current configuration"
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx starkfi@latest config list
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**User:** "Switch to testnet"
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx starkfi@latest config set-network sepolia
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**User:** "Enable free gas mode"
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx starkfi@latest config set-gasfree on
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**User:** "I want to pay gas in USDC"
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx starkfi@latest config set-gasfree off
|
|
115
|
+
npx starkfi@latest config set-gas-token USDC
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**User:** "Reset gas token to default"
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npx starkfi@latest config set-gas-token reset
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**User:** "Did my transaction go through? Hash is 0xabc..."
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npx starkfi@latest tx-status 0xabc...
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Error Handling
|
|
131
|
+
|
|
132
|
+
| Error | Action |
|
|
133
|
+
| ----------------------- | --------------------------------------------------- |
|
|
134
|
+
| `Invalid RPC URL` | Ensure URL starts with `http://` or `https://`. |
|
|
135
|
+
| `Invalid network` | Use `mainnet` or `sepolia`. |
|
|
136
|
+
| `Unsupported gas token` | Must be one of: ETH, STRK, USDC, USDT, DAI. |
|
|
137
|
+
| `Transaction not found` | Verify the hash is correct and the network matches. |
|
|
138
|
+
| `Pending` | Transaction is still in mempool — wait and retry. |
|
|
139
|
+
|
|
140
|
+
## Related Skills
|
|
141
|
+
|
|
142
|
+
- This skill is referenced by all other skills for rate limit recovery.
|
|
143
|
+
- Use `config set-gasfree on` for developer-sponsored gas.
|
|
144
|
+
- Use `tx-status` to verify transactions from any transactional skill.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lending
|
|
3
|
+
description: Manage Vesu V2 lending positions on Starknet — supply assets, borrow against collateral, repay debt, withdraw, and close positions. Use this skill when the user mentions lending, borrowing, supplying collateral, Vesu, interest, health factor, liquidation, or DeFi yield from lending protocols.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Node.js 18+ and npx.
|
|
6
|
+
metadata:
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
author: ahmetenesdur
|
|
9
|
+
category: transaction
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash(npx starkfi@latest lend-pools)
|
|
12
|
+
- Bash(npx starkfi@latest lend-pools *)
|
|
13
|
+
- Bash(npx starkfi@latest lend-status *)
|
|
14
|
+
- Bash(npx starkfi@latest lend-supply *)
|
|
15
|
+
- Bash(npx starkfi@latest lend-withdraw *)
|
|
16
|
+
- Bash(npx starkfi@latest lend-borrow *)
|
|
17
|
+
- Bash(npx starkfi@latest lend-repay *)
|
|
18
|
+
- Bash(npx starkfi@latest lend-close *)
|
|
19
|
+
- Bash(npx starkfi@latest status)
|
|
20
|
+
- Bash(npx starkfi@latest balance)
|
|
21
|
+
- Bash(npx starkfi@latest balance *)
|
|
22
|
+
- Bash(npx starkfi@latest tx-status *)
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Lending (Vesu V2)
|
|
26
|
+
|
|
27
|
+
Manage lending and borrowing positions on Vesu V2 protocol on Starknet. Supply assets to earn yield, borrow against collateral, repay debt, and close positions.
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
- Active session required.
|
|
32
|
+
- Sufficient token balance for supply/repay operations + gas fees.
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
1. BEFORE any lending action, run `npx starkfi@latest lend-pools` to discover available pools and tokens. Use `lend-pools <name>` for detailed pool info including APY rates.
|
|
37
|
+
2. Pool can be specified by **name** (e.g. `Prime`, `Genesis`) or by **contract address** (`0x...`).
|
|
38
|
+
3. BEFORE borrowing, run `npx starkfi@latest lend-status` to check Health Factor:
|
|
39
|
+
- Health Factor **> 2.0** → Safe to borrow.
|
|
40
|
+
- Health Factor **1.5 – 2.0** → WARN the user about increasing risk.
|
|
41
|
+
- Health Factor **< 1.5** → STRONGLY advise against borrowing. Suggest repaying instead.
|
|
42
|
+
- Health Factor **< 1.1** → DO NOT proceed without explicit double-confirmation from the user.
|
|
43
|
+
4. AFTER any transactional operation, verify with `tx-status`.
|
|
44
|
+
5. When using `--use-supplied`, the borrow is backed by the user's existing vTokens (supplied positions) rather than transferring from wallet.
|
|
45
|
+
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
### Discovery
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# List all pools (overview table)
|
|
52
|
+
npx starkfi@latest lend-pools [--json]
|
|
53
|
+
|
|
54
|
+
# Detailed pool info with APY rates
|
|
55
|
+
npx starkfi@latest lend-pools <name> [--json]
|
|
56
|
+
|
|
57
|
+
# View position status
|
|
58
|
+
npx starkfi@latest lend-status --pool <name|address> --collateral-token <symbol> [--borrow-token <symbol>]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Supply & Withdraw
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Supply (deposit assets to earn yield)
|
|
65
|
+
npx starkfi@latest lend-supply <amount> --pool <name|address> --token <symbol>
|
|
66
|
+
|
|
67
|
+
# Withdraw (remove supplied assets)
|
|
68
|
+
npx starkfi@latest lend-withdraw <amount> --pool <name|address> --token <symbol>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Borrow & Repay
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Borrow (provide collateral and take loan)
|
|
75
|
+
npx starkfi@latest lend-borrow \
|
|
76
|
+
--pool <name|address> \
|
|
77
|
+
--collateral-amount <n> --collateral-token <symbol> \
|
|
78
|
+
--borrow-amount <n> --borrow-token <symbol> \
|
|
79
|
+
[--use-supplied]
|
|
80
|
+
|
|
81
|
+
# Repay (pay back borrowed amount)
|
|
82
|
+
npx starkfi@latest lend-repay <amount> --pool <name|address> --token <symbol> --collateral-token <symbol>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Close Position
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Atomically repay all debt and withdraw all collateral
|
|
89
|
+
npx starkfi@latest lend-close --pool <name|address> --collateral-token <symbol> --borrow-token <symbol>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Parameters
|
|
93
|
+
|
|
94
|
+
### lend-supply / lend-withdraw
|
|
95
|
+
|
|
96
|
+
| Parameter | Type | Description | Required |
|
|
97
|
+
| --------- | ------ | ------------------------------------------ | -------- |
|
|
98
|
+
| `amount` | number | Amount (positional) | Yes |
|
|
99
|
+
| `--pool` | string | Pool name or address | Yes |
|
|
100
|
+
| `--token` | string | Token symbol (`USDC`, `ETH`, `STRK`, etc.) | Yes |
|
|
101
|
+
|
|
102
|
+
### lend-borrow
|
|
103
|
+
|
|
104
|
+
| Parameter | Type | Description | Required |
|
|
105
|
+
| --------------------- | ------ | ------------------------------------- | -------- |
|
|
106
|
+
| `--pool` | string | Pool name or address | Yes |
|
|
107
|
+
| `--collateral-amount` | number | Collateral amount to supply | Yes |
|
|
108
|
+
| `--collateral-token` | string | Collateral token (e.g. `ETH`, `STRK`) | Yes |
|
|
109
|
+
| `--borrow-amount` | number | Amount to borrow | Yes |
|
|
110
|
+
| `--borrow-token` | string | Token to borrow (e.g. `USDC`, `USDT`) | Yes |
|
|
111
|
+
| `--use-supplied` | flag | Use existing vTokens as collateral | No |
|
|
112
|
+
|
|
113
|
+
### lend-repay
|
|
114
|
+
|
|
115
|
+
| Parameter | Type | Description | Required |
|
|
116
|
+
| -------------------- | ------ | -------------------------------- | -------- |
|
|
117
|
+
| `amount` | number | Amount to repay (positional) | Yes |
|
|
118
|
+
| `--pool` | string | Pool name or address | Yes |
|
|
119
|
+
| `--token` | string | Token to repay (e.g. `USDC`) | Yes |
|
|
120
|
+
| `--collateral-token` | string | Collateral token of the position | Yes |
|
|
121
|
+
|
|
122
|
+
### lend-close
|
|
123
|
+
|
|
124
|
+
| Parameter | Type | Description | Required |
|
|
125
|
+
| -------------------- | ------ | ----------------------- | -------- |
|
|
126
|
+
| `--pool` | string | Pool name or address | Yes |
|
|
127
|
+
| `--collateral-token` | string | Collateral token symbol | Yes |
|
|
128
|
+
| `--borrow-token` | string | Borrow token symbol | Yes |
|
|
129
|
+
|
|
130
|
+
### lend-status
|
|
131
|
+
|
|
132
|
+
| Parameter | Type | Description | Required |
|
|
133
|
+
| -------------------- | ------ | -------------------------------------- | -------- |
|
|
134
|
+
| `--pool` | string | Pool name or address | Yes |
|
|
135
|
+
| `--collateral-token` | string | Token supplied/used as collateral | Yes |
|
|
136
|
+
| `--borrow-token` | string | Borrow token (needed to see debt + HF) | No |
|
|
137
|
+
|
|
138
|
+
## Examples
|
|
139
|
+
|
|
140
|
+
**User:** "What lending pools are available?"
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx starkfi@latest lend-pools
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**User:** "Show me details for the Prime pool"
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npx starkfi@latest lend-pools Prime
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**User:** "Supply 500 USDC to Prime"
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
npx starkfi@latest status
|
|
156
|
+
npx starkfi@latest balance --token USDC
|
|
157
|
+
npx starkfi@latest lend-supply 500 --pool Prime --token USDC
|
|
158
|
+
npx starkfi@latest tx-status <hash>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**User:** "Borrow 100 USDC with ETH collateral from Prime"
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
npx starkfi@latest lend-status --pool Prime --collateral-token ETH --borrow-token USDC
|
|
165
|
+
# Check Health Factor before proceeding
|
|
166
|
+
npx starkfi@latest lend-borrow \
|
|
167
|
+
--pool Prime \
|
|
168
|
+
--collateral-amount 0.1 --collateral-token ETH \
|
|
169
|
+
--borrow-amount 100 --borrow-token USDC
|
|
170
|
+
npx starkfi@latest tx-status <hash>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**User:** "Repay my 100 USDC loan from Prime"
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
npx starkfi@latest lend-repay 100 --pool Prime --token USDC --collateral-token ETH
|
|
177
|
+
npx starkfi@latest tx-status <hash>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**User:** "Close my ETH/USDC position in Prime"
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
npx starkfi@latest lend-close --pool Prime --collateral-token ETH --borrow-token USDC
|
|
184
|
+
npx starkfi@latest tx-status <hash>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**User:** "How healthy is my position?"
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npx starkfi@latest lend-status --pool Prime --collateral-token ETH --borrow-token USDC
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Error Handling
|
|
194
|
+
|
|
195
|
+
| Error | Action |
|
|
196
|
+
| ------------------------- | ------------------------------------------------------------- |
|
|
197
|
+
| `Pool not found` | Run `lend-pools` to list valid pool names. |
|
|
198
|
+
| `Health Factor too low` | Warn of liquidation risk. Suggest repaying or supplying more. |
|
|
199
|
+
| `Insufficient collateral` | Cannot borrow without supplying first. |
|
|
200
|
+
| `Dust limit` | Amount is below the pool's minimum dollar value. Increase it. |
|
|
201
|
+
| `Insufficient balance` | Check `balance` — user may need to swap for the token. |
|
|
202
|
+
| `Not authenticated` | Run `authenticate-wallet` skill first. |
|
|
203
|
+
|
|
204
|
+
## Related Skills
|
|
205
|
+
|
|
206
|
+
- Use `balance` to verify available assets before supplying.
|
|
207
|
+
- Use `trade` to swap tokens if the user doesn't have the right asset.
|
|
208
|
+
- Use `portfolio` for a full overview including lending positions with USD values.
|
|
209
|
+
- Use `batch` to combine supply operations with swaps or staking.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: multi-swap
|
|
3
|
+
description: Execute multiple token swaps in a single Starknet transaction using Fibrous aggregation. Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, or execute several trades simultaneously in one transaction.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Node.js 18+ and npx.
|
|
6
|
+
metadata:
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
author: ahmetenesdur
|
|
9
|
+
category: transaction
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash(npx starkfi@latest multi-swap *)
|
|
12
|
+
- Bash(npx starkfi@latest status)
|
|
13
|
+
- Bash(npx starkfi@latest balance)
|
|
14
|
+
- Bash(npx starkfi@latest balance *)
|
|
15
|
+
- Bash(npx starkfi@latest tx-status *)
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Multi-Swap
|
|
19
|
+
|
|
20
|
+
Execute 2-3 independent token swaps in a single Starknet transaction via Fibrous aggregation. All swaps are bundled into one multicall, saving gas compared to executing them individually.
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- Active session required.
|
|
25
|
+
- Sufficient balance for ALL source tokens + gas fees.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
1. BEFORE any multi-swap, you MUST run `npx starkfi@latest status` and `npx starkfi@latest balance` to verify connectivity and source token balances for ALL pairs.
|
|
30
|
+
2. Minimum **2** and maximum **3** swap pairs per multi-swap. Single swaps should use the `trade` skill instead.
|
|
31
|
+
3. The pairs string MUST be wrapped in **double quotes** and each pair separated by a **comma**.
|
|
32
|
+
4. Each pair follows the format: `<amount> <FROM>><TO>` (no spaces around `>`).
|
|
33
|
+
5. Default slippage is **1%**. To change, use `--slippage <percent>`.
|
|
34
|
+
6. Suggest using `--simulate` first so the user can confirm gas cost.
|
|
35
|
+
7. AFTER a successful multi-swap, you MUST verify using `npx starkfi@latest tx-status <hash>`.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx starkfi@latest multi-swap "<pairs>" [--slippage <percent>] [--simulate] [--json]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Parameters
|
|
44
|
+
|
|
45
|
+
| Parameter | Type | Description | Required |
|
|
46
|
+
| ------------ | ------ | ------------------------------------------------------ | -------- |
|
|
47
|
+
| `pairs` | string | Swap pairs: `"100 USDC>ETH, 50 USDT>STRK"` (2-3 pairs) | Yes |
|
|
48
|
+
| `--slippage` | number | Slippage tolerance in % (default: `1`) | No |
|
|
49
|
+
| `--simulate` | flag | Estimate fees without broadcasting | No |
|
|
50
|
+
| `--json` | flag | Output as JSON | No |
|
|
51
|
+
|
|
52
|
+
## Pair Format
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
"<amount> <FROM>><TO>, <amount> <FROM>><TO>"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Examples:
|
|
59
|
+
|
|
60
|
+
- `"100 USDC>ETH, 200 USDT>STRK"` — two pairs
|
|
61
|
+
- `"50 DAI>ETH, 100 USDC>STRK, 0.1 ETH>USDT"` — three pairs (maximum)
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
**User:** "Swap 100 USDC to ETH and 200 USDT to STRK in one transaction"
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx starkfi@latest status
|
|
69
|
+
npx starkfi@latest balance
|
|
70
|
+
npx starkfi@latest multi-swap "100 USDC>ETH, 200 USDT>STRK"
|
|
71
|
+
npx starkfi@latest tx-status <hash>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**User:** "Simulate swapping 50 DAI, 100 USDC, and 0.1 ETH"
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx starkfi@latest multi-swap "50 DAI>ETH, 100 USDC>STRK, 0.1 ETH>USDT" --simulate
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Error Handling
|
|
81
|
+
|
|
82
|
+
| Error | Action |
|
|
83
|
+
| ---------------------- | -------------------------------------------------------------- |
|
|
84
|
+
| `Too few pairs` | Multi-swap requires at least 2 pairs. Use `trade` for singles. |
|
|
85
|
+
| `Too many pairs` | Maximum 3 pairs. Split into multiple calls. |
|
|
86
|
+
| `No route found` | One or more pairs lack liquidity. |
|
|
87
|
+
| `Insufficient balance` | Check `balance` — user may lack one of the source tokens. |
|
|
88
|
+
| `Simulation failed` | One of the routes is invalid or would revert. |
|
|
89
|
+
| `Not authenticated` | Run `authenticate-wallet` skill first. |
|
|
90
|
+
|
|
91
|
+
## Related Skills
|
|
92
|
+
|
|
93
|
+
- Use `trade` for a single swap (simpler syntax).
|
|
94
|
+
- Use `batch` for combining swaps with other operations (stake, supply, send).
|
|
95
|
+
- Use `balance` to verify you have enough of all source tokens.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: portfolio
|
|
3
|
+
description: View a comprehensive DeFi portfolio dashboard — token balances, staking positions, and lending positions with USD valuations. Use this skill when the user wants an overview, summary, total value, net worth, or wants to see all their positions across Starknet at once.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Node.js 18+ and npx.
|
|
6
|
+
metadata:
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
author: ahmetenesdur
|
|
9
|
+
category: wallet-data
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash(npx starkfi@latest portfolio)
|
|
12
|
+
- Bash(npx starkfi@latest portfolio *)
|
|
13
|
+
- Bash(npx starkfi@latest status)
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Portfolio Overview
|
|
17
|
+
|
|
18
|
+
Display a comprehensive DeFi portfolio dashboard aggregating token balances, staking positions, and lending positions — all with USD valuations. This is a read-only, single-command skill that provides a complete snapshot of the user's Starknet DeFi activity.
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
- Active session required.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
1. Use this as the FIRST command when the user asks "what do I have?" or wants an overall assessment.
|
|
27
|
+
2. This is a read-only operation — it never modifies any on-chain state.
|
|
28
|
+
3. USD prices are sourced from Fibrous aggregation and may have slight variations.
|
|
29
|
+
|
|
30
|
+
## Commands
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx starkfi@latest portfolio [--json]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Parameters
|
|
37
|
+
|
|
38
|
+
| Parameter | Type | Description | Required |
|
|
39
|
+
| --------- | ---- | -------------- | -------- |
|
|
40
|
+
| `--json` | flag | Output as JSON | No |
|
|
41
|
+
|
|
42
|
+
## Dashboard Sections
|
|
43
|
+
|
|
44
|
+
The portfolio displays three sections:
|
|
45
|
+
|
|
46
|
+
1. **Token Balances** — STRK, ETH, and all ERC-20 tokens with non-zero balances and their USD values.
|
|
47
|
+
2. **Staking Positions** — Active stakes across all validators/pools with pending rewards.
|
|
48
|
+
3. **Lending Positions** — Active Vesu V2 positions: supplied and borrowed amounts with pool details.
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
**User:** "Show me my portfolio"
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx starkfi@latest portfolio
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**User:** "What's my total value on Starknet?"
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx starkfi@latest portfolio
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**User:** "Get my portfolio as JSON for analysis"
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx starkfi@latest portfolio --json
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Error Handling
|
|
71
|
+
|
|
72
|
+
| Error | Action |
|
|
73
|
+
| ------------------- | -------------------------------------------------------------------------------------------------- |
|
|
74
|
+
| `Not authenticated` | Run `authenticate-wallet` skill first. |
|
|
75
|
+
| `Partial failure` | Some sections may show errors while others succeed. The portfolio uses fault-tolerant aggregation. |
|
|
76
|
+
| `Network error` | Retry once. Use `config` to set custom RPC. |
|
|
77
|
+
|
|
78
|
+
## Related Skills
|
|
79
|
+
|
|
80
|
+
- Use `balance` for a focused view of token balances only.
|
|
81
|
+
- Use `staking` `stake-status` for detailed staking positions.
|
|
82
|
+
- Use `lending` `lend-status` for detailed lending positions.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: send
|
|
3
|
+
description: Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to transfer, send, or move tokens to another wallet address.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires Node.js 18+ and npx.
|
|
6
|
+
metadata:
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
author: ahmetenesdur
|
|
9
|
+
category: transaction
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash(npx starkfi@latest send *)
|
|
12
|
+
- Bash(npx starkfi@latest status)
|
|
13
|
+
- Bash(npx starkfi@latest balance)
|
|
14
|
+
- Bash(npx starkfi@latest balance *)
|
|
15
|
+
- Bash(npx starkfi@latest tx-status *)
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Send Transaction
|
|
19
|
+
|
|
20
|
+
Transfer STRK, ETH, or ERC-20 tokens to a destination Starknet address. The CLI automatically checks balance before sending and validates the recipient address. Supports simulation (dry-run) mode to estimate fees without broadcasting.
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- Active session required.
|
|
25
|
+
- Sufficient balance for the transfer amount + gas fees.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
1. BEFORE any send, you MUST run `npx starkfi@latest status` and `npx starkfi@latest balance` to verify connectivity and funds.
|
|
30
|
+
2. If the recipient address was NOT previously mentioned in the conversation, you MUST ask for explicit confirmation: _"Sending [amount] [token] to [address]. Confirm?"_
|
|
31
|
+
3. Suggest using `--simulate` first for large amounts so the user can review the estimated fee before committing.
|
|
32
|
+
4. AFTER a successful send, you MUST verify the transaction using `npx starkfi@latest tx-status <hash>`.
|
|
33
|
+
5. Starknet addresses start with `0x` and can be up to 66 characters long (including the `0x` prefix).
|
|
34
|
+
|
|
35
|
+
## Commands
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx starkfi@latest send <amount> <token> <recipient> [--simulate] [--json]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Parameters
|
|
42
|
+
|
|
43
|
+
| Parameter | Type | Description | Required |
|
|
44
|
+
| ------------ | ------ | ----------------------------------------- | -------- |
|
|
45
|
+
| `amount` | number | Amount to send (e.g. `10`, `0.5`) | Yes |
|
|
46
|
+
| `token` | string | Token symbol (e.g. `STRK`, `ETH`, `USDC`) | Yes |
|
|
47
|
+
| `recipient` | string | Destination Starknet address (`0x...`) | Yes |
|
|
48
|
+
| `--simulate` | flag | Estimate fees without broadcasting | No |
|
|
49
|
+
| `--json` | flag | Output as JSON | No |
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
**User:** "Send 10 STRK to 0x04a3..."
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx starkfi@latest status
|
|
57
|
+
npx starkfi@latest balance --token STRK
|
|
58
|
+
# Confirm recipient with user if needed
|
|
59
|
+
npx starkfi@latest send 10 STRK 0x04a3...
|
|
60
|
+
npx starkfi@latest tx-status <hash>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**User:** "Simulate sending 100 USDC to 0x07b2..."
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx starkfi@latest send 100 USDC 0x07b2... --simulate
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Error Handling
|
|
70
|
+
|
|
71
|
+
| Error | Action |
|
|
72
|
+
| ---------------------- | -------------------------------------------------------- |
|
|
73
|
+
| `Insufficient balance` | Inform user of current balance via `balance`. |
|
|
74
|
+
| `Invalid address` | Validate recipient is a valid `0x` Starknet address. |
|
|
75
|
+
| `Simulation failed` | Transaction would revert — check amount, token, and gas. |
|
|
76
|
+
| `Not authenticated` | Run `authenticate-wallet` skill first. |
|
|
77
|
+
|
|
78
|
+
## Related Skills
|
|
79
|
+
|
|
80
|
+
- Use `balance` to verify funds before sending.
|
|
81
|
+
- Use `config` to set a custom RPC if experiencing rate limits.
|
|
82
|
+
- Use `trade` if the user needs to swap tokens before sending.
|