kraken-alert-patterns
Price alerts, threshold monitoring, and notification triggers for agents.
Narrate a recorded session's post-mortem: replay the window, explain the P&L decomposition in plain terms, and deliver a presentation-ready summary.
Claude Code
$ npx -y skills add krakenfx/kraken-cli --skill recipe-session-post-mortem --agent claude-code
Codex
$ npx skills add krakenfx/kraken-cli --skill recipe-session-post-mortem -a codex -y
Cursor
$ npx skills add krakenfx/kraken-cli --skill recipe-session-post-mortem -a cursor -y
Gemini CLI
$ npx skills add krakenfx/kraken-cli --skill recipe-session-post-mortem -a gemini-cli -y
GitHub Copilot
$ npx skills add krakenfx/kraken-cli --skill recipe-session-post-mortem -a github-copilot -y
OpenCode
$ npx skills add krakenfx/kraken-cli --skill recipe-session-post-mortem -a opencode -y
Windsurf
$ npx skills add krakenfx/kraken-cli --skill recipe-session-post-mortem -a windsurf -y
name: recipe-session-post-mortem
version: 1.0.0
description: "Narrate a recorded session's post-mortem: replay the window, explain the P&L decomposition in plain terms, and deliver a presentation-ready summary."
metadata:
openclaw:
category: "recipe"
domain: "sessions"
requires:
bins: ["kraken"]
skills: ["kraken-playground"]> **PREREQUISITE:** Load `kraken-playground` to understand what a session is and where it lives.
Turn a stopped, recorded session into a story a non-trader can follow: what the market did, what the agent did, where every dollar of P&L went, and what to change next session. The CLI supplies the deterministic facts (`kraken explain pnl`, `kraken replay`); this recipe is the interpretive layer on top. The output is good enough to paste into a board deck.
Use this skill for:
The session must be **stopped** (`kraken session stop`). `explain pnl` decomposes a stopped session's window against its recorded tape; on a recording session, stop it first.
The CLI stays deterministic; the narrative is yours. Every dollar figure, percentage, and count in the narrative must come from the command output — never estimate, extrapolate, or invent a number the JSON does not contain.
kraken explain pnl --session "$SESSION_ID" -o json 2>/dev/null # --session defaults to latest
One JSON object. The parts that drive the narrative:
Useful digests:
# Headline + waterfall
kraken explain pnl --session "$SESSION_ID" -o json 2>/dev/null \
| jq '{anchor, waterfall: [.components[] | {kind, amount}]}'
# Cost per trade, with the agent's stated reason
kraken explain pnl --session "$SESSION_ID" -o json 2>/dev/null \
| jq -r '.trades[] | [.side, .volume, .price, .fees, .reason] | @tsv'kraken replay --session "$SESSION_ID" --speed 1000 -o json 2>/dev/null
NDJSON, one event per line, in recorded order. `--speed` is a multiplier (0.01–1000, default 1 = real time with recorded gaps reproduced); for analysis always use `--speed 1000` so the tape flushes as fast as pacing allows. Three record families interleave on the same clock:
Digest it rather than reading every tick:
REPLAY=$(kraken replay --session "$SESSION_ID" --speed 1000 -o json 2>/dev/null)
# The action beats: every fill and every decision, in order
echo "$REPLAY" | jq -c 'select(.event == "order_filled" or .kind != null)'
# The price path: first, last, low, high of the recorded mids
echo "$REPLAY" | jq -s '[.[] | select(.channel == "ticker") | .data[0].last] |
{first: .[0], last: .[-1], low: min, high: max}'Weave both outputs into one story, in this order:
1. **Headline** — one sentence: outcome and dominant cause, citing `total_pnl` and the largest component. *"The session lost $20.70 on a flat market: $20.18 of it was fees from churning three fills through an 0.02% move."* 2. **What the market did** — from `window.symbols` and the replay price path: direction, size of the move, spread conditions. 3. **What the agent did** — from the replay beats: each decision with its recorded `reason`, and whether the fill helped or hurt (per-trade `price_movement` vs `fees` + `spread`). 4. **Where the money went** — the waterfall, every component, summing to the total. Name the dominant cost in plain terms. 5. **Patterns** — call out what the numbers show: churning a flat market and paying the spread N times, buying strength that faded, skips that saved money, fees exceeding gross edge. 6. **Next steps** — concrete, tied to the evidence: fewer/larger fills to cut the fee bill, limit orders to earn the spread instead of paying it, a wider trigger threshold, a different window.
Honesty rules:
A session with no fills is a valid post-mortem, not an error: `trades` is `[]` and every component is zero. Say so directly — "no trades were placed, so the balance is unchanged" — then narrate what the market did over the window and, if decisions were logged (skips with reasons), whether staying out was the right call given the tape.
Wh
Trade on Kraken from your terminal, or let your AI agent trade for you. One install covers crypto, tokenized U.S. stocks and ETFs (for non-U.S. customers), forex, and futures. Every command can answer in JSON.
Price alerts, threshold monitoring, and notification triggers for agents.
Progress from manual trading to full agent autonomy with controlled risk at each level.
Capture the spot-futures price spread with delta-neutral basis trades.
Dollar cost averaging with scheduled buys and performance tracking.
Discover staking strategies, allocate funds, and track earn positions.
Handle order failures, network errors, and duplicate submissions safely.
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…