zest-borrow-asset-primitive/SKILL.md
Borrows a selected asset from Zest against existing collateral with explicit confirmation and proof-ready safety checks.
npx skillsauth add aibtcdev/skills zest-borrow-asset-primitiveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
zest-borrow-asset-primitive borrows a selected Zest V2-supported asset against an existing V2 collateral position on Stacks mainnet. It is a primitive write skill: one operator-selected amount, one Zest V2 borrow transaction, and proof-ready JSON output.
The skill is market-aware but not strategy-specific: callers choose --collateral-asset, --borrow-asset, and --amount, and the skill validates those choices against the live Zest registry before planning or broadcasting. It does not supply collateral, swap borrowed assets, run a leverage loop, repay debt, or unwind a position.
Leveraged sBTC workflows need a proven borrow leg before any controller can safely compose borrow, swap, and re-supply steps. This skill isolates the debt-creating action so it can be reviewed, proved, and reused without hiding borrow risk inside a larger strategy.
--confirm=BORROW before broadcast.PostConditionMode.Deny with an asset transfer postcondition for the borrowed asset where expressible.v0-4-market.borrow directly; legacy helper contracts are not the submission target.borrow-helper-v2-1-7 and borrow-helper-v2-1-5 as legacy/non-target paths for this V2 primitive.--wallet.Checks live Zest contract/interface readiness, wallet gas, pending transaction depth, and selected asset support. If asset flags are omitted, doctor uses a baseline supported-asset pair only for dependency readiness; that default pass does not prove readiness for every supported asset pair.
bun run zest-borrow-asset-primitive/zest-borrow-asset-primitive.ts doctor --wallet <stacks-address>
If doctor returns UNSUPPORTED_* for any dependency, stop. Re-verify the Zest contract identifier against live protocol sources or Hiro before planning a borrow.
Reads current collateral/debt state for the selected collateral and borrow assets.
Requires explicit --collateral-asset and --borrow-asset; strategy commands do not infer the market from defaults.
bun run zest-borrow-asset-primitive/zest-borrow-asset-primitive.ts status --wallet <stacks-address> --collateral-asset sBTC --borrow-asset STX
Builds a read-only borrow preview, including contract arguments, postcondition plan, pending depth, current position data, and proof obligations.
Requires explicit --collateral-asset, --borrow-asset, and --amount.
bun run zest-borrow-asset-primitive/zest-borrow-asset-primitive.ts plan --wallet <stacks-address> --collateral-asset sBTC --borrow-asset STX --amount <base-units>
--amount is always in base units for the selected borrow asset. STX is accepted as an operator-facing alias for Zest wSTX, and other supported assets use their live registry token, asset name, LP token, oracle, and decimals.
Rechecks live state, resolves a signer, broadcasts only after explicit confirmation, and returns proof JSON.
Requires explicit --collateral-asset, --borrow-asset, --amount, and --confirm=BORROW.
bun run zest-borrow-asset-primitive/zest-borrow-asset-primitive.ts run --wallet <stacks-address> --collateral-asset sBTC --borrow-asset STX --amount <base-units> --confirm=BORROW
Without --confirm=BORROW, run refuses before signer resolution or transaction construction.
All commands print one JSON object to stdout with this envelope:
{ "status": "success|blocked|error", "action": "doctor|status|plan|run", "data": {}, "error": null }
Success:
{ "status": "success", "action": "plan", "data": {}, "error": null }
Blocked:
{
"status": "blocked",
"action": "run",
"data": {},
"error": {
"code": "CONFIRMATION_REQUIRED",
"message": "This write skill requires explicit confirmation.",
"next": "Re-run with --confirm=BORROW."
}
}
Error:
{ "status": "error", "action": "run", "data": {}, "error": { "code": "ERROR", "message": "...", "next": "Inspect the error and rerun doctor." } }
STX is treated as the Zest wrapped STX asset (wSTX) for the borrow contract.SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.v0-4-market.borrow.ft, amount, receiver, price-feeds; receiver must be an optional principal such as (some --wallet).scaledDebt is index-scaled principal, not the exact repayment amount. Status output includes debt-index fields and estimated current debt when the borrow vault exposes them.Winner of AIBTC x Bitflow Skills Pay the Bills competition. Original author: @macbotmini-eng Competition PR: https://github.com/BitflowFinance/bff-skills/pull/572
development
Web of Trust operations for Nostr pubkeys — trust scoring, sybil detection, trust path analysis, neighbor discovery, follow recommendations, and network health. Free tier (wot.klabo.world, 50 req/day) with paid fallback (maximumsats.com, 100 sats via L402). Covers 52K+ pubkeys and 2.4M+ zap-weighted trust edges. Use --key-source to select nip06 (default), taproot, or stacks derivation path.
data-ai
BTC ordinals marketplace operations via Magic Eden — browse active listings, list inscriptions for sale via PSBT flow, submit signed listings, buy inscriptions, and cancel active listings. BTC ordinals only (not Solana). Mainnet-only.
testing
Pay-per-call access to LunarCrush social and market intelligence (Galaxy Score, AltRank, market cap rank, price, 24h change) via x402 on Stacks. USD-pegged pricing recomputed hourly from live STX/USD. Mainnet endpoint live; testnet supported.
devops
Detects HODLMM LP inventory drift (token-ratio imbalance from one-sided swap flow) and restores the target ratio via a corrective Bitflow swap plus a hodlmm-move-liquidity redeploy, gated by the 4h per-pool cooldown.