# @deepliquidity/curve-math 中文文档

规范地址：https://npmcn.com/package/%40deepliquidity/curve-math/

版本：0\.1\.3
npm 元数据更新时间：2026-10-12T22:47:26.880Z
中文译文更新时间：2026-11-13T05:18:35.600Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40deepliquidity/curve-math
原文对照：https://npmcn.com/package/%40deepliquidity/curve-math/?lang=original
项目主页：https://deepliquidity.fun/
源码仓库：https://github.com/Deep-Liquidity/deep-sdk

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：142 kB，27 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=22
- 运行依赖：0 个
- 首次发布：2026-10-08T20:33:33.431Z
- 最新版本发布：2026-10-12T22:47:25.324Z
- 近 30 天下载量：2216（2026-10-12 至 2026-11-10，npm 官方下载统计）
- 已发布版本数：5（近 12 个月 5 个）

## 中文简介

DEEP连接曲线(深曲线)和DeepSwap常量产品引用的定量整数(BigInt)数学. 镜像 链上 rust 位.

## 安装

```sh
npm install @deepliquidity/curve-math
```

也可以使用：`pnpm add @deepliquidity/curve-math`、`yarn add @deepliquidity/curve-math`、`bun add @deepliquidity/curve-math`

## README

# @ deep 流动性/ 曲线- math

[![DEEP — Launch deeper.](https://raw.githubusercontent.com/Deep-Liquidity/deep-sdk/main/assets/deep-og.png)](https://deepliquidity.fun/)

[![App](https://img.shields.io/badge/App-mainnet-00F0FF?style=for-the-badge&labelColor=0E141A)](https://deepliquidity.fun/) [![Integration guide](https://img.shields.io/badge/Guide-integrators-AEC6FF?style=for-the-badge&labelColor=0E141A)](https://github.com/Deep-Liquidity/deep-sdk/blob/main/docs/INTEGRATORS.md) [![API](https://img.shields.io/badge/API-OpenAPI%203.1-34F6A8?style=for-the-badge&labelColor=0E141A)](https://api.deepliquidity.fun/v1/openapi.json) [![X @LaunchOnDL](https://img.shields.io/badge/X-%40LaunchOnDL-DDE3EC?style=for-the-badge&logo=x&logoColor=white&labelColor=0E141A)](https://x.com/LaunchOnDL) [![Telegram @LaunchOnDL](https://img.shields.io/badge/Telegram-%40LaunchOnDL-34F6A8?style=for-the-badge&logo=telegram&logoColor=white&labelColor=0E141A)](https://t.me/LaunchOnDL)

组合数学( 大缩写) **深处** 连接曲线(深曲线索拉纳方案)和 恒产引出. 它与程序Rust相对应 `math.rs` 位元: 两个测试套件运行 同样的矢量。 没有浮点,没有依赖.

> DEEP 程序继续运行 **主网** 财务报告和审定财务报表 **脱网**。 。 。 .

## 安装

```bash
npm install @deepliquidity/curve-math
```

仅限无害环境管理,有类型脚本声明. 22号节点或任何现代浏览器捆绑.

## 四舍五入

-   支付金额 **关闭** 给交易商 **下来**· ;
-   交易商必须支付的费用和金额 **内** 圆形 **上来**· ;
-   所以曲线变化无常 `k = virtualSol × virtualToken` 从不减少.

## 快开始

```ts
import { quoteBuyV1, quoteSellV1, depthBps, marketCapLamports } from "@deepliquidity/curve-math";

// `state` and `fees` come from the token's BondingCurve account: decode it with the SDK
// (`decodeBondingCurve`, `curveFees`). Every token keeps the rates it was launched with.
const buy = quoteBuyV1(state, 1_000_000_000n, fees); // 1 SOL budget
buy.solIn; // lamports actually charged (less than the budget when the buy completes the curve)
buy.fees; // { total, protocol, creator }: rounded up, on top of what reaches the curve
buy.routing; // who receives the reward part: the creator or the token's holders
buy.tokensOut; // floor(vToken × net / (vSol + net)), capped at the tokens left
buy.next; // the curve state after the trade

const sell = quoteSellV1(state, 1_000_000n, fees);
sell.solOut; // floor(vSol × tokens / (vToken + tokens)) minus fees rounded up

depthBps(state); // curve progress in basis points of the curve supply (rounded down)
marketCapLamports(state); // fully diluted value at the spot price: not liquidity
```

`quoteBuyV1`编号 :`quoteSellV1` 掷出 `CurveMathError` 带有程序错误名称( i)`ZeroAmount`, (中文(简体) ), `CurveComplete`, (中文(简体) ), `InsufficientReserves`, (中文(简体) ), `SlippageExceeded`, (中文(简体) ), `InvalidFee`, (中文(简体) ), `InvalidParams`, (中文(简体) ), `Overflow`程序会拒绝的地方.

## 许可证

麻省理工学院

## 链接

[网站和应用程序](https://deepliquidity.fun/) • 妇女 [文档](https://docs.deepliquidity.fun/docs) • 妇女 [融合指南](https://github.com/Deep-Liquidity/deep-sdk/blob/main/docs/INTEGRATORS.md) • 妇女 [GitHub 图像](https://github.com/Deep-Liquidity/deep-sdk) • 妇女 [博客](https://blog.deepliquidity.fun/) • 妇女 [状态](https://status.deepliquidity.fun/) • 妇女 [页:1](https://x.com/LaunchOnDL) • 妇女 [电报](https://t.me/LaunchOnDL)

## 常见问题

### @deepliquidity/curve-math 是什么？

DEEP连接曲线\(深曲线\)和DeepSwap常量产品引用的定量整数\(BigInt\)数学\. 镜像 链上 rust 位\.

### 如何安装 @deepliquidity/curve-math？

在项目目录运行 npm install @deepliquidity/curve-math，或使用 pnpm add / yarn add / bun add。

### @deepliquidity/curve-math 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @deepliquidity/curve-math 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @deepliquidity/curve-math 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @deepliquidity/curve-math 可以商用吗？

@deepliquidity/curve-math 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @deepliquidity/curve-math 的下载量有多少？

根据 npm 官方下载统计，@deepliquidity/curve-math 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,216 次，日均约 74 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @deepliquidity/curve-math 还在维护吗？

最新版本 0\.1\.3 发布于 2026/10/13（1 个月前）；至今共发布 5 个版本，其中过去 12 个月发布了 5 个；首次发布于 2026/10/09。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

