fix(hodlmm-inventory-balancer): fix abort_by_post_condition + single-skill resubmission [Day 24]#546
Conversation
….prepareSwap for correct FT asset names
The original executeCorrectiveSwap manually built post-conditions by extracting
the FT asset name from the token contract string (.split(".")[1]), which gave the
contract name (e.g. "sbtc-token") instead of the Clarity FT identifier (e.g. "sbtc").
This caused every live swap to abort_by_post_condition.
Fix: replace the manual PC construction with sdk.prepareSwap(), which uses the SDK's
own tokenName field (the correct define-fungible-token identifier) for each FT in the
route. The SDK also re-fetches a fresh quote immediately before broadcast, eliminating
the quote-staleness window between Step 3 (planning) and Step 4 (execution).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Validation PassedSkill: All checks passed. This submission is ready for review. |
|
@TheBigMacBTC — this is the single-skill resubmission of Bundling: this PR now contains exactly one skill directory ( Post-condition fix: the A replacement proof TX with Thank you for the detailed review on #496. |
Summary
Resubmission of
hodlmm-inventory-balanceras a single-skill PR (split from closed PR #496 per reviewer feedback from @TheBigMacBTC).Post-condition fix included (addresses the
abort_by_post_conditionfailure on the cited proof TX).What changed from the closed PR
Root cause of
abort_by_post_condition(original TX0x2130b9c4...)The original
executeCorrectiveSwapbuilt post-conditions manually:The contract name (
sbtc-token) differs from the Clarity FT identifier (sbtc). Every swap aborted because the PC referenced an asset name that doesn't match what the chain actually transferred.Fix
Replaced manual PC construction with
sdk.prepareSwap()(the same pattern used in the provendcaskill). The SDK holds the correcttokenName(thedefine-fungible-tokenidentifier) for every token in its registry and re-fetches a fresh quote right before broadcast — eliminating both the asset-name mismatch and the quote-staleness window.Skill files
skills/hodlmm-inventory-balancer/SKILL.mdskills/hodlmm-inventory-balancer/AGENT.mdskills/hodlmm-inventory-balancer/hodlmm-inventory-balancer.tsFrontmatter validation
Single-skill verification
On-chain proof
A new successful proof TX is pending execution after the PC fix. The original TX
0x2130b9c4b445af6bd1bc7f7a91a6a6d8c4d2753bbd1eee6fce3f411c7fa0d558returnedabort_by_post_condition(as identified by reviewer) — the fix addresses the root cause. A replacement proof TX withtx_status: successwill be submitted and this PR updated before merge review.Wallet:
SP301E0FY52B19281VCHP41SAKKZFR761BMKQH4QEPool:
dlmm_6— STX/sBTCSafety gates (unchanged — reviewer confirmed strongest static-shape in batch)
runwithout--confirm=BALANCE→ dry-runexecuteCorrectiveSwapright before broadcast🤖 Generated with Claude Code