jpskill.com
💼 ビジネス コミュニティ

スリッページモデリング

slippage-modeling

AMM(自動マーケットメイカー)の流動性に基づいて、取引コストやスリッページ(約定価格のずれ)を予測し、最適な取引サイズを算出することで、より有利な取引戦略を立てることを支援するSkill。

📜 元の英語説明(参考)

Execution cost estimation, slippage curve modeling, and optimal trade sizing based on AMM liquidity depth

🇯🇵 日本人クリエイター向け解説

一言でいうと

AMM(自動マーケットメイカー)の流動性に基づいて、取引コストやスリッページ(約定価格のずれ)を予測し、最適な取引サイズを算出することで、より有利な取引戦略を立てることを支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o slippage-modeling.zip https://jpskill.com/download/10436.zip && unzip -o slippage-modeling.zip && rm slippage-modeling.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10436.zip -OutFile "$d\slippage-modeling.zip"; Expand-Archive "$d\slippage-modeling.zip" -DestinationPath $d -Force; ri "$d\slippage-modeling.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して slippage-modeling.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → slippage-modeling フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

スリッページモデリング

約定コストの推定、AMMのメカニズムと経験的な相場情報からのスリッページカーブのモデル化、およびコストを許容可能な閾値内に維持する最適な取引サイズを決定します。

スリッページとは?

スリッページとは、取引を決定した時点での予想価格と、実際に受け取った約定価格との差です。分散型取引所では、スリッページは決定論的で測定可能です。これは、隠れたオーダーブックのダイナミクスに依存するCEXのスリッページとは異なります。

: あるトークンを0.001 SOLで購入することを期待します。あなたの取引は0.00105 SOLで約定します。その5%の差がスリッページです。これはあなたの利益を直接的に減らし、損益分岐点を引き上げます。

スリッページの原因

1. AMMの価格インパクト(主な原因)

自動マーケットメーカーは、流動性が消費されるにつれて価格が変動する結合曲線を使用します。定積AMM(x * y = k)では:

price_impact = Δx / (x + Δx)

ここで、xは入力トークンの準備金であり、Δxはあなたの取引サイズです。100 SOLの準備金を持つプールに対して1 SOLの取引を行うと、約1%の価格インパクトが生じます。10 SOLの準備金に対して行うと、約10%の価格インパクトが生じます。

完全な導出とCLMMの調整については、references/slippage_math.mdを参照してください。

2. DEX手数料

すべてのスワップには、取引から徴収される手数料が発生します。

DEX 手数料 注記
Raydium 0.25% 標準的なAMMプール
Orca 0.30% Whirlpool集中型プール
Meteora 0.1–2.0% ボラティリティに基づく動的手数料
PumpFun 1.0% 結合曲線フェーズ

3. 優先手数料

Solanaのバリデーターは、より高い計算ユニット価格を持つトランザクションを優先します。輻輳時や時間的制約のある取引の場合:

  • 通常:0.0001 SOL(無視できる程度)
  • 競争的:0.001–0.01 SOL
  • 高い輻輳:0.01–0.1 SOL

4. MEV(サンドイッチ攻撃)

サーチ業者(Searchers)は保留中のスワップを検出し、それらをサンドイッチします。あなたの取引の前に購入(価格を上げる)し、その後販売(差額を獲得)します。MEVコストは以下に依存します。

  • 取引サイズ(大きいほど魅力的なターゲット)
  • トークンの流動性(薄いプールほど操作しやすい)
  • スリッページ許容度の設定(高い許容度ほど抽出可能)

典型的なMEVコスト:脆弱な取引で0–200 bps。

5. 古い相場情報

相場情報を受け取ってから、トランザクションがオンチェーンに着地するまで(Solanaでは0.4–2秒)、価格が変動する可能性があります。ボラティリティの高いトークンは、そのウィンドウで50–500 bps変動する可能性があります。

定積スリッページ計算式

準備金(x, y)と不変量k = x * yを持つプールの場合:

SOLでトークンを購入する(入力Δx SOL):

tokens_received = y * Δx / (x + Δx)
effective_price = Δx / tokens_received = (x + Δx) / y
spot_price      = x / y
price_impact    = effective_price / spot_price - 1 = Δx / (x + Δx)

トークンをSOLで販売する(入力Δyトークン):

sol_received   = x * Δy / (y + Δy)
effective_price = sol_received / Δy = x / (y + Δy)
spot_price      = x / y
price_impact    = 1 - effective_price / spot_price = Δy / (y + Δy)

重要な洞察: スリッページはtrade_size / (reserves + trade_size)に比例します。これは、小さな取引ではほぼ線形であり、取引サイズが準備金サイズに近づくにつれて急激に加速します。

簡単な参照表

取引/準備金比率 おおよそのスリッページ
0.1% 0.1% (1 bp)
1% 1.0% (100 bps)
5% 4.8% (476 bps)
10% 9.1% (909 bps)
25% 20% (2000 bps)
50% 33% (3333 bps)

CLMMスリッページ

集中流動性マーケットメーカー(Orca Whirlpools、Meteora DLMM)は、特定の価格範囲に流動性を集中させます。

  • アクティブな範囲内:スリッページは集中係数によって定積よりも低い
  • ティック境界を越える:次のティックの流動性がまばらである可能性があるため、追加のスリッページ
  • 近似:clmm_slippage ≈ cp_slippage / concentration_factor

典型的な集中係数:適切に管理されたポジションで5–50倍。

経験的なスリッページ測定

理論的な計算式は、単一プールルーティングを前提としています。実際には、Jupiterは複数のプールを集約してルーティングします。経験的な測定の方がより正確です。

  1. 複数の取引サイズ(0.01、0.1、1、5、10、50 SOL)でJupiter /quoteをクエリします。
  2. 各サイズでの出力量と実効価格を記録します。
  3. 最小の取引(スポットのプロキシ)に対する相対的なスリッページをbpsで計算します。
  4. べき乗則モデルを適合させます:slippage_bps = a * trade_size^b

これにより、実際ルーティングの動作、マルチプールの分割、および利用可能な流動性が把握できます。

完全な実装については、scripts/slippage_curve.pyを参照してください。

総約定コストモデル

total_cost_bps = price_impact_bps + fee_bps + priority_fee_bps + mev_risk_bps
total_cost_sol = trade_size_sol * total_cost_bps / 10_000

コンポーネントの内訳と計算例については、references/cost_model.mdを参照してください。

損益分岐点分析

往復(購入+販売)の場合:

roundtrip_cost_bps = entry_impact + exit_impact + 2 * fee_bps + 2 * priority_bps + mev_bps

トークンは、利益を上げるために、あなたにとって有利な方向にroundtrip_cost_bps以上に動く必要があります。200 bpsのエントリー・スリッページ、200 bpsのエグジット・スリッページ、および50 bpsの手数料を持つトークンの場合:

roundtrip = 200 + 200 + 50 = 450 bps = 4.5%

少なくとも4.5%の価格変動がないと、損益分岐点に達しません。

自動コスト推定については、scripts/execution_cost.pyを参照してください。

最適な取引サイズ

スリッページ閾値の最大サイズ

スリッページカーブs(q) = a * q^bが与えられた場合、最大取引サイズを求めます。

q_max = (threshold_bps / a) ^ (1/b)

マルチトランシェ実行

大規模な注文の場合、分割すると、各トランシェが部分的にリセットされたオーダーブックに直面する(CLMMの場合)か、裁定取引者がトランシェ間でリバランスできるようになるため、合計スリッページが減少します。

n_tranches = ceil(total_size / q_max)
tranche_size = total_size / n_tranches
wait_between = 2-10 seconds (allow arb rebalancing)

TWAP戦略

時間加重平均価格実行

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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)

Where x is the reserve of the input token and Δx is your trade size. A 1 SOL trade against a pool with 100 SOL reserves produces ~1% price impact. Against 10 SOL reserves, it produces ~10%.

See references/slippage_math.md for full derivations and CLMM adjustments.

2. DEX Fees

Every swap incurs a fee taken from the trade:

DEX Fee Notes
Raydium 0.25% Standard AMM pools
Orca 0.30% Whirlpool concentrated pools
Meteora 0.1–2.0% Dynamic fees based on volatility
PumpFun 1.0% Bonding curve phase

3. Priority Fees

Solana validators prioritize transactions with higher compute unit prices. During congestion or for time-sensitive trades:

  • Normal: 0.0001 SOL (negligible)
  • Competitive: 0.001–0.01 SOL
  • High congestion: 0.01–0.1 SOL

4. MEV (Sandwich Attacks)

Searchers detect pending swaps and sandwich them — buying before your trade (raising the price) and selling after (capturing the difference). MEV cost depends on:

  • Trade size (larger = more attractive target)
  • Token liquidity (thin pools = easier to manipulate)
  • Slippage tolerance setting (higher tolerance = more extractable)

Typical MEV cost: 0–200 bps on vulnerable trades.

5. Stale Quotes

Between receiving a quote and landing the transaction on-chain (0.4–2 seconds on Solana), the price may move. Volatile tokens can shift 50–500 bps in that window.

Constant-Product Slippage Formula

For a pool with reserves (x, y) and invariant k = x * y:

Buying tokens with SOL (input Δx SOL):

tokens_received = y * Δx / (x + Δx)
effective_price = Δx / tokens_received = (x + Δx) / y
spot_price      = x / y
price_impact    = effective_price / spot_price - 1 = Δx / (x + Δx)

Selling tokens for SOL (input Δy tokens):

sol_received   = x * Δy / (y + Δy)
effective_price = sol_received / Δy = x / (y + Δy)
spot_price      = x / y
price_impact    = 1 - effective_price / spot_price = Δy / (y + Δy)

Key insight: Slippage scales with trade_size / (reserves + trade_size). This is approximately linear for small trades and accelerates sharply as trade size approaches reserve size.

Quick Reference Table

Trade / Reserve Ratio Approximate Slippage
0.1% 0.1% (1 bp)
1% 1.0% (100 bps)
5% 4.8% (476 bps)
10% 9.1% (909 bps)
25% 20% (2000 bps)
50% 33% (3333 bps)

CLMM Slippage

Concentrated Liquidity Market Makers (Orca Whirlpools, Meteora DLMM) concentrate liquidity in specific price ranges:

  • Within the active range: slippage is lower than constant-product by a concentration factor
  • Crossing tick boundaries: additional slippage as the next tick's liquidity may be sparse
  • Approximation: clmm_slippage ≈ cp_slippage / concentration_factor

Typical concentration factors: 5–50x for well-managed positions.

Empirical Slippage Measurement

Theoretical formulas assume single-pool routing. In practice, Jupiter aggregates across multiple pools and routes. Empirical measurement is more accurate:

  1. Query Jupiter /quote at multiple trade sizes (0.01, 0.1, 1, 5, 10, 50 SOL)
  2. Record output amount and effective price at each size
  3. Compute slippage in bps relative to smallest trade (proxy for spot)
  4. Fit a power-law model: slippage_bps = a * trade_size^b

This captures real routing behavior, multi-pool splitting, and available liquidity.

See scripts/slippage_curve.py for the full implementation.

Total Execution Cost Model

total_cost_bps = price_impact_bps + fee_bps + priority_fee_bps + mev_risk_bps
total_cost_sol = trade_size_sol * total_cost_bps / 10_000

See references/cost_model.md for component breakdowns and worked examples.

Break-Even Analysis

For a roundtrip (buy + sell):

roundtrip_cost_bps = entry_impact + exit_impact + 2 * fee_bps + 2 * priority_bps + mev_bps

The token must move more than roundtrip_cost_bps in your favor to be profitable. For a token with 200 bps entry slippage, 200 bps exit slippage, and 50 bps fees:

roundtrip = 200 + 200 + 50 = 450 bps = 4.5%

You need at least a 4.5% price move just to break even.

See scripts/execution_cost.py for automated cost estimation.

Optimal Trade Sizing

Maximum Size for Slippage Threshold

Given a slippage curve s(q) = a * q^b, solve for max trade size:

q_max = (threshold_bps / a) ^ (1/b)

Multi-Tranche Execution

For large orders, splitting reduces total slippage because each tranche faces a partially-reset order book (on CLMMs) or allows arbitrageurs to rebalance between tranches:

n_tranches = ceil(total_size / q_max)
tranche_size = total_size / n_tranches
wait_between = 2-10 seconds (allow arb rebalancing)

TWAP Strategy

Time-Weighted Average Price execution:

  • Divide total order into equal-sized tranches
  • Execute one tranche per interval (e.g., every 10 seconds)
  • Total slippage is significantly lower than single execution
  • Tradeoff: price may move against you during execution window

Slippage by Token Category

Category Typical Pool TVL Slippage for 1 SOL Slippage for 10 SOL
Blue chip >$10M <5 bps <20 bps
Mid-cap $100K–$10M 10–50 bps 50–500 bps
Small-cap $10K–$100K 50–200 bps 500–2000 bps
Micro/PumpFun <$10K 200–2000 bps Often impossible

Integration Points

  • liquidity-analysis: Get pool TVL and reserve data to feed slippage estimates
  • position-sizing: Use max trade size from slippage curve as a position size constraint
  • jupiter-api: Fetch real quotes for empirical slippage measurement
  • risk-management: Include execution costs in risk/reward calculations
  • dex-pool-analysis: Understand pool mechanics that drive slippage

Files

References

File Description
references/slippage_math.md AMM slippage derivations, CLMM adjustments, multi-pool routing math
references/cost_model.md Total execution cost components, break-even analysis, cost comparison tables

Scripts

File Description
scripts/slippage_curve.py Build empirical slippage curves from Jupiter quotes, fit power-law model
scripts/execution_cost.py Estimate total execution cost and break-even for a specific trade