| name | dex-integration |
| description | Integrate new DEX protocols into PTB Builder on Sui. Use for requests like “integrate new DEX”, “add <DEX> protocol support”, “implement <DEX> adapter/manifest”, “extend DEX support”, or mainnet validation/dry-run of Sui Move DEX packages, manifests, L2 adapters, pipeline placeholders, and tests. |
DEX Integration (PTB Builder)
Workflow
Read references/dex-integration.md and follow the phased workflow (Discovery → MVP → Validation → Pitfalls → Completion). Prioritize on-chain RPC verification before writing code.
Repo touchpoints
Use these paths as the default integration map:
src/manifests/<dex>_manifest.json
src/l2/adapters/<dex>.ts
src/types/edge.ts
src/types/intent.ts
src/pipeline/path_to_ptb.ts
src/index.ts
tests/<dex>_offline.test.ts
src/scripts/mainnet_<dex>_swap.ts
docs/<dex>/<dex>_meta.md
Conventions to enforce
- Use lowercase protocol IDs consistently across adapter, manifest, and registry.
- For Sui upgrades, use the original package ID for type prefixes and the latest package ID for Move calls.
- Require correct
initialSharedVersion for all shared objects.
- Implement Standard Swap first; add flash swap/loan only after standard swap is validated.
References
- Read
references/dex-integration.md for RPC commands, templates, and troubleshooting.
- Consult
docs/dex扩展指南.md for repo-specific guidance.
- Use
src/l2/adapter.ts, src/types/manifest.ts, and src/pipeline/path_to_ptb.ts for interfaces and wiring.