CommunityProgramación y desarrollogithub.com

binance/margin-trading

Operaciones de trading con margen en Binance usando la API de Binance. La autenticación requiere clave API y clave secreta.

¿Qué es margin-trading?

Esta habilidad permite a un agente de IA realizar operaciones de trading con margen en el exchange Binance a través de su API oficial. Está diseñada para desarrolladores y traders automatizados que necesitan gestionar posiciones apalancadas con préstamos de Binance. La habilidad se encarga de manejar la autenticación mediante API key y secret key, y proporciona funciones para consultar información de cuentas, crear y cancelar órdenes, transferir fondos entre cuentas spot y de margen, y gestionar el pago de intereses. Es útil para bots de trading, estrategias de arbitraje, o herramientas de gestión de carteras que requieren acceso a mercados de margen. La habilidad soporta tanto margen aislado como cruzado, y sigue los estándares de la API de Binance, por lo que es compatible con cualquier agente que pueda realizar solicitudes HTTP firmadas.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/binance/binance-skills-hub/tree/main/skills/margin-trading

Installed? Explore more Programación y desarrollo skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

¿Qué hace margin-trading?

Operaciones de trading con margen en Binance usando la API de Binance. La autenticación requiere clave API y clave secreta.

Descripción

Esta habilidad permite realizar operaciones de trading con margen en el exchange Binance a través de su API. Los usuarios deben proporcionar su clave API y clave secreta para autenticarse. Soporta la gestión de cuentas de margen aislado y cruzado, incluyendo la capacidad de realizar órdenes de compra y venta, consultar saldos y estados de cuentas, y gestionar préstamos y reembolsos de margen.

Configuración

Para usar esta habilidad, necesitarás:

  1. Una cuenta de Binance.
  2. Generar una clave API y clave secreta desde el panel de administración de Binance (asegúrate de habilitar los permisos de trading con margen).
  3. Configurar las variables de entorno o los parámetros de habilidad apropiados.

Variables de Entorno

  • BINANCE_API_KEY: Tu clave pública de la API de Binance.
  • BINANCE_SECRET_KEY: Tu clave secreta de la API de Binance.

Parámetros de Habilidad (Alternativa)

También puedes pasar la clave API y la clave secreta directamente al invocar la habilidad.

Capacidades

La habilidad proporciona las siguientes funciones principales:

  1. Crear una orden de margen: Realizar una orden de compra o venta con apalancamiento.
  2. Cancelar una orden: Cancelar una orden abierta en tu cuenta de margen.
  3. Consultar saldo: Verificar el saldo disponible en tu cuenta de margen (activos y pasivos).
  4. Transferir fondos: Mover fondos entre tu cuenta spot y de margen.
  5. Gestionar préstamos: Solicitar un préstamo de margen o reembolsarlo.

Ejemplo de Uso

Aquí hay un ejemplo de cómo usar la habilidad con un agente de IA:

# Solicitar una orden de margen
node margin-trade.js --symbol BTCUSDT --side BUY --type MARKET --quoteOrderQty 100

O en un script:

const marginTrade = require('binance-margin-trading');

// Autenticación
marginTrade.setApiKey(process.env.BINANCE_API_KEY, process.env.BINANCE_SECRET_KEY);

// Crear orden de margen
const order = await marginTrade.createMarginOrder({
  symbol: 'BTCUSDT',
  side: 'BUY',
  type: 'MARKET',
  quoteOrderQty: 100
});

console.log('Orden creada:', order);

Notas de Seguridad

  • Nunca compartas tu clave secreta.
  • Usa claves API con permisos específicos (solo trading con margen) y considera limitar los retiros.
  • Almacena las claves de forma segura mediante variables de entorno o un gestor de secretos.

Soporte

Para problemas o preguntas, consulta la documentación oficial de la API de Binance o abre un issue en este repositorio.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

binance/algo

Binance Algo request using the Binance API. Authentication requires API key and secret key.

binance/alpha

Binance Alpha request using the Binance API. Authentication requires API key and secret key.

binance/assets

Binance Assets request using the Binance API. Authentication requires API key and secret key.

binance/binance

Use binance-cli for Binance Spot, Futures (USD-S), and Convert. Requires auth.

binance/binance-agentic-wallet

Use when the user mentions connect/disconnect wallet, sign in, sign out, web3 wallet, wallet address, check balance, how much crypto do I have, send BNB/USDT/crypto, transfer tokens, swap tokens, buy/sell token, DEX trade, limit order, market order, cancel order, get a quote, transaction history, wallet settings, daily limit, slippage, MEV protection, supported chains, available networks, prediction market, predict.fun, YES/NO market, place a prediction, redeem winnings, claim payout, prediction portfolio, prediction PnL, x402 payment, HTTP 402 Payment Required, pay a known x402 API, or any on-chain wallet operation.

binance/binance-tokenized-securities-info

Query Ondo tokenized US stock data on Binance Web3. Covers: supported stock token list, RWA metadata (company info, attestation reports), market and per-asset trading status (with corporate action codes for earnings, dividends, splits), real-time on-chain data (token price, holders, circulating supply, market cap), US stock fundamentals (P/E, dividend yield, 52-week range), and token K-Line/candlestick charts. Use this skill when users ask about: - Tokenized stock price, holders, or on-chain data for specific tickers - Whether a stock token is tradable, paused, or halted - Ondo RWA token list or which US stocks are available on-chain - Corporate actions affecting a token (dividends, stock splits, earnings halt) - Stock token K-Line or candlestick chart data - Comparing on-chain token price vs US stock price NOT for general crypto tokens (BTC, ETH, SOL, etc.) — use query-token-info for those.

binance/convert

Binance Convert request using the Binance API. Authentication requires API key and secret key.

binance/crypto-market-rank

Crypto market leaderboards — ranked aggregate feeds across the whole market: social-hype/sentiment rank, trending / top-search / Binance Alpha / tokenized-stocks rank, smart-money net-inflow rank (which tokens received the most inflow), top meme tokens by breakout score on Pulse launchpad, top trader PnL leaderboard (ALL / KOL). Use whenever the user wants a ranked list of tokens or addresses by some metric — phrases like "trending tokens", "top N by hype", "leaderboard", "rank by X", "biggest inflows", "top traders this week".

binance/derivatives-trading-coin-futures

Binance Derivatives-trading-coin-futures request using the Binance API. Authentication requires API key and secret key. Supports testnet and mainnet.

binance/derivatives-trading-options

Binance Derivatives-trading-options request using the Binance API. Authentication requires API key and secret key. Supports testnet and mainnet.

binance/derivatives-trading-portfolio-margin

Binance Derivatives-trading-portfolio-margin request using the Binance API. Authentication requires API key and secret key. Supports testnet and mainnet.

binance/derivatives-trading-portfolio-margin-pro

Binance Derivatives-trading-portfolio-margin-pro request using the Binance API. Authentication requires API key and secret key.

binance/derivatives-trading-usds-futures

Binance Derivatives-trading-usds-futures request using the Binance API. Authentication requires API key and secret key. Supports testnet and mainnet.

binance/fiat

Query Binance fiat payment capabilities — supported countries, currencies, payment methods, limits, and crypto prices — via public APIs, plus authenticated order/payment history lookup. Use whenever users ask about buying or selling crypto with fiat, depositing or withdrawing fiat, fiat-crypto exchange rates, payment options in a specific country, or their fiat order history — even if they don't explicitly mention Binance APIs.

binance/meme-rush

Live launchpad feed + AI hot topics for meme tokens. (1) meme-rush: real-time lifecycle feed on launchpads (Pump.fun, Four.meme) — brand-new launches, currently-finalizing / bonding-curve tokens, and just-migrated-to-DEX tokens; filter by dev behavior, age, market cap. (2) topic-rush: AI-detected hot market narratives with the associated tokens ranked by inflow. Use for: "new pump.fun launches", "what just migrated", "currently bonding", "hot narratives", "what topic is pumping right now", "live launchpad feed", "AI hot topics".

binance/onchain-pay-open-api

Binance Onchain Pay enables users to buy cryptocurrency with fiat (e.g., EUR, USD) or send existing crypto from their Binance account directly to any external on-chain wallet address in a single flow—no manual withdrawal needed. Enables partners to integrate crypto buying services: - payment-method-list: Get available payment methods (Card, P2P, Google Pay, Apple Pay, etc.) with limits for a fiat/crypto pair - trading-pairs: List all supported fiat currencies and cryptocurrencies - estimated-quote: Get real-time price quote including exchange rate, fees, and estimated crypto amount - pre-order: Create a buy order and get redirect URL to Binance payment flow - order: Query order status and details (processing, completed, failed, etc.) - crypto-network: Get supported blockchain networks with withdraw fees and limits - p2p/trading-pairs: List P2P-specific trading pairs

binance/p2p

Binance P2P trading assistant for natural-language queries about P2P/C2C market ads, the user's own P2P order history, order detail & appeal tracking, and advertisement publish & management. Use when the user asks about P2P prices, searching/choosing ads, comparing payment methods, reviewing P2P order history, checking order detail/appeal status, querying complaints, publishing/updating/managing P2P advertisements, or viewing merchant profiles. Do NOT use for spot/futures prices, exchange trading, deposits/withdrawals, on-chain transfers, or anything unrelated to P2P/C2C.

binance/payment-assistant

Binance Pay Assistant - Send and Receive crypto payments. Send: QR code payment from Funding Wallet (C2C + PIX). Use when user wants to buy/purchase/pay/transfer/send, confirm/cancel payment, or query order status. Requires QR code data. PIX QR codes (pix, br.gov.bcb.pix) are auto-detected. Receive: Generate QR codes and payment links to collect crypto. Use when user wants to receive/collect payment (generate receive link, receive QR). Do NOT use for earning, buying/selling crypto, or digital goods.

binance/query-address-info

Snapshot of a single wallet's token holdings on a specific chain — list of every token currently held with name, symbol, current price, 24h price change, and holding quantity. Use when the user provides an explicit wallet address (or says "my wallet") and wants the current portfolio: "what does 0x... hold", "wallet balance breakdown", "list positions for this address", "what tokens are in this wallet", "show me the holdings of <address>".

binance/query-token-audit

Query token security audit to detect scams, honeypots, and malicious contracts before trading. Returns comprehensive security analysis including contract risks, trading risks, and scam detection. Use when users ask "is this token safe?", "check token security", "audit token", or before any swap.

Skills relacionados