slippage-modeling
Slippage Modeling
Estimate execution costs, model slippage curves from AMM mechanics and empirical quotes, and determine optimal trade sizes that keep costs within acceptable thresholds.
What Is Slippage?
Slippage is the difference between the expected price at the time you decide to trade and the actual execution price you receive. On decentralized exchanges, slippage is deterministic and measurable — unlike CEX slippage, which depends on hidden order book dynamics.
Example: You expect to buy a token at 0.001 SOL. Your trade executes at 0.00105 SOL. That 5% difference is slippage — it directly reduces your profit and increases your break-even threshold.
Sources of Slippage
1. AMM Price Impact (Primary Source)
Automated market makers use bonding curves that move price as liquidity is consumed. On a constant-product AMM (x * y = k):
price_impact = Δx / (x + Δx)
More from agiprolabs/claude-trading-skills
pandas-ta
Technical analysis with 130+ indicators using pandas-ta for crypto market data
105risk-management
Portfolio-level risk controls, drawdown management, exposure limits, and circuit breakers for crypto trading
76feature-engineering
Feature construction from market data for ML trading models including price, volume, on-chain, and microstructure features
76trading-visualization
Professional trading charts including candlesticks, equity curves, drawdowns, correlation heatmaps, and return distributions
76signal-classification
ML trading signal classifiers using XGBoost and LightGBM with walk-forward validation, SHAP feature importance, and threshold optimization
73market-microstructure
DEX orderflow analysis, trade classification, buyer/seller pressure, and microstructure signals for Solana tokens
73