Skip to content

[AIBTC Skills Comp Day 29] hodlmm-dca — Recurring DCA into HODLMM DLMM Pools#544

Open
sonic-mast wants to merge 5 commits into
BitflowFinance:mainfrom
sonic-mast:skill/hodlmm-dca
Open

[AIBTC Skills Comp Day 29] hodlmm-dca — Recurring DCA into HODLMM DLMM Pools#544
sonic-mast wants to merge 5 commits into
BitflowFinance:mainfrom
sonic-mast:skill/hodlmm-dca

Conversation

@sonic-mast
Copy link
Copy Markdown

@sonic-mast sonic-mast commented Apr 24, 2026

Skill Submission

Skill name: hodlmm-dca
Category: Trading / LP
HODLMM integration? Yes — queries Bitflow HODLMM DLMM pool API for active bin + token state; outputs bitflow_hodlmm_add_liquidity MCP command for LP deployment

What it does

Recurring Dollar Cost Averaging directly into Bitflow HODLMM DLMM pools. Each run swaps a fixed STX amount via BitflowSDK at the current active-bin price and outputs a ready-to-execute bitflow_hodlmm_add_liquidity command for LP deployment.

Commands: doctor | install-packs | setup | run [--confirm] | status | history | cancel

On-chain proof

TX: a73c08e2...7535e11
Swap 2 STX → sBTC on HODLMM pool dlmm_6 (STX/sBTC, active bin 278)

Doctor output

{"status":"success","action":"doctor","data":{"hodlmmApi":true,"pools":[{"pool_id":"dlmm_6","pair":"STX/sBTC","activeBin":278,"binStep":15}],"walletConfigFound":true,"planExists":true,"safetyLimits":{"maxStxPerRun":500,"maxTotalStx":10000,"minIntervalHours":1,"maxSlippagePct":5,"maxBinSpread":5}}}

Why HODLMM-specific DCA beats token DCA

  • Earns LP fees from the first entry — no waiting to accumulate tokens before deploying
  • Active-bin aware: each swap priced at the live HODLMM pool active bin, not a generic oracle
  • No competing skill combines DCA frequency logic with HODLMM bin-aware LP accumulation

Registry compatibility checklist

  • SKILL.md uses metadata: nested frontmatter
  • AGENT.md starts with YAML frontmatter
  • tags/requires are comma-separated quoted strings
  • user-invocable is "false"
  • entry path is repo-root-relative (hodlmm-dca/hodlmm-dca.ts)
  • metadata.author is "sonic-mast"
  • All commands output JSON to stdout
  • --confirm required for all write operations
  • Commander.js for argument parsing
  • Validation: ✅ 0 errors, 0 warnings

Safety model

Limit Value
Max STX per run 500 STX (hardcoded)
Max total per plan 10,000 STX (hardcoded)
Min interval 1 hour (hardcoded)
Max slippage 5% (hardcoded, PostConditionMode.Deny)
Max bin spread ±5 bins from active (hardcoded)
--confirm gate Required — no silent writes

Built by Sonic Mast@sonic-mast

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

✅ Validation Passed

Skill: hodlmm-dca
Errors: 0
Warnings: 0

All checks passed. This submission is ready for review.

brandonjamesmarshall and others added 4 commits April 24, 2026 16:47
…nce API shape, require→import

- bin_price: use DLMM formula (1 + bin_step/10000)^active_bin, not active_bin*bin_step
- resolveSwapTarget(): dynamically determine non-STX token (STX can be token_x or token_y)
- buildDepositCmd: pass isTargetTokenX flag so amount_x/amount_y are set on correct side
- fetchStxBalance: Hiro API returns flat {balance} not nested {stx:{balance}}; add fallback
- executeSwap: require() → await import() to avoid blocking event loop in async context
- fetchPools: switch to quotes API (active_bin field) with KNOWN_SYMBOLS contract lookup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants