liberfi-portfolio

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LiberFi Portfolio Analysis

LiberFi 投资组合分析

Analyze wallet holdings, transaction activity, PnL statistics, and net worth using the LiberFi CLI.
Supports two modes:
  • Public wallet (
    lfi wallet *
    ): Query any wallet address. No authentication required.
  • My TEE wallet (
    lfi me *
    ): Query the authenticated user's own LiberFi TEE wallet without specifying an address. Requires authentication.
使用LiberFi CLI分析钱包持仓、交易活动、PnL统计数据和净值。
支持两种模式:
  • 公开钱包查询 (
    lfi wallet *
    ):查询任意钱包地址,无需身份认证。
  • 我的TEE钱包查询 (
    lfi me *
    ):查询已认证用户自己的LiberFi TEE钱包,无需指定地址,需要完成身份认证。

Pre-flight Checks

前置检查

See bootstrap.md for CLI installation and connectivity verification.
This skill's auth requirements:
Command groupRequires Auth
lfi wallet *
No (public API, uses on-chain data)
lfi me *
Yes (JWT, uses TEE wallet)
Authentication pre-flight for
me
commands:
  1. Run
    lfi status --json
  2. If not authenticated:
    • Agent:
      lfi login key --role AGENT --json
    • Human:
      lfi login <email> --json
      lfi verify <otpId> <code> --json
  3. Run
    lfi whoami --json
    to confirm wallet addresses
查看bootstrap.md了解CLI安装和连接性验证方法。
此技能的身份认证要求:
命令组需要认证
lfi wallet *
否(公开API,使用链上数据)
lfi me *
(JWT认证,使用TEE钱包数据)
me
系列命令的身份认证前置步骤:
  1. 运行
    lfi status --json
  2. 如果未完成认证:
    • Agent端:
      lfi login key --role AGENT --json
    • 用户端:
      lfi login <email> --json
      lfi verify <otpId> <code> --json
  3. 运行
    lfi whoami --json
    确认钱包地址

Skill Routing

技能路由

If user asks about...Route to
Token search, price, details, securityliberfi-token
Token holders, smart money tradersliberfi-token
Token K-line, candlestick chartliberfi-token
Trending tokens, market rankingsliberfi-market
Newly listed tokensliberfi-market
Swap, trade, buy, sell tokensliberfi-swap
Transaction fees, gas estimationliberfi-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)

公开钱包命令(无需认证,需要提供钱包地址)

CommandDescriptionAuth
lfi wallet holdings <chain> <address>
Get all token holdings with valuesNo
lfi wallet activity <chain> <address>
Get transaction activity historyNo
lfi wallet stats <chain> <address> [--resolution <window>]
Get PnL statisticsNo
lfi wallet net-worth <chain> <address>
Get total wallet net worthNo
命令说明认证要求
lfi wallet holdings <chain> <address>
获取所有代币持仓及对应价值
lfi wallet activity <chain> <address>
获取交易活动历史
lfi wallet stats <chain> <address> [--resolution <window>]
获取PnL统计数据
lfi wallet net-worth <chain> <address>
获取钱包总净值

My TEE Wallet Commands (auth required, no address needed)

我的TEE钱包命令(需要认证,无需提供地址)

CommandDescriptionAuth
lfi me holdings <chain>
Get holdings for the authenticated user's TEE walletYes
lfi me activity <chain>
Get transfer activity for the authenticated user's TEE walletYes
lfi me stats <chain> [--resolution <window>]
Get PnL statistics for the authenticated user's TEE walletYes
lfi me net-worth <chain>
Get total net worth for the authenticated user's TEE walletYes
命令说明认证要求
lfi me holdings <chain>
获取已认证用户TEE钱包的持仓数据
lfi me activity <chain>
获取已认证用户TEE钱包的转账活动记录
lfi me stats <chain> [--resolution <window>]
获取已认证用户TEE钱包的PnL统计数据
lfi me net-worth <chain>
获取已认证用户TEE钱包的总净值

Parameter Reference

参数参考

Activity options (apply to both
wallet activity
and
me activity
):
  • --type <type>
    — Comma-separated transfer types to filter (e.g.
    buy,sell,transfer,add,remove
    )
  • --token-address <address>
    — Filter activity by specific token address
  • --cursor <cursor>
    — Pagination cursor
  • --limit <limit>
    — Max results per page
  • --direction <direction>
    — Cursor direction:
    next
    or
    prev
Stats options:
  • --resolution <resolution>
    — Time window:
    7d
    ,
    30d
    , or
    all
    • Default for
      wallet stats
      :
      all
    • Default for
      me stats
      :
      7d
活动查询参数(同时适用于
wallet activity
me activity
命令):
  • --type <type>
    — 用逗号分隔的转账类型筛选(例如
    buy,sell,transfer,add,remove
  • --token-address <address>
    — 按指定代币地址筛选活动记录
  • --cursor <cursor>
    — 分页游标
  • --limit <limit>
    — 单页最大返回结果数
  • --direction <direction>
    — 游标方向:
    next
    (下一页)或
    prev
    (上一页)
统计查询参数
  • --resolution <resolution>
    — 时间窗口:
    7d
    (7天)、
    30d
    (30天)或
    all
    (全部)
    • wallet stats
      默认值:
      all
    • me stats
      默认值:
      7d

Operation Flow

操作流程

View Wallet Holdings (public)

查看公开钱包持仓

  1. Collect inputs: Ask user for chain (e.g.
    sol
    ,
    eth
    ,
    bsc
    ) and wallet address if not provided
  2. Fetch holdings:
    lfi wallet holdings <chain> <address> --json
  3. Present: Show a table with Token, Amount, Value (USD), sorted by value descending
  4. Suggest next step: "Want to see your PnL stats or transaction history?"
  1. 收集输入:如果用户未提供,询问链标识(例如
    sol
    eth
    bsc
    )和钱包地址
  2. 获取持仓数据
    lfi wallet holdings <chain> <address> --json
  3. 结果展示:展示包含代币名称、数量、价值(USD)的表格,按价值降序排列
  4. 后续步骤建议:"需要查看你的PnL统计数据或交易历史吗?"

View Transaction Activity (public)

查看公开钱包交易活动

  1. Collect inputs: Chain and wallet address
  2. Fetch activity:
    lfi wallet activity <chain> <address> --limit 20 --json
  3. Present: Show a table with Time, Type, Token, Amount, Tx Hash
  4. Suggest next step: "Want to filter by a specific token or check your overall PnL?"
  1. 收集输入:链标识和钱包地址
  2. 获取活动数据
    lfi wallet activity <chain> <address> --limit 20 --json
  3. 结果展示:展示包含时间、类型、代币、数量、交易哈希的表格
  4. 后续步骤建议:"需要按特定代币筛选记录,或者查看你的整体盈亏情况吗?"

Filter Activity by Token (public)

按代币筛选公开钱包活动记录

  1. Fetch filtered:
    lfi wallet activity <chain> <address> --token-address <tokenAddress> --limit 20 --json
  2. Present: Show filtered transaction list
  3. Suggest next step: "Want to check the details or security of this token?"
  1. 获取筛选后的数据
    lfi wallet activity <chain> <address> --token-address <tokenAddress> --limit 20 --json
  2. 结果展示:展示筛选后的交易列表
  3. 后续步骤建议:"需要查看这个代币的详情或安全信息吗?"

Check PnL Statistics (public)

查询公开钱包PnL统计数据

  1. Determine time window: Ask user or default to
    all
    . Options:
    7d
    ,
    30d
    ,
    all
  2. Fetch stats:
    lfi wallet stats <chain> <address> --resolution <window> --json
  3. Present: Show PnL summary — total PnL, win rate, realized/unrealized P&L
  4. Suggest next step: "Want to see your current holdings or total net worth?"
  1. 确定时间窗口:询问用户偏好或默认使用
    all
    ,可选值:
    7d
    30d
    all
  2. 获取统计数据
    lfi wallet stats <chain> <address> --resolution <window> --json
  3. 结果展示:展示PnL摘要——总盈亏、胜率、已实现/未实现盈亏
  4. 后续步骤建议:"需要查看你当前的持仓或总净值吗?"

Check Net Worth (public)

查询公开钱包净值

  1. Fetch net worth:
    lfi wallet net-worth <chain> <address> --json
  2. Present: Show total portfolio value in USD
  3. Suggest next step: "Want to see the breakdown by token?"
  1. 获取净值数据
    lfi wallet net-worth <chain> <address> --json
  2. 结果展示:展示以USD计价的投资组合总价值
  3. 后续步骤建议:"需要查看按代币划分的明细吗?"

Full Portfolio Overview (public)

公开钱包完整投资组合概览

  1. Net worth:
    lfi wallet net-worth <chain> <address> --json
    → total value
  2. Holdings:
    lfi wallet holdings <chain> <address> --json
    → token breakdown
  3. Stats:
    lfi wallet stats <chain> <address> --json
    → PnL summary
  4. Present: Consolidated portfolio report with total value, top holdings, and PnL
  1. 查询净值
    lfi wallet net-worth <chain> <address> --json
    → 总价值
  2. 查询持仓
    lfi wallet holdings <chain> <address> --json
    → 代币明细
  3. 查询统计数据
    lfi wallet stats <chain> <address> --json
    → PnL摘要
  4. 结果展示:整合的投资组合报告,包含总价值、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 --json

If 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
  1. Present: Consolidated report — total value, top holdings, and 7d PnL summary
  2. 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
  1. 结果展示:整合报告——总价值、Top持仓和7天PnL摘要
  2. 后续步骤建议:"需要查看趋势或者研究某个特定代币吗?"

View My Activity (authenticated)

查看我的交易活动(已认证)

  1. Auth pre-flight:
    lfi status --json
    ; authenticate if needed
  2. Fetch:
    lfi me activity <chain> --limit 20 --json
  3. Present: Show Time, Type, Token, Amount, Tx Hash
  4. Suggest next step: "Want to filter by a specific token?"
  1. 认证前置检查:运行
    lfi status --json
    ;如有需要完成认证
  2. 获取数据
    lfi me activity <chain> --limit 20 --json
  3. 结果展示:展示时间、类型、代币、数量、交易哈希
  4. 后续步骤建议:"需要按特定代币筛选记录吗?"

Cross-Skill Workflows

跨技能工作流

"Check my wallet and tell me about my biggest holding"

"查询我的钱包,告诉我持仓最多的代币信息"

Full flow: portfolio → token → token
  1. portfolio
    lfi wallet holdings <chain> <address> --json
    — Get all holdings
  2. Identify the largest holding by USD value
  3. token
    lfi token info <chain> <tokenAddress> --json
    — Get token details
  4. token
    lfi token security <chain> <tokenAddress> --json
    — Security audit
  5. Present findings: "Your largest holding is X, currently worth $Y"
完整流程:portfolio → token → token
  1. portfolio技能
    lfi wallet holdings <chain> <address> --json
    — 获取所有持仓
  2. 识别出USD价值最高的持仓
  3. token技能
    lfi token info <chain> <tokenAddress> --json
    — 获取代币详情
  4. token技能
    lfi token security <chain> <tokenAddress> --json
    — 安全审计
  5. 展示结果:"你持仓最多的代币是X,当前价值$Y"

"Show my recent trades and check if any tokens I hold are risky"

"展示我最近的交易,检查我持有的代币有没有高风险的"

Full flow: portfolio → portfolio → token
  1. portfolio
    lfi wallet activity <chain> <address> --limit 10 --json
    — Recent activity
  2. portfolio
    lfi wallet holdings <chain> <address> --json
    — Current holdings
  3. For each held token: token
    lfi token security <chain> <tokenAddress> --json
  4. Present: Activity summary + risk flags for any held tokens
完整流程:portfolio → portfolio → token
  1. portfolio技能
    lfi wallet activity <chain> <address> --limit 10 --json
    — 最近活动
  2. portfolio技能
    lfi wallet holdings <chain> <address> --json
    — 当前持仓
  3. 对每个持仓代币:token技能
    lfi token security <chain> <tokenAddress> --json
  4. 展示结果:活动摘要 + 所有持仓代币的风险标记

"What's my PnL this month, and what's trending that I should look at?"

"我这个月的盈亏是多少?有什么热门代币值得关注吗?"

Full flow: portfolio → market
  1. portfolio
    lfi wallet stats <chain> <address> --resolution 30d --json
    — Monthly PnL
  2. market
    lfi ranking trending <chain> 24h --limit 10 --json
    — Current trends
  3. Present: "Your 30d PnL is $X. Here are today's trending tokens you might consider."
完整流程:portfolio → market
  1. portfolio技能
    lfi wallet stats <chain> <address> --resolution 30d --json
    — 月度PnL
  2. market技能
    lfi ranking trending <chain> 24h --limit 10 --json
    — 当前热门代币
  3. 展示结果:"你过去30天的盈亏是$X。以下是今日的热门代币,你可以参考。"

"Check my own LiberFi wallet — I don't know my address"

"查询我自己的LiberFi钱包——我不知道我的地址"

Full flow: auth → portfolio (me commands)
  1. auth
    lfi status --json
    — Check session; if not authed →
    lfi login key --json
  2. auth
    lfi whoami --json
    — Confirm chain addresses
  3. portfolio
    lfi me holdings sol --json
    — Get Solana TEE wallet holdings
  4. portfolio
    lfi me stats sol --resolution 7d --json
    — 7d PnL
  5. portfolio
    lfi me net-worth sol --json
    — Total net worth
  6. Present consolidated report
完整流程:auth → portfolio(me命令)
  1. 认证
    lfi status --json
    — 检查会话;如果未认证 →
    lfi login key --json
  2. 认证
    lfi whoami --json
    — 确认对应链的地址
  3. portfolio技能
    lfi me holdings sol --json
    — 获取Solana TEE钱包持仓
  4. portfolio技能
    lfi me stats sol --resolution 7d --json
    — 7天PnL
  5. portfolio技能
    lfi me net-worth sol --json
    — 总净值
  6. 展示整合报告

"I just swapped — check my updated TEE wallet balance"

"我刚完成了一笔兑换——帮我查下TEE钱包更新后的余额"

Full flow: swap (already done) → portfolio (me commands)
  1. auth
    lfi status --json
    — Confirm session still valid
  2. portfolio
    lfi me holdings <chain> --json
    — Updated holdings post-swap
  3. portfolio
    lfi me net-worth <chain> --json
    — Updated total value
  4. Present: Before vs after comparison if prior holdings are available
完整流程:swap(已完成) → portfolio(me命令)
  1. 认证
    lfi status --json
    — 确认会话仍然有效
  2. portfolio技能
    lfi me holdings <chain> --json
    — 兑换后的最新持仓
  3. portfolio技能
    lfi me net-worth <chain> --json
    — 更新后的总价值
  4. 展示结果:如果有之前的持仓数据,展示前后对比

Suggest Next Steps

后续步骤建议

Just completedSuggest 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
    0x
    + 40 hex chars
  • 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
    sol
    chain (or vice versa) will fail; detect the address format and suggest the correct chain
  • Large number of holdings: Default to top 20 by value; inform user if more exist and offer pagination
  • me
    command returns 401
    : Session expired; run
    lfi status --json
    , then re-authenticate
  • me
    command used without auth
    : Do not call
    lfi me *
    without first verifying authentication via
    lfi status --json
  • 无效钱包地址:如果API返回400/404,让用户核实地址格式。Solana地址是base58编码(32-44个字符),EVM地址是
    0x
    + 40个十六进制字符
  • 钱包未找到/空钱包:告知用户:"该钱包在这条链上没有代币持仓,请核实地址和链是否正确。"
  • 无活动记录:告知用户:"该钱包在这条链上没有找到近期交易活动。"
  • 网络超时:3秒后重试一次;如果仍然失败,建议检查网络连接
  • 地址与链不匹配:EVM地址和
    sol
    链搭配使用(反之亦然)会报错;识别地址格式并建议正确的链
  • 持仓数量过多:默认展示价值Top20的持仓;如果还有更多数据告知用户并提供分页选项
  • me
    命令返回401
    :会话过期;运行
    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
    wallet *
    commands;
    me *
    commands require no address at all
  • 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
  • me
    commands expose the authenticated user's TEE wallet data — only use after confirming the user intends to query their own account
查看security-policy.md了解全局安全规则。
技能特定规则:
  • 公开钱包数据是公开的链上信息——查询任意地址不存在隐私问题
  • 永远不要索要或接收私钥、助记词——
    wallet *
    命令仅需要公开钱包地址;
    me *
    命令完全不需要地址
  • 展示用户提供的钱包地址时,查询前先确认地址,避免出错
  • PnL数据是历史数据,可能无法反映实时价值——展示统计数据时标注此说明
  • me
    命令会暴露已认证用户的TEE钱包数据——仅在确认用户想要查询自己账户时使用