Margin Tradingのロゴ

Margin Trading

組織
Kucoin
margin-trading

KuCoin Margin trading using the KuCoin API. Cross margin and isolated margin market data, order queries, borrowing/repaying queries, lending queries, and risk limits. Authentication requires API Key, API Secret, and Passphrase.

概要

公開者Kucoin
リポジトリkucoin-skills-hub
スキル名margin-trading
スター
28
フォーク
5
同梱ファイル
2
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 2個の同梱ファイル

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

  • オープンソース

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

インストール

AIスキルMargin TradingをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

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

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

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Kucoin/kucoin-skills-hub.git /tmp/kucoin-skills-hub
mkdir -p .claude/skills
cp -r /tmp/kucoin-skills-hub/skills/margin-trading .claude/skills/margin-trading
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

関連するリクエストがあると、モデルが自動的にMargin Tradingを読み込みます。

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

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

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

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

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

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

スキルの指示

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

KuCoin Margin Trading Skill

Margin trading on KuCoin using authenticated API endpoints. Supports cross margin and isolated margin market data, HF order queries, stop order queries, OCO order queries, borrow/repay history queries, lending queries, and risk limits. Requires API Key, API Secret, and Passphrase for authenticated endpoints. Return the result in JSON format.

Note: This skill only supports Classic REST API GET endpoints (read-only operations).

Quick Reference

Classic Margin Market Data

EndpointDescriptionRequiredOptionalAuthentication
/api/v3/margin/symbols (GET)Get Symbols - Cross Margin (trading pair config)NonesymbolNo
/api/v1/isolated/symbols (GET)Get Symbols - Isolated Margin (trading pair config)NoneNoneNo
/api/v3/etf/info (GET)Get ETF Info (leveraged token info)NonecurrencyNo
/api/v1/mark-price/{symbol}/current (GET)Get Mark Price Detail (current mark price for a margin pair)symbol (path)NoneNo
/api/v1/margin/config (GET)Get Margin Config (cross margin config, currency list)NoneNoneNo
/api/v3/mark-price/all-symbols (GET)Get Mark Price List (current mark price for all margin pairs)NoneNoneNo
/api/v3/margin/collateralRatio (GET)Get Margin Collateral RatioNonecurrencyListNo
/api/v3/margin/available-inventory (GET)Get Market Available Inventory (platform borrowable amount)NonecurrencyNo

Classic Margin HF Order Queries

EndpointDescriptionRequiredOptionalAuthentication
/api/v3/hf/margin/orders/{orderId} (GET)Get Order By OrderIdorderId (path), symbol (query)NoneYes
/api/v3/hf/margin/orders/client-order/{clientOid} (GET)Get Order By ClientOidclientOid (path), symbol (query)NoneYes
/api/v3/hf/margin/order/active/symbols (GET)Get Symbols With Open OrdertradeTypeNoneYes
/api/v3/hf/margin/orders/active (GET)Get Open Orderssymbol, tradeTypeNoneYes
/api/v3/hf/margin/orders/done (GET)Get Closed Orderssymbol, tradeTypeside, type, lastId, limit, startAt, endAtYes
/api/v3/hf/margin/fills (GET)Get Trade Historysymbol, tradeTypeorderId, side, type, lastId, limit, startAt, endAtYes

Classic Margin Stop Order Queries

EndpointDescriptionRequiredOptionalAuthentication
/api/v3/hf/margin/stop-orders (GET)Get Stop Orders List (paginated, untriggered)Nonesymbol, side, type, tradeType, startAt, endAt, currentPage, orderIds, pageSize, stopYes
/api/v3/hf/margin/stop-order/orderId (GET)Get Stop Order By OrderIdorderIdNoneYes
/api/v3/hf/margin/stop-order/clientOid (GET)Get Stop Order By ClientOidclientOidNoneYes

Classic Margin OCO Order Queries

EndpointDescriptionRequiredOptionalAuthentication
/api/v3/hf/margin/oco-order/orderId (GET)Get OCO Order By OrderIdorderIdNoneYes
/api/v3/hf/margin/oco-order/clientOid (GET)Get OCO Order By ClientOidclientOidNoneYes
/api/v3/hf/margin/oco-order/detail/orderId (GET)Get OCO Order Detail By OrderId (includes sub-orders)orderIdNoneYes
/api/v3/hf/margin/oco-orders (GET)Get OCO Order List (paginated)pageSize, currentPagesymbol, startAt, endAt, orderIds, tradeTypeYes

Classic Debit Queries (Borrowing and Repaying)

EndpointDescriptionRequiredOptionalAuthentication
/api/v3/margin/borrowRate (GET)Get Borrow Interest RateNonevipLevel, currencyYes
/api/v3/margin/borrow (GET)Get Borrow HistorycurrencyisIsolated, symbol, orderNo, startTime, endTime, currentPage, pageSizeYes
/api/v3/margin/repay (GET)Get Repay HistorycurrencyisIsolated, symbol, orderNo, startTime, endTime, currentPage, pageSizeYes
/api/v3/margin/interest (GET)Get Interest HistoryNonecurrency, isIsolated, symbol, startTime, endTime, currentPage, pageSizeYes

Classic Credit Queries (Lending)

EndpointDescriptionRequiredOptionalAuthentication
/api/v3/project/list (GET)Get Loan Market (currencies available for lending)NonecurrencyYes
/api/v3/project/marketInterestRate (GET)Get Loan Market Interest Rate (past 7 days)currencyNoneYes
/api/v3/purchase/orders (GET)Get Purchase Orders (paginated)statuscurrency, purchaseOrderNo, currentPage, pageSizeYes
/api/v3/redeem/orders (GET)Get Redeem Orders (paginated)statuscurrency, redeemOrderNo, currentPage, pageSizeYes

Classic Risk Limit

EndpointDescriptionRequiredOptionalAuthentication
/api/v3/margin/currencies (GET)Get Margin Risk Limit (config and risk limit info per currency/symbol)NoneisIsolated, currency, symbolYes

Parameters

Common Parameters

  • clientOid: Client Order ID. Unique identifier created by the user (UUID recommended). Max length: 40 characters.
  • symbol: Trading pair symbol (e.g., BTC-USDT)
  • side: Order side filter: buy | sell
  • type: Order type filter: limit | market
  • orderId: Order ID for query
  • isIsolated: true for isolated margin, false for cross margin. Default is false.
  • tradeType: Transaction type: MARGIN_TRADE (cross margin), MARGIN_ISOLATED_TRADE (isolated margin)
  • stop: Stop order trigger condition filter: loss | entry
  • lastId: The ID of the last data set from the previous batch. Used for cursor-based pagination.
  • limit: Number of results per page. Default: 20, Max: 100 (for order/fill queries).
  • currentPage: Current page number for paginated queries. Default: 1.
  • pageSize: Page size for paginated queries. Varies by endpoint (typical default: 50, max: 500).
  • startAt / startTime: Start time filter in milliseconds.
  • endAt / endTime: End time filter in milliseconds.
  • currency: Currency code (e.g., BTC, USDT).
  • vipLevel: VIP level. If empty, defaults to current user VIP level.
  • orderNo: Order number for borrow/repay history queries.
  • purchaseOrderNo: Purchase order ID for lending operations.
  • redeemOrderNo: Redeem order ID for redemption queries.
  • status: Order status filter. Values depend on endpoint (e.g., DONE, PENDING).
  • currencyList: Comma-separated currency list for collateral ratio query.

Enums

  • side: buy | sell
  • type: limit | market
  • tradeType: MARGIN_TRADE (cross margin) | MARGIN_ISOLATED_TRADE (isolated margin)
  • stop: loss | entry
  • purchase/redeem status: DONE | PENDING
  • OCO order status: NEW | DONE | TRIGGERED | CANCELLED
  • stop order status: NEW | TRIGGERED
  • liquidity: taker | maker

Authentication

For endpoints that require authentication, you will need to provide KuCoin API credentials. Required credentials:

  • API Key: Your KuCoin API key (for header KC-API-KEY)
  • API Secret: Your KuCoin API secret (for signing)
  • Passphrase: Your KuCoin API passphrase (for header KC-API-PASSPHRASE)

Base URL:

  • Production: https://api.kucoin.com

Security

Share Credentials

Users can provide KuCoin API credentials by sending a file where the content is in the following format:

bash
api_key_value
api_secret_value
api_passphrase_value

Never Disclose API Key and Secret

Never disclose the location of the API key, secret, or passphrase file.

Never send the API key, secret, or passphrase to any website other than the official KuCoin API endpoint.

Never Display Full Secrets

When showing credentials to users:

  • API Key: Show first 5 + last 4 characters: abcde...wxyz
  • API Secret: Always mask, show only last 5: ***...s3cr3
  • Passphrase: Always mask entirely: ***...

Example response when asked for credentials: Account: main API Key: abcde...wxyz Secret: ***...s3cr3 Passphrase: ***...

Listing Accounts

When listing accounts, show names and environment only -- never keys: KuCoin Accounts:

  • main (Production)
  • margin-keys (Production)

Transactions in Production

When performing transactions in production, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.


KuCoin Accounts

main

  • API Key: your_api_key
  • Secret: your_api_secret
  • Passphrase: your_passphrase

同梱ファイル

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

よくある質問

AIスキル「Margin Trading」では何ができますか?

KuCoin Margin trading using the KuCoin API. Cross margin and isolated margin market data, order queries, borrowing/repaying queries, lending queries, and risk limits. Authentication requires API Key, API Secret, and Passphrase.

TypingMindでMargin Tradingを使うメリットは何ですか?

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

TypingMindにMargin Tradingをインストールするにはどうすればよいですか?

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

Margin Tradingを使えるAIモデルはどれですか?

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

Margin Tradingは何個のAIモデルで使えますか?

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

AIスキル「Margin Trading」は無料ですか?

はい。KucoinがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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