krakenfx/kraken-cli/kraken-twap-execution

Claude Code and agent skill by krakenfx/kraken-cli

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Execute large orders as time-weighted slices to reduce market impact.

Install

npx vskill@latest install krakenfx/kraken-cli/kraken-twap-execution

SKILL.md

kraken-twap-execution

Use this skill for:

  • breaking a large order into smaller time-spaced slices
  • reducing market impact and slippage on size
  • executing over minutes, hours, or days
  • tracking average fill price across slices

Core Concept

Time-Weighted Average Price (TWAP) splits a large order into N equal slices executed at regular intervals. The goal is to achieve an average price close to the time-weighted market average, reducing the impact a single large order would have on the book.

Parameters

  • Total volume: the full amount to buy or sell
  • Slices: number of child orders (e.g., 10)
  • Interval: time between slices (e.g., 60s, 300s)
  • Slice volume: total volume / slices

Paper TWAP Test

bash
kraken workspace create sandbox --capital 50000 --mode paper -o json 2>/dev/null
export KRAKEN_WORKSPACE=sandbox
# Simulate 5 slices of 0.01 BTC each, 60s apart
kraken paper buy BTCUSD 0.01 -o json 2>/dev/null
# wait 60s
kraken paper buy BTCUSD 0.01 -o json 2>/dev/null
# wait 60s
kraken paper buy BTCUSD 0.01 -o json 2>/dev/null
# repeat...
kraken paper history -o json 2>/dev/null
kraken workspace status -o json 2>/dev/null

Live TWAP Loop

The agent runs this loop externally (the CLI does not have a built-in scheduler). As written, the loop sends every slice without asking anyone, so run it only at autonomy level 4+. Below that, run one validated slice per approved call and wait the interval between calls. Live orders run outside the paper workspace, so clear it first:

bash
unset KRAKEN_WORKSPACE
TOTAL_VOLUME=0.05
SLICES=5
SLICE_VOL=$(echo "scale=8; $TOTAL_VOLUME / $SLICES" | bc)
INTERVAL=60
for i in $(seq 1 $SLICES); do
kraken order buy BTCUSD $SLICE_VOL --type market --validate -o json 2>/dev/null || break
# A failure prints its envelope here; on "verify_first": true, check open-orders before any retry.
kraken order buy BTCUSD $SLICE_VOL --type market -o json 2>/dev/null || break
[ $i -lt $SLICES ] && sleep $INTERVAL
done

Limit-Order TWAP Variant

Use limit orders at the current best bid/ask for potentially better fills:

bash
PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].ask_price')
kraken order buy BTCUSD $SLICE_VOL --type limit --price $PRICE -o json 2>/dev/null

Check fill status before the next slice. Cancel unfilled orders and adjust:

bash
kraken open-orders -o json 2>/dev/null

Tracking Average Fill

After all slices, compute the volume-weighted average price from trade history:

bash
kraken trades-history --consolidate-taker -o json 2>/dev/null

Sum (price * volume) for each fill, divide by total volume filled.

Rate Limit Awareness

The CLI does not pre-throttle requests. If a slice submission hits a rate limit, the error includes a suggestion field with tier-specific limits and a docs_url pointing to Kraken's documentation. On rate_limit error, pause the loop, read the suggestion, and adjust the interval before resuming. A 60-second interval between slices is well within budget for all tiers. For shorter intervals, consult the kraken-rate-limits skill for per-tier counter costs and decay rates.

Hard Rules

  • Each live slice requires human approval unless operating at autonomy level 4+.
  • Track cumulative fill volume and stop if total exceeds target (handle partial fills).
  • On error, pause the loop rather than skipping the slice; resume after recovery.
  • Log every slice for post-execution analysis.
  • 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.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
74
Repository forks
10
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/krakenfx/kraken-cli/kraken-twap-execution/badge)](https://verified-skill.com/skills/krakenfx/kraken-cli/kraken-twap-execution)

Something wrong with this skill or its page? Tell us.