[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GSYACSX0NNYJFY110W1YTP":3,"skill-same:01M6GSYACSX0NNYJFY110W1YTP":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6GSYACSX0NNYJFY110W1YTP","recipe-playground-rebalance",null,"Example driver: drive a portfolio-rebalance hypothesis into a recorded session.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fkraken-official-recipe-playground-rebalance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fkraken-official-recipe-playground-rebalance\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30],"playground","recipe","recipe playground rebalance","sessions","hypothesis","session","example","portfolio","drive","kraken","driver","2026-11-10 10:12:30",false,"---\nname: recipe-playground-rebalance\nversion: 1.1.0\ndescription: \"Example driver: drive a portfolio-rebalance hypothesis into a recorded session.\"\nmetadata:\n  openclaw:\n    category: \"recipe\"\n    domain: \"sessions\"\n  requires:\n    bins: [\"kraken\"]\n    skills: [\"kraken-playground\", \"kraken-rebalancing\"]\n---\n\n# Playground: Rebalance\n\n> **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-playground`, `kraken-rebalancing`\n\n> **This recipe is an example, not a boundary.** Adapt its steps to your hypothesis, or write your own driver — see `kraken-playground` → Driving Your Own Hypothesis.\n\nTest a target-allocation rebalancing hypothesis on live prices with no real money, recording the market data, paper trades, and the \"why\" behind each adjustment into one session for later replay and P&L analysis.\n\n## Important\n\nPaper results may overstate live performance: fees and slippage are simulated and there are no partial fills (see `kraken-paper-strategy`). This recipe records a session inside a paper workspace. With that workspace named on every session, balance and order call and checked each round (see Hard Rules), it never places a live order.\n\nEvery number that gates a trade or a skip (`targets`, `threshold_usd`, `drift_pct`) belongs in `--strategy-params` — it's what makes two sessions comparable knob-for-knob. A recurring run adds `rounds` and `interval_s` (see Schedule the Rounds). The values in the Start the Session example are placeholders: a number the operator names (band, threshold, cadence) replaces the example verbatim — params that don't match the mandate record a hypothesis nobody asked to test. Over a long window this recipe is **interventional** — one visit per `interval_s`, paced by the harness (see `kraken-playground` → Running over a Window).\n\n## Quick Start\n\nRebalance a portfolio toward target allocations:\n\n```\nHold a portfolio 50% BTC, 35% ETH, 15% SOL over 24 hours. \nRebalance when any asset drifts more than 5% from target AND the delta exceeds $50. \nCheck every 2 hours. Report final weights and P&L.\n```\n\n## Start the Session\n\nWork inside a paper workspace (create one once: `kraken workspace create rebalance --capital 10000 --mode paper`). Every session, balance and order command below names it with `--workspace rebalance`. An exported `KRAKEN_WORKSPACE` does not reach a later shell, such as a `\u002Floop` fire, and without a workspace `kraken order buy` and `kraken order sell` trade the real account.\n\n```bash\nkraken --workspace rebalance session start \\\n  --symbols BTC\u002FUSD,ETH\u002FUSD,SOL\u002FUSD --channels ticker --to duckdb,jsonl \\\n  --label rebalance-$(date +%Y%m%d-%H%M%S) \\\n  --strategy recipe-playground-rebalance \\\n  --strategy-params '{\"targets\":{\"BTCUSD\":0.50,\"ETHUSD\":0.35,\"SOLUSD\":0.15},\"rounds\":12,\"interval_s\":7200,\"drift_pct\":5,\"threshold_usd\":50}' \\\n  -o json 2>\u002Fdev\u002Fnull &\n\n# The session_started stdout line carries the id: {\"type\":\"session_started\",\"session\":\"s\u003Cn>\",...}\n```\n\nPrint the session id to the user right after starting, and again in the final report — it is the handle for resuming the `\u002Floop`, checking `kraken session show`, and locating the artifacts.\n\n## Schedule the Rounds\n\n`\u002Floop` owns the pacing. Set its interval to `interval_s` and it fires each round on cadence (late under jitter, never early). Parse the interval from the user's request: \"every 2 hours\" to `2h`, \"every 4 hours\" to `4h`, \"every day\" to `24h`.\n\n**The scheduler floor is 60 seconds** (`\u002Floop`, cron, and `ScheduleWakeup` all clamp to a one-minute minimum). `interval_s` must be `>= 60`. If the user asks for a sub-minute cadence, clamp to `60` and tell them — never set a sub-minute `interval_s` and never let the report claim a cadence the harness cannot run.\n\n```\n\u002Floop 2h \"Run one rebalance round for session s\u003Cn> in workspace rebalance per recipe-playground-rebalance\"\n```\n\nDo not re-add an elapsed-time gate inside the round. `\u002Floop` already enforces the spacing. The round cursor lives in the session's typed state cell — a rebalance round writes one decision **per leg**, so the decision log cannot count rounds; the cursor can. Reasons stay narrative (keep \"round N\" in them for the story; nothing parses it). Stop once the cursor reaches `rounds`:\n\n```bash\nROUNDS=12   # the `rounds` you set in --strategy-params\n\n# The trades below are simulated only while rebalance is a paper workspace.\n[ \"$(kraken workspace show rebalance -o json 2>\u002Fdev\u002Fnull | jq -r '.mode')\" = paper ] \\\n  || { echo \"workspace rebalance is missing or not paper; no round runs\" >&2; exit 1; }\n\n# A failed read must end the firing rather than restart at round 1.\nSTATE=$(kraken --workspace rebalance session state get --session s\u003Cn> -o json 2>\u002Fdev\u002Fnull) || exit 1\nLAST_ROUND=$(echo \"$STATE\" | jq '.cursor.round \u002F\u002F 0')\nif [ \"${LAST_ROUND:-0}\" -ge \"$ROUNDS\" ]; then\n  kraken --workspace rebalance session stop -o json 2>\u002Fdev\u002Fnull\n  exit 0\nfi\n# A stopped session refuses the cursor writes below, so trading on would repeat legs.\n[ \"$(kraken --workspace rebalance session show --session s\u003Cn> -o json 2>\u002Fdev\u002Fnull | jq -r '.status')\" = recording ] \\\n  || { echo \"session s\u003Cn> is not recording; no round runs\" >&2; exit 1; }\nROUND=$((LAST_ROUND + 1))\n```\n\nBetween legs, record progress so a crashed firing resumes at the first\nmissing leg instead of re-trading executed ones; completing the round writes\nonly the round (the replace drops `legs_done` automatically):\n\n```bash\nkraken --workspace rebalance session state set --round \"$LAST_ROUND\" --legs-done \"BTC\u002FUSD\" \\\n  --note \"round $ROUND: leg 1 of 3 done\" -o json 2>\u002Fdev\u002Fnull || exit 1   # after each leg\nkraken --workspace rebalance session state set --round \"$ROUND\" -o json 2>\u002Fdev\u002Fnull || exit 1   # round complete\n```\n\nOn a fresh firing, `state get`'s `legs_done` names any half-done round — but\na crash can land between a leg executing and its `legs_done` write, so never\ntrust the cursor alone before re-trading: cross-check the evidence\n(`kraken session decisions`, reasons mentioning the in-flight round) and skip\nany leg that already filled. The cursor is the fast path; the decision log is\nthe truth.\n The first firing is the seed round: every asset is underweight, so it allocates the whole portfolio toward the targets.\n\n## Each Round\n\nOn each firing: READ, THINK, ACT.\n\nREAD: a fresh balance and each symbol's price. Read the balance **every round** — never carry a snapshot across rounds or across trades within a round; each fill mutates cash and holdings.\n\n```bash\nBALANCE=$(kraken --workspace rebalance paper balance -o json 2>\u002Fdev\u002Fnull)\nCASH=$(echo \"$BALANCE\" | jq -r '.balances.USD.available \u002F\u002F empty')\nPRICE_BTC=$(kraken ticker BTCUSD -o json 2>\u002Fdev\u002Fnull | jq -r '.[] | .last_price')   # repeat per symbol\n```\n\n`kraken paper balance` returns `{\"balances\":{\"USD\":{\"total\",\"reserved\",\"available\"},...}}`. Cash is `.balances.USD.available`; a holding is `.balances.\u003CASSET>.total` (0 if the key is absent). Price is the ticker's last-trade close (`.[] | .last_price`).\n\n**Fail loud before any leg trades:** validate the cash figure and EVERY price\nbefore computing deltas — a rebalance acts on several legs, so one silently\nfailed read sizes every order from garbage. On an empty read, note an alert\nand end the firing (the claimed round stays claimed; the next firing retries):\n\n```bash\nif [ -z \"$CASH\" ] || [ -z \"$PRICE_BTC\" ]; then\n  kraken --workspace rebalance session note --kind alert \\\n    --reason \"round $ROUND aborted: READ failed (cash='$CASH' btc='$PRICE_BTC')\" -o json 2>\u002Fdev\u002Fnull\n  exit 0\nfi\n```\n\nTHINK: value the portfolio, then decide each leg.\n- `total_value = cash + Σ(holdings × price)`\n- Per symbol: `value = holdings × price`, `current_pct = value \u002F total_value × 100`, `target_pct = target × 100`, `drift = current_pct − target_pct`, `delta_usd = target_value − value` where `target_value = total_value × target`.\n- A leg needs action only when `|drift| > drift_pct` **AND** `|delta_usd| > threshold_usd`. Otherwise leave it.\n\nACT: **sells before buys.** Execute every overweight leg (`delta_usd \u003C 0`) first so its proceeds land back in cash, then execute the underweight legs. Size each buy against a fee\u002Fslippage reserve so the last leg never rejects: keep the buy cost at or below `available_cash \u002F (1 + fee_rate + slippage_rate)` (defaults 0.0026 fee, 0.0 slippage — read them from `kraken workspace show rebalance` if unsure). Between legs, re-read the balance rather than assuming the pre-trade cash, and skip or shrink a buy the remaining cash can no longer fund.\n\n```bash\n# Overweight — sell the excess first\nkraken --workspace rebalance order sell BTC\u002FUSD \u003Cvolume> --type market \\\n  --reason \"rebalance round N: BTC\u002FUSD weight \u003Ccurrent_pct>% above target \u003Ctarget_pct>%; selling \u003Cvolume>\" \\\n  -o json 2>\u002Fdev\u002Fnull\n\n# Underweight — buy toward target, capped by fee-reserved cash\nkraken --workspace rebalance order buy SOL\u002FUSD \u003Cvolume> --type market \\\n  --reason \"rebalance round N: SOL\u002FUSD weight \u003Ccurrent_pct>% below target \u003Ctarget_pct>%; buying \u003Cvolume>\" \\\n  -o json 2>\u002Fdev\u002Fnull\n```\n\nIf no leg breaches both thresholds, note a single skip:\n\n```bash\nkraken --workspace rebalance session note --kind skip --symbol BTC\u002FUSD \\\n  --reason \"skip round N: all weights within \u003Cdrift_pct>%\u002F$\u003Cthreshold_usd> band\" \\\n  -o json 2>\u002Fdev\u002Fnull\n```\n\nAlways pass the numeric reason so the decision log carries the \"why\" behind every round.\n\n## Stop and Review\n\n```bash\nkraken --workspace rebalance session stop -o json 2>\u002Fdev\u002Fnull\nkraken --workspace rebalance session show -o json 2>\u002Fdev\u002Fnull | jq '.summary'\n\nkraken --workspace rebalance session decisions --session s\u003Cn> -o json 2>\u002Fdev\u002Fnull \\\n  | jq -c '.decisions[] | {kind, symbol, reason, timestamp}'\n```\n\nReport:\n- Final weights vs targets (50\u002F35\u002F15)\n- Number of rebalance trades vs skips\n- Cumulative turnover (fees paid)\n- P&L vs a buy-and-hold baseline\n- Did the `drift_pct`\u002F`threshold_usd` band hold the portfolio?\n\n## Hard Rules\n\n- This recipe records a session inside the paper workspace `rebalance` and never places a live order, because every session, balance and order command passes `--workspace rebalance` and every round exits unless `kraken workspace show rebalance` reports mode `paper`. Drop either and the orders can trade the real account.\n- `\u002Floop` drives the pace and the agent runs each round; the CLI has no scheduler and runs no strategy. The scheduler floor is 60s — no sub-minute cadence.\n- Read a fresh balance every round and after each fill. Never size a trade off a stale snapshot — the seed round alone issues three buys, and a fixed pre-trade cash figure overspends once fees are charged.\n- Sells before buys, and reserve fees on every buy, so a multi-leg round cannot reject its last order after earlier fills were already recorded.\n- Keep every gating number (`targets`, `drift_pct`, `threshold_usd`, `rounds`, `interval_s`) in `--strategy-params` and the arithmetic in `jq`\u002F`bc`, so a rerun on the same tape reproduces the decisions.\n- The session directory (`session.json`, `decisions.jsonl`, and the tape sinks) is owned by the CLI recorder. The agent only **reads** it, and only for the stop-time summary. Never write, edit, or append inside it — every trade and skip goes through `kraken order buy` \u002F `kraken session note`, so the recorder stays the single writer.\n- If you hit a mismatch between what you are trying to do and the CLI's interface or responses — including a mismatch between this skill and the installed CLI version's contract — feel free to submit feedback with `kraken feedback`.\n","# Playground: Rebalance\n\n> **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-playground`, `kraken-rebalancing`\n\n> **This recipe is an example, not a boundary.** Adapt its steps to your hypothesis, or write your own driver — see `kraken-playground` → Driving Your Own Hypothesis.\n\nTest a target-allocation rebalancing hypothesis on live prices with no real money, recording the market data, paper trades, and the \"why\" behind each adjustment into one session for later replay and P&L analysis.\n\n## Important\n\nPaper results may overstate live performance: fees and slippage are simulated and there are no partial fills (see `kraken-paper-strategy`). This recipe records a session inside a paper workspace. With that workspace named on every session, balance and order call and checked each round (see Hard Rules), it never places a live order.\n\nEvery number that gates a trade or a skip (`targets`, `threshold_usd`, `drift_pct`) belongs in `--strategy-params` — it's what makes two sessions comparable knob-for-knob. A recurring run adds `rounds` and `interval_s` (see Schedule the Rounds). The values in the Start the Session example are placeholders: a number the operator names (band, threshold, cadence) replaces the example verbatim — params that don't match the mandate record a hypothesis nobody asked to test. Over a long window this recipe is **interventional** — one visit per `interval_s`, paced by the harness (see `kraken-playground` → Running over a Window).\n\n## Quick Start\n\nRebalance a portfolio toward target allocations:\n\n```\nHold a portfolio 50% BTC, 35% ETH, 15% SOL over 24 hours. \nRebalance when any asset drifts more than 5% from target AND the delta exceeds $50. \nCheck every 2 hours. Report final weights and P&L.\n```\n\n## Start the Session\n\nWork inside a paper workspace (create one once: `kraken workspace create rebalance --capital 10000 --mode paper`). Every session, balance and order command below names it with `--workspace rebalance`. An exported `KRAKEN_WORKSPACE` does not reach a later shell, such as a `\u002Floop` fire, and without a workspace `kraken order buy` and `kraken order sell` trade the real account.\n\n```bash\nkraken --workspace rebalance session start \\\n  --symbols BTC\u002FUSD,ETH\u002FUSD,SOL\u002FUSD --channels ticker --to duckdb,jsonl \\\n  --label rebalance-$(date +%Y%m%d-%H%M%S) \\\n  --strategy recipe-playground-rebalance \\\n  --strategy-params '{\"targets\":{\"BTCUSD\":0.50,\"ETHUSD\":0.35,\"SOLUSD\":0.15},\"rounds\":12,\"interval_s\":7200,\"drift_pct\":5,\"threshold_usd\":50}' \\\n  -o json 2>\u002Fdev\u002Fnull &\n\n# The session_started stdout line carries the id: {\"type\":\"session_started\",\"session\":\"s\u003Cn>\",...}\n```\n\nPrint the session id to the user right after starting, and again in the final report — it is the handle for resuming the `\u002Floop`, checking `kraken session show`, and locating the artifacts.\n\n## Schedule the Rounds\n\n`\u002Floop` owns the pacing. Set its interval to `interval_s` and it fires each round on cadence (late under jitter, never early). Parse the interval from the user's request: \"every 2 hours\" to `2h`, \"every 4 hours\" to `4h`, \"every day\" to `24h`.\n\n**The scheduler floor is 60 seconds** (`\u002Floop`, cron, and `ScheduleWakeup` all clamp to a one-minute minimum). `interval_s` must be `>= 60`. If the user asks for a sub-minute cadence, clamp to `60` and tell them — never set a sub-minute `interval_s` and never let the report claim a cadence the harness cannot run.\n\n```\n\u002Floop 2h \"Run one rebalance round for session s\u003Cn> in workspace rebalance per recipe-playground-rebalance\"\n```\n\nDo not re-add an elapsed-time gate inside the round. `\u002Floop` already enforces the spacing. The round cursor lives in the session's typed state cell — a rebalance round writes one decision **per leg**, so the decision log cannot count rounds; the cursor can. Reasons stay narrative (keep \"round N\" in them for the story; nothing parses it). Stop once the cursor reaches `rounds`:\n\n```bash\nROUNDS=12   # the `rounds` you set in --strategy-params\n\n# The trades below are simulated only while rebalance is a paper workspace.\n[ \"$(kraken workspace show rebalance -o json 2>\u002Fdev\u002Fnull | jq -r '.mode')\" = paper ] \\\n  || { echo \"workspace rebalance is missing or not paper; no round runs\" >&2; exit 1; }\n\n# A failed read must end the firing rather than restart at round 1.\nSTATE=$(kraken --workspace rebalance session state get --session s\u003Cn> -o json 2>\u002Fdev\u002Fnull) || exit 1\nLAST_ROUND=$(echo \"$STATE\" | jq '.cursor.round \u002F\u002F 0')\nif [ \"${LAST_ROUND:-0}\" -ge \"$ROUNDS\" ]; then\n  kraken --workspace rebalance session stop -o json 2>\u002Fdev\u002Fnull\n  exit 0\nfi\n# A stopped session refuses the cursor writes below, so trading on would repeat legs.\n[ \"$(kraken --workspace rebalance session show --session s\u003Cn> -o json 2>\u002Fdev\u002Fnull | jq -r '.status')\" = recording ] \\\n  || { echo \"session s\u003Cn> is not recording; no round runs\" >&2; exit 1; }\nROUND=$((LAST_ROUND + 1))\n```\n\nBetween legs, record progress so a crashed firing resumes at the first\nmissing leg instead of re-trading executed ones; completing the round writes\nonly the round (the replace drops `legs_done` automatically):\n\n```bash\nkraken --workspace rebalance session state set --round \"$LAST_ROUND\" --legs-done \"BTC\u002FUSD\" \\\n  --note \"round $ROUND: leg 1 of 3 done\" -o json 2>\u002Fdev\u002Fnull || exit 1   # after each leg\nkraken --workspace rebalance session state set --round \"$ROUND\" -o json 2>\u002Fdev\u002Fnull || exit 1   # round complete\n```\n\nOn a fresh firing, `state get`'s `legs_done` names any half-done round — but\na crash can land between a leg executing and its `legs_done` write, so never\ntrust the cursor alone before re-trading: cross-check the evidence\n(`kraken session decisions`, reasons mentioning the in-flight round) and skip\nany leg that already filled. The cursor is the fast path; the decision log is\nthe truth.\n The first firing is the seed round: every asset is underweight, so it allocates the whole portfolio toward the targets.\n\n## Each Round\n\nOn each firing: READ, THINK, ACT.\n\nREAD: a fresh balance and each symbol's price. Read the balance **every round** — never carry a snapshot across rounds or across trades within a round; each fill mutates cash and holdings.\n\n```bash\nBALANCE=$(kraken --workspace rebalance paper balance -o json 2>\u002Fdev\u002Fnull)\nCASH=$(echo \"$BALANCE\" | jq -r '.balances.USD.available \u002F\u002F empty')\nPRICE_BTC=$(kraken ticker BTCUSD -o json 2>\u002Fdev\u002Fnull | jq -r '.[] | .last_price')   # repeat per symbol\n```\n\n`kraken paper balance` returns `{\"balances\":{\"USD\":{\"total\",\"reserved\",\"available\"},...}}`. Cash is `.balances.USD.available`; a holding is `.balances.\u003CASSET>.total` (0 if the key is absent). Price is the ticker's last-trade close (`.[] | .last_price`).\n\n**Fail loud before any leg trades:** validate the cash figure and EVERY price\nbefore computing deltas — a rebalance acts on several legs, so one silently\nfailed read sizes every order from garbage. On an empty read, note an alert\nand end the firing (the claimed round stays claimed; the next firing retries):\n\n```bash\nif [ -z \"$CASH\" ] || [ -z \"$PRICE_BTC\" ]; then\n  kraken --workspace rebalance session note --kind alert \\\n    --reason \"round $ROUND aborted: READ failed (cash='$CASH' btc='$PRICE_BTC')\" -o json 2>\u002Fdev\u002Fnull\n  exit 0\nfi\n```\n\nTHINK: value the portfolio, then decide each leg.\n- `total_value = cash + Σ(holdings × price)`\n- Per symbol: `value = holdings × price`, `current_pct = value \u002F total_value × 100`, `target_pct = target × 100`, `drift = current_pct − target_pct`, `delta_usd = target_value − value` where `target_value = total_value × target`.\n- A leg needs action only when `|drift| > drift_pct` **AND** `|delta_usd| > threshold_usd`. Otherwise leave it.\n\nACT: **sells before buys.** Execute every overweight leg (`delta_usd \u003C 0`) first so its proceeds land back in cash, then execute the underweight legs. Size each buy against a fee\u002Fslippage reserve so the last leg never rejects: keep the buy cost at or below `available_cash \u002F (1 + fee_rate + slippage_rate)` (defaults 0.0026 fee, 0.0 slippage — read them from `kraken workspace show rebalance` if unsure). Between legs, re-read the balance rather than assuming the pre-trade cash, and skip or shrink a buy the remaining cash can no longer fund.\n\n```bash\n# Overweight — sell the excess first\nkraken --workspace rebalance order sell BTC\u002FUSD \u003Cvolume> --type market \\\n  --reason \"rebalance round N: BTC\u002FUSD weight \u003Ccurrent_pct>% above target \u003Ctarget_pct>%; selling \u003Cvolume>\" \\\n  -o json 2>\u002Fdev\u002Fnull\n\n# Underweight — buy toward target, capped by fee-reserved cash\nkraken --workspace rebalance order buy SOL\u002FUSD \u003Cvolume> --type market \\\n  --reason \"rebalance round N: SOL\u002FUSD weight \u003Ccurrent_pct>% below target \u003Ctarget_pct>%; buying \u003Cvolume>\" \\\n  -o json 2>\u002Fdev\u002Fnull\n```\n\nIf no leg breaches both thresholds, note a single skip:\n\n```bash\nkraken --workspace rebalance session note --kind skip --symbol BTC\u002FUSD \\\n  --reason \"skip round N: all weights within \u003Cdrift_pct>%\u002F$\u003Cthreshold_usd> band\" \\\n  -o json 2>\u002Fdev\u002Fnull\n```\n\nAlways pass the numeric reason so the decision log carries the \"why\" behind every round.\n\n## Stop and Review\n\n```bash\nkraken --workspace rebalance session stop -o json 2>\u002Fdev\u002Fnull\nkraken --workspace rebalance session show -o json 2>\u002Fdev\u002Fnull | jq '.summary'\n\nkraken --workspace rebalance session decisions --session s\u003Cn> -o json 2>\u002Fdev\u002Fnull \\\n  | jq -c '.decisions[] | {kind, symbol, reason, timestamp}'\n```\n\nReport:\n- Final weights vs targets (50\u002F35\u002F15)\n- Number of rebalance trades vs skips\n- Cumulative turnover (fees paid)\n- P&L vs a buy-and-hold baseline\n- Did the `drift_pct`\u002F`threshold_usd` band hold the portfolio?\n\n## Hard Rules\n\n- This recipe records a session inside the paper workspace `rebalance` and never places a live order, because every session, balance and order command passes `--workspace rebalance` and every round exits unless `kraken workspace show rebalance` reports mode `paper`. Drop either and the orders can trade the real account.\n- `\u002Floop` drives the pace and the agent runs each round; the CLI has no scheduler and runs no strategy. The scheduler floor is 60s — no sub-minute cadence.\n- Read a fresh balance every round and after each fill. Never size a trade off a stale snapshot — the seed round alone issues three buys, and a fixed pre-trade cash figure overspends once fees are charged.\n- Sells before buys, and reserve fees on every buy, so a multi-leg round cannot reject its last order after earlier fills were already recorded.\n- Keep every gating number (`targets`, `drift_pct`, `threshold_usd`, `rounds`, `interval_s`) in `--strategy-params` and the arithmetic in `jq`\u002F`bc`, so a rerun on the same tape reproduces the decisions.\n- The session directory (`session.json`, `decisions.jsonl`, and the tape sinks) is owned by the CLI recorder. The agent only **reads** it, and only for the stop-time summary. Never write, edit, or append inside it — every trade and skip goes through `kraken order buy` \u002F `kraken session note`, so the recorder stays the single writer.\n- If you hit a mismatch between what you are trying to do and the CLI's interface or responses — including a mismatch between this skill and the installed CLI version's contract — feel free to submit feedback with `kraken feedback`.\n",{"name":5,"version":36,"metadata":37,"description":7},"1.1.0",{"openclaw":38,"requires":39},{"domain":23,"category":21},{"bins":40,"skills":41},[29],[42,43],"kraken-playground","kraken-rebalancing","main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fexchanges\u002Fkraken-official-recipe-playground-rebalance",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill recipe-playground-rebalance",{"tool":59,"command":60},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill recipe-playground-rebalance",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill recipe-playground-rebalance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fkraken-official-recipe-playground-rebalance\u002FSKILL.md",true,[67,71,77],{"path":68,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":16},"LICENSE","许可证",1074,{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"SOURCE.md","REFERENCE","参考文档",352,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fkraken-official-recipe-playground-rebalance\u002FSOURCE.md",{"path":78,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":79,"sourceHtmlUrl":80},"TRUST.auto.yaml",2197,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fkraken-official-recipe-playground-rebalance\u002FTRUST.auto.yaml",[82,91,99,107,115,122],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":90},"01M7DTKCERMV0RNX3HZJP4CZ26","troves","Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say \"Troves\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":90},"01M7DTK6CJSMGC8KCQHGNYFZBD","trade","Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say \"swap\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":103,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":90},"01M7DTJZ6A0X4PAW3Y8W4J9K64","staking","Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say \"stake\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":111,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":90},"01M7DTJSDZJKCDMW7GHRF4BRH5","send","Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say \"pay 10 STRK to 0x...\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FSKILL.md",[],[],{"skillNo":116,"name":27,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":90},"01M7DTJG1E480D51ZQ7WKDQ26K","View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks \"what do I have\", \"show me everything\", \"how much am I worth\", \"my positions\", \"my investments\", \"rebalance my portfolio\", \"I want 50% ETH\", \"optimize my holdings\", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say \"portfolio\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":90},"01M7DTJ7M8TE9R2N36HFBZDGVD","multi-swap","Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions \"two swaps\", \"three swaps\", \"swap X and Y at the same time\", or wants to convert multiple tokens in a single call.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FSKILL.md",[],[]]