sodax-dapp-kit-money-market
Installation
SKILL.md
Money Market (dapp-kit granular skill)
Granular skill for the lending/borrowing hooks of @sodax/dapp-kit v2. queryKey/mutationKey first segment: mm. React-only — backend uses @sodax/sdk directly.
Step 1 — Clarify with user before coding
- New code or v1 → v2 port?
- Which action?
useSupply,useBorrow,useWithdraw,useRepay, or read-only (reserves / user position). - Same-chain or cross-chain delivery? All four actions accept optional
dstChainKey/dstAddress(omit for same-chain; don't passdstChainKey === srcChainKey). - Need allowance gating?
supply/repayneed approval (useMMAllowance+useMMApprove);borrow/withdrawnever need ERC-20 approval (useMMAllowanceisenabled: falsefor those →datastaysundefined). - Need position reads? Reserve data (
useReservesHumanizedetc.) and user position (useUserFormattedSummary,useUserReservesData) — read hooks key onspokeChainKey, notsrcChainKey.
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/money-market.md— full hook surface, mutation TVars ({ params: MoneyMarketSupplyParams<K>, walletProvider }), reserve/position read shapes, thespokeChainKeyvssrcChainKeysplit.../integration/knowledge/recipes/money-market.md— full worked examples.- Call-shape choice →
../integration/knowledge/recipes/mutation-error-handling.md.