feat: add hodlmm-arb-executor (BFF Skills Comp Day 20 winner by @ronkenx9)#326
Conversation
arc0btc
left a comment
There was a problem hiding this comment.
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:
--confirmrequired for all writes — correct gatePREFLIGHT_FAILEDwhen any data source is unreachable — no guessing spreads from partial data- Oracle confidence buffer (
profitablerequires net spread > oracle confidence noise) — prevents filling at noise not signal COOLDOWN_ACTIVEstamped 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.
|
@BigMacbtc5 |
|
@arc0btc @Rapha-btc @diegomey waiting on merge |
|
Tip 🚩 This is the main thread — the code fix lands here. The fix lands upstream, via a direct PR you own against 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 Hi @ronkenx9 — thanks for the work on 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 ( Warning (a) Bin-label fix on 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 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:
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:
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 doesQuoting
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
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 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" framingWe understand
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:
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
How to land the code fix — GitHub mechanicsThe 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:
Replacement #320 was a direct PR from Precedent 2 — Day 12 hodlmm-range-keeper (@tearful-saw): @whoabuddy's close comment on aibtcdev/skills#307 2026-04-08T00:07:37Z:
Replacement #308 was a direct PR from @diegomey's policy statement on aibtcdev/skills#307 2026-04-07T20:08:49Z:
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 metadataBin-label correction on 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 -user-invocable: "true"
+user-invocable: "false"Fix (b) — fee-mathReplace 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 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 PRgh 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.mdRun 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 contentsYour 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:
Important Compose your PR body following these rules. Save it to a file (e.g. 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 What we're asking forPlease 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 Alternate-wallet proof requires two artifacts: a SIP-018 signed message binding the alternate to 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. |
|
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
|
| # | 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.
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>
5d204ac to
33699f1
Compare
biwasxyz
left a comment
There was a problem hiding this comment.
Reviewed and ready to merge.
Changes in this PR:
- Adds
hodlmm-arb-executorskill (BFF Skills Comp Day 20 winner by @ronkenx9) — LP-based sBTC/STX arbitrage on Bitflow HODLMM withsimulate/execute/watchsubcommands - Fixes pre-existing CI validation failures on
contract-preflightandstacking-delegation
Review highlights:
- ✅ Safety:
MAX_AUTONOMOUS_SATS=100_000cap enforced;--confirmgate 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;afterprocess.exit(1)at hodlmm-arb-executor.ts:659 and :671
Verdict: MERGE-READY
|
Hi @ronkenx9 — thanks for the work on cc @TheBigMacBTC @diegomey @macbotmini-eng @aibtcdev — on-thread for decision-chain visibility. Post-merge statusThis PR was merged on 2026-04-21 by @biwasxyz. The merge-time modifications inside The three audit items from the main audit comment remain outstanding:
Important Payment remains on hold until the three items above land. @ronkenx9 — open a follow-up patch PR from your fork directly against @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. |
|
From @arc0btc | #350 (review)
|
|
🏆 Payment confirmed — Day 20 Winner Congratulations again, Parallel Owl / ronkenx9. Prize: $100 in BTC / sBTC Thank you for shipping and participating in the competition. |
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 frontmatterhodlmm-arb-executor/AGENT.md— Agent behavior rules and guardrailshodlmm-arb-executor/hodlmm-arb-executor.ts— TypeScript implementationAttribution
Original author: @ronkenx9. The
metadata.authorfield in SKILL.md preserves their attribution permanently.Automated by BFF Skills Bot on merge of PR #379.