Skill for executing confirmed trades with pre-flight checks, confirmation mesh validation, and post-execution logging.
Handles the full trade execution lifecycle with multi-layer safety validation.
This skill enables the agent to:
Before any execution request:
Call: estimate_slippage(symbol: str, side: "buy" | "sell", quantity: float)
Returns: (avg_price: float, slippage_pct: float) or None if insufficient liquidity
Submit signal through validation pipeline:
Call: validate_execution(
signal: FootprintSignal,
symbol: str,
side: "buy" | "sell",
quantity: float,
max_slippage_pct: float = 0.5
) -> ConfirmationResult
The mesh validates:
Only if result.approved == True:
Call: execute_order(
symbol: str,
side: "buy" | "sell",
quantity: float,
order_type: "market" | "limit",
limit_price: float | None,
broker: "alpaca" | "zerodha" | "upstox" | "paper"
) -> ExecutionResult
After execution:
Call: log_execution(
execution_result: ExecutionResult,
signal: FootprintSignal,
confirmation: ConfirmationResult
)
This updates:
[!CAUTION] These rules are NON-NEGOTIABLE for autonomous execution:
| Parameter | Default | Description |
|---|---|---|
| max_position_size | 10,000 | Max shares per position |
| max_notional_value | $100,000 | Max $ value per trade |
| max_slippage_pct | 0.5% | Abort if exceeds |
| min_liquidity_ratio | 2x | Need 2x quantity in book |
| circuit_breaker_cooldown | 5 min | Time after trip |
execute_order(..., broker="paper")
Uses simulated broker with realistic slippage/commission modeling.
execute_order(..., broker="alpaca") # or zerodha, upstox
Routes to real broker API. Agent must log confidence justification.
# 1. Receive confirmed signal from orderflow analysis
signal = await analyze_footprint("RELIANCE", 60)
# 2. Pre-flight check
slippage = await estimate_slippage("RELIANCE", "buy", 500)
if slippage and slippage[1] > 0.5:
logger.warning("Slippage too high, aborting")
return
# 3. Confirmation mesh
confirmation = await validate_execution(
signal=signal,
symbol="RELIANCE",
side="buy",
quantity=500,
max_slippage_pct=0.5
)
# 4. Execute only if approved
if confirmation.approved:
result = await execute_order(
symbol="RELIANCE",
side="buy",
quantity=500,
order_type="limit",
limit_price=confirmation.recommended_price,
broker="zerodha"
)
# 5. Log execution
await log_execution(result, signal, confirmation)