lista-lending

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lista Lending Skill (POC)

Lista Lending Skill(POC)

Status: Pre-release (internal only, not in public registry) Agent quick check:
node dist/cli.js version
Agent rebuild:
npm install && npm run build
Execute Lista Lending vault and market operations through
@lista-dao/moolah-lending-sdk
, with transaction sending delegated to
lista-wallet-connect
.
状态: 预发布阶段(仅限内部使用,未纳入公开注册表) Agent快速检查:
node dist/cli.js version
Agent重新构建:
npm install && npm run build
通过
@lista-dao/moolah-lending-sdk
执行Lista Lending金库和市场操作,交易发送委托给
lista-wallet-connect
处理。

Agent 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:
  • lista
    : VIEW report-style lending analytics and summaries
  • lista-lending
    : VIEW/OPERATE lending only (vaults + markets)
  • lista-wallet-connect
    : Wallet operations (connect/sign/transfer)
本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:
  1. Wallet/session/signing issues (
    pair
    ,
    auth
    ,
    sign
    ,
    topic
    ,
    session
    ) →
    lista-wallet-connect
  2. Lending write operations (
    deposit
    ,
    withdraw
    ,
    supply
    ,
    borrow
    ,
    repay
    ,
    market-withdraw
    ) →
    lista-lending
  3. Lending actionable reads (
    holdings
    ,
    vaults
    ,
    markets
    for selection/filtering/follow-up execution) →
    lista-lending
  4. Report/narrative analysis (
    position report
    ,
    risk check
    ,
    daily digest
    , high-level market/vault summary) →
    lista
Ambiguous intent handling:
  • check my positions
    : if user asks for operation follow-up or lending-only detail, use
    lista-lending
    ; otherwise use
    lista
    .
  • market list
    /
    vault list
    : if user needs execution target selection, use
    lista-lending
    ; if user only wants macro overview, use
    lista
    .
运行命令前需遵循以下路由规则:
  1. 钱包/会话/签名问题(
    pair
    auth
    sign
    topic
    session
    )→ 使用
    lista-wallet-connect
  2. 借贷写入操作(
    deposit
    withdraw
    supply
    borrow
    repay
    market-withdraw
    )→ 使用
    lista-lending
  3. 借贷可操作读取(
    holdings
    vaults
    markets
    ,用于选择/筛选/后续执行)→ 使用
    lista-lending
  4. 报告/叙述性分析(
    position report
    risk check
    daily digest
    、高级市场/金库摘要)→ 使用
    lista
模糊意图处理:
  • check my positions
    :如果用户要求后续操作或仅借贷类详情,使用
    lista-lending
    ;否则使用
    lista
  • market list
    /
    vault list
    :如果用户需要选择执行目标,使用
    lista-lending
    ;如果用户仅需宏观概览,使用
    lista

Scope

适用范围

Supported capabilities:
  • Vault:
    vaults
    ,
    select --vault
    ,
    deposit
    ,
    withdraw
  • Market:
    markets
    ,
    select --market
    ,
    supply
    ,
    borrow
    ,
    repay
    ,
    market-withdraw
  • Portfolio:
    holdings
  • Runtime/config:
    config
    ,
    version
Not in scope:
  • CDP operations
  • Non-EVM chains
支持的功能:
  • 金库:
    vaults
    select --vault
    deposit
    withdraw
  • 市场:
    markets
    select --market
    supply
    borrow
    repay
    market-withdraw
  • 投资组合:
    holdings
  • 运行时/配置:
    config
    version
不包含的范围:
  • 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:
  • markets
    command filters them out from list output.
  • select --market
    rejects them with
    unsupported_market_type
    .
  • holdings
    still returns them (for full portfolio visibility) and marks:
    • isSmartLending
    • isFixedTerm
    • isActionable
目前交易操作(
select/supply/borrow/repay/market-withdraw
)不支持的市场类型:
  • SmartLending市场(
    zone === 3
  • 固定期限市场(
    termType === 1
行为表现:
  • markets
    命令会在列表输出中过滤掉这些市场。
  • select --market
    会拒绝这些市场并返回
    unsupported_market_type
  • holdings
    仍会返回这些市场信息(为了完整展示投资组合),并标记:
    • isSmartLending
    • isFixedTerm
    • isActionable

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 entrypoint
Notes:
  • CLI parsing/routing lives in
    src/cli/*
    and keeps
    src/cli.ts
    as the single entrypoint.
  • Read-side querying is split by domain in
    src/api/*
    (
    vault
    ,
    market
    ,
    user
    ).
  • SDK integration is centralized in
    src/sdk/client.ts
    ; market runtime prefetch is in
    src/sdk/market-runtime.ts
    .
  • borrow
    and
    repay
    are split into dedicated
    simulate
    and
    execute
    modules to keep command files small.
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

前置条件

  1. Wallet is paired via
    lista-wallet-connect
    skill.
  2. You have a valid
    wallet-topic
    and
    wallet-address
    .
  3. Node.js version is
    >= 18.0.0
    (recommended
    >= 20
    ).
  4. lista-wallet-connect
    is built (
    skills/lista-wallet-connect/dist/cli.js
    exists).
  5. lista-lending
    is built (
    skills/lista-lending/dist/cli.js
    exists).
  1. 已通过
    lista-wallet-connect
    Skill配对钱包。
  2. 拥有有效的
    wallet-topic
    wallet-address
  3. Node.js版本
    >= 18.0.0
    (推荐
    >= 20
    )。
  4. lista-wallet-connect
    已构建完成(
    skills/lista-wallet-connect/dist/cli.js
    已存在)。
  5. 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
undefined

install 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

输出约定

  • stdout
    : machine-readable JSON (result payload)
  • stderr
    : errors only
  • stdout
    :机器可读的JSON(结果负载)
  • 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
recommended columns:
  • Vault
    ,
    Asset
    ,
    TVL (USD)
    ,
    APY
    ,
    Curator
markets
recommended columns:
  • Collateral
    ,
    Loan
    ,
    LLTV
    ,
    Borrow Rate
    ,
    Liquidity (USD)
holdings
recommended structure:
  • Summary block first: total vault count, total market count, actionable market count, unsupported market count.
  • Vault table columns:
    • Vault
      ,
      Chain
      ,
      Deposited
      ,
      Deposited USD
      ,
      APY
      ,
      Wallet Balance
  • Actionable market table columns:
    • Market
      ,
      Chain
      ,
      Collateral USD
      ,
      Borrowed USD
      ,
      LTV
      ,
      Health
  • Unsupported market table columns (non-technical by default):
    • Market
      ,
      Chain
      ,
      Reason
      ,
      Collateral USD
      ,
      Borrowed USD
Default rule:
  • Use different table layouts for different commands (
    vaults
    ,
    markets
    ,
    holdings
    ); do not reuse holdings layout for vault/market list pages.
  • Do not show
    zone/termType
    in user-facing table unless user explicitly asks for technical details.
  • Do not paste full raw payloads (JSON/RPC internals) in normal user-facing replies.
  • Derive
    Reason
    from flags:
    • isSmartLending => SmartLending
    • isFixedTerm => Fixed-term
Health definition (for market positions):
  • Formula:
    health = LLTV / LTV
    when
    LTV > 0
    ; otherwise
    health = 100
    .
  • Display label suggestion:
    • Healthy
      :
      health >= 1.2
    • Warning
      :
      1.0 <= health < 1.2
    • Risk
      :
      health < 1.0
  • Action hint: if label is
    Warning
    or
    Risk
    , suggest repay/reduce borrow.
对于面向用户的回复,将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

支持的链

  • eip155:56
    (BSC, default)
  • eip155:1
    (Ethereum)
  • eip155:56
    (BSC,默认)
  • eip155:1
    (以太坊)

Command Index

命令索引

  • version
    - show skill version and compatibility hints
  • config
    - read/update RPC settings
  • vaults
    - list vaults with filters
  • markets
    - list markets with filters (SmartLending/fixed-term filtered)
  • holdings
    - query user positions across vault + market
  • select
    - set active vault or market context
  • deposit
    - deposit to selected/explicit vault
  • withdraw
    - withdraw from selected/explicit vault
  • supply
    - supply collateral to selected/explicit market
  • borrow
    - simulate or execute borrow
  • repay
    - simulate or execute repay
  • market-withdraw
    - withdraw supplied collateral from selected/explicit market
  • version
    - 显示Skill版本和兼容性提示
  • config
    - 读取/更新RPC设置
  • vaults
    - 带筛选条件的金库列表
  • markets
    - 带筛选条件的市场列表(已过滤SmartLending/固定期限市场)
  • 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

1)
version

Purpose: Print skill version and dependency constraints.
bash
node dist/cli.js version
用途:打印Skill版本和依赖约束。
bash
node dist/cli.js version

2)
config

2)
config

Purpose: Manage RPC override.
Examples:
bash
undefined
用途:管理RPC覆盖设置。
示例:
bash
undefined

show 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

3)
vaults

Purpose: 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

4)
markets

Purpose: 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,BTCB
Notes:
  • Command filters out SmartLending (
    zone=3
    ) and fixed-term (
    termType=1
    ) markets in output.
  • 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

5)
holdings

Purpose: Query positions by wallet address.
Options:
  • --address <0x...>
    (optional if context already has
    userAddress
    )
  • --scope <all|vault|market|selected>
Examples:
bash
undefined
用途:按钱包地址查询仓位。
选项:
  • --address <0x...>
    (如果上下文已包含
    userAddress
    则可选)
  • --scope <all|vault|market|selected>
示例:
bash
undefined

all 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

6)
select

Purpose: 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
undefined

select vault

选择金库

node dist/cli.js select
--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

select market

选择市场

node dist/cli.js select
--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

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

7)
deposit

Purpose: Deposit vault asset.
Required:
  • --amount
  • plus either selected vault context or explicit
    --vault
    + wallet info
Example:
bash
undefined
用途:向金库存入资产。
必填项:
  • --amount
  • 加上已选中的金库上下文,或明确的
    --vault
    + 钱包信息
示例:
bash
undefined

using 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
undefined
node dist/cli.js deposit
--vault 0xVAULT
--amount 1
--chain eip155:56
--wallet-topic <topic>
--wallet-address 0xYOUR_ADDRESS
undefined

8)
withdraw

8)
withdraw

Purpose: Withdraw vault asset.
Required:
  • one of
    --amount
    or
    --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-all

9)
supply

9)
supply

Purpose: 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 2

10)
borrow

10)
borrow

Purpose: 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
undefined

check 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
undefined
node dist/cli.js borrow --amount 0.01
undefined

11)
repay

11)
repay

Purpose: Repay market debt, or simulate repay impact.
Modes:
  • simulate repay amount:
    --simulate --amount <amt>
  • simulate repay-all:
    --simulate --repay-all
  • execute repay:
    --amount <amt>
    or
    --repay-all
Examples:
bash
undefined
用途:偿还债务,或模拟还款影响。
模式:
  • 模拟还款金额的影响:
    --simulate --amount <amt>
  • 模拟全额还款的影响:
    --simulate --repay-all
  • 执行还款:
    --amount <amt>
    --repay-all
示例:
bash
undefined

simulate 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
undefined
node dist/cli.js repay --amount 0.01 node dist/cli.js repay --repay-all
undefined

12)
market-withdraw

12)
market-withdraw

Purpose: Withdraw market collateral.
Required:
  • one of
    --amount
    or
    --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-all

Transaction Behavior

交易行为

  • Transactions are built by SDK and executed through
    lista-wallet-connect
    call
    command.
  • call
    performs simulation by default before requesting wallet signature.
  • 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
undefined
bash
undefined

1) 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
undefined
node dist/cli.js deposit --amount 1 node dist/cli.js withdraw --amount 0.5
undefined

Market flow

市场流程

bash
undefined
bash
undefined

1) 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
undefined
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
undefined

Security Checklist

安全检查清单

  1. Confirm token symbol and amount with user before any state-changing action.
  2. Confirm chain (
    eip155:56
    vs
    eip155:1
    ) before sending tx.
  3. Prefer
    borrow --simulate
    before first borrow on a market.
  4. Treat
    user_rejected
    as normal user decision, not protocol failure.
  1. 在执行任何状态变更操作前,与用户确认代币符号和金额。
  2. 在发送交易前,与用户确认链(
    eip155:56
    vs
    eip155:1
    )。
  3. 在首次对某市场借款前,优先使用
    borrow --simulate
    进行模拟。
  4. user_rejected
    视为用户的正常决策,而非协议失败。