portfolio
Portfolio Overview & Optimization
Display a comprehensive DeFi portfolio dashboard aggregating token balances, staking positions, Troves vault positions, Endur liquid staking (LST), lending positions, DCA orders, and confidential Tongo balances — all with USD valuations. Rebalance the portfolio to a target allocation via automated batch swaps.
Prerequisites
- Active session required.
- For rebalancing: sufficient token balances + gas for batch swap transactions.
Rules
- Use
portfolioas the FIRST command when the user asks "what do I have?" or wants an overall assessment. - The
portfoliocommand is read-only — it never modifies any on-chain state. - USD prices are sourced from the StarkZap SDK and may have slight variations.
- For
portfolio-rebalance, ALWAYS use--simulatefirst to preview the plan before executing. - Target allocations must sum to 100%. If they don't, inform the user and ask them to adjust.
- After rebalancing, run
portfolioagain to confirm the new allocation.
Commands
Portfolio Dashboard
npx starkfi@latest portfolio [--json]
Portfolio Rebalance
# Rebalance to target allocation
npx starkfi@latest portfolio-rebalance --target "<allocation>" [--slippage <n>] [--simulate] [--json]
Parameters
portfolio
| Parameter | Type | Description | Required |
|---|---|---|---|
--json |
flag | Output as JSON | No |
portfolio-rebalance
| Parameter | Type | Description | Required |
|---|---|---|---|
--target |
string | Target allocation (e.g. "50 ETH, 30 USDC, 20 STRK") |
Yes |
--slippage |
number | Slippage tolerance % (default: 1) | No |
--simulate |
flag | Preview plan without executing | No |
--json |
flag | Output as JSON | No |
Target allocation format: Comma-separated <percentage> <token> pairs that sum to 100.
Dashboard Sections
The portfolio displays seven sections:
- Token Balances — STRK, ETH, and all ERC-20 tokens with non-zero balances and their USD values.
- Staking Positions — Active stakes across all validators/pools with pending rewards. Shows unpooling amounts and cooldown dates when exit intents are active.
- Lending Positions — Active Vesu V2 positions: supplied and borrowed amounts with pool details.
- DCA Orders — Active Dollar-Cost Averaging recurring swap orders.
- Confidential Tongo Balance — Private active and pending balances under Tongo Cash.
- Troves Vault Positions — Active deposits in Troves DeFi yield strategies with current value and APY.
- LST Positions — xSTRK holdings from Endur liquid staking with current STRK value and yield accrued.
Examples
User: "Show me my portfolio"
npx starkfi@latest portfolio
User: "What's my total value on Starknet?"
npx starkfi@latest portfolio
User: "Get my portfolio as JSON for analysis"
npx starkfi@latest portfolio --json
User: "Rebalance to 50% ETH, 30% USDC, 20% STRK"
# 1. View current allocation
npx starkfi@latest portfolio
# 2. Preview the rebalance plan
npx starkfi@latest portfolio-rebalance --target "50 ETH, 30 USDC, 20 STRK" --simulate
# 3. Execute after user confirms
npx starkfi@latest portfolio-rebalance --target "50 ETH, 30 USDC, 20 STRK"
npx starkfi@latest tx-status <hash>
# 4. Verify new allocation
npx starkfi@latest portfolio
User: "I want 60% ETH and 40% STRK"
npx starkfi@latest portfolio-rebalance --target "60 ETH, 40 STRK" --simulate
User: "Optimize my portfolio with 2% slippage"
npx starkfi@latest portfolio-rebalance --target "50 ETH, 30 USDC, 20 STRK" --slippage 2
Error Handling
| Error | Action |
|---|---|
Not authenticated |
Run authenticate-wallet skill first. |
Partial failure |
Some sections may show errors while others succeed. The portfolio uses fault-tolerant aggregation. |
Network error |
Retry once. Use config to set custom RPC. |
Invalid allocation |
Ensure target percentages sum to 100 and token symbols are valid. |
Rebalance failed |
Check balances, ensure tokens have sufficient liquidity on supported providers. |
Insufficient balance |
Not enough tokens to execute swaps — check balance first. |
Related Skills
- Use
balancefor a focused view of token balances only. - Use
stakingstake-statusfor detailed staking positions. - Use
lendinglend-statusfor detailed lending positions. - Use
lendinglend-monitorto monitor health factors across lending positions. - Use
dcadca-listto view active DCA orders. - Use
trovestroves-positionfor detailed vault positions. - Use
lstlst-positionfor detailed liquid staking positions. - Use
tradeif you need to swap a single token pair (not full rebalance).
More from ahmetenesdur/starkfi
send
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 send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
10trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
10balance
Check Starknet wallet token balances — STRK, ETH, and all ERC-20 tokens. Use this skill when the user asks about their balance, holdings, funds, tokens, wallet contents, or wants to know how much of something they have. Also use before any transaction to verify sufficient funds. Trigger whenever the user says "check my balance", "how much ETH do I have", "what's in my wallet", "do I have enough", "show my tokens", or any variation about checking available assets — even if they don't use the word "balance".
9staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
9config
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, settings, preferences, or wants to check a transaction hash. Also trigger when the user wants to customize their setup, troubleshoot connection issues, fix errors, switch between mainnet and testnet, change how gas is paid, enable free gas, "gas fees too high", "not working", verify whether a transaction succeeded, or check tx status — even if they don't say "config".
9multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). 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, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.
9