Skip to content

feat: add hodlmm-arb-executor (BFF Skills Comp Day 20 winner by @ronkenx9)#326

Merged
biwasxyz merged 2 commits into
aibtcdev:mainfrom
diegomey:bff-comp/hodlmm-arb-executor
Apr 21, 2026
Merged

feat: add hodlmm-arb-executor (BFF Skills Comp Day 20 winner by @ronkenx9)#326
biwasxyz merged 2 commits into
aibtcdev:mainfrom
diegomey:bff-comp/hodlmm-arb-executor

Conversation

@diegomey
Copy link
Copy Markdown
Contributor

hodlmm-arb-executor

Author: @ronkenx9 (Parallel Owl (ERC-8004 ID #354, SP1KNKVXNNS9B6TBBT8YTM2VTYKVZYWS65TTRD430))
Competition PR: BitflowFinance/bff-skills#379
PR Title: [AIBTC Skills Comp Day 20] feat(hodlmm-arb-executor): autonomous HODLMM arb position manager


This skill was submitted to the AIBTC x Bitflow Skills Pay the Bills competition, reviewed by judging agents and the human panel, and approved as a Day 20 winner.

Frontmatter has been converted to the aibtcdev/skills metadata: convention. Command paths updated to match this repo root-level skill layout.

Files

  • hodlmm-arb-executor/SKILL.md — Skill definition with AIBTC-format frontmatter
  • hodlmm-arb-executor/AGENT.md — Agent behavior rules and guardrails
  • hodlmm-arb-executor/hodlmm-arb-executor.ts — TypeScript implementation

Attribution

Original author: @ronkenx9. The metadata.author field in SKILL.md preserves their attribution permanently.


Automated by BFF Skills Bot on merge of PR #379.

Copy link
Copy Markdown
Contributor

@arc0btc arc0btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as Arc (arc0.btc) — run sBTC/STX positions on Bitflow daily; the XYK vs HODLMM spread is a real arbitrage signal.

Verdict: Approve

Sophisticated and disciplined design. The three-source preflight (Pyth + Hiro XYK + Bitflow DLMM), confidence buffer requirement, and hard sats cap show careful thinking about what can go wrong in autonomous execution.

What's good:

  • --confirm required for all writes — correct gate
  • PREFLIGHT_FAILED when any data source is unreachable — no guessing spreads from partial data
  • Oracle confidence buffer (profitable requires net spread > oracle confidence noise) — prevents filling at noise not signal
  • COOLDOWN_ACTIVE stamped only when commands were actually emitted — no-op runs don't consume the cooldown window. This is the right behavior.
  • 2-hour max hold — prevents stale LP exposure on illiquid pairs
  • On-chain proof provided with a real txid and post-conditions — verifiable

[question] --max-sats flag and the hardcoded cap:
AGENT.md says "hardcoded 100_000 sat limit — not just documentation." But SKILL.md shows [--max-sats 100000] as a flag. Can the flag be used to reduce the cap (e.g., --max-sats 10000)? Or only to set it up to the hardcoded limit? Clarifying whether --max-sats is a reduce-only floor would prevent agent confusion. If users can pass --max-sats 999999, that would contradict the AGENT.md guarantee.

[nit] Exit trigger "spread reversal":
The watch logic monitors for exit on spread reversal. What's the threshold? If you entered at 1.9% gross spread, does any negative spread trigger exit, or is there a minimum reversal threshold to avoid closing on noise? This matters for P&L on positions held through brief spread compression.

Solid write skill with real operational proof.

@ronkenx9
Copy link
Copy Markdown
Contributor

ronkenx9 commented Apr 20, 2026

@BigMacbtc5
@diegomey waiting on clearance for this skill to merge

@ronkenx9
Copy link
Copy Markdown
Contributor

@arc0btc @Rapha-btc @diegomey waiting on merge

@macbotmini-eng
Copy link
Copy Markdown
Contributor

macbotmini-eng commented Apr 21, 2026

Tip

🚩 This is the main thread — the code fix lands here. The fix lands upstream, via a direct PR you own against aibtcdev/skills:main. This is the established pattern for post-audit fixes on bff-skills winners (precedents: #287→#320 and #307→#308). Exact gh/git commands are in the "How to land the code fix" section below. Copies of this post also appear on bff-skills#222 and bff-skills#379 so anyone following those threads sees the same story, but nothing actually happens on those threads — they're just breadcrumbs pointing back here.


Important

Status update — 2026-04-21: This PR was merged by @biwasxyz at 2026-04-21T16:52:01Z. The audit findings (a)(b)(c) below were NOT applied in the merged code — the .ts on aibtcdev/skills:main matches the submitted version byte-for-byte (only the CI metadata flip on SKILL.md landed pre-merge). See the post-merge follow-up comment for the current outstanding-items list and the next-step instructions for @ronkenx9. Payment remains on hold until the three items land.


Hi @ronkenx9 — thanks for the work on hodlmm-arb-executor.

cc @TheBigMacBTC @diegomey @macbotmini-eng @aibtcdev — on-thread for decision-chain visibility.


We've completed a full on-chain audit of the skill's claimed behavior against the Parallel Owl wallet (SP1KNKVXNNS9B6TBBT8YTM2VTYKVZYWS65TTRD430), and three gaps need to close before the $100 BTC prize ships.

Warning

(a) Bin-label fix on hodlmm-arb-executor.ts lines 370-374. The Leg 2 bitflow_hodlmm_add_liquidity MCP command puts the sBTC value in xAmount at activeBinOffset: 1. For pool dlmm_6 (tokenX=STX, tokenY=sBTC), sBTC is Y. Above-active bins hold Y only, so the positioning (offset +1) is correct — the bug is the label. Fix: set xAmount: "0" and yAmount: String(satsCapped), keep activeBinOffset: 1. Plus the CI metadata flip (user-invocable: "true""false") required by the validator.

Warning

(b) Fee-math fix to use live per-direction + variable fees from pool state, not static estimates, when deciding GO/NO-GO on an arb cycle. Static fee math can greenlight "profitable" arbs that are negative-PnL net of actual fees — particularly in exactly the high-volatility moments arb opportunities appear and variable fees spike. Post-conditions protect against single-swap loss but do not protect against a losing cycle where each leg individually satisfies its post-condition.

Warning

(c) A full 4-leg on-chain proof cycle. Your SKILL.md currently cites one successful on-chain transaction — the XYK entry swap a343883… from 2026-04-07 (Leg 1). That proves the entry swap works. It does NOT prove the HODLMM portion — which is the value proposition of hodlmm-arb-executor. Legs 2, 3, 4 (DLMM add-liquidity, DLMM withdraw-liquidity, XYK exit swap) have never executed on Parallel Owl; the 10,064 sats of sBTC from the entry swap are still sitting unused in the wallet 14 days later. Full proof = 4 successful transactions, same wallet, in temporal sequence, amounts chained (Leg 1's output ≈ Leg 2's input; Leg 3's output ≈ Leg 4's input), within a coherent timing window.

Important

Payment is on hold until all three are resolved. The skill stays merged in both repos while this resolves — this is purely about the prize. Details below: every requirement is traceable, every ask includes the exact GitHub workflow.


Continuity with the existing Next Steps

@TheBigMacBTC's 2026-04-14 Day 20 Winner Next Steps on bff-skills#222 set the original payment path:

"Step 3 — Claim Prize: Complete step 1 and 2 + once your skill is merged to AIBTC Repo, the prize will be sent out."

Steps 1 + 2 are complete — you opened bff-skills#379 and tagged the admins. @diegomey confirmed the merge-gated payment flow on bff-skills#379 2026-04-15:

"Please follow the AIBTC Skill Repo #326

  • make sure it gets cleared and merged and prize will follow."

That path stands. The on-chain audit completed since then adds one pre-merge gate to Step 3: the 4-leg proof of execution (and the associated code fix). Once upstream merge happens AND the proof is demonstrated, the $100 BTC ships as originally committed.

What the skill says it does

Quoting skills/hodlmm-arb-executor/SKILL.md lines 16–18 verbatim:

"Detects price spreads between Bitflow XYK pool and HODLMM (DLMM) for sBTC/STX, then executes LP-based arb via MCP command objects. Entry: swap STX→sBTC on XYK (buy cheap), deposit sBTC to DLMM bins as LP (capture premium). Exit: withdraw LP from DLMM, swap sBTC→STX. Exit triggers: spread reversal or 2-hour max hold."

That's a four-leg cycle. For each leg the skill emits an MCP command; the agent framework submits the transaction. Our bar is that if the skill claims leg X, there has to be a tx on mainnet demonstrating leg X.

What's been proven on-chain

Leg Expected Evidence
1 — Entry XYK swap (STX→sBTC) SM1793C4R5PZ4NS4VQ4WMP7SKKYVH8JZEWSZ9HCCR.xyk-core-v-1-2::swap-y-for-x from Parallel Owl, status success https://explorer.hiro.so/txid/a34388332765330ff0299e598757078c7512c0db8dfd7dd96737b6ba9753e424?chain=mainnet(ok u10064) on 2026-04-07T20:32Z
2 — DLMM add-liquidity-simple on dlmm-pool-stx-sbtc-v-1-bps-15 contract call from Parallel Owl, status success NO EVIDENCE
3 — DLMM withdraw-liquidity contract call from Parallel Owl, status success NO EVIDENCE
4 — Exit XYK swap (sBTC→STX) SM1793C4R5PZ4NS4VQ4WMP7SKKYVH8JZEWSZ9HCCR.xyk-core-v-1-2::swap-x-for-y from Parallel Owl, status success NO EVIDENCE

Full wallet transaction history (9 txs, fits in one Hiro page): 2 STX funding transfers, 2 identity-registry-v2 registrations, 1 STX top-up, 3 abort_by_post_condition XYK swap attempts, and the 1 successful swap above. No DLMM contract calls ever. The 10,064 sats of sBTC the wallet received on 2026-04-07 has not moved — the wallet has been dormant for 14 days.

That means Leg 1 is demonstrated and Legs 2–4 (the "HODLMM" part of "hodlmm-arb-executor") are code-only and unverified on-chain. The "Live ... full pipeline demonstrated against mainnet" claim in SKILL.md §On-chain proof is, strictly, true for the entry XYK swap only.

On composition — preempting the "but it's just MCP orchestration" framing

We understand hodlmm-arb-executor is a composed skill. Quoting your own 2026-04-07T16:00:20Z comment on bff-skills#222:

"execute --confirm emits MCP command objects to stdout — it does not submit transactions directly."

The agent runtime submits the txs; your skill emits the commands. That's a legitimate architecture and it's explicitly allowed. It does NOT change the proof bar, for four reasons:

  1. The individual MCP tools being battle-tested separately does not prove the 4-leg sequence composes end-to-end. Nonce sequencing, amount propagation between legs, post-condition coherence across legs, timing, and mid-cycle error recovery are all properties of the composition, not of the primitives.
  2. Your caller emits arguments, and arguments can be wrong. Our audit found that for pool dlmm_6 (SM1FKX...dlmm-pool-stx-sbtc-v-1-bps-15), your Leg 2 command places sBTC as xAmount at activeBinOffset: +1 (above active bin). The pool's X token is STX, not sBTC, and bins above active hold Y only. The underlying bitflow:add-liquidity-simple tool being correct for OTHER callers does not prove your caller passes correct args. If this is what runs, Leg 2 likely aborts.
  3. The composition is what's being paid for. $100 BTC is the reward for a working autonomous arbitrage skill, not for emitting MCP JSON that delegates to other skills. The composition itself needs to be demonstrably operational.
  4. Whatever layer submits the tx, the resulting on-chain fingerprint is the same: 4 txs from the agent's wallet in sequence. That fingerprint does not exist. The absence of Legs 2–4 on Parallel Owl is direct evidence that the composition — however well-designed — has never run to completion on mainnet.

So "my skill composes already-proven primitives" is heard and acknowledged. The ask is the same: run the composition end-to-end, and show us the 4 transactions that prove it completed.


Additional concerns (non-blockers, surfaced for completeness)

Two more items the audit noted. Neither is merge-gated — listed here so the full audit is visible.

Note

10-minute cooldown between arb fires vs ~15-19s data-freshness on DLMM quotes. The skill under-polls by a factor of ~40× relative to what Bitflow serves fresh. Execution when the skill does fire is correct; it just fires rarely. Missed-opportunity cost, not a bug.

Note

--max-sats default cap ($85-ish sats range) vs Bitflow MEV's ~$50 atomic-single-AMM pattern. Your chosen risk cap is larger than Bitflow's own MEV engine uses — reasonable for an agent-driven (non-atomic) arb that can't compose in a single tx, but larger than Bitflow's in-house reference. Product choice; flagged for awareness.

How to land the code fix — GitHub mechanics

The fix lands upstream, via a direct PR you own against aibtcdev/skills:main. This is the established pattern for post-audit fixes on bff-skills winners — two canonical precedents in this same competition:

Precedent 1 — Day 8 zest-auto-repay (@azagh72-creator): @diegomey's close comment on aibtcdev/skills#287 2026-04-15T00:39:00Z:

"New PR resubmitted to BFF SKILL Repo - so closing this one for now. #320 Ready for re-review."

Replacement #320 was a direct PR from azagh72-creator/skills:fix/zest-auto-repay-review against aibtcdev/skills:main. @whoabuddy merged it on 2026-04-15.

Precedent 2 — Day 12 hodlmm-range-keeper (@tearful-saw): @whoabuddy's close comment on aibtcdev/skills#307 2026-04-08T00:07:37Z:

"Closing in favor of #308, which includes arc0btc review fixes and is based on main. Thank you @tearful-saw for the submission and the cleanup!"

Replacement #308 was a direct PR from tearful-saw/skills:fix/hodlmm-range-keeper-review. Merged 2026-04-08.

@diegomey's policy statement on aibtcdev/skills#307 2026-04-07T20:08:49Z:

"Feel free to submit final version here. We'll be using AIBTC merged skills as final source of truth."

Once your direct PR is opened, @diegomey (or an AIBTC maintainer) will close the current aibtcdev/skills#326 as superseded with a backlink to your new PR — same pattern as above. The BitflowFinance/bff-skills staging version (#222) is a competition judging record and doesn't need changes.

Fix (a) — bin-label + CI metadata

Bin-label correction on hodlmm-arb-executor.ts lines 370-374, shown as a diff:

  bins: JSON.stringify([
    {
-     activeBinOffset: 1,
-     xAmount: String(satsCapped),
-     yAmount: "0",
+     activeBinOffset: 1,           // keep as-is (above active is correct for Y-only deposit)
+     xAmount: "0",                 // was: String(satsCapped)
+     yAmount: String(satsCapped),  // was: "0"
    },
  ]),

CI metadata flip in hodlmm-arb-executor/SKILL.md:

-user-invocable: "true"
+user-invocable: "false"

Fix (b) — fee-math

Replace static fee estimates in the GO/NO-GO profitability check with live per-direction + variable fees read from pool state. Exact lines to be identified by the author; searchable patterns in hodlmm-arb-executor.ts: fee, estimate, profitability, gross, net. The live values are available on the pool's state — pull them at decision time, not at build time.

Note

(c) is not a code change — it's the 4-leg on-chain proof cycle run from Parallel Owl AFTER the PR merges. See "What we're asking for" section below.


Click to expand — exact `gh`/`git` commands to open the direct PR
gh repo fork aibtcdev/skills --clone --fork-name skills-fix
cd skills-fix
git checkout -b fix/hodlmm-arb-executor-review main

# Pull Diego's current #326 skill code as your starting point so you're
# not reverse-engineering from memory:
git remote add diegomey https://github.com/diegomey/skills.git
git fetch diegomey bff-comp/hodlmm-arb-executor
git checkout diegomey/bff-comp/hodlmm-arb-executor -- hodlmm-arb-executor/

# Apply fixes (a) + (b) per the audit:
# Fix (a) — bin-label fix in hodlmm-arb-executor/hodlmm-arb-executor.ts
#           at lines 370-374 (see diff above), plus
#           hodlmm-arb-executor/SKILL.md metadata flip
#           user-invocable: "true" -> "false".
# Fix (b) — replace static fee estimates in hodlmm-arb-executor.ts
#           with live per-direction + variable fees from pool state.
vim hodlmm-arb-executor/hodlmm-arb-executor.ts
vim hodlmm-arb-executor/SKILL.md

git add hodlmm-arb-executor/
git commit -m "feat: add hodlmm-arb-executor (Day 20 winner by @ronkenx9) — supersedes #326 with audit fixes (a) + (b)"
git push -u origin fix/hodlmm-arb-executor-review

# Compose your PR body per the "PR body — required breadcrumb contents"
# rules in the section above, save it to /tmp/pr-body.md, then:
gh pr create --repo aibtcdev/skills --base main \
  --title "feat: add hodlmm-arb-executor (BFF Skills Comp Day 20 winner by @ronkenx9) — supersedes #326" \
  --body-file /tmp/pr-body.md

Run the 4-leg proof cycle AFTER your direct PR is open and CI-clean — running it against the un-fixed code just wastes your STX on an avoidable Leg 2 abort.

PR body — required breadcrumb contents

Your new PR's body must include the following sections so anyone landing on your PR can trace the full story without scrolling back through this thread. You compose the body yourself; these are the rules for what it must contain:


  1. Context statement. One paragraph stating that this PR supersedes the current upstream promotion PR on aibtcdev/skills and links to the main audit comment on that thread.

  2. Competition lineage — a bulleted list in chronological order linking to each step in your submission history:

    • (i) your original staging PR on BitflowFinance/bff-skills that received the winner trophy;
    • (ii) your staging resubmission, if you made one after the trophy;
    • (iii) the upstream promotion PR being superseded by THIS PR;
    • (iv) the main audit comment on the flagship thread.
  3. What changed vs the superseded PR. A summary of the audit fixes applied, using the exact (a)/(b)/(c) labels from the flagship audit. For each applied fix, state the specific file path and line range touched plus a one-sentence description matching the audit language.

  4. Fix (c) placeholder. A statement that the 4-leg on-chain proof cycle will follow in a subsequent comment on this PR per audit requirements, with the proof format as described on the flagship thread.

  5. Reviewer cc. Tag @TheBigMacBTC, @diegomey, @macbotmini-eng, @aibtcdev, @arc0btc per the Next Steps action list on the flagship thread.


Important

Compose your PR body following these rules. Save it to a file (e.g. /tmp/pr-body.md) and use --body-file /tmp/pr-body.md in the gh pr create command below so the full breadcrumb is part of the PR body itself.

Issue linking — standing rule for this repo (FYI, not blocking you)

Our BitflowFinance/bff-skills issues tab is a skill-ideas forum. When a staging PR resolves a specific skill-idea issue, use GitHub's Closes #NNN or Fixes #NNN syntax in the PR body so the issue auto-closes on merge. hodlmm-arb-executor predates the current system (the 11 skill-direction issues were posted 2026-04-16, your original PR merged 2026-04-14), so there's no issue to link here. Noting for future submissions.

What we're asking for

Please run a complete cycle on Parallel Owl (or on a cryptographically linked alternate wallet — see below) and publish the four tx hashes. The requirement is one success tx per leg, all from the same wallet, within a coherent timing window, with execute --confirm output published alongside as the causal source. Please use this format:

| Leg | Tx | Contract::Function | Wallet | Amount | Status |
|---|---|---|---|---|---|
| 1 | <full hiro URL> | SM1793...xyk-core-v-1-2::swap-y-for-x | SP1KNK...RD430 | <µSTX> → <sats> | success |
| 2 | <full hiro URL> | SM1FKX...dlmm-liquidity-router-v-1-1::<fn> | SP1KNK...RD430 | <sats> into dlmm_6 | success |
| 3 | <full hiro URL> | SM1FKX...dlmm-liquidity-router-v-1-1::<fn> | SP1KNK...RD430 | 100% position | success |
| 4 | <full hiro URL> | SM1793...xyk-core-v-1-2::swap-x-for-y | SP1KNK...RD430 | <sats> → <µSTX> | success |

Alternate-wallet proof requires two artifacts: a SIP-018 signed message binding the alternate to ronkenx9, plus an identity-registry-v2::set-wallet tx linking it to Parallel Owl (agent #354). Without both, only the Parallel Owl wallet is accepted.


Important

Timing: payment is held until the fix + proof land. No specific date — you have until the end of the competition to deliver. If you need to signal progress or a blocker, post a WIP comment on the thread.

Unblock sequence (payment status: on hold):

Payment remains on hold until these conditions are met.

@arc0btc — please validate or invalidate: a fix is being requested (X/Y bin-arg correction + user-invocable flip) and a 4-leg on-chain proof cycle on Parallel Owl is being required before the $100 BTC Day 20 prize ships. Thank you.

@macbotmini-eng
Copy link
Copy Markdown
Contributor

macbotmini-eng commented Apr 21, 2026

Important

Heads-up on migration: when @ronkenx9 opens the direct PR that supersedes this one, this PR closes and the main-thread designation moves to the new PR. A follow-up will post on all three threads with the new URL at that point. Until then, this IS the main thread.


Tip

The action plan for the main thread. This goes with the main audit comment just above. You'll see the same action plan mirrored on the staging threads (bff-skills#222 and bff-skills#379) — but the actual steps happen here on the main thread.


Next Steps — Day 20 hodlmm-arb-executor payment pipeline

Extending @TheBigMacBTC's 2026-04-14 Day 20 Winner Next Steps on bff-skills#222 and @diegomey's 2026-04-15 merge-gated payment confirmation on bff-skills#379, with one pre-merge gate from the on-chain audit.

👉 Full audit, GitHub mechanics, and proof requirements: #326 (comment)


Sequenced action list — who does what, in order

🛠️ highlighted rows = the actual fix + proof actions (the three audit gaps close here). Other rows are admin + payment pipeline.

# Type Owner Action Audit ref
1 🛠️ FIX @ronkenx9 Ship the code fix. Direct PR from your fork to aibtcdev/skills:main with (a) the bin-label correction on dlmm_6 Leg 2 + metadata.user-invocable: "false" and (b) fee-math replacement using live per-direction + variable fees from pool state. Supersedes aibtcdev/skills#326. Exact gh/git commands and the required PR-body breadcrumb content rules are in the main audit comment — compose the body yourself per those rules and use --body-file when opening the PR. (a), (b)
2 ⚙️ admin @diegomey Close aibtcdev/skills#326 as superseded once Ronken's new PR opens. Comment with a backlink. Established pattern on #287→#320 and #307→#308.
3 🛠️ PROOF @ronkenx9 Run the 4-leg on-chain proof cycle on Parallel Owl wallet (SP1KNKVXNNS9B6TBBT8YTM2VTYKVZYWS65TTRD430) after the new PR is open and CI-clean. Post the 4 tx hashes as a table on the new PR in the format given in the main audit comment. (c)
4 ⚙️ merge @whoabuddy / @biwasxyz Merge the new PR once CI green, proof table posted, and @arc0btc has validated. Standard AIBTC registry merge.
5 💰 pay @diegomey Send the Day 20 prize to @ronkenx9 once upstream merge confirms, per the original Day 20 Next Steps.
6 💰 confirm @diegomey Post payment-confirmation comment with TX hash on the merged upstream PR per the canonical payment pipeline.

@aibtcdev — flagging for org visibility.


Important

Payment remains on hold until the conditions above are met.

@arc0btc — please validate or invalidate this sequence.

ronkenx9 and others added 2 commits April 21, 2026 22:12
Submitted by @ronkenx9 (Parallel Owl (ERC-8004 ID aibtcdev#354, SP1KNKVXNNS9B6TBBT8YTM2VTYKVZYWS65TTRD430)) via the AIBTC x Bitflow Skills Pay the Bills competition.

Competition PR: BitflowFinance/bff-skills#379
- hodlmm-arb-executor: user-invocable false (CLAUDE.md rule)
- contract-preflight: replace invalid tags with controlled vocabulary, drop unknown "network" dependency
- stacking-delegation: user-invocable false, add missing AGENT.md frontmatter
- regenerate skills.json

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@biwasxyz biwasxyz force-pushed the bff-comp/hodlmm-arb-executor branch from 5d204ac to 33699f1 Compare April 21, 2026 16:29
Copy link
Copy Markdown
Contributor

@biwasxyz biwasxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and ready to merge.

Changes in this PR:

  • Adds hodlmm-arb-executor skill (BFF Skills Comp Day 20 winner by @ronkenx9) — LP-based sBTC/STX arbitrage on Bitflow HODLMM with simulate/execute/watch subcommands
  • Fixes pre-existing CI validation failures on contract-preflight and stacking-delegation

Review highlights:

  • ✅ Safety: MAX_AUTONOMOUS_SATS=100_000 cap enforced; --confirm gate blocks all writes; cooldown stamped only when commands actually emit (prevents no-op runs from consuming the window)
  • ✅ Correct MCP command emission — skill does not sign itself, outputs instruction objects for the caller
  • ✅ Slippage + post-conditions applied on entry (1.5%) and exit (2%)
  • ✅ Bin-offset state tracking in ~/.hodlmm-arb-executor-state.json
  • Nit (non-blocking): unreachable return; after process.exit(1) at hodlmm-arb-executor.ts:659 and :671

Verdict: MERGE-READY

@biwasxyz biwasxyz merged commit 5472699 into aibtcdev:main Apr 21, 2026
2 checks passed
@macbotmini-eng
Copy link
Copy Markdown
Contributor

macbotmini-eng commented Apr 21, 2026

Hi @ronkenx9 — thanks for the work on hodlmm-arb-executor.

cc @TheBigMacBTC @diegomey @macbotmini-eng @aibtcdev — on-thread for decision-chain visibility.


Post-merge status

This PR was merged on 2026-04-21 by @biwasxyz. The merge-time modifications inside hodlmm-arb-executor/ were the CI metadata flip on SKILL.md (user-invocable: "true""false"); the .ts code on aibtcdev/skills:main matches the submitted version byte-for-byte.

The three audit items from the main audit comment remain outstanding:

  • (a) Bin-label fix on hodlmm-arb-executor.ts lines 370-374. Keep activeBinOffset: 1; swap xAmount / yAmount labels so the sBTC value is in yAmount.
  • (b) Fee-math fix — replace the static FEE_BPS constants with live per-direction + variable fees read from pool state for the GO/NO-GO profitability check.
  • (c) Full 4-leg on-chain proof cycle on Parallel Owl (SP1KNKVXNNS9B6TBBT8YTM2VTYKVZYWS65TTRD430): XYK entry → DLMM add-liquidity → DLMM withdraw → XYK exit, same wallet, temporal sequence, amounts chained.

Important

Payment remains on hold until the three items above land.

@ronkenx9 — open a follow-up patch PR from your fork directly against aibtcdev/skills:main carrying (a) and (b). After it merges, post the (c) proof table as a comment on that patch PR per the audit requirements. PR-body breadcrumb rules + exact gh/git commands are in the main audit comment.

@arc0btc — please validate or invalidate: a follow-up patch PR is being requested and full-cycle on-chain proof on Parallel Owl is still being required per the original audit.

@TheBigMacBTC
Copy link
Copy Markdown

From @arc0btc | #350 (review)

All four blocking items from the CHANGES_REQUESTED review are now addressed:

  • [blocking] Router surface coverage test — static fixture of all 8 verified dlmm-swap-router-v-1-1 entrypoints; fails loudly on drift. Correct approach.
  • [blocking] 429 partial-result contract test — mocked fetch, asserts partial: true + partial_reason: "hiro_rate_limited" + structural integrity of the returned object. Tests pass (2/2).
  • [nit] fetchResult! non-null assertion — replaced with initialized default { txs: [], totalFetched: 0 }.
  • [question] 429 detection via string match.statusCode = 429 stamped on the thrown Error in fetchJson; both catch sites check the property first with the string match as fallback.

The import.meta.main guard on program.parse() and the exports of SWAP_FUNCTIONS/analyzePool are correct — they're required for the test file to import without triggering the CLI.

The outstanding [suggestion] re: denominator semantics is non-blocking and the JSDoc clarification in this PR is sufficient for now.

This closes the #348 acceptance criteria for the hodlmm-flow items. Ready to merge.

Copy link
Copy Markdown
Contributor Author

🏆 Payment confirmed — Day 20 Winner

Congratulations again, Parallel Owl / ronkenx9. hodlmm-arb-executor has completed the AIBTC x Bitflow Skills Competition payment pipeline.

Prize: $100 in BTC / sBTC
Payment: 125,917 sats sBTC
Recipient: SP1KNKVXNNS9B6TBBT8YTM2VTYKVZYWS65TTRD430
Transaction: https://explorer.hiro.so/txid/0x9a6f2d49464354bcd11d4747ed6e892a3ba34415a7fddfd17956e0861813e1ad?chain=mainnet

Thank you for shipping and participating in the competition.

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.

6 participants