Commodity Futures Storage And Carry Cost Modelingのロゴ

Commodity Futures Storage And Carry Cost Modeling

コミュニティ
HimanshuJ16
commodity-futures-storage-and-carry-cost-modeling

現物コモディティ先物の価格算定やロール戦略の設計に使用します。資金調達コスト、保管費、保険料を通じて現物価格と先物価格を結び付け、インプライド・コンビニエンス・イールドを算出し、コンタンゴとバックワーデーションを判別します。

Add to TypingMind

概要

公開者HimanshuJ16
リポジトリAlgo-Trading-Skills
スキル名commodity-futures-storage-and-carry-cost-modeling
スター
50
フォーク
7
同梱ファイル
5
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    HimanshuJ16がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Commodity Futures Storage And Carry Cost Modeling」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/commodity-futures-storage-and-carry-cost-modeling
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/commodity-futures-storage-and-carry-cost-modeling .claude/skills/commodity-futures-storage-and-carry-cost-modeling
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCommodity Futures Storage And Carry Cost Modelingを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にCommodity Futures Storage And Carry Cost Modelingを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Commodity Futures Storage And Carry Cost Modelingは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

When to Use

Use this skill when pricing physical commodity futures (Crude Oil CL, Natural Gas NG, Gold GC, Agriculture ZC) or designing term-structure roll strategies. The Cost of Carry model links spot prices ($S_0$) to futures prices ($F_T$) using financing costs ($r$), physical storage/insurance costs ($c$ proportional and/or $U$ per unit), and implied convenience yield ($y$). High convenience yield causes Backwardation ($F_T < S_0$), signaling physical inventory scarcity, whereas high storage costs relative to convenience yield lead to Contango ($F_T > S_0$).

When NOT to Use

  • As an arbitrage signal generator on the cheap side of the curve. For a consumption commodity the cost-of-carry relation is an inequality, $F_0 \le (S_0 + U)e^{(r+c)T}$, not an equality. Only the rich side is enforceable. A futures price below your fair-value estimate is a view about convenience yield, not a riskless trade, because you cannot generally borrow and sell short a physical commodity.
  • For non-storable commodities (electricity, most weather and freight underlyings). Storage arbitrage is the entire basis of this model; without storability the futures price is a risk-neutral expectation, not a carry relation. See weather-derivatives-and-niche-instrument-handling.
  • When spot and futures are not the same deliverable. A refiner's local crude assessment is not the contract-grade deliverable at the delivery point. A basis difference between grades or locations shows up here as a spurious convenience yield or a spurious arbitrage.
  • At sub-daily maturities. The implied-yield inversion divides by $T$, so within a day or two of expiry ordinary quote noise annualises into implausible yields.

Prerequisites

  • Spot price $S_0$ and futures contract price $F_{market}$ sampled at the same timestamp, for the contract-deliverable grade and delivery point.
  • Time to maturity $T$ in years, on a stated day-count basis.
  • A continuously compounded annual financing rate $r$ on that same day-count basis. Money-market quotes (e.g. SOFR, ACT/360, simple) must be converted before use.
  • Storage cost as a proportional annual rate $c$, a fixed currency amount per unit per year $U$, or both.

Workflow

  1. Full-Carry Price (the no-arbitrage bound):
    • $F_{full} = (S_0 + U_{PV}) \cdot e^{(r + c) T}$, where $U_{PV}$ is the present value of the fixed per-unit storage charge accruing over $[0, T]$.
    • This is the upper bound on the futures price, and equals the price at $y = 0$.
  2. Theoretical Futures Price at an Assumed Yield:
    • $F_{theoretical} = F_{full} \cdot e^{-yT}$. Because $y$ is unobservable, this is a view, not a fair value that arbitrage enforces.
  3. Implied Convenience Yield Extraction:
    • $y = \frac{1}{T}\ln\left(\frac{F_{full}}{F_{market}}\right)$.
    • If $y < 0$ the bound is violated. Before treating it as profit, re-check timestamp synchronisation, grade/location deliverability, and whether storage and financing costs are understated — those explain the great majority of apparent violations.
  4. Regime Identification:
    • $F_{market} > S_0$ is CONTANGO; $F_{market} < S_0$ is BACKWARDATION; equality is FLAT. Do not fold the equality case into either regime — a flat curve is a distinct, informative state.
  5. Arbitrage Audit (Cash-and-Carry only):
    • Raise a CASH_AND_CARRY signal only when $F_{market} > F_{full} \cdot (1 + \text{round-trip costs})$: buy spot, pay financing and storage, sell futures, deliver. This leg is executable by anyone with capital and storage capacity.
    • Do not raise an arbitrage on the other side. A cheap futures price is surfaced separately as a reverse-carry candidate, actionable only by an existing inventory holder (who is really monetising their own convenience yield) or in a commodity with a genuine lease/borrow market such as gold.

Full procedure: see references/workflows.md. Standards reference: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Treating backwardation as a reverse cash-and-carry arbitrage: Crude oil routinely trades at implied convenience yields of tens of percent annualised during tight-inventory periods. A model that compares the market price to a fixed "baseline" convenience yield and flags every deviation will fire a false arbitrage on essentially every backwardated market, because the short-physical leg needed to capture it does not exist.
  • Ignoring Convenience Yield ($y$): Assuming futures prices are purely driven by $r + c$. In tight physical markets, convenience yield surges, causing deep backwardation that pure storage models fail to explain.
  • Fixed vs. Proportional Storage Costs: Exchanges regulate physical storage as a fixed charge per unit per day, not as a percentage of spot — CBOT caps grain storage in fractions of a cent per bushel per day and adjusts that cap through the Variable Storage Rate mechanism. Modelling a fixed charge as a percentage of spot silently makes storage cheap when the commodity is cheap, which is exactly backwards.
  • Day-Count / Compounding Misalignment: $T$ and $r$ must share a day-count basis, and $r$ must be continuously compounded. Pairing an ACT/360 simple money-market quote with an ACT/365 $T$ biases the implied yield by roughly 1.4% of the rate before any market signal is present.
  • Silent NaN propagation: nan <= 0 is False, so a naive positivity check passes NaN straight through to math.log and returns a NaN price alongside a confidently wrong regime string. Validate for finiteness, not just sign.
  • Non-synchronous quotes: A settlement-price futures quote against a live spot tick manufactures basis out of nothing. At short maturities the $1/T$ factor amplifies it into a headline-grade convenience yield.

Verification

  • Instantiate CommodityCarryCostModel(risk_free_rate=0.05, storage_cost_rate=0.02). With $S_0 = 100$, $T = 1.0$, $y = 0.01$, verify the theoretical price is $100 \cdot e^{0.06} \approx 106.1837$; with $y = 0.10$, verify $100 \cdot e^{-0.03} \approx 97.0446$. The full-carry price ($y = 0$) must be $100 \cdot e^{0.07} \approx 107.2508$.
  • Feed a WTI-like backwardated curve ($S_0 = 80$, $F = 76$, $T = 0.5$). Confirm the regime is BACKWARDATION, the implied convenience yield is roughly 17%, and is_arbitrage_opportunity is False — this is a normal market, not a trade.
  • Feed $F_{market} = 115$ against $S_0 = 100$, $T = 1.0$. Confirm CASH_AND_CARRY, a negative implied yield, and convenience_yield_bound_violated.
  • Feed $F_{market} = S_0$ and confirm the regime is FLAT, not BACKWARDATION.
  • Run python -m unittest discover -s skills/commodity-futures-storage-and-carry-cost-modeling/scripts and confirm 100% pass rate.

Related Skills

  • synthetic-continuous-futures-contract-construction
  • calendar-spread-and-multi-leg-order-atomicity
  • futures-contract-roll-automation
  • physical-vs-cash-settlement-handling

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Commodity Futures Storage And Carry Cost Modeling」では何ができますか?

現物コモディティ先物の価格算定やロール戦略の設計に使用します。資金調達コスト、保管費、保険料を通じて現物価格と先物価格を結び付け、インプライド・コンビニエンス・イールドを算出し、コンタンゴとバックワーデーションを判別します。

TypingMindでCommodity Futures Storage And Carry Cost Modelingを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Commodity Futures Storage And Carry Cost Modelingはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCommodity Futures Storage And Carry Cost Modelingをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/commodity-futures-storage-and-carry-cost-modelingを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Commodity Futures Storage And Carry Cost Modelingを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Commodity Futures Storage And Carry Cost Modelingで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCommodity Futures Storage And Carry Cost Modelingを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Commodity Futures Storage And Carry Cost Modeling」は無料ですか?

はい。HimanshuJ16がApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇