Loading...
Loading...
JingSwap STX↔sBTC cycle monitor and participation agent. Reads live cycle state and prices directly from the Stacks contract via Hiro API and Pyth oracle — no API key required. Outputs PARTICIPATE / MONITOR / WAIT_FOR_DEPOSIT_PHASE / NO_SBTC_AVAILABLE with oracle-vs-DEX discount analysis.
npx skill4agent add aibtcdev/skills jingswap-cycle-agent| Data source | What it reads | Why it matters |
|---|---|---|
| Cycle ID, phase, blocks elapsed, deposits, minimums | Is the cycle in deposit phase? Is sBTC available? |
| Pyth Hermes oracle | BTC/USD and STX/USD live prices | Computes oracle STX/sBTC settlement rate |
| DLMM pool price (1e10 / raw) | Best DEX rate for comparison |
| XYK pool price (raw / 1e8) | Secondary DEX rate cross-check |
faktory-dao-backend.vercel.appx-api-keyanalyzeactiondoctorstatusanalyzeparticipate--dry-runDEPOSIT_READYjingswap_deposit_stxbun run jingswap-cycle-agent/jingswap-cycle-agent.ts doctor{
"result": "ready",
"checks": {
"hiro_contract_api": "ok",
"pyth_hermes_api": "ok"
},
"contract": "SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.sbtc-stx-jing-v2"
}bun run jingswap-cycle-agent/jingswap-cycle-agent.ts status{
"skill": "jingswap-cycle-agent",
"timestamp": "2026-03-29T15:22:18.792Z",
"contract": "SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.sbtc-stx-jing-v2",
"cycle": {
"id": 9,
"phase": "deposit",
"blocks_elapsed": 191,
"sbtc_deposited": "0.01929494 sBTC",
"stx_deposited": "0.00 STX",
"min_stx_deposit": "1.00 STX",
"min_sbtc_deposit": "0.00001000 sBTC"
},
"prices": {
"btc_usd": "66488.42",
"stx_usd": "0.216440",
"oracle_stx_per_sbtc": "307191.64",
"dex_stx_per_sbtc_dlmm": "305922.66",
"dex_stx_per_sbtc_xyk": "305306.01",
"oracle_vs_dex_discount_pct": "-0.394"
},
"summary": "Cycle 9 in deposit phase. Oracle 0.39% MORE EXPENSIVE than DEX."
}bun run jingswap-cycle-agent/jingswap-cycle-agent.ts analyze
bun run jingswap-cycle-agent/jingswap-cycle-agent.ts analyze --min-discount 2.0--min-discount <pct>1.0{
"skill": "jingswap-cycle-agent",
"timestamp": "2026-03-29T15:22:27.573Z",
"contract": "SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.sbtc-stx-jing-v2",
"input": { "min_discount_pct": 1 },
"cycle": {
"id": 9,
"phase": "deposit",
"sbtc_available": "0.01929494 sBTC",
"stx_deposited": "0.00 STX"
},
"pricing": {
"oracle_stx_per_sbtc": "307148.46",
"dex_stx_per_sbtc": "305922.66",
"discount_pct": "-0.401"
},
"action": "MONITOR",
"confidence": "high",
"is_favourable": false,
"rationale": "Oracle rate (307148 STX/sBTC) is 0.40% MORE expensive than DEX (305923 STX/sBTC). Spread does not meet minimum discount threshold of 1%.",
"summary": "MONITOR (high confidence) — cycle 9 (deposit), oracle 0.40% premium vs DEX."
}bun run jingswap-cycle-agent/jingswap-cycle-agent.ts participate --amount-stx 100
bun run jingswap-cycle-agent/jingswap-cycle-agent.ts participate --amount-stx 100 --min-discount 2.0 --dry-run--amount-stx <amount>--min-discount <pct>1.0--dry-run{
"skill": "jingswap-cycle-agent",
"action": "DEPOSIT_READY",
"deposit_params": {
"amount_stx": 100,
"amount_micro_stx": 100000000,
"market": "sbtc-stx",
"cycle": 9
},
"instruction": "Parent agent: call jingswap_deposit_stx with amount=100000000 and market=sbtc-stx to execute this deposit. Confirm before proceeding."
}| Action | Meaning |
|---|---|
| Oracle < DEX by ≥ min-discount — deposit STX to acquire sBTC below market |
| Spread present but below threshold — watch and retry |
| Cycle is in buffer or settle phase — deposits closed |
| No sBTC deposited in current cycle — nothing to acquire |
highmediumlowSPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.sbtc-stx-jing-v2STX/sBTC = 1e10 / dlmmRawSTX/sBTC = xykRaw / 1e8BTC/USD ÷ STX/USD = STX/sBTCSP000000000000000000002Q6VF78{ "error": "descriptive message" }