manifest
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseManifest DEX Integration Guide
Manifest DEX 集成指南
Build trading, routing, portfolio, and frontend integrations on top of Manifest's permissionless orderbook.
在Manifest的无需许可订单簿之上构建交易、路由、投资组合及前端集成。
Overview
概述
Use this skill when the task involves:
- Reading Manifest market state or orderbooks
- Placing, canceling, depositing, or withdrawing via the Manifest SDK
- Choosing between local market balances and global balances
- Handling wrapper setup, seat claims, and wallet-adapter flows
- Understanding ,
Limit,PostOnly,ImmediateOrCancel,Global, andReverseorder typesReverseTight
Load supporting references as needed:
resources/manifest-actions.mdresources/manifest-sdk.mddocs/troubleshooting.mdexamples/read-market/read-market.tsexamples/wallet-order/place-order.tsexamples/global-liquidity/global-order.tsexamples/reverse-liquidity/amm-style-batch.tstemplates/manifest-setup.ts
当任务涉及以下内容时,可使用本技能:
- 读取Manifest市场状态或订单簿
- 通过Manifest SDK下达、取消订单,进行存款或提款操作
- 在本地市场余额与全局余额之间做选择
- 处理包装器设置、席位申领及钱包适配器流程
- 理解、
Limit、PostOnly、ImmediateOrCancel、Global和Reverse订单类型ReverseTight
按需加载配套参考资料:
resources/manifest-actions.mdresources/manifest-sdk.mddocs/troubleshooting.mdexamples/read-market/read-market.tsexamples/wallet-order/place-order.tsexamples/global-liquidity/global-order.tsexamples/reverse-liquidity/amm-style-batch.tstemplates/manifest-setup.ts
Instructions
操作步骤
- Determine whether the task is read-only market access or transaction-building.
- For read-only access, prefer reads or
Market.ManifestClient.getClientReadOnly(...) - For transaction-building, use for signer-controlled flows, or use
getClientForMarket(...)first and thengetSetupIxs(...)for wallet-adapter flows.getClientForMarketNoPrivateKey(...) - Decide whether liquidity should be market-local (wrapper balances plus a market seat) or global (global account plus ).
OrderType.Global - If the task involves recurring two-sided liquidity, evaluate or
Reverseinstead of ordinary limit orders.ReverseTight - For UI/orderbook work, prefer and
bidsL2()for display-ready levels.asksL2() - When documenting or implementing cleanup behavior, distinguish wrapper-level cancels from core-level cancels. does not fully cover all reverse/global edge cases;
cancelAllIx()is the stronger cleanup path.cancelAllOnCoreIx() - State assumptions explicitly:
- cluster
- market address
- trader/signer model
- whether wrapper/global setup already exists
- 判断任务是仅读取市场数据还是需要构建交易。
- 对于仅读取场景,优先使用读取或
Market。ManifestClient.getClientReadOnly(...) - 对于交易构建场景,若为签名者控制的流程,使用;若为钱包适配器流程,先调用
getClientForMarket(...),再使用getSetupIxs(...)。getClientForMarketNoPrivateKey(...) - 决定流动性是采用市场本地模式(包装器余额+市场席位)还是全局模式(全局账户+)。
OrderType.Global - 若任务涉及双向循环流动性,考虑使用或
Reverse订单,而非普通限价订单。ReverseTight - 对于UI/订单簿开发,优先使用和
bidsL2()获取可直接用于展示的档位数据。asksL2() - 当编写文档或实现清理逻辑时,区分包装器层级的取消操作与核心层级的取消操作。无法完全覆盖所有反向/全局订单的边缘情况,
cancelAllIx()是更彻底的清理方式。cancelAllOnCoreIx() - 明确说明假设前提:
- 集群环境
- 市场地址
- 交易者/签名者模型
- 包装器/全局设置是否已完成
Examples
示例
Basic Usage
基础用法
When user asks: "Show the best bid and ask on a Manifest market"
The agent should:
- Use or
Market.loadFromAddress(...)ManifestClient.getClientReadOnly(...) - Read and
bestBidPrice()orbestAskPrice()/bidsL2()asksL2() - Return prices without introducing signing or setup logic
当用户询问:“显示某个Manifest市场的最优买价和卖价”
Agent应执行以下操作:
- 使用或
Market.loadFromAddress(...)ManifestClient.getClientReadOnly(...) - 读取和
bestBidPrice(),或调用bestAskPrice()/bidsL2()asksL2() - 返回价格信息,无需引入签名或设置逻辑
Wallet Trading Flow
钱包交易流程
When user asks: "Place a Manifest order from a browser wallet"
The agent should:
- Call
ManifestClient.getSetupIxs(...) - If setup is needed, create wrapper state and/or claim the seat first
- Then use
ManifestClient.getClientForMarketNoPrivateKey(...) - Build the order instruction with
client.placeOrderIx(...)
当用户询问:“通过浏览器钱包下达Manifest订单”
Agent应执行以下操作:
- 调用
ManifestClient.getSetupIxs(...) - 若需要设置,先创建包装器状态和/或申领席位
- 然后使用
ManifestClient.getClientForMarketNoPrivateKey(...) - 通过构建订单指令
client.placeOrderIx(...)
Global Liquidity Flow
全局流动性流程
When user asks: "Use the same capital across multiple Manifest markets"
The agent should:
- Explain that market-local balances are insufficient for this requirement
- Use global-account setup with
createGlobalAddTraderIx(...) - Deposit via
globalDepositIx(...) - Place orders
OrderType.Global
当用户询问:“在多个Manifest市场中复用同一资金”
Agent应执行以下操作:
- 说明市场本地余额无法满足该需求
- 使用完成全局账户设置
createGlobalAddTraderIx(...) - 通过进行存款
globalDepositIx(...) - 下达类型的订单
OrderType.Global
Reverse Orders
反向订单
When user asks: "Provide recurring liquidity that flips after fills"
The agent should:
- Recommend or
OrderType.ReverseOrderType.ReverseTight - Explain that reverse orders use instead of
spreadBpslastValidSlot - Use when tighter spread precision matters
ReverseTight - Mention that cleanup may require rather than only wrapper-level cancellation
cancelAllOnCoreIx()
Copy-paste oriented examples in this skill:
examples/read-market/read-market.tsexamples/wallet-order/place-order.tsexamples/global-liquidity/global-order.tsexamples/reverse-liquidity/amm-style-batch.ts
当用户询问:“提供成交后自动翻转的循环流动性”
Agent应执行以下操作:
- 推荐使用或
OrderType.ReverseOrderType.ReverseTight - 说明反向订单使用而非
spreadBpslastValidSlot - 当需要更精确的点差控制时,使用
ReverseTight - 提及清理操作可能需要,而非仅依赖包装器层级的取消操作
cancelAllOnCoreIx()
本技能中可直接复制使用的示例:
examples/read-market/read-market.tsexamples/wallet-order/place-order.tsexamples/global-liquidity/global-order.tsexamples/reverse-liquidity/amm-style-batch.ts
Guidelines
指南
- DO: Use before wallet-adapter trading flows.
getSetupIxs(...) - DO: Use for anonymous or pre-setup inspection paths.
getClientReadOnly(...) - DO: Use /
bidsL2()for UI-facing orderbook displays.asksL2() - DO: Separate market-local account logic from global-account logic.
- DO: Mention wrapper state, market seats, and global accounts explicitly when relevant.
- DON'T: Assume a connected wallet already has wrapper state or a market seat.
- DON'T: Treat as equivalent to ordinary market-local orders.
OrderType.Global - DON'T: Use as if it always fully cleans up reverse/global edge cases.
cancelAllIx() - DON'T: Ask for or embed private keys in examples.
- 必须:在钱包适配器交易流程前调用。
getSetupIxs(...) - 必须:对于匿名或前置设置完成后的查询场景,使用。
getClientReadOnly(...) - 必须:面向UI的订单簿展示,使用/
bidsL2()。asksL2() - 必须:区分市场本地账户逻辑与全局账户逻辑。
- 必须:在相关场景下明确提及包装器状态、市场席位及全局账户。
- 禁止:假设已连接的钱包已完成包装器状态设置或拥有市场席位。
- 禁止:将等同于普通市场本地订单。
OrderType.Global - 禁止:认为总能彻底清理反向/全局订单的所有边缘情况。
cancelAllIx() - 禁止:在示例中请求或嵌入私钥。
Common Errors
常见错误
Error: Read only
错误:只读模式
Cause: A write method was called on a read-only client or without a payer/wrapper context.
Solution: Switch to or complete the flow and then use .
getClientForMarket(...)getSetupIxs(...)getClientForMarketNoPrivateKey(...)原因:在只读客户端或无付款人/包装器上下文的情况下调用了写入方法。
解决方案:切换至,或完成流程后使用。
getClientForMarket(...)getSetupIxs(...)getClientForMarketNoPrivateKey(...)Error: Setup still required
错误:仍需设置
Cause: Wrapper creation or market seat claim has not been completed.
Solution: Run the instructions returned by before building normal wrapper-based trading actions.
ManifestClient.getSetupIxs(...)原因:未完成包装器创建或市场席位申领。
解决方案:在构建基于包装器的常规交易操作前,先执行返回的指令。
ManifestClient.getSetupIxs(...)Error: Global order funded incorrectly
错误:全局订单资金配置错误
Cause: The trader is using without a funded global account for the supporting token.
OrderType.GlobalSolution: Run if needed, then , and only then place the global order.
createGlobalAddTraderIx(...)globalDepositIx(...)原因:交易者使用类型订单,但对应代币未配置已充值的全局账户。
OrderType.Global解决方案:若需要,先执行,再调用存款,最后下达全局订单。
createGlobalAddTraderIx(...)globalDepositIx(...)Error: Reverse/global orders remain after cancel-all
错误:执行全量取消后仍存在反向/全局订单
Cause: Wrapper-level cancellation does not fully cover all core-level order states.
Solution: Use when full core cleanup is required.
cancelAllOnCoreIx()原因:包装器层级的取消操作无法覆盖所有核心层级的订单状态。
解决方案:当需要彻底清理核心层级订单时,使用。
cancelAllOnCoreIx()References
参考资料
- Official site:
https://manifest.trade - SDK package:
https://www.npmjs.com/package/@bonasa-tech/manifest-sdk - Source repository:
https://github.com/Bonasa-Tech/manifest - TypeScript client docs:
https://github.com/Bonasa-Tech/manifest/tree/main/client/ts
- 官方网站:
https://manifest.trade - SDK包:
https://www.npmjs.com/package/@bonasa-tech/manifest-sdk - 源码仓库:
https://github.com/Bonasa-Tech/manifest - TypeScript客户端文档:
https://github.com/Bonasa-Tech/manifest/tree/main/client/ts