> ## Documentation Index
> Fetch the complete documentation index at: https://docs.li.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Stablecoin 预设

> 面向稳定币的 LI.FI 报价和高级路由默认值。

当你需要 LI.FI 为稳定币转移倾向于收紧滑点并提供可靠路由时，请使用 stablecoin 预设。它专为以下场景而构建：

* 资金库以及资金库再平衡流程。
* 需要可预测执行的大额跨链稳定币转移。
* 需要安全默认值、但在必要时仍能覆盖特定字段的集成。

## 快速开始

1. 在你的报价或高级路由请求中添加 `preset=stablecoin`。
2. 照常发送请求。LI.FI 会先应用预设默认值，然后合并你提供的任何覆盖值。

### 报价请求（GET）

```bash theme={"system"}
curl "https://li.quest/v1/quote?fromChain=1&toChain=137&fromToken=0xA0b86a33E6441b8C4C8C0C4C0C4C0C4C0C4C0C4C&toToken=0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174&fromAddress=0x123...&fromAmount=1000000000000000000&preset=stablecoin"
```

<Info>
  在 [`GET /v1/quote` 参考](/api-reference/get-a-quote-for-a-token-transfer)中查看完整的查询参数结构。
</Info>

### 高级路由（POST）

```bash theme={"system"}
curl -X POST "https://li.quest/v1/advanced/routes" \
  -H "Content-Type: application/json" \
  -d '{
    "fromChainId": 1,
    "toChainId": 137,
    "fromAmount": "1000000000000000000",
    "fromTokenAddress": "0xA0b86a33E6441b8C4C8C0C4C0C4C0C4C0C4C0C4C",
    "toTokenAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
    "options": {
      "preset": "stablecoin"
    }
  }'
```

<Info>
  在 [`POST /v1/advanced/routes` 参考](/api-reference/advanced/get-a-set-of-routes-for-a-request-that-describes-a-transfer-of-tokens)中查看完整的请求体结构。
</Info>

### JavaScript/TypeScript

```ts theme={"system"}
const quoteRequest = {
  fromChain: 1,
  toChain: 137,
  fromToken: "0xA0b86a33E6441b8C4C8C0C4C0C4C0C4C0C4C0C4C",
  toToken: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
  fromAddress: "0x123...",
  fromAmount: "1000000000000000000",
  preset: "stablecoin"
};
```

## 预设默认值

stablecoin 预设配置了以下默认值，以保障执行质量：

* order：`CHEAPEST`
* slippage：`0.001`（0.1%）
* 价格影响上限为 2%
* 精选出适合稳定币转移的桥接短名单
* 默认启用所有交易所

<Info>
  如果你的请求包含冲突的值，则以你的请求为准。例如，当你提供 `denyBridges` 或类似的列表覆盖时，预设的默认值会被你发送的值替换。请在请求负载中包含你想要拒绝的所有桥接（既有的和新的）。
</Info>

这意味着你可以用自己的值覆盖预设默认值，如下所示。

## 覆盖示例

```ts theme={"system"}
const routesRequestWithOverrides = {
  fromChainId: 1,
  toChainId: 137,
  fromAmount: "1000000000000000000",
  fromTokenAddress: "0xA0b86a33E6441b8C4C8C0C4C0C4C0C4C0C4C0C4C",
  toTokenAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
  options: {
    preset: "stablecoin",
    slippage: 0.005, // loosen to 0.5% instead of the default 0.1%
    order: "FASTEST" // override the default CHEAPEST order
  }
};
```

<Info>
  建议集成方按原样使用 stablecoin 预设，仅在绝对必要时才覆盖其值，因为默认选项已针对稳定币转移做了精心优化。
</Info>

要查看你可以覆盖的所有可用选项，请查看[选项 schema](https://github.com/lifinance/types/blob/main/src/api.ts#L116)。

## 工具偏好

在桥接方面，该预设会优先选择对稳定币友好的路径，例如：

* 铸造并销毁（mint-and-burn）流程，如 Glacis、Mayan Swift、Mayan MCTP 和 Celer
* 基于意图和求解器（solver）的方案，如 Eco、Relay、Across 和 Gaszip
* 随着时间推移经过审核并加入的其他工具

## 查询支持的稳定币

稳定币支持由 LI.FI 的代币标签驱动。使用带 `tags` 过滤器的 [`/v1/tokens`](/api-reference/fetch-all-known-tokens) 来确认哪些资产符合条件。

### 所有稳定币

```bash theme={"system"}
curl "https://li.quest/v1/tokens?tags=stablecoin"
```

### 特定链上的稳定币

```bash theme={"system"}
curl "https://li.quest/v1/tokens?chains=ARB&tags=stablecoin"
```

<Info>
  将 `tags` 过滤器与 `chains` 过滤器组合以匹配你的集成需求。需要完整的参数列表？请查看 [`GET /v1/tokens` 参考](/api-reference/fetch-all-known-tokens)。
</Info>

## 相关文档

* [API 预设概述](/api-reference/presets/overview)
* [`GET /v1/quote`](/api-reference/get-a-quote-for-a-token-transfer)
* [`POST /v1/advanced/routes`](/api-reference/advanced/get-a-set-of-routes-for-a-request-that-describes-a-transfer-of-tokens)
