lista-lending
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLista Lending Skill (POC)
Lista Lending Skill(POC)
Status: Pre-release (internal only, not in public registry) Agent quick check:Agent rebuild:node dist/cli.js versionnpm install && npm run build
Execute Lista Lending vault and market operations through , with transaction sending delegated to .
@lista-dao/moolah-lending-sdklista-wallet-connect状态: 预发布阶段(仅限内部使用,未纳入公开注册表) Agent快速检查:Agent重新构建:node dist/cli.js versionnpm install && npm run build
通过执行Lista Lending金库和市场操作,交易发送委托给处理。
@lista-dao/moolah-lending-sdklista-wallet-connectAgent Execution Policy
Agent执行策略
- Execute CLI/setup commands directly as the agent; do not ask the user to run shell commands.
- If dependencies/build are missing or outdated, run setup/build automatically.
- Before any signing or on-chain write action, explain the action and get user consent.
- Do not output raw JSON/internal payloads to users by default; convert results into human-readable summaries/tables.
- Use command snippets in this document as agent-side execution references only.
- 以Agent身份直接执行CLI/设置命令;不要让用户运行Shell命令。
- 如果依赖项/构建缺失或过时,自动运行设置/构建流程。
- 在进行任何签名或链上写入操作前,向用户说明操作内容并获得同意。
- 默认情况下,不要向用户输出原始JSON/内部负载;将结果转换为易读的摘要/表格。
- 本文档中的命令片段仅作为Agent端执行参考使用。
When to Use This Skill
何时使用该Skill
This skill handles LENDING-SPECIFIC viewing and operations.
✅ Use when user wants to:
1. View LENDING positions only:
- "Check my lending positions"
- "Show my Lista vaults"
- "What's in my lending markets"
- "My collateral in lending vaults"
2. Execute lending operations:
- "Deposit 100 USDT to Lista vault"
- "Withdraw from my Lista vault"
- "Borrow against my collateral"
- "Repay my lending debt"
- "Find best lending yield"
❌ Do NOT use for:
- All-product/report-style overview → Use
lista - "Check ALL my Lista positions" (report view) → Use
lista - "My total Lista collateral/debt" (summary-style answer) → Use
lista
Key difference:
- : VIEW report-style lending analytics and summaries
lista - : VIEW/OPERATE lending only (vaults + markets)
lista-lending - : Wallet operations (connect/sign/transfer)
lista-wallet-connect
本Skill处理仅针对借贷的查看与操作。
✅ 当用户需要以下操作时使用:
1. 仅查看借贷仓位:
- "查看我的借贷仓位"
- "展示我的Lista金库"
- "我的借贷市场中有什么"
- "我在借贷金库中的抵押物"
2. 执行借贷操作:
- "向Lista金库存入100 USDT"
- "从我的Lista金库提取资金"
- "用我的抵押物借款"
- "偿还我的借贷债务"
- "寻找最佳借贷收益率"
❌ 以下情况请勿使用:
- 全产品/报告式概览 → 使用
lista - "查看我所有的Lista仓位"(报告视图)→ 使用
lista - "我的Lista总抵押物/债务"(摘要式回答)→ 使用
lista
核心区别:
- :查看报告式借贷分析与摘要
lista - :查看/操作仅借贷类(金库+市场)
lista-lending - :钱包操作(连接/签名/转账)
lista-wallet-connect
Routing Priority (Required)
路由优先级(必填)
Apply these routing rules before running commands:
- Wallet/session/signing issues (,
pair,auth,sign,topic) →sessionlista-wallet-connect - Lending write operations (,
deposit,withdraw,supply,borrow,repay) →market-withdrawlista-lending - Lending actionable reads (,
holdings,vaultsfor selection/filtering/follow-up execution) →marketslista-lending - Report/narrative analysis (,
position report,risk check, high-level market/vault summary) →daily digestlista
Ambiguous intent handling:
- : if user asks for operation follow-up or lending-only detail, use
check my positions; otherwise uselista-lending.lista - /
market list: if user needs execution target selection, usevault list; if user only wants macro overview, uselista-lending.lista
运行命令前需遵循以下路由规则:
- 钱包/会话/签名问题(、
pair、auth、sign、topic)→ 使用sessionlista-wallet-connect - 借贷写入操作(、
deposit、withdraw、supply、borrow、repay)→ 使用market-withdrawlista-lending - 借贷可操作读取(、
holdings、vaults,用于选择/筛选/后续执行)→ 使用marketslista-lending - 报告/叙述性分析(、
position report、risk check、高级市场/金库摘要)→ 使用daily digestlista
模糊意图处理:
- :如果用户要求后续操作或仅借贷类详情,使用
check my positions;否则使用lista-lending。lista - /
market list:如果用户需要选择执行目标,使用vault list;如果用户仅需宏观概览,使用lista-lending。lista
Scope
适用范围
Supported capabilities:
- Vault: ,
vaults,select --vault,depositwithdraw - Market: ,
markets,select --market,supply,borrow,repaymarket-withdraw - Portfolio:
holdings - Runtime/config: ,
configversion
Not in scope:
- CDP operations
- Non-EVM chains
支持的功能:
- 金库:、
vaults、select --vault、depositwithdraw - 市场:、
markets、select --market、supply、borrow、repaymarket-withdraw - 投资组合:
holdings - 运行时/配置:、
configversion
不包含的范围:
- CDP操作
- 非EVM链
Temporary Limitations
临时限制
Current unsupported market types for trade actions ():
select/supply/borrow/repay/market-withdraw- SmartLending markets ()
zone === 3 - Fixed-term markets ()
termType === 1
Behavior:
- command filters them out from list output.
markets - rejects them with
select --market.unsupported_market_type - still returns them (for full portfolio visibility) and marks:
holdingsisSmartLendingisFixedTermisActionable
目前交易操作()不支持的市场类型:
select/supply/borrow/repay/market-withdraw- SmartLending市场()
zone === 3 - 固定期限市场()
termType === 1
行为表现:
- 命令会在列表输出中过滤掉这些市场。
markets - 会拒绝这些市场并返回
select --market。unsupported_market_type - 仍会返回这些市场信息(为了完整展示投资组合),并标记:
holdingsisSmartLendingisFixedTermisActionable
Project Structure
项目结构
text
skills/lista-lending/
├── SKILL.md
├── package.json
├── tsconfig.json
└── src/
├── cli/ # args/help/meta/run
├── api/ # vault/market/user read-side queries
├── sdk/ # SDK client + market runtime prefetch
├── executor/ # tx execution + receipt polling
├── commands/ # command handlers
│ ├── shared/ # context/errors/output/tx helpers
│ ├── select/
│ ├── borrow/
│ └── repay/
├── presenters/
├── utils/
├── config.ts
├── context.ts
├── api.ts # API facade export
├── sdk.ts # SDK facade export
├── executor.ts # executor facade export
└── cli.ts # CLI entrypointNotes:
- CLI parsing/routing lives in and keeps
src/cli/*as the single entrypoint.src/cli.ts - Read-side querying is split by domain in (
src/api/*,vault,market).user - SDK integration is centralized in ; market runtime prefetch is in
src/sdk/client.ts.src/sdk/market-runtime.ts - and
borroware split into dedicatedrepayandsimulatemodules to keep command files small.execute
text
skills/lista-lending/
├── SKILL.md
├── package.json
├── tsconfig.json
└── src/
├── cli/ # args/help/meta/run
├── api/ # vault/market/user read-side queries
├── sdk/ # SDK client + market runtime prefetch
├── executor/ # tx execution + receipt polling
├── commands/ # command handlers
│ ├── shared/ # context/errors/output/tx helpers
│ ├── select/
│ ├── borrow/
│ └── repay/
├── presenters/
├── utils/
├── config.ts
├── context.ts
├── api.ts # API facade export
├── sdk.ts # SDK facade export
├── executor.ts # executor facade export
└── cli.ts # CLI entrypoint说明:
- CLI解析/路由逻辑位于,并将
src/cli/*作为单一入口点。src/cli.ts - 读取端查询按领域拆分到(
src/api/*、vault、market)。user - SDK集成集中在;市场运行时预取逻辑位于
src/sdk/client.ts。src/sdk/market-runtime.ts - 和
borrow被拆分为独立的repay和simulate模块,以保持命令文件精简。execute
Prerequisites
前置条件
- Wallet is paired via skill.
lista-wallet-connect - You have a valid and
wallet-topic.wallet-address - Node.js version is (recommended
>= 18.0.0).>= 20 - is built (
lista-wallet-connectexists).skills/lista-wallet-connect/dist/cli.js - is built (
lista-lendingexists).skills/lista-lending/dist/cli.js
- 已通过Skill配对钱包。
lista-wallet-connect - 拥有有效的和
wallet-topic。wallet-address - Node.js版本(推荐
>= 18.0.0)。>= 20 - 已构建完成(
lista-wallet-connect已存在)。skills/lista-wallet-connect/dist/cli.js - 已构建完成(
lista-lending已存在)。skills/lista-lending/dist/cli.js
Setup (Agent-Run)
设置(Agent执行)
Agent should run these steps automatically when environment is not ready:
bash
undefined当环境未就绪时,Agent应自动运行以下步骤:
bash
undefinedinstall dependencies
安装依赖
cd skills/lista-lending && npm install
cd skills/lista-lending && npm install
build
构建项目
npm run build
Agent execution path:
```bash
cd skills/lista-lending
node dist/cli.js <command> [options]npm run build
Agent执行路径:
```bash
cd skills/lista-lending
node dist/cli.js <command> [options]Output Contract
输出约定
- : machine-readable JSON (result payload)
stdout - : errors only
stderr
- :机器可读的JSON(结果负载)
stdout - :仅输出错误信息
stderr
Agent Display Guidelines
Agent展示指南
For user-facing answers, keep CLI JSON as internal source of truth, then render human-readable tables/summaries.
Return raw JSON only when the user explicitly asks for raw output.
vaults- ,
Vault,Asset,TVL (USD),APYCurator
markets- ,
Collateral,Loan,LLTV,Borrow RateLiquidity (USD)
holdings- Summary block first: total vault count, total market count, actionable market count, unsupported market count.
- Vault table columns:
- ,
Vault,Chain,Deposited,Deposited USD,APYWallet Balance
- Actionable market table columns:
- ,
Market,Chain,Collateral USD,Borrowed USD,LTVHealth
- Unsupported market table columns (non-technical by default):
- ,
Market,Chain,Reason,Collateral USDBorrowed USD
Default rule:
- Use different table layouts for different commands (,
vaults,markets); do not reuse holdings layout for vault/market list pages.holdings - Do not show in user-facing table unless user explicitly asks for technical details.
zone/termType - Do not paste full raw payloads (JSON/RPC internals) in normal user-facing replies.
- Derive from flags:
ReasonisSmartLending => SmartLendingisFixedTerm => Fixed-term
Health definition (for market positions):
- Formula: when
health = LLTV / LTV; otherwiseLTV > 0.health = 100 - Display label suggestion:
- :
Healthyhealth >= 1.2 - :
Warning1.0 <= health < 1.2 - :
Riskhealth < 1.0
- Action hint: if label is or
Warning, suggest repay/reduce borrow.Risk
对于面向用户的回复,将CLI JSON作为内部数据源,然后转换为易读的表格/摘要。仅当用户明确要求时才返回原始JSON。
vaults- 、
金库、资产、TVL(美元)、APY管理者
markets- 、
抵押物、贷款、LLTV、借款利率流动性(美元)
holdings- 首先展示摘要块:金库总数、市场总数、可操作市场数、不支持的市场数。
- 金库表格列:
- 、
金库、链、存入金额、存入金额(美元)、APY钱包余额
- 可操作市场表格列:
- 、
市场、链、抵押物(美元)、借款金额(美元)、LTV健康度
- 不支持的市场表格列(默认非技术视角):
- 、
市场、链、原因、抵押物(美元)借款金额(美元)
默认规则:
- 为不同命令(、
vaults、markets)使用不同的表格布局;不要将holdings的布局复用在金库/市场列表页。holdings - 除非用户明确要求技术细节,否则不要在面向用户的表格中显示。
zone/termType - 在常规面向用户的回复中,不要粘贴完整的原始负载(JSON/RPC内部信息)。
- 根据标记推导:
原因isSmartLending => 智能借贷市场isFixedTerm => 固定期限市场
健康度定义(针对市场仓位):
- 公式:当时,
LTV > 0;否则健康度 = LLTV / LTV。健康度 = 100 - 显示标签建议:
- :
健康健康度 >= 1.2 - :
警告1.0 <= 健康度 < 1.2 - :
风险健康度 < 1.0
- 操作提示:如果标签为或
警告,建议用户偿还债务/减少借款。风险
Supported Chains
支持的链
- (BSC, default)
eip155:56 - (Ethereum)
eip155:1
- (BSC,默认)
eip155:56 - (以太坊)
eip155:1
Command Index
命令索引
- - show skill version and compatibility hints
version - - read/update RPC settings
config - - list vaults with filters
vaults - - list markets with filters (SmartLending/fixed-term filtered)
markets - - query user positions across vault + market
holdings - - set active vault or market context
select - - deposit to selected/explicit vault
deposit - - withdraw from selected/explicit vault
withdraw - - supply collateral to selected/explicit market
supply - - simulate or execute borrow
borrow - - simulate or execute repay
repay - - withdraw supplied collateral from selected/explicit market
market-withdraw
- - 显示Skill版本和兼容性提示
version - - 读取/更新RPC设置
config - - 带筛选条件的金库列表
vaults - - 带筛选条件的市场列表(已过滤SmartLending/固定期限市场)
markets - - 查询用户在金库+市场中的仓位
holdings - - 设置活跃金库或市场上下文,用于后续操作
select - - 向选中/指定的金库存入资金
deposit - - 从选中/指定的金库提取资金
withdraw - - 向选中/指定的市场存入抵押物
supply - - 模拟或执行借款操作
borrow - - 模拟或执行还款操作
repay - - 从选中/指定的市场提取已存入的抵押物
market-withdraw
Global/Shared Options
全局/共享选项
--chain <eip155:56|eip155:1>--wallet-topic <topic>--wallet-address <0x...>
--chain <eip155:56|eip155:1>--wallet-topic <topic>--wallet-address <0x...>
Command Details
命令详情
All command snippets below are for agent execution; do not instruct the user to type them manually.
以下所有命令片段仅供Agent执行使用;请勿指导用户手动输入。
1) version
version1) version
versionPurpose: Print skill version and dependency constraints.
bash
node dist/cli.js version用途:打印Skill版本和依赖约束。
bash
node dist/cli.js version2) config
config2) config
configPurpose: Manage RPC override.
Examples:
bash
undefined用途:管理RPC覆盖设置。
示例:
bash
undefinedshow config
查看配置
node dist/cli.js config --show
node dist/cli.js config --show
set rpc override
设置RPC覆盖
node dist/cli.js config --set-rpc --chain eip155:56 --url https://bsc-mainnet.nodereal.io/v1/<key>
node dist/cli.js config --set-rpc --chain eip155:56 --url https://bsc-mainnet.nodereal.io/v1/<key>
clear rpc override
清除RPC覆盖
node dist/cli.js config --clear-rpc --chain eip155:56
Notes:
- Config file: `~/.agent-wallet/lending-config.json`
- Chain fallback RPCs are still used if primary RPC fails.node dist/cli.js config --clear-rpc --chain eip155:56
说明:
- 配置文件:`~/.agent-wallet/lending-config.json`
- 如果主RPC失败,仍会使用链的备用RPC。3) vaults
vaults3) vaults
vaultsPurpose: Discover vaults from SDK list API.
Common options:
- ,
--page,--page-size,--sort--order - ,
--zone--keyword - ,
--assets <a,b>--curators <a,b>
Examples:
bash
node dist/cli.js vaults
node dist/cli.js vaults --chain eip155:1
node dist/cli.js vaults --sort apy --order desc --page 1 --page-size 10
node dist/cli.js vaults --assets 0x8d0d...,0x55d3... --curators "Lista DAO,Pangolins"用途:从SDK列表API发现金库。
常用选项:
- 、
--page、--page-size、--sort--order - 、
--zone--keyword - 、
--assets <a,b>--curators <a,b>
示例:
bash
node dist/cli.js vaults
node dist/cli.js vaults --chain eip155:1
node dist/cli.js vaults --sort apy --order desc --page 1 --page-size 10
node dist/cli.js vaults --assets 0x8d0d...,0x55d3... --curators "Lista DAO,Pangolins"4) markets
markets4) markets
marketsPurpose: Discover markets from SDK list API.
Common options:
- ,
--page,--page-size,--sort--order - ,
--zone--keyword - ,
--loans <a,b>--collaterals <a,b>
Examples:
bash
node dist/cli.js markets
node dist/cli.js markets --chain eip155:56 --sort liquidity --order desc --page-size 20
node dist/cli.js markets --loans USD1,USDT --collaterals USD1,BTCBNotes:
- Command filters out SmartLending () and fixed-term (
zone=3) markets in output.termType=1 - Always include this user-facing note when presenting market list:
Smart Lending and fixed-term market operations are currently not supported in this skill. For full functionality, please use the Lista website.
用途:从SDK列表API发现市场。
常用选项:
- 、
--page、--page-size、--sort--order - 、
--zone--keyword - 、
--loans <a,b>--collaterals <a,b>
示例:
bash
node dist/cli.js markets
node dist/cli.js markets --chain eip155:56 --sort liquidity --order desc --page-size 20
node dist/cli.js markets --loans USD1,USDT --collaterals USD1,BTCB说明:
- 该命令会在输出中过滤掉SmartLending()和固定期限(
zone=3)市场。termType=1 - 展示市场列表时,需始终包含以下面向用户的说明:
本Skill目前不支持智能借贷和固定期限市场的操作。如需完整功能,请使用Lista官网。
5) holdings
holdings5) holdings
holdingsPurpose: Query positions by wallet address.
Options:
- (optional if context already has
--address <0x...>)userAddress --scope <all|vault|market|selected>
Examples:
bash
undefined用途:按钱包地址查询仓位。
选项:
- (如果上下文已包含
--address <0x...>则可选)userAddress --scope <all|vault|market|selected>
示例:
bash
undefinedall positions (vault + market)
所有仓位(金库+市场)
node dist/cli.js holdings --address 0xYOUR_ADDRESS
node dist/cli.js holdings --address 0xYOUR_ADDRESS
only vault positions
仅金库仓位
node dist/cli.js holdings --address 0xYOUR_ADDRESS --scope vault
node dist/cli.js holdings --address 0xYOUR_ADDRESS --scope vault
only market positions
仅市场仓位
node dist/cli.js holdings --address 0xYOUR_ADDRESS --scope market
node dist/cli.js holdings --address 0xYOUR_ADDRESS --scope market
only currently selected position
仅当前选中的仓位
node dist/cli.js holdings --scope selected
Market position fields include:
- User-facing fields:
- `isSmartLending` (`zone === 3`)
- `isFixedTerm` (`termType === 1`)
- `isActionable` (`!isSmartLending && !isFixedTerm`)
- Raw JSON technical fields (debug/integration only):
- `zone`, `termType`node dist/cli.js holdings --scope selected
市场仓位字段包括:
- 面向用户的字段:
- `isSmartLending`(`zone === 3`)
- `isFixedTerm`(`termType === 1`)
- `isActionable`(`!isSmartLending && !isFixedTerm`)
- 原始JSON技术字段(仅用于调试/集成):
- `zone`、`termType`6) select
select6) select
selectPurpose: Persist active target in context for follow-up operations.
Modes:
- select vault:
--vault - select market:
--market - read context:
--show - clear context:
--clear
Examples:
bash
undefined用途:在上下文中持久化活跃目标,以便后续操作使用。
模式:
- 选择金库:
--vault - 选择市场:
--market - 查看上下文:
--show - 清除上下文:
--clear
示例:
bash
undefinedselect vault
选择金库
node dist/cli.js select
--vault 0xfa27f172e0b6ebcef9c51abf817e2cb142fbe627
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
--vault 0xfa27f172e0b6ebcef9c51abf817e2cb142fbe627
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
node dist/cli.js select
--vault 0xfa27f172e0b6ebcef9c51abf817e2cb142fbe627
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
--vault 0xfa27f172e0b6ebcef9c51abf817e2cb142fbe627
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
select market
选择市场
node dist/cli.js select
--market 0xd384584abf6504425c9873f34a63372625d46cd1f2e79aeedc77475cacaca922
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
--market 0xd384584abf6504425c9873f34a63372625d46cd1f2e79aeedc77475cacaca922
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
node dist/cli.js select
--market 0xd384584abf6504425c9873f34a63372625d46cd1f2e79aeedc77475cacaca922
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
--market 0xd384584abf6504425c9873f34a63372625d46cd1f2e79aeedc77475cacaca922
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
show/clear
查看/清除上下文
node dist/cli.js select --show
node dist/cli.js select --clear
Notes:
- Market selection rejects SmartLending and fixed-term markets.
- Context file: `~/.agent-wallet/lending-context.json`node dist/cli.js select --show
node dist/cli.js select --clear
说明:
- 市场选择会拒绝SmartLending和固定期限市场。
- 上下文文件:`~/.agent-wallet/lending-context.json`7) deposit
deposit7) deposit
depositPurpose: Deposit vault asset.
Required:
--amount- plus either selected vault context or explicit + wallet info
--vault
Example:
bash
undefined用途:向金库存入资产。
必填项:
--amount- 加上已选中的金库上下文,或明确的+ 钱包信息
--vault
示例:
bash
undefinedusing selected vault
使用已选中的金库
node dist/cli.js deposit --amount 1
node dist/cli.js deposit --amount 1
explicit target
明确指定目标
node dist/cli.js deposit
--vault 0xVAULT
--amount 1
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
--vault 0xVAULT
--amount 1
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
undefinednode dist/cli.js deposit
--vault 0xVAULT
--amount 1
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
--vault 0xVAULT
--amount 1
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
undefined8) withdraw
withdraw8) withdraw
withdrawPurpose: Withdraw vault asset.
Required:
- one of or
--amount--withdraw-all
Examples:
bash
node dist/cli.js withdraw --amount 0.5
node dist/cli.js withdraw --withdraw-all用途:从金库提取资产。
必填项:
- 或
--amount二者之一--withdraw-all
示例:
bash
node dist/cli.js withdraw --amount 0.5
node dist/cli.js withdraw --withdraw-all9) supply
supply9) supply
supplyPurpose: Supply market collateral.
Required:
--amount- plus selected market context or explicit market/wallet parameters
Example:
bash
node dist/cli.js supply --amount 2用途:向市场存入抵押物。
必填项:
--amount- 加上已选中的市场上下文,或明确的市场/钱包参数
示例:
bash
node dist/cli.js supply --amount 210) borrow
borrow10) borrow
borrowPurpose: Borrow loan token, or simulate borrow capacity.
Modes:
- simulate only:
--simulate - simulate with hypothetical supply:
--simulate --simulate-supply <amt> - execute borrow:
--amount <amt>
Examples:
bash
undefined用途:借款,或模拟借款额度。
模式:
- 仅模拟:
--simulate - 模拟假设存入抵押物后的额度:
--simulate --simulate-supply <amt> - 执行借款:
--amount <amt>
示例:
bash
undefinedcheck max borrowable
查看最大可借款额度
node dist/cli.js borrow --simulate
node dist/cli.js borrow --simulate
check max after hypothetical supply
查看存入指定抵押物后的最大可借款额度
node dist/cli.js borrow --simulate --simulate-supply 2
node dist/cli.js borrow --simulate --simulate-supply 2
execute borrow
执行借款
node dist/cli.js borrow --amount 0.01
undefinednode dist/cli.js borrow --amount 0.01
undefined11) repay
repay11) repay
repayPurpose: Repay market debt, or simulate repay impact.
Modes:
- simulate repay amount:
--simulate --amount <amt> - simulate repay-all:
--simulate --repay-all - execute repay: or
--amount <amt>--repay-all
Examples:
bash
undefined用途:偿还债务,或模拟还款影响。
模式:
- 模拟还款金额的影响:
--simulate --amount <amt> - 模拟全额还款的影响:
--simulate --repay-all - 执行还款:或
--amount <amt>--repay-all
示例:
bash
undefinedsimulate partial repay impact
模拟部分还款的影响
node dist/cli.js repay --simulate --amount 0.01
node dist/cli.js repay --simulate --amount 0.01
simulate full repay impact
模拟全额还款的影响
node dist/cli.js repay --simulate --repay-all
node dist/cli.js repay --simulate --repay-all
execute
执行还款
node dist/cli.js repay --amount 0.01
node dist/cli.js repay --repay-all
undefinednode dist/cli.js repay --amount 0.01
node dist/cli.js repay --repay-all
undefined12) market-withdraw
market-withdraw12) market-withdraw
market-withdrawPurpose: Withdraw market collateral.
Required:
- one of or
--amount--withdraw-all
Examples:
bash
node dist/cli.js market-withdraw --amount 0.5
node dist/cli.js market-withdraw --withdraw-all用途:从市场提取抵押物。
必填项:
- 或
--amount二者之一--withdraw-all
示例:
bash
node dist/cli.js market-withdraw --amount 0.5
node dist/cli.js market-withdraw --withdraw-allTransaction Behavior
交易行为
- Transactions are built by SDK and executed through
lista-wallet-connectcommand.call - performs simulation by default before requesting wallet signature.
call - If simulation fails, result is returned as error/reverted and no signing request is sent.
- If user rejects in wallet, command returns .
status: "rejected", reason: "user_rejected" - For multi-step operations (approve + action), responses include completed step count and failed/pending step.
- 交易由SDK构建,并通过的
lista-wallet-connect命令执行。call - 命令默认在请求钱包签名前先进行模拟。
call - 如果模拟失败,结果会以错误/回滚形式返回,不会发送签名请求。
- 如果用户在钱包中拒绝,命令会返回。
status: "rejected", reason: "user_rejected" - 对于多步骤操作(授权 + 执行),响应会包含已完成的步骤数,以及失败/待处理的步骤。
Typical Workflows
典型工作流
Vault flow
金库流程
bash
undefinedbash
undefined1) discover
1) 发现金库
node dist/cli.js vaults --chain eip155:56
node dist/cli.js vaults --chain eip155:56
2) select
2) 选择金库
node dist/cli.js select --vault 0xVAULT --wallet-topic <topic> --wallet-address 0xADDR
node dist/cli.js select --vault 0xVAULT --wallet-topic <topic> --wallet-address 0xADDR
3) operate
3) 执行操作
node dist/cli.js deposit --amount 1
node dist/cli.js withdraw --amount 0.5
undefinednode dist/cli.js deposit --amount 1
node dist/cli.js withdraw --amount 0.5
undefinedMarket flow
市场流程
bash
undefinedbash
undefined1) discover
1) 发现市场
node dist/cli.js markets --chain eip155:56
node dist/cli.js markets --chain eip155:56
2) select
2) 选择市场
node dist/cli.js select --market 0xMARKET --wallet-topic <topic> --wallet-address 0xADDR
node dist/cli.js select --market 0xMARKET --wallet-topic <topic> --wallet-address 0xADDR
3) operate
3) 执行操作
node dist/cli.js supply --amount 2
node dist/cli.js borrow --simulate
node dist/cli.js borrow --amount 0.01
node dist/cli.js repay --simulate --amount 0.01
node dist/cli.js repay --amount 0.01
node dist/cli.js market-withdraw --amount 1
undefinednode dist/cli.js supply --amount 2
node dist/cli.js borrow --simulate
node dist/cli.js borrow --amount 0.01
node dist/cli.js repay --simulate --amount 0.01
node dist/cli.js repay --amount 0.01
node dist/cli.js market-withdraw --amount 1
undefinedSecurity Checklist
安全检查清单
- Confirm token symbol and amount with user before any state-changing action.
- Confirm chain (vs
eip155:56) before sending tx.eip155:1 - Prefer before first borrow on a market.
borrow --simulate - Treat as normal user decision, not protocol failure.
user_rejected
- 在执行任何状态变更操作前,与用户确认代币符号和金额。
- 在发送交易前,与用户确认链(vs
eip155:56)。eip155:1 - 在首次对某市场借款前,优先使用进行模拟。
borrow --simulate - 将视为用户的正常决策,而非协议失败。
user_rejected