@deepliquidity/curve-math

中文文档
0.1.3发布于 2026/10/13MITTypeScriptES Module零依赖近 30 天下载 2216

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

中文使用文档
文档目录5 节
  1. 安装
  2. 四舍五入
  3. 快开始
  4. 许可证
  5. 链接

@ deep 流动性/ 曲线- math

DEEP — Launch deeper.

App Integration guide API X @LaunchOnDL Telegram @LaunchOnDL

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

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

安装

npm install @deepliquidity/curve-math

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

四舍五入

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

快开始

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程序会拒绝的地方.

许可证

麻省理工学院

网站和应用程序 • 妇女 文档 • 妇女 融合指南 • 妇女 GitHub 图像 • 妇女 博客 • 妇女 状态 • 妇女 页:1 • 妇女 电报

版本与发布记录

@deepliquidity/curve-math 共发布 5 个版本,首次发布于 2026/10/09;过去 12 个月发布了 5 个版本。

版本发布日期距今
0.1.3latest2026/10/131 个月前
0.1.22026/10/131 个月前
0.1.12026/10/091 个月前
0.1.02026/10/091 个月前
0.0.0-stage2026/10/091 个月前

关于 @deepliquidity/curve-math 的常见问题

@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 和提交记录判断。