[AIBTC Skills Comp Day 23] HODLMM Yield Router — Autonomous HODLMM + Zest APY Capital Router#517
[AIBTC Skills Comp Day 23] HODLMM Yield Router — Autonomous HODLMM + Zest APY Capital Router#517Terese678 wants to merge 3 commits into
Conversation
✅ Validation PassedSkill: All checks passed. This submission is ready for review. |
|
@arc0btc @macbotmini-eng, just requesting review on PR #517. CI green, 0 errors. Thank you. |
arc0btc
left a comment
There was a problem hiding this comment.
Good architecture overall — instruction-emission pattern is the right approach for a skills-comp entry, documentation is thorough, and the three-command contract (doctor / status / run) is clean. CI green. Requesting changes on three correctness issues before approve.
[blocking] ROUTER_ADDR uses testnet SM prefix
const ROUTER_ADDR = "SM1FKXGNZJWSTWDWXQZJNF7B5TV5ZB235JTCXYXKD";SM is the Stacks testnet address prefix. Mainnet contracts use SP. The PR description says "Mainnet only" but all routing instructions will reference a testnet contract. Users following the emitted instruction will target a contract that doesn't exist on mainnet. Needs the correct mainnet SP deployer address for dlmm-liquidity-router-v-1-1.
[blocking] APY scaling assumption in fetchHodlmmApyPct
if (apy !== null) return Number(apy) * 100;This assumes the API returns a decimal fraction (e.g., 0.08 → 8%). If the Bitflow API returns a percentage directly (e.g., 8.0 for 8%), this returns 800%, making every Zest comparison look trivial. The field probing covers many aliases but none validate the magnitude. The fallback fee-based calculation (fees24h / tvl * 365 * 100) does not multiply by 100 — the two paths produce APYs on incompatible scales. Recommend: log the raw apy field value during status output so operators can verify the scale against known pool APYs before trusting routing decisions.
[suggestion] Zest deployer address — V1 vs V2
const ZEST_DEPLOYER = "SP2VCQJGH7PHP2DJK7Z0V48AGBHQAW3R3ZW1QF4N";
const ZEST_RESERVE = "pool-0-reserve";SP2VCQJGH... is the Zest V1 deployer. The live Zest V2 deployer is SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7. If pool-0-reserve exists on V1 but the reserve-state interface differs from V2, the liquidity-rate parsing will silently fail and fall back to the hardcoded 4.5%. Since that fallback is below the 2% threshold needed to trigger routing, the router would never move capital to Zest even when it's genuinely paying more. Verify which deployer is intended and document the version explicitly.
[nit] CENTER_BIN_ID and fetchNonce are unused
CENTER_BIN_ID = 500 (line 182) is defined but never referenced — buildSnapshot computes center from actual user positions. fetchNonce is defined but never called (routing is instruction-only, no on-chain execution). Dead code is low risk but worth a cleanup pass.
[nit] doctor balance check passes on empty wallet
const allOk = Object.values(checks).every((v) => v === true || typeof v === "number");stx_balance_ustx = 0 satisfies typeof v === "number" and passes allOk. A wallet with zero balance should fail the doctor since gas cannot be covered. Consider: checks.stx_sufficient = bal >= MAX_GAS_STX * 1_000_000.
Fix the SM address and document the APY scale assumption and this is solid work. The instruction-emission-only design is a good guardrail for a competition entry.
|
@arc0btc I have addressed all three blocking issues fixed. SP mainnet router address corrected, APY scaling fixed with magnitude check (raw > 1 ? raw : raw * 100), Zest V2 deployer updated to SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7. Ready for re-review. |
Closing -- write-skill-in-disguise + malformed router contractHey @Terese678, this PR is being closed. There are 2 specific reasons. They cascade in severity: the first is that the skill claims write behavior in tags + PR body but the code contains zero on-chain write calls, the second is that the core router contract the skill references is malformed and cannot be queried on Hiro mainnet. Each reason has the same shape below: what your PR did, what the rule says, and what you need to do to fix it. Reason 1 — Write-skill-in-disguise.
|
|
Hey — your BFF skills work caught my eye. Heads up: the AIBTC trading comp is live with a thin field (4 agents, 1-2 trades each on the leaderboard). Scoring is unrealized P&L (USD) + volume across allowlisted Bitflow swaps — exactly the surface area BFF skills cover. If your agent is verified on aibtc.com, |
|
Hey @secret-mars, thanks for the heads up. My agent is already verified
on aibtc.com. I'll check the leaderboard and submit a trade. Appreciate you
reaching out.
…On Thu, May 14, 2026 at 3:56 PM Secret Mars ***@***.***> wrote:
*secret-mars* left a comment (BitflowFinance/bff-skills#517)
<#517 (comment)>
Hey — your BFF skills work caught my eye. Heads up: the AIBTC trading comp
is live with a thin field (4 agents, 1-2 trades each on the leaderboard).
Scoring is unrealized P&L (USD) + volume across allowlisted Bitflow swaps —
exactly the surface area BFF skills cover. If your agent is verified on
aibtc.com, competition_submit_trade is the entry point. Plenty of room
while the field is small. — Secret Mars
(SP20GPDS5RYB2DV03KG4W08EG6HD11KYPK6FQJE1)
—
Reply to this email directly, view it on GitHub
<#517 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BTUEFCWT4SLXRW6RMC7IAGD42XNBJAVCNFSM6AAAAACX6UXGQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DINJRHAZTAMZRGM>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Skill Submission
Skill name: hodlmm-yield-router
Category: Yield
HODLMM integration? Yes
What it does
Autonomously monitors a Bitflow HODLMM liquidity position and compares its fee APY against Zest Protocol STX supply APY in real time. Routes capital to whichever protocol is earning more — emitting Zest deposit instructions when Zest pays 2%+ more, and re-entry instructions when HODLMM recovers. Rebalances bins when drift exceeds 5 bins from position center.
On-chain proof
Skill reads live APY data from Zest pool-0-reserve via Hiro read-only API. Doctor and status commands verify all APIs and wallet reachable. Live wallet execution requires WALLET_SECRET and ENCRYPTION_KEY.
Registry compatibility checklist
SKILL.mdusesmetadata:nested frontmatter (not flat keys)AGENT.mdstarts with YAML frontmatter (name,skill,description)tagsandrequiresare comma-separated quoted strings, not YAML arraysuser-invocableis the string"false", not a booleanentrypath is repo-root-relative (noskills/prefix)metadata.authorfield is present with your GitHub username{ "error": "descriptive message" }formatSecurity notes
Writes to chain only via explicit instruction emission. Maximum gas spend enforced at 10 STX per cycle. Never moves capital unless Zest APY exceeds HODLMM by 2%+ threshold. Mainnet only. Clean branch from upstream/main — 3 files only.
Reference
Clean resubmission of #481. Same skill, clean branch, correct validator detection.