
Margin Trading
Wire Binance margin-trading API calls into an agent or script with correct signing for API key, secret, RSA, or Ed25519 credentials.
Overview
margin-trading is an agent skill for the Build phase that performs Binance Margin-trading API requests with API-key authentication and supported RSA/Ed25519 signing.
Install
npx skills add https://github.com/binance/binance-skills-hub --skill margin-tradingWhat is this skill?
- Binance Margin-trading requests via official Binance API patterns with API key and secret (or env/file inputs per v1.1.0
- Signature generation fixes for RSA and Ed25519 keys in changelog 1.1.0
- Environment variables or files supported for API key and secret key input
- Openclaw metadata appended to User-Agent header (1.1.0)
- MIT-licensed Binance skills-hub package with dated changelog (1.0.0 initial, 1.1.0 env + signing)
- Changelog documents versions 1.0.0 (2026-03-10) and 1.1.0 (2026-03-24) with env/file key input and RSA/Ed25519 signature
Adoption & trust: 1.9k installs on skills.sh; 881 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are building a margin trading bot or tool but do not want to hand-roll Binance auth, env-based secrets, and signature edge cases on every request.
Who is it for?
Developers already approved for Binance API trading who are integrating margin endpoints into agents, CLIs, or backend services.
Skip if: Beginners seeking investment advice, paper-trading-only products without key management, or teams that cannot accept live exchange risk on margin accounts.
When should I use this skill?
Authentication requires API key and secret key for Binance Margin-trading requests via the Binance API.
What do I get? / Deliverables
Your agent can issue margin-trading API calls using the hub’s documented auth and signing conventions, with keys supplied via env or files where configured.
- Authenticated Binance margin-trading API requests from agent-driven workflows
- Correctly signed requests for configured key types including RSA and Ed25519 where applicable
Recommended Skills
Journey fit
Margin trading is an external exchange integration you implement while building trading automation—not a generic launch or growth playbook. integrations holds third-party API skills where auth, signatures, and request shapes are the deliverable.
How it compares
Exchange API integration skill—not a backtesting framework, tax tool, or discretionary trade recommender.
Common Questions / FAQ
Who is margin-trading for?
Solo builders and small teams coding Binance-connected agents or services who need margin-trading endpoints with proper API authentication.
When should I use margin-trading?
During Build while implementing Binance margin order, borrow, or account flows in your app or agent—after you have API keys and a risk plan, not before basic spot read-only prototyping if margin is unnecessary.
Is margin-trading safe to install?
It handles live trading credentials and network calls to Binance—review the Security Audits panel on this page, restrict API permissions, never commit secrets, and test on Binance test endpoints or minimal size before production margin use.
SKILL.md
READMESKILL.md - Margin Trading
# Changelog ## 1.1.0 - 2026-03-24 - Environmental variables or files can now be used as input for the API key and secret key. - Fix signature generation for RSA and Ed25519 keys. - Add `Openclaw` metadata to the User Agent header ## 1.0.0 - 2026-03-10 - Initial release MIT License Copyright (c) 2026 Binance Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- name: margin-trading description: Binance Margin-trading request using the Binance API. Authentication requires API key and secret key. metadata: version: 1.1.0 author: Binance openclaw: requires: bins: - curl - openssl - date homepage: https://github.com/binance/binance-skills-hub/tree/main/skills/binance/margin-trading/SKILL.md license: MIT --- # Binance Margin-trading Skill Margin-trading request on Binance using authenticated API endpoints. Requires API key and secret key for certain endpoints. Return the result in JSON format. ## Quick Reference | Endpoint | Description | Required | Optional | Authentication | |----------|-------------|----------|----------|----------------| | `/sapi/v1/margin/max-leverage` (POST) | Adjust cross margin max leverage (USER_DATA) | maxLeverage | None | Yes | | `/sapi/v1/margin/isolated/account` (DELETE) | Disable Isolated Margin Account (TRADE) | symbol | recvWindow | Yes | | `/sapi/v1/margin/isolated/account` (POST) | Enable Isolated Margin Account (TRADE) | symbol | recvWindow | Yes | | `/sapi/v1/margin/isolated/account` (GET) | Query Isolated Margin Account Info (USER_DATA) | None | symbols, recvWindow | Yes | | `/sapi/v1/bnbBurn` (GET) | Get BNB Burn Status (USER_DATA) | None | recvWindow | Yes | | `/sapi/v1/margin/tradeCoeff` (GET) | Get Summary of Margin account (USER_DATA) | None | recvWindow | Yes | | `/sapi/v1/margin/capital-flow` (GET) | Query Cross Isolated Margin Capital Flow (USER_DATA) | None | asset, symbol, type, startTime, endTime, fromId, limit, recvWindow | Yes | | `/sapi/v1/margin/account` (GET) | Query Cross Margin Account Details (USER_DATA) | None | recvWindow | Yes | | `/sapi/v1/margin/crossMarginData` (GET) | Query Cross Margin Fee Data (USER_DATA) | None | vipLevel, coin, recvWindow | Yes | | `/sapi/v1/margin/isolated/accountLimit` (GET) | Query Enabled Isolated Margin Account Limit (USER_DATA) | None | recvWindow | Yes | | `/sapi/v1/margin/isolatedMarginData` (GET) | Query Isolated Margin Fee Data (USER_DATA) | None | vipLevel, symbol, recvWindow | Yes | | `/sapi/v1/margin/interestHistory` (GET) | Get Interest History (USER_DATA) | None | asset, isolatedSymbol, startTime, endTime, current, size, recvWindow | Yes | | `/sapi/v1/margin/next-hourly-interest-rate` (GET) | Get future hourly interest rate (USER_DATA) | assets, isIsolated | None | Yes | | `/sapi/v1/margin/borrow-repay` (POST) | Margin account borrow/repay(MARGIN) | asset, isIsolated, symbol, amount, type | recvWindow | Yes | | `/sapi/v1/margin/borrow-repay` (GET) | Query borrow/repay records in Margin account(USER_DATA) | type | asset, isol