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

Aave V3

Aave V3 是一个去中心化借贷协议。Composer 支持跨 Aave V3 市场的存款和取款操作。

同链:USDC → Base 上的 Aave V3

curl -X GET 'https://li.quest/v1/quote?\
fromChain=8453&\
toChain=8453&\
fromToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&\
toToken=AAVE_AUSDC_TOKEN_ADDRESS_ON_BASE&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=1000000'
参数说明
fromChain8453Base
toChain8453Base (同链)
fromToken0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913Base 上的 USDC
toTokenAAAVE_AUSDC_TOKEN_ADDRESS_ON_BASEBase 上的 Aave aUSDC
fromAmount10000001 USDC (6 位小数)

跨链:Ethereum 上的 ETH → Arbitrum 上的 Aave V3

curl -X GET 'https://li.quest/v1/quote?\
fromChain=1&\
toChain=42161&\
fromToken=0x0000000000000000000000000000000000000000&\
toToken=AAAVE_AUSDC_TOKEN_ADDRESS_ON_ARBITRUM&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=100000000000000000'
AAAVE_AUSDC_TOKEN_ADDRESS_ON_BASE 替换为您目标链上 Aave V3 市场的特定 aToken 地址。您可以在 Aave 文档 上找到 aToken 地址。

HyperLend

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

同链:存入 HyperLend

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

Seamless

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

同链:存入 Seamless

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

Maple

Maple 是一个机构借贷协议。Composer 支持存款操作(仅存款)。

同链:存入 Maple

curl -X GET 'https://li.quest/v1/quote?\
fromChain=CHAIN_ID&\
toChain=CHAIN_ID&\
fromToken=SOURCE_TOKEN_ADDRESS&\
toToken=MAPLE_TOKEN_ADDRESS&\
fromAddress=0xYOUR_WALLET_ADDRESS&\
toAddress=0xYOUR_WALLET_ADDRESS&\
fromAmount=AMOUNT_IN_SMALLEST_UNIT'
Maple 仅支持存款操作,无法通过 Composer 取款。

USDai

USDai 是一个收益协议。Composer 支持存款和取款操作。

同链:存入 USDai

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

通用模式

所有借贷配方都遵循相同的模式:
GET /quote
  fromChain  = 源链 ID
  toChain    = 目标链 ID(相同或不同)
  fromToken  = 您起始的代币
  toToken    = 借贷协议代币地址(这会触发 Composer)
  fromAmount = 最小单位的金额
  fromAddress = 您的钱包
  toAddress   = 您的钱包(接收借贷代币)
唯一的 Composer 特定细节toToken 必须是支持的借贷协议的代币地址(例如 Aave 的 aToken)。

下一步