Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/khanh-vu/claude-force/order-execution-patternsnpx skills add khanh-vu/claude-force --skill order-execution-patternsgit clone --depth 1 https://github.com/khanh-vu/claude-forceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/khanh-vu/claude-force/order-execution-patterns)<a href="https://agentmods.dev/skills/khanh-vu/claude-force/order-execution-patterns"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/order-execution-patterns.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02836 |
| Opus 5 | $0.00000 | $0.01418 |
| Sonnet 5 | $0.00000 | $0.00567 |
| Haiku 4.5 | $0.00000 | $0.00284 |
Grade A, and why
order-execution-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 456 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Order Execution Patterns
Advanced order execution algorithms to minimize slippage and optimize fill quality.
TWAP (Time-Weighted Average Price) Execution
import asyncio
from decimal import Decimal
from datetime import datetime, timedelta
from typing import List, Dict
class TWAPExecutor:
"""
Time-Weighted Average Price execution
Splits large order evenly over time to minimize market impact
"""
def __init__(self, exchange_connector):
self.exchange = exchange_connector
self.active_executions = {}
async def execute_twap(
self,
symbol: str,
side: str, # 'buy' or 'sell'
total_amount: Decimal,
duration_minutes: int,
num_slices: int = None
) -> Dict:
"""
Execute TWAP order
Args:
symbol: Trading pair (e.g., 'BTC/USDT')
side: 'buy' or 'sell'
total_amount: Total quantity to trade
duration_minutes: Time window for execution
num_slices: Number of slices (default: duration_minutes)
Returns:
Execution report with fills, average price, slippage
"""
if num_slices is None:
num_slices = duration_minutes
slice_amount = total_amount / num_slices
interval_seconds = (duration_minutes * 60) / num_slices
execution_id = f"twap_{symbol}_{datetime.utcnow().timestamp()}"
self.active_executions[execution_id] = {
'symbol': symbol,
'side': side,
'total_amount': total_amount,
'fills': [],
'start_time': datetime.utcnow(),
'status': 'active'
}
logger.info(
f"Starting TWAP execution: {total_amount} {symbol} "
f"over {duration_minutes}m in {num_slices} slices"
)
try:
for slice_num in range(num_slices):
# Get current mid price
ticker = await self.exchange.fetch_ticker(symbol)
mid_price = (ticker['bid'] + ticker['ask']) / 2
# Place limit order at mid price (passive execution)
order = await self.exchange.create_limit_order(
symbol=symbol,
side=side,
amount=float(slice_amount),
price=float(mid_price)
)
# Wait for partial fill or timeout
fill = await self._wait_for_fill(
order['id'],
timeout_seconds=interval_seconds * 0.8 # 80% of interval
)
self.active_executions[execution_id]['fills'].append(fill)
# If not fully filled, cancel and use market order for remainder
if fill['filled'] < slice_amount:
await self.exchange.cancel_order(order['id'])
remainder = slice_amount - fill['filled']
if remainder > 0:
market_fill = await self.exchange.create_market_order(
symbol=symbol,
side=side,
amount=float(remainder)
)
self.active_executions[execution_id]['fills'].append(market_fill)
# Wait until next slice
if slice_num < num_slices - 1:
await asyncio.sleep(interval_seconds)
# Calculate execution statistics
report = self._generate_execution_report(execution_id)
self.active_executions[execution_id]['status'] = 'completed'
return report
except Exception as e:
logger.error(f"TWAP execution failed: {e}")
self.active_executions[execution_id]['status'] = 'failed'
raise
async def _wait_for_fill(
self,
order_id: str,
timeout_seconds: float
) -> Dict:
"""Wait for order to fill or timeout"""
start_time = time.time()
while time.time() - start_time < timeout_seconds:
order = await self.exchange.fetch_order(order_id)
if order['status'] in ['closed', 'filled']:
return {
'filled': Decimal(str(order['filled'])),
'price': Decimal(str(order['average'])),
'timestamp': order['timestamp']
}
await asyncio.sleep(1)
# Timeout - return partial fill
order = await self.exchange.fetch_order(order_id)
return {
'filled': Decimal(str(order.get('filled', 0))),
'price': Decimal(str(order.get('average', 0))),
'timestamp': order['timestamp']
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 456 lines · 0 tokens per session scan A 6a9cf77bc21f
order-execution-patterns is a skill published in the GitHub repository khanh-vu/claude-force (5 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,836 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
sector-rotation
行业轮动分析——申万行业景气度评分、行业动量排名、产业链传导、估值/盈利/资金流多维比较框架.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
chenhao-limit-up
Use when evaluating A-share limit-up (涨停板) setups through Chen Hao's sentiment and momentum lens: market emotion cycles, board strength, follow-through, and short-term aggressive momentum trading.
trading-risk-gate
Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.
vectorbt
High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics.