liberfi-portfolio
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLiberFi Portfolio Analysis
LiberFi 投资组合分析
Analyze wallet holdings, transaction activity, PnL statistics, and net worth using the LiberFi CLI.
Supports two modes:
- Public wallet (): Query any wallet address. No authentication required.
lfi wallet * - My TEE wallet (): Query the authenticated user's own LiberFi TEE wallet without specifying an address. Requires authentication.
lfi me *
使用LiberFi CLI分析钱包持仓、交易活动、PnL统计数据和净值。
支持两种模式:
- 公开钱包查询 ():查询任意钱包地址,无需身份认证。
lfi wallet * - 我的TEE钱包查询 ():查询已认证用户自己的LiberFi TEE钱包,无需指定地址,需要完成身份认证。
lfi me *
Pre-flight Checks
前置检查
See bootstrap.md for CLI installation and connectivity verification.
This skill's auth requirements:
| Command group | Requires Auth |
|---|---|
| No (public API, uses on-chain data) |
| Yes (JWT, uses TEE wallet) |
Authentication pre-flight for commands:
me- Run
lfi status --json - If not authenticated:
- Agent:
lfi login key --role AGENT --json - Human: →
lfi login <email> --jsonlfi verify <otpId> <code> --json
- Agent:
- Run to confirm wallet addresses
lfi whoami --json
查看bootstrap.md了解CLI安装和连接性验证方法。
此技能的身份认证要求:
| 命令组 | 需要认证 |
|---|---|
| 否(公开API,使用链上数据) |
| 是(JWT认证,使用TEE钱包数据) |
me- 运行
lfi status --json - 如果未完成认证:
- Agent端:
lfi login key --role AGENT --json - 用户端:→
lfi login <email> --jsonlfi verify <otpId> <code> --json
- Agent端:
- 运行确认钱包地址
lfi whoami --json
Skill Routing
技能路由
| If user asks about... | Route to |
|---|---|
| Token search, price, details, security | liberfi-token |
| Token holders, smart money traders | liberfi-token |
| Token K-line, candlestick chart | liberfi-token |
| Trending tokens, market rankings | liberfi-market |
| Newly listed tokens | liberfi-market |
| Swap, trade, buy, sell tokens | liberfi-swap |
| Transaction fees, gas estimation | liberfi-swap |
| 如果用户咨询以下内容 | 路由到对应技能 |
|---|---|
| 代币搜索、价格、详情、安全信息 | liberfi-token |
| 代币持币地址、聪明钱交易者 | liberfi-token |
| 代币K线、蜡烛图 | liberfi-token |
| 热门代币、市场排名 | liberfi-market |
| 新上线代币 | liberfi-market |
| 兑换、交易、买入、卖出代币 | liberfi-swap |
| 交易手续费、gas预估 | liberfi-swap |
CLI Command Index
CLI命令索引
Public Wallet Commands (no auth, wallet address required)
公开钱包命令(无需认证,需要提供钱包地址)
| Command | Description | Auth |
|---|---|---|
| Get all token holdings with values | No |
| Get transaction activity history | No |
| Get PnL statistics | No |
| Get total wallet net worth | No |
| 命令 | 说明 | 认证要求 |
|---|---|---|
| 获取所有代币持仓及对应价值 | 否 |
| 获取交易活动历史 | 否 |
| 获取PnL统计数据 | 否 |
| 获取钱包总净值 | 否 |
My TEE Wallet Commands (auth required, no address needed)
我的TEE钱包命令(需要认证,无需提供地址)
| Command | Description | Auth |
|---|---|---|
| Get holdings for the authenticated user's TEE wallet | Yes |
| Get transfer activity for the authenticated user's TEE wallet | Yes |
| Get PnL statistics for the authenticated user's TEE wallet | Yes |
| Get total net worth for the authenticated user's TEE wallet | Yes |
| 命令 | 说明 | 认证要求 |
|---|---|---|
| 获取已认证用户TEE钱包的持仓数据 | 是 |
| 获取已认证用户TEE钱包的转账活动记录 | 是 |
| 获取已认证用户TEE钱包的PnL统计数据 | 是 |
| 获取已认证用户TEE钱包的总净值 | 是 |
Parameter Reference
参数参考
Activity options (apply to both and ):
wallet activityme activity- — Comma-separated transfer types to filter (e.g.
--type <type>)buy,sell,transfer,add,remove - — Filter activity by specific token address
--token-address <address> - — Pagination cursor
--cursor <cursor> - — Max results per page
--limit <limit> - — Cursor direction:
--direction <direction>ornextprev
Stats options:
- — Time window:
--resolution <resolution>,7d, or30dall- Default for :
wallet statsall - Default for :
me stats7d
- Default for
活动查询参数(同时适用于和命令):
wallet activityme activity- — 用逗号分隔的转账类型筛选(例如
--type <type>)buy,sell,transfer,add,remove - — 按指定代币地址筛选活动记录
--token-address <address> - — 分页游标
--cursor <cursor> - — 单页最大返回结果数
--limit <limit> - — 游标方向:
--direction <direction>(下一页)或next(上一页)prev
统计查询参数:
- — 时间窗口:
--resolution <resolution>(7天)、7d(30天)或30d(全部)all- 默认值:
wallet statsall - 默认值:
me stats7d
Operation Flow
操作流程
View Wallet Holdings (public)
查看公开钱包持仓
- Collect inputs: Ask user for chain (e.g. ,
sol,eth) and wallet address if not providedbsc - Fetch holdings:
lfi wallet holdings <chain> <address> --json - Present: Show a table with Token, Amount, Value (USD), sorted by value descending
- Suggest next step: "Want to see your PnL stats or transaction history?"
- 收集输入:如果用户未提供,询问链标识(例如、
sol、eth)和钱包地址bsc - 获取持仓数据:
lfi wallet holdings <chain> <address> --json - 结果展示:展示包含代币名称、数量、价值(USD)的表格,按价值降序排列
- 后续步骤建议:"需要查看你的PnL统计数据或交易历史吗?"
View Transaction Activity (public)
查看公开钱包交易活动
- Collect inputs: Chain and wallet address
- Fetch activity:
lfi wallet activity <chain> <address> --limit 20 --json - Present: Show a table with Time, Type, Token, Amount, Tx Hash
- Suggest next step: "Want to filter by a specific token or check your overall PnL?"
- 收集输入:链标识和钱包地址
- 获取活动数据:
lfi wallet activity <chain> <address> --limit 20 --json - 结果展示:展示包含时间、类型、代币、数量、交易哈希的表格
- 后续步骤建议:"需要按特定代币筛选记录,或者查看你的整体盈亏情况吗?"
Filter Activity by Token (public)
按代币筛选公开钱包活动记录
- Fetch filtered:
lfi wallet activity <chain> <address> --token-address <tokenAddress> --limit 20 --json - Present: Show filtered transaction list
- Suggest next step: "Want to check the details or security of this token?"
- 获取筛选后的数据:
lfi wallet activity <chain> <address> --token-address <tokenAddress> --limit 20 --json - 结果展示:展示筛选后的交易列表
- 后续步骤建议:"需要查看这个代币的详情或安全信息吗?"
Check PnL Statistics (public)
查询公开钱包PnL统计数据
- Determine time window: Ask user or default to . Options:
all,7d,30dall - Fetch stats:
lfi wallet stats <chain> <address> --resolution <window> --json - Present: Show PnL summary — total PnL, win rate, realized/unrealized P&L
- Suggest next step: "Want to see your current holdings or total net worth?"
- 确定时间窗口:询问用户偏好或默认使用,可选值:
all、7d、30dall - 获取统计数据:
lfi wallet stats <chain> <address> --resolution <window> --json - 结果展示:展示PnL摘要——总盈亏、胜率、已实现/未实现盈亏
- 后续步骤建议:"需要查看你当前的持仓或总净值吗?"
Check Net Worth (public)
查询公开钱包净值
- Fetch net worth:
lfi wallet net-worth <chain> <address> --json - Present: Show total portfolio value in USD
- Suggest next step: "Want to see the breakdown by token?"
- 获取净值数据:
lfi wallet net-worth <chain> <address> --json - 结果展示:展示以USD计价的投资组合总价值
- 后续步骤建议:"需要查看按代币划分的明细吗?"
Full Portfolio Overview (public)
公开钱包完整投资组合概览
- Net worth: → total value
lfi wallet net-worth <chain> <address> --json - Holdings: → token breakdown
lfi wallet holdings <chain> <address> --json - Stats: → PnL summary
lfi wallet stats <chain> <address> --json - Present: Consolidated portfolio report with total value, top holdings, and PnL
- 查询净值:→ 总价值
lfi wallet net-worth <chain> <address> --json - 查询持仓:→ 代币明细
lfi wallet holdings <chain> <address> --json - 查询统计数据:→ PnL摘要
lfi wallet stats <chain> <address> --json - 结果展示:整合的投资组合报告,包含总价值、Top持仓和PnL数据
View My Own TEE Wallet Portfolio (authenticated)
查看我自己的TEE钱包投资组合(已认证)
Use when the user wants to check their own LiberFi account without knowing the wallet address.
Authentication pre-flight:
bash
lfi status --json当用户想要查询自己的LiberFi账户但不知道钱包地址时使用此流程。
身份认证前置步骤:
bash
lfi status --jsonIf not authenticated:
如果未认证:
lfi login key --role AGENT --json # agent
lfi login key --role AGENT --json # agent端
or: lfi login <email> --json → lfi verify <otpId> <code> --json
或: lfi login <email> --json → lfi verify <otpId> <code> --json
lfi whoami --json # confirm evmAddress / solAddress
1. **Ask for chain**: Which chain to check (e.g. `sol` for Solana, `eth` for Ethereum)
2. **Run all four in sequence**:
```bash
lfi me net-worth <chain> --json
lfi me holdings <chain> --json
lfi me stats <chain> --resolution 7d --json- Present: Consolidated report — total value, top holdings, and 7d PnL summary
- Suggest next step: "Want to check trends or research any specific token?"
lfi whoami --json # 确认evmAddress / solAddress
1. **询问链标识**:需要查询的链(例如Solana对应`sol`,Ethereum对应`eth`)
2. **按顺序运行以下四个命令**:
```bash
lfi me net-worth <chain> --json
lfi me holdings <chain> --json
lfi me stats <chain> --resolution 7d --json- 结果展示:整合报告——总价值、Top持仓和7天PnL摘要
- 后续步骤建议:"需要查看趋势或者研究某个特定代币吗?"
View My Activity (authenticated)
查看我的交易活动(已认证)
- Auth pre-flight: ; authenticate if needed
lfi status --json - Fetch:
lfi me activity <chain> --limit 20 --json - Present: Show Time, Type, Token, Amount, Tx Hash
- Suggest next step: "Want to filter by a specific token?"
- 认证前置检查:运行;如有需要完成认证
lfi status --json - 获取数据:
lfi me activity <chain> --limit 20 --json - 结果展示:展示时间、类型、代币、数量、交易哈希
- 后续步骤建议:"需要按特定代币筛选记录吗?"
Cross-Skill Workflows
跨技能工作流
"Check my wallet and tell me about my biggest holding"
"查询我的钱包,告诉我持仓最多的代币信息"
Full flow: portfolio → token → token
- portfolio → — Get all holdings
lfi wallet holdings <chain> <address> --json - Identify the largest holding by USD value
- token → — Get token details
lfi token info <chain> <tokenAddress> --json - token → — Security audit
lfi token security <chain> <tokenAddress> --json - Present findings: "Your largest holding is X, currently worth $Y"
完整流程:portfolio → token → token
- portfolio技能 → — 获取所有持仓
lfi wallet holdings <chain> <address> --json - 识别出USD价值最高的持仓
- token技能 → — 获取代币详情
lfi token info <chain> <tokenAddress> --json - token技能 → — 安全审计
lfi token security <chain> <tokenAddress> --json - 展示结果:"你持仓最多的代币是X,当前价值$Y"
"Show my recent trades and check if any tokens I hold are risky"
"展示我最近的交易,检查我持有的代币有没有高风险的"
Full flow: portfolio → portfolio → token
- portfolio → — Recent activity
lfi wallet activity <chain> <address> --limit 10 --json - portfolio → — Current holdings
lfi wallet holdings <chain> <address> --json - For each held token: token →
lfi token security <chain> <tokenAddress> --json - Present: Activity summary + risk flags for any held tokens
完整流程:portfolio → portfolio → token
- portfolio技能 → — 最近活动
lfi wallet activity <chain> <address> --limit 10 --json - portfolio技能 → — 当前持仓
lfi wallet holdings <chain> <address> --json - 对每个持仓代币:token技能 →
lfi token security <chain> <tokenAddress> --json - 展示结果:活动摘要 + 所有持仓代币的风险标记
"What's my PnL this month, and what's trending that I should look at?"
"我这个月的盈亏是多少?有什么热门代币值得关注吗?"
Full flow: portfolio → market
- portfolio → — Monthly PnL
lfi wallet stats <chain> <address> --resolution 30d --json - market → — Current trends
lfi ranking trending <chain> 24h --limit 10 --json - Present: "Your 30d PnL is $X. Here are today's trending tokens you might consider."
完整流程:portfolio → market
- portfolio技能 → — 月度PnL
lfi wallet stats <chain> <address> --resolution 30d --json - market技能 → — 当前热门代币
lfi ranking trending <chain> 24h --limit 10 --json - 展示结果:"你过去30天的盈亏是$X。以下是今日的热门代币,你可以参考。"
"Check my own LiberFi wallet — I don't know my address"
"查询我自己的LiberFi钱包——我不知道我的地址"
Full flow: auth → portfolio (me commands)
- auth → — Check session; if not authed →
lfi status --jsonlfi login key --json - auth → — Confirm chain addresses
lfi whoami --json - portfolio → — Get Solana TEE wallet holdings
lfi me holdings sol --json - portfolio → — 7d PnL
lfi me stats sol --resolution 7d --json - portfolio → — Total net worth
lfi me net-worth sol --json - Present consolidated report
完整流程:auth → portfolio(me命令)
- 认证 → — 检查会话;如果未认证 →
lfi status --jsonlfi login key --json - 认证 → — 确认对应链的地址
lfi whoami --json - portfolio技能 → — 获取Solana TEE钱包持仓
lfi me holdings sol --json - portfolio技能 → — 7天PnL
lfi me stats sol --resolution 7d --json - portfolio技能 → — 总净值
lfi me net-worth sol --json - 展示整合报告
"I just swapped — check my updated TEE wallet balance"
"我刚完成了一笔兑换——帮我查下TEE钱包更新后的余额"
Full flow: swap (already done) → portfolio (me commands)
- auth → — Confirm session still valid
lfi status --json - portfolio → — Updated holdings post-swap
lfi me holdings <chain> --json - portfolio → — Updated total value
lfi me net-worth <chain> --json - Present: Before vs after comparison if prior holdings are available
完整流程:swap(已完成) → portfolio(me命令)
- 认证 → — 确认会话仍然有效
lfi status --json - portfolio技能 → — 兑换后的最新持仓
lfi me holdings <chain> --json - portfolio技能 → — 更新后的总价值
lfi me net-worth <chain> --json - 展示结果:如果有之前的持仓数据,展示前后对比
Suggest Next Steps
后续步骤建议
| Just completed | Suggest to user |
|---|---|
| Holdings view | "Want to check your PnL or transaction history?" / "需要查看盈亏或交易记录?" |
| Activity list | "Want to filter by token or check PnL stats?" / "需要按代币筛选或查看盈亏统计?" |
| PnL stats | "Want to see your current holdings?" / "需要查看当前持仓?" |
| Net worth | "Want to see the token breakdown?" / "需要查看各代币明细?" |
| Full overview | "Want to research any specific token or check trends?" / "需要研究某个代币或查看趋势?" |
| Me holdings | "Want to check your activity or PnL stats?" / "需要查看交易记录或盈亏统计?" |
| Me stats | "Want to see your full holdings breakdown?" / "需要查看完整持仓明细?" |
| 刚完成的操作 | 给用户的建议 |
|---|---|
| 持仓查询 | "Want to check your PnL or transaction history?" / "需要查看盈亏或交易记录?" |
| 活动列表查询 | "Want to filter by token or check PnL stats?" / "需要按代币筛选或查看盈亏统计?" |
| PnL统计查询 | "Want to see your current holdings?" / "需要查看当前持仓?" |
| 净值查询 | "Want to see the token breakdown?" / "需要查看各代币明细?" |
| 完整概览查询 | "Want to research any specific token or check trends?" / "需要研究某个代币或查看趋势?" |
| 个人持仓查询 | "Want to check your activity or PnL stats?" / "需要查看交易记录或盈亏统计?" |
| 个人统计查询 | "Want to see your full holdings breakdown?" / "需要查看完整持仓明细?" |
Edge Cases
边界情况
- Invalid wallet address: If the API returns 400/404, ask the user to verify the address format. Solana addresses are base58 (32–44 chars), EVM addresses are + 40 hex chars
0x - Wallet not found / Empty wallet: Inform user: "This wallet has no token holdings on this chain. Verify the address and chain are correct."
- No activity: Inform user: "No recent activity found for this wallet on this chain."
- Network timeout: Retry once after 3 seconds; if still fails, suggest checking connectivity
- Wrong chain for address: EVM addresses used with chain (or vice versa) will fail; detect the address format and suggest the correct chain
sol - Large number of holdings: Default to top 20 by value; inform user if more exist and offer pagination
- command returns 401: Session expired; run
me, then re-authenticatelfi status --json - command used without auth: Do not call
mewithout first verifying authentication vialfi me *lfi status --json
- 无效钱包地址:如果API返回400/404,让用户核实地址格式。Solana地址是base58编码(32-44个字符),EVM地址是+ 40个十六进制字符
0x - 钱包未找到/空钱包:告知用户:"该钱包在这条链上没有代币持仓,请核实地址和链是否正确。"
- 无活动记录:告知用户:"该钱包在这条链上没有找到近期交易活动。"
- 网络超时:3秒后重试一次;如果仍然失败,建议检查网络连接
- 地址与链不匹配:EVM地址和链搭配使用(反之亦然)会报错;识别地址格式并建议正确的链
sol - 持仓数量过多:默认展示价值Top20的持仓;如果还有更多数据告知用户并提供分页选项
- 命令返回401:会话过期;运行
me,然后重新认证lfi status --json - 未认证时调用命令:在通过
me确认认证状态前,不要调用lfi status --json系列命令lfi me *
Security Notes
安全说明
See security-policy.md for global security rules.
Skill-specific rules:
- Public wallet data is public on-chain information — no privacy concern in querying any address
- Never ask for or accept private keys or seed phrases — only public wallet addresses are needed for commands;
wallet *commands require no address at allme * - When displaying wallet addresses provided by the user, confirm the address before querying to avoid mistakes
- PnL data is historical and may not reflect real-time values — note this when presenting stats
- commands expose the authenticated user's TEE wallet data — only use after confirming the user intends to query their own account
me
查看security-policy.md了解全局安全规则。
技能特定规则:
- 公开钱包数据是公开的链上信息——查询任意地址不存在隐私问题
- 永远不要索要或接收私钥、助记词——命令仅需要公开钱包地址;
wallet *命令完全不需要地址me * - 展示用户提供的钱包地址时,查询前先确认地址,避免出错
- PnL数据是历史数据,可能无法反映实时价值——展示统计数据时标注此说明
- 命令会暴露已认证用户的TEE钱包数据——仅在确认用户想要查询自己账户时使用
me