jpskill.com
🛠️ 開発・MCP コミュニティ

percolator

Percolatorは、将来の永続先物取引プロトコル開発を目指し、利益を優先するリスク管理モデルを用いた教育研究プロジェクトで、リスクエンジンやSolanaプログラムなどを開発・検証するSkill。

📜 元の英語説明(参考)

Percolator perpetual futures protocol development (Feb 2026). Educational research project for predictable risk management using profit-as-junior-claims model. Covers core risk engine (Rust), Solana programs, CLI tools, matcher development, testing, and formal verification. Alternative to traditional ADL with global coverage ratio and self-healing mechanics.

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

一言でいうと

Percolatorは、将来の永続先物取引プロトコル開発を目指し、利益を優先するリスク管理モデルを用いた教育研究プロジェクトで、リスクエンジンやSolanaプログラムなどを開発・検証するSkill。

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して percolator.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → percolator フォルダができる
  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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] percolator

Percolator 開発スキル

このスキルの目的

このスキルは、ユーザーが以下を求めている場合に使用します。

  • Percolator プロトコルの開発または統合
  • 永久先物リスクエンジンの実装
  • 利益のウォームアップと引き出しのメカニズム
  • グローバルカバレッジ比率(h)の計算
  • マッチャープログラムの開発(パッシブまたは vAMM)
  • オラクル統合(Pyth、Chainlink、またはカスタム)
  • 清算とキーパーのオペレーション
  • ファンディングレートのメカニズム
  • Kani を使用した形式検証
  • プロトコルのテストとストレステスト
  • CLI ツールの使用とスクリプト作成

コアコンセプト

Percolator モデル

Percolator は、従来の取引所とは異なる方法で利益を扱います。

  • 資本(シニアクレーム): ユーザーの預金、常に引き出し可能
  • 利益(ジュニアクレーム): 取引による利益、引き出し前に成熟が必要
  • グローバルカバレッジ比率 h: 実際に裏付けられている利益の量を決定
  • 自己修復: システムは状況が改善すると自動的に回復

主要な数式

Residual = max(0, V - C_tot - I)
h = min(Residual, PNL_pos_tot) / PNL_pos_tot

ここで:
  V = vault balance
  C_tot = total capital across all accounts
  I = insurance fund
  PNL_pos_tot = sum of all positive PnL

ADL を使用しない理由

従来の ADL は、保険が枯渇すると、強制的に収益性の高いポジションを閉じます。 Percolator は代わりに、利益の抽出に比例配分でヘアカットを適用し、ポジションを維持します。

デフォルトのスタックの決定

  1. コアライブラリ: 形式検証(Kani)を備えた Rust

    • 保全、元本保護、分離をカバーする 145 の証明
    • クリティカルパスに安全でないコードはゼロ
  2. Solana プログラム: percolator-prog

    • マーケットの初期化と構成
    • ユーザーおよび LP アカウントの管理
    • キーパーのオペレーション(清算、ファンディング)
  3. CLI: TypeScript と @solana/web3.js

    • ユーザーのオペレーション(預金、引き出し、取引)
    • LP 管理
    • キーパーボット
    • テストおよび監視スクリプト
  4. マッチャー: 個別の Solana プログラム

    • パッシブ: 固定スプレッド価格設定
    • vAMM: インパクトのある動的な価格設定
    • カスタム: 独自の価格設定ロジックを実装
  5. オラクル: 複数のソースのサポート

    • Pyth Network(本番環境に推奨)
    • Chainlink OCR2
    • Oracle Authority(テストのみ)

運用手順

1. タスクレイヤーの分類

  • コアリスクエンジン: Rust ライブラリの変更
  • オンチェーンプログラム: Solana スマートコントラクトの変更
  • マッチャーロジック: 価格設定アルゴリズムの実装
  • CLI/ツール: ユーザー向けのコマンドとスクリプト
  • テスト: ユニットテスト、統合テスト、ストレステスト
  • 検証: Kani の証明と不変条件

2. 不変条件の理解

常に以下を維持します。

  • 保全: Withdrawable ≤ Backed capital
  • 元本保護: 資本は決してヘアカットされない
  • 分離: アカウントのオペレーションは、(h を介する場合を除き)他のアカウントに影響を与えない
  • No Teleport: 値は出現/消失しない

3. Percolator 固有の正確さで実装

以下について明確にしてください。

  • Slab state: マーケットの構成とナンス
  • アカウントタイプ: ユーザー vs LP、資本 vs 利益
  • カバレッジ比率: h がオペレーションにどのように影響するか
  • キーパーの要件: リスクを高める取引のための新鮮なクランク
  • オラクルの鮮度: タイムスタンプと鮮度チェック
  • マッチャーのセキュリティ: LP PDA 署名検証

4. テストの追加

  • ユニットテスト: Rust のコアロジック
  • Kani の証明: 不変条件の形式検証
  • 統合テスト: devnet 上の完全なトランザクションフロー
  • ストレステスト: 最悪のシナリオ(ギャップリスク、保険の枯渇)
  • ペンテスト: セキュリティとオラクルの操作

5. 成果物の期待

変更を実装する場合は、以下を提供します。

  • 変更された正確なファイルと差分
  • ビルド/テスト/デプロイするコマンド
  • 以下に触れるもののリスクに関する注意:
    • 引き出しのメカニズム
    • 清算ロジック
    • オラクル価格の処理
    • マッチャー CPI コール
    • 保険基金のオペレーション

プログレッシブディスクロージャー(必要に応じて読む)

クイックリファレンス

一般的な CLI コマンド

# Initialize user account
percolator-cli init-user --slab <slab-pubkey>

# Deposit collateral
percolator-cli deposit --slab <slab> --user-idx <n> --amount <lamports>

# Check best prices
percolator-cli best-price --slab <slab> --oracle <oracle>

# Run keeper crank (required before trading)
percolator-cli keeper-crank --slab <slab> --oracle <oracle>

# Trade via matcher
percolator-cli trade-cpi --slab <slab> --user-idx <n> --lp-idx <n> \
  --size <i128> --matcher-program <prog> --matcher-ctx <ctx> --oracle <oracle>

# Withdraw capital
percolator-cli withdraw --slab <slab> --user-idx <n> --amount <lamports>

Devnet テストマーケット

Slab:    A7wQtRT9DhFqYho8wTVqQCDc7kYPTUXGPATiyVbZKVFs
Oracle:  99B2bTijsU6f1GCT73HmdR7HCFFjGMBcPZY6jZ96ynrR (Chainlink SOL/USD)
Program: 2SSnp35m7FQ7cRLNKGdW5UzjYFF6RBUNq7d3m5mqNByp
Type:    INVERTED (price = 1/SOL in USD)

リスクパラメータ

Maintenance Margin: 5%
Initial Margin:     10%
Trading Fee:        10 bps (0.1%)

重要な警告

⚠️ 教育研究プロジェクト

  • 監査されていません
  • 本番環境に対応していません
  • 実際のお金で使用しないでください
  • 学習とテストのみを目的としています

⚠️ キーパークランクの要件

  • リスクを高める取引には、最近のクランクが必要です(200 スロット以内 / 約 80 秒)
  • 取引前にキーパーを実行するか、キーパーボットを使用してください

⚠️ マッチャーのセキュリティ

  • マッチャープログラムで LP PDA 署名を確認する必要があります
  • マッチャーコンテキスト + LP をアトミックに作成する必要があります
  • 失敗 = 資金窃盗の可能性

⚠️ 反転市場

  • Long = USD ロング(SOL が下落した場合に利益)
  • Short = USD ショート(SOL が上昇した場合に利益)
  • ダイレクトを理解してください

(原文がここで切り詰められています)

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

Percolator Development Skill

What this Skill is for

Use this Skill when the user asks for:

  • Percolator protocol development or integration
  • Perpetual futures risk engine implementation
  • Profit warmup and withdrawal mechanics
  • Global coverage ratio (h) calculations
  • Matcher program development (passive or vAMM)
  • Oracle integration (Pyth, Chainlink, or custom)
  • Liquidation and keeper operations
  • Funding rate mechanics
  • Formal verification with Kani
  • Testing and stress testing the protocol
  • CLI tool usage and scripting

Core Concepts

The Percolator Model

Percolator treats profit differently from traditional exchanges:

  • Capital (Senior Claims): User deposits, always withdrawable
  • Profit (Junior Claims): Trading gains, must mature before withdrawal
  • Global Coverage Ratio h: Determines how much profit is actually backed
  • Self-Healing: System automatically recovers as conditions improve

Key Formula

Residual = max(0, V - C_tot - I)
h = min(Residual, PNL_pos_tot) / PNL_pos_tot

Where:
  V = vault balance
  C_tot = total capital across all accounts
  I = insurance fund
  PNL_pos_tot = sum of all positive PnL

Why Not ADL?

Traditional ADL forcibly closes profitable positions when insurance depletes. Percolator instead applies a pro-rata haircut on profit extraction, preserving positions.

Default Stack Decisions

  1. Core Library: Rust with formal verification (Kani)

    • 145 proofs covering conservation, principal protection, isolation
    • Zero unsafe code in critical paths
  2. Solana Program: percolator-prog

    • Market initialization and configuration
    • User and LP account management
    • Keeper operations (liquidations, funding)
  3. CLI: TypeScript with @solana/web3.js

    • User operations (deposit, withdraw, trade)
    • LP management
    • Keeper bots
    • Testing and monitoring scripts
  4. Matchers: Separate Solana programs

    • Passive: Fixed spread pricing
    • vAMM: Dynamic pricing with impact
    • Custom: Implement your own pricing logic
  5. Oracles: Multi-source support

    • Pyth Network (preferred for production)
    • Chainlink OCR2
    • Oracle Authority (testing only)

Operating Procedure

1. Classify the Task Layer

  • Core risk engine: Rust library modifications
  • On-chain program: Solana smart contract changes
  • Matcher logic: Pricing algorithm implementation
  • CLI/tooling: User-facing commands and scripts
  • Testing: Unit tests, integration tests, stress tests
  • Verification: Kani proofs and invariants

2. Understand the Invariants

Always preserve:

  • Conservation: Withdrawable ≤ Backed capital
  • Principal Protection: Capital never haircut
  • Isolation: Account operations don't affect others (except via h)
  • No Teleport: Value can't appear/disappear

3. Implement with Percolator-Specific Correctness

Be explicit about:

  • Slab state: Market configuration and nonce
  • Account types: User vs LP, capital vs profit
  • Coverage ratio: How h affects the operation
  • Keeper requirements: Fresh crank for risk-increasing trades
  • Oracle freshness: Timestamp and staleness checks
  • Matcher security: LP PDA signature verification

4. Add Tests

  • Unit tests: Core logic in Rust
  • Kani proofs: Formal verification of invariants
  • Integration tests: Full transaction flows on devnet
  • Stress tests: Worst-case scenarios (gap risk, insurance depletion)
  • Pen tests: Security and oracle manipulation

5. Deliverables Expectations

When implementing changes, provide:

  • Exact files changed with diffs
  • Commands to build/test/deploy
  • Risk notes for anything touching:
    • Withdrawal mechanics
    • Liquidation logic
    • Oracle price handling
    • Matcher CPI calls
    • Insurance fund operations

Progressive Disclosure (Read When Needed)

Quick Reference

Common CLI Commands

# Initialize user account
percolator-cli init-user --slab <slab-pubkey>

# Deposit collateral
percolator-cli deposit --slab <slab> --user-idx <n> --amount <lamports>

# Check best prices
percolator-cli best-price --slab <slab> --oracle <oracle>

# Run keeper crank (required before trading)
percolator-cli keeper-crank --slab <slab> --oracle <oracle>

# Trade via matcher
percolator-cli trade-cpi --slab <slab> --user-idx <n> --lp-idx <n> \
  --size <i128> --matcher-program <prog> --matcher-ctx <ctx> --oracle <oracle>

# Withdraw capital
percolator-cli withdraw --slab <slab> --user-idx <n> --amount <lamports>

Devnet Test Market

Slab:    A7wQtRT9DhFqYho8wTVqQCDc7kYPTUXGPATiyVbZKVFs
Oracle:  99B2bTijsU6f1GCT73HmdR7HCFFjGMBcPZY6jZ96ynrR (Chainlink SOL/USD)
Program: 2SSnp35m7FQ7cRLNKGdW5UzjYFF6RBUNq7d3m5mqNByp
Type:    INVERTED (price = 1/SOL in USD)

Risk Parameters

Maintenance Margin: 5%
Initial Margin:     10%
Trading Fee:        10 bps (0.1%)

Important Warnings

⚠️ EDUCATIONAL RESEARCH PROJECT

  • NOT audited
  • NOT production ready
  • Do NOT use with real funds
  • For learning and testing only

⚠️ Keeper Crank Requirement

  • Risk-increasing trades require recent crank (within 200 slots / ~80s)
  • Run keeper before trading or use a keeper bot

⚠️ Matcher Security

  • MUST verify LP PDA signature in matcher programs
  • MUST create matcher context + LP atomically
  • Failure = potential fund theft

⚠️ Inverted Markets

  • Long = long USD (profit if SOL drops)
  • Short = short USD (profit if SOL rises)
  • Understand direction before trading