sodax-dapp-kit-dex
Installation
SKILL.md
DEX (dapp-kit granular skill)
Granular skill for the concentrated-liquidity DEX hooks of @sodax/dapp-kit v2. queryKey/mutationKey first segment: dex. Two-step flow: useDexDeposit (spoke asset → hub ERC-4626 pool shares) then useSupplyLiquidity (shares → position). React-only — backend uses @sodax/sdk directly.
Step 1 — Clarify with user before coding
- New code or v1 → v2 port?
- Which operation? Asset deposit/withdraw (
useDexDeposit/useDexWithdraw), supply liquidity (useSupplyLiquidity— mint-new OR increase-existing), decrease (useDecreaseLiquidity), claim fees (useClaimRewards). - Does opening a position require a deposit first? Yes — positions hold hub pool shares; deposit from a spoke before supplying liquidity. UI flows usually combine the two steps.
- Using the param builders?
useCreate*Paramscompute derived params (tick range, ERC-4626 conversions) client-side; spread their result intomutate({ params: { ...result, srcChainKey, srcAddress }, walletProvider }).
Integration workflow (new v2 code)
../integration/knowledge/ai-rules.md— DO / DO NOT (read first).../integration/knowledge/architecture.md— hook shapes,mutateAsyncSafe,unwrapResult, queryKey conventions.../integration/knowledge/features/dex.md— full hook surface, SDK param types, the FLAT-props param builders, position-lifecycle notes.../integration/knowledge/recipes/dex.md— full worked examples.- Call-shape choice →
../integration/knowledge/recipes/mutation-error-handling.md.