跳转到主要内容
通过 Composer 存入支持的金库协议的复制粘贴配方。
所有配方都使用 GET /quote 端点。相同的 toToken 地址适用于 POST /advanced/routes 和 LI.FI SDK。完整集成指南请参见 API 集成SDK 集成

Morpho 金库(V1 和 V2)

Morpho 是一个具有优化金库策略的借贷协议。Composer 支持 V1 和 V2 金库。

同链:USDC → Base 上的 Morpho 金库

这是原始 Composer 文档中的示例:将 1 USDC 存入 Base 上的 Morpho 金库。
curl -X GET 'https://li.quest/v1/quote?\
fromChain=8453&\
toChain=8453&\
fromToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&\
toToken=0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=1000000'
参数说明
fromChain8453Base
toChain8453Base (同链)
fromToken0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913Base 上的 USDC
toToken0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34ABase 上的 Morpho 金库代币
fromAmount10000001 USDC (6 位小数)

跨链:Ethereum 上的 ETH → Base 上的 Morpho 金库

跨链 Composer:使用来自 Ethereum 的 ETH 存入 Base 上的 Morpho 金库,全部在单个用户流程中完成。路由引擎自动确定最优路径(跨链、兑换、存款)。
curl -X GET 'https://li.quest/v1/quote?\
fromChain=1&\
toChain=8453&\
fromToken=0x0000000000000000000000000000000000000000&\
toToken=0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=100000000000000000'
跨链 Composer 流程需要通过 GET /status 进行状态轮询。完整执行流程请参见 跨链 Composer 模式

Euler 金库

Euler 是一个借贷协议。Composer 支持存款和取款操作。

同链:存入 Euler 金库

curl -X GET 'https://li.quest/v1/quote?\
fromChain=CHAIN_ID&\
toChain=CHAIN_ID&\
fromToken=SOURCE_TOKEN_ADDRESS&\
toToken=EULER_VAULT_TOKEN_ADDRESS&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=AMOUNT_IN_SMALLEST_UNIT'
EULER_VAULT_TOKEN_ADDRESS 替换为您目标金库的特定 Euler 金库代币地址。您可以在 Euler 应用 上找到金库代币地址。

Felix Vanilla 金库

Felix Vanilla 金库支持存款和取款。

同链:存入 Felix Vanilla 金库

curl -X GET 'https://li.quest/v1/quote?\
fromChain=CHAIN_ID&\
toChain=CHAIN_ID&\
fromToken=SOURCE_TOKEN_ADDRESS&\
toToken=FELIX_VAULT_TOKEN_ADDRESS&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=AMOUNT_IN_SMALLEST_UNIT'

Neverland 金库

Neverland 金库支持存款和取款。

同链:存入 Neverland 金库

curl -X GET 'https://li.quest/v1/quote?\
fromChain=CHAIN_ID&\
toChain=CHAIN_ID&\
fromToken=SOURCE_TOKEN_ADDRESS&\
toToken=NEVERLAND_VAULT_TOKEN_ADDRESS&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=AMOUNT_IN_SMALLEST_UNIT'

Pendle 收益代币

Pendle 实现收益代币化。Composer 支持存款和取款。

同链:存入 Pendle

curl -X GET 'https://li.quest/v1/quote?\
fromChain=CHAIN_ID&\
toChain=CHAIN_ID&\
fromToken=SOURCE_TOKEN_ADDRESS&\
toToken=PENDLE_TOKEN_ADDRESS&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=AMOUNT_IN_SMALLEST_UNIT'

仅存款协议

以下协议仅支持存款(无法通过 Composer 取款): 对于这些协议,使用相同的 GET /quote 模式,将协议的金库/质押代币作为 toToken

通用模式

每个金库存款配方都遵循相同的模式:
GET /quote
  fromChain  = 源链 ID
  toChain    = 目标链 ID(相同或不同)
  fromToken  = 您起始的代币
  toToken    = 金库代币地址(这会触发 Composer)
  fromAmount = 最小单位的金额
  fromAddress = 您的钱包
  toAddress   = 您的钱包(接收金库代币)
唯一的 Composer 特定细节toToken 必须是支持的协议的金库代币地址。其他所有内容都与标准 LI.FI 兑换或跨链请求相同。

下一步