Skip to main content

Execution API

The Execution API provides a unified interface for order execution across all supported exchanges. Users specify standard parameters (order_type, time_in_force, stop_price, etc.) and the system automatically handles exchange-specific translation.

Key Features

  • Unified Parameters: Same API works across all exchanges
  • Clear Error Messages: If an exchange doesn’t support a feature, you get a specific error
  • Capability Discovery: Query what each exchange supports before trading
  • Pre-validation: Check if your order would be valid before submitting

Unified Order Types

Order TypeDescription
marketExecute immediately at best available price
limitExecute at specified price or better
stop_lossMarket order triggered when price falls to stop_price
stop_loss_limitLimit order triggered when price falls to stop_price
take_profitMarket order triggered when price rises to stop_price
take_profit_limitLimit order triggered when price rises to stop_price
trailing_stopStop order that follows price with trailing_delta
ocoOne-Cancels-Other (limit + stop loss pair)

Time-in-Force Options

TIFDescription
GTCGood-Till-Cancelled
IOCImmediate-Or-Cancel
FOKFill-Or-Kill
POST_ONLYMaker only (rejects if would immediately fill)

Exchange Capabilities Matrix

Order Type Support

Exchangemarketlimitstop_losstake_profittrailing_stopoco
BinanceSpot/PerpSpot/PerpSpot/PerpSpot/PerpPerp onlySpot only
BybitSpot/PerpSpot/PerpSpot/PerpSpot/PerpPerp only-
Gate.ioSpot/PerpSpot/PerpSpot/PerpSpot/Perp--
KrakenSpot/PerpSpot/PerpSpot/PerpSpot/Perp--
HyperliquidPerpPerpPerpPerp--
OKXSpot/PerpSpot/PerpSpot/PerpSpot/PerpPerp onlySpot only

Feature Support

Exchangereduce_onlypost_onlyhedge_modeNotes
BinancePerpBothPerpDemo trading uses demo-api.binance.com
BybitPerpBothPerpUses category param (spot/linear/inverse)
Gate.ioPerpPerp-Spot stop orders use price-triggered endpoint
KrakenPerpBoth-Uses oflags=‘post’ for post-only
HyperliquidPerpPerp-Perp only, requires slippage for market orders
OKXPerpBothPerp-

POST /oems/execution/order

Execute an order using unified parameters. The system automatically translates to exchange-specific format.

Authentication

Requires valid Bearer token with trader or admin role.

Request Body (JSON)

  • exchange_account_id (string, required): The exchange account UUID (e.g., “binance-sandbox-001”)
  • symbol (string, required): Trading pair in CCXT format (e.g., “BTC/USDT”)
  • side (string, required): Order side: "buy" or "sell"
  • order_type (string, required): Order type: market, limit, stop_loss, stop_loss_limit, take_profit, take_profit_limit, trailing_stop, oco
  • quantity (number, required): Order quantity in base asset units
  • price (number, optional): Limit price. Required for limit, stop_loss_limit, take_profit_limit orders.
  • stop_price (number, optional): Trigger price for stop orders. Required for stop_loss, stop_loss_limit, take_profit, take_profit_limit orders.
  • trailing_delta (number, optional): Trailing delta percentage. Required for trailing_stop orders.
  • time_in_force (string, optional): Time-in-force: GTC, IOC, FOK, POST_ONLY. Default: GTC
  • reduce_only (boolean, optional): For perps: only reduce existing position, don’t open new one. Default: false
  • post_only (boolean, optional): Maker only: reject if order would immediately fill. Default: false
  • client_order_id (string, optional): Optional user-defined order ID for tracking.
  • market_type (string, optional): Market type: spot, swap, or future. Default: spot

Request Examples

Market Order
curl -X POST http://localhost:8082/oems/execution/order \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-sandbox-001",
    "symbol": "BTC/USDT",
    "side": "buy",
    "order_type": "market",
    "quantity": 0.001
  }'
Limit Order with Post-Only
curl -X POST http://localhost:8082/oems/execution/order \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-sandbox-001",
    "symbol": "BTC/USDT",
    "side": "buy",
    "order_type": "limit",
    "quantity": 0.001,
    "price": 80000,
    "time_in_force": "POST_ONLY"
  }'
Stop Loss Order
curl -X POST http://localhost:8082/oems/execution/order \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-sandbox-001",
    "symbol": "BTC/USDT",
    "side": "sell",
    "order_type": "stop_loss",
    "quantity": 0.001,
    "stop_price": 85000
  }'
Stop Loss Limit Order
curl -X POST http://localhost:8082/oems/execution/order \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-sandbox-001",
    "symbol": "BTC/USDT",
    "side": "sell",
    "order_type": "stop_loss_limit",
    "quantity": 0.001,
    "price": 84000,
    "stop_price": 85000
  }'
Trailing Stop Order (Binance Futures)
curl -X POST http://localhost:8082/oems/execution/order \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-sandbox-001",
    "symbol": "BTC/USDT:USDT",
    "side": "sell",
    "order_type": "trailing_stop",
    "quantity": 0.001,
    "trailing_delta": 1.0,
    "market_type": "swap"
  }'
Perp Order with Reduce-Only
curl -X POST http://localhost:8082/oems/execution/order \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "bybit-001",
    "symbol": "BTC/USDT:USDT",
    "side": "sell",
    "order_type": "market",
    "quantity": 0.001,
    "reduce_only": true,
    "market_type": "swap"
  }'

Response Examples

Successful Order
{
  "isError": false,
  "message": "Order executed successfully",
  "statusCode": 200,
  "data": {
    "order_id": "12345678",
    "exchange": "binance",
    "market": "BTC/USDT",
    "order_type": "market",
    "order_side": "buy",
    "order_status": "closed",
    "quantity": 0.001,
    "quantity_filled": 0.001,
    "avg_fill_price": 43250.50,
    "order_fee": 0.0432505,
    "fee_currency": "USDT",
    "execution_time": 0.342,
    "execution_date": "2025-01-15T10:30:00Z"
  }
}
Unsupported Feature
{
  "isError": true,
  "message": "Gate.io does not support trailing_stop orders",
  "statusCode": 400,
  "data": {
    "exchange": "gateio",
    "order_type": "trailing_stop",
    "market_type": "spot"
  }
}
Daily Limit Exceeded
{
  "isError": true,
  "message": "Order would exceed daily limit. Remaining: $23.50",
  "statusCode": 400,
  "data": {
    "error": "DAILY_LIMIT_EXCEEDED",
    "limit_check": {
      "allowed": false,
      "order_value_usd": 100.00,
      "remaining_usd": 23.50
    }
  }
}

GET /oems/execution/capabilities

Query what order types, time-in-force options, and features each exchange supports.

Query Parameters

  • exchange (string, optional): Exchange name. If not provided, returns all exchanges.

Request Example

# Get Binance capabilities
curl "http://localhost:8082/oems/execution/capabilities?exchange=binance"

# Get all exchange capabilities
curl "http://localhost:8082/oems/execution/capabilities"

Response Examples

Single Exchange
{
  "isError": false,
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "supports_spot": true,
    "supports_perp": true,
    "spot": {
      "order_types": ["limit", "market", "oco", "stop_loss", "stop_loss_limit", "take_profit", "take_profit_limit"],
      "time_in_force": ["FOK", "GTC", "IOC"],
      "features": ["post_only"]
    },
    "perp": {
      "order_types": ["limit", "market", "stop_loss", "stop_loss_limit", "take_profit", "take_profit_limit", "trailing_stop"],
      "time_in_force": ["FOK", "GTC", "IOC", "POST_ONLY"],
      "features": ["hedge_mode", "portfolio_margin", "post_only", "reduce_only"]
    },
    "notes": {
      "trailing_stop": "Only available on futures (TRAILING_STOP_MARKET)",
      "oco": "Only available on spot"
    }
  }
}
All Exchanges
{
  "isError": false,
  "statusCode": 200,
  "data": {
    "exchanges": {
      "binance": { "..." },
      "bybit": { "..." },
      "gateio": { "..." },
      "kraken": { "..." },
      "hyperliquid": { "..." },
      "okx": { "..." }
    }
  }
}

POST /oems/execution/validate

Check if an order would be valid for a specific exchange before submitting.

Request Body (JSON)

  • exchange (string, required): Exchange name (e.g., “binance”, “gateio”)
  • order_type (string, required): Order type to validate
  • market_type (string, optional): Market type: spot, swap, or future. Default: spot
  • time_in_force (string, optional): Time-in-force option to validate
  • reduce_only (boolean, optional): Check if reduce_only is supported. Default: false
  • post_only (boolean, optional): Check if post_only is supported. Default: false
  • stop_price (number, optional): Include to validate stop order requirements
  • trailing_delta (number, optional): Include to validate trailing stop requirements

Request Example

# Check if trailing_stop is supported on Gate.io spot
curl -X POST http://localhost:8082/oems/execution/validate \
  -H "Content-Type: application/json" \
  -d '{
    "exchange": "gateio",
    "order_type": "trailing_stop",
    "market_type": "spot"
  }'
# Returns: "Gate.io does not support trailing_stop orders"

Response Examples

Valid
{
  "isError": false,
  "message": "Order parameters are valid",
  "statusCode": 200,
  "data": {
    "valid": true,
    "error": null,
    "warnings": []
  }
}
Invalid
{
  "isError": true,
  "message": "Hyperliquid does not support spot trading",
  "statusCode": 400,
  "data": {
    "valid": false,
    "error": "Hyperliquid does not support spot trading",
    "warnings": []
  }
}

GET /oems/execution/order/

Fetch the current status of an order from the exchange.

Path Parameters

  • order_id (string, required): The exchange order ID

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, optional): Trading symbol (required by some exchanges)
  • market_type (string, optional): Market type: spot, swap, or future. Default: spot

Request Example

curl "http://localhost:8082/oems/execution/order/12345678?exchange_account_id=binance-sandbox-001&symbol=BTC/USDT"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "order_id": "12345678",
    "symbol": "BTC/USDT",
    "status": "closed",
    "type": "market",
    "side": "buy",
    "price": null,
    "amount": 0.001,
    "filled": 0.001,
    "remaining": 0,
    "average": 43250.50,
    "cost": 43.25,
    "fee": { "cost": 0.04325, "currency": "USDT" },
    "timestamp": 1705315800000,
    "datetime": "2025-01-15T10:30:00Z"
  }
}

DELETE /oems/execution/order/

Cancel an open order on the exchange.

Path Parameters

  • order_id (string, required): The exchange order ID to cancel

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, optional): Trading symbol (required by some exchanges)
  • market_type (string, optional): Market type: spot, swap, or future. Default: spot

Request Example

curl -X DELETE "http://localhost:8082/oems/execution/order/12345678?exchange_account_id=binance-sandbox-001&symbol=BTC/USDT"

GET /oems/execution/balance

Fetch account balance from the exchange.

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • market_type (string, optional): Market type: spot, swap, or future. Default: spot

Request Example

curl "http://localhost:8082/oems/execution/balance?exchange_account_id=gateio-001"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "exchange": "gateio",
    "exchange_account_id": "gateio-001",
    "free": { "BTC": 0.00033967, "USDT": 0.30120829 },
    "used": { "BTC": 0.0001 },
    "total": { "BTC": 0.00043967, "USDT": 0.30120829 }
  }
}

GET /oems/execution/orders/open

Fetch all open orders from the exchange.

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, optional): Filter by trading symbol
  • market_type (string, optional): Market type: spot, swap, or future. Default: spot

Request Example

curl "http://localhost:8082/oems/execution/orders/open?exchange_account_id=binance-sandbox-001"

GET /oems/execution/daily-limit

Get the daily trading limit status for an exchange account.

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID

Request Example

curl "http://localhost:8082/oems/execution/daily-limit?exchange_account_id=gateio-001"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "date": "2025-01-15",
    "exchange_account_id": "gateio-001",
    "limit_usd": 100.00,
    "used_usd": 76.50,
    "remaining_usd": 23.50,
    "pct_used": 76.5,
    "order_count": 3
  }
}

Error Codes

Error CodeStatusDescription
DAILY_LIMIT_EXCEEDED400Order would exceed daily trading limit
DEV_MODE_LIMIT_EXCEEDED400Order exceeds DEV_MODE safety limit ($50)
INSUFFICIENT_BALANCE400Not enough balance for order
INSUFFICIENT_MARGIN400Not enough margin (futures)
EXCHANGE_ERROR500Exchange returned an error
NETWORK_ERROR500Network error after max retries
ORDER_NOT_FOUND404Order not found on exchange

Migration from Legacy API

If you were using the old params object for exchange-specific parameters, here’s how to migrate: Before (Legacy)
{
  "order_type": "stop_loss_limit",
  "price": 84000,
  "params": {
    "stopPrice": 85000,
    "timeInForce": "GTC"
  }
}
After (Unified)
{
  "order_type": "stop_loss_limit",
  "price": 84000,
  "stop_price": 85000,
  "time_in_force": "GTC"
}
The unified API handles all exchange-specific translation automatically. If you try to use a feature that an exchange doesn’t support, you’ll get a clear error message like “Gate.io does not support trailing_stop orders” instead of a cryptic exchange error.

Futures/Perpetuals Endpoints

The following endpoints are specific to futures and perpetual trading.

POST /oems/execution/leverage

Set leverage for a symbol on futures/perp markets.

Request Body (JSON)

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, required): Trading pair in perp format (e.g., “BTC/USDT:USDT”)
  • leverage (number, required): Leverage value (e.g., 1, 5, 10, 20, 50, 100)
  • market_type (string, optional): swap or future. Default: swap

Request Example

curl -X POST "https://api.renesis.fi/order-execution/execution/leverage" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-perp-001",
    "symbol": "BTC/USDT:USDT",
    "leverage": 10
  }'

Response Example

{
  "isError": false,
  "message": "Leverage set to 10x for BTC/USDT:USDT",
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "exchange_account_id": "binance-perp-001",
    "symbol": "BTC/USDT:USDT",
    "leverage": 10,
    "result": { "leverage": 10, "symbol": "BTCUSDT" }
  }
}

GET /oems/execution/leverage

Get current leverage and margin mode for a symbol.

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, required): Trading pair (e.g., “BTC/USDT:USDT”)
  • market_type (string, optional): swap or future. Default: swap

Request Example

curl "https://api.renesis.fi/order-execution/execution/leverage?exchange_account_id=binance-perp-001&symbol=BTC/USDT:USDT" \
  -H "Authorization: Bearer $TOKEN"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "exchange_account_id": "binance-perp-001",
    "symbol": "BTC/USDT:USDT",
    "leverage": 10,
    "margin_mode": "cross",
    "position_side": "long",
    "position_size": 0.05,
    "notional": 4925.25,
    "unrealized_pnl": 125.50
  }
}

POST /oems/execution/margin-mode

Set margin mode (cross or isolated) for a symbol.

Request Body (JSON)

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, required): Trading pair (e.g., “BTC/USDT:USDT”)
  • margin_mode (string, required): cross or isolated
  • market_type (string, optional): swap or future. Default: swap

Request Example

curl -X POST "https://api.renesis.fi/order-execution/execution/margin-mode" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-perp-001",
    "symbol": "BTC/USDT:USDT",
    "margin_mode": "isolated"
  }'

Response Example

{
  "isError": false,
  "message": "Margin mode set to isolated for BTC/USDT:USDT",
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "exchange_account_id": "binance-perp-001",
    "symbol": "BTC/USDT:USDT",
    "margin_mode": "isolated",
    "result": {}
  }
}

GET /oems/execution/positions

Fetch open positions from exchange (futures/perp only).

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, optional): Filter by symbol
  • market_type (string, optional): swap or future. Default: swap

Request Example

curl "https://api.renesis.fi/order-execution/execution/positions?exchange_account_id=binance-perp-001" \
  -H "Authorization: Bearer $TOKEN"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "positions": [
      {
        "symbol": "BTC/USDT:USDT",
        "side": "long",
        "contracts": 0.05,
        "contract_size": 1,
        "entry_price": 98000.00,
        "mark_price": 98505.00,
        "notional": 4925.25,
        "leverage": 10,
        "unrealized_pnl": 25.25,
        "percentage": 0.51,
        "margin_mode": "cross",
        "liquidation_price": 88200.00,
        "collateral": 492.52,
        "timestamp": 1706745600000,
        "datetime": "2025-01-31T12:00:00Z",
        "exchange": "binance",
        "exchange_account_id": "binance-perp-001"
      }
    ],
    "count": 1
  }
}

GET /oems/execution/funding-history

Fetch funding rate payments for perpetual futures.

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, optional): Filter by symbol
  • since (number, optional): Start timestamp in milliseconds
  • limit (number, optional): Max number of records
  • market_type (string, optional): swap or future. Default: swap

Request Example

curl "https://api.renesis.fi/order-execution/execution/funding-history?exchange_account_id=binance-perp-001&symbol=BTC/USDT:USDT&limit=10" \
  -H "Authorization: Bearer $TOKEN"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "exchange_account_id": "binance-perp-001",
    "symbol": "BTC/USDT:USDT",
    "payments": [
      {
        "id": "123456789",
        "symbol": "BTC/USDT:USDT",
        "amount": -0.15,
        "code": "USDT",
        "timestamp": 1706745600000,
        "datetime": "2025-01-31T12:00:00Z",
        "info": {}
      }
    ],
    "count": 1
  }
}

GET /oems/execution/realized-pnl

Fetch realized PnL for perpetual futures positions.

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID
  • symbol (string, optional): Filter by symbol
  • since (number, optional): Start timestamp in milliseconds
  • limit (number, optional): Max number of records
  • market_type (string, optional): swap or future. Default: swap

Request Example

curl "https://api.renesis.fi/order-execution/execution/realized-pnl?exchange_account_id=binance-perp-001&limit=10" \
  -H "Authorization: Bearer $TOKEN"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "exchange_account_id": "binance-perp-001",
    "symbol": null,
    "entries": [
      {
        "id": "987654321",
        "symbol": "BTC/USDT:USDT",
        "amount": 125.50,
        "code": "USDT",
        "timestamp": 1706745600000,
        "datetime": "2025-01-31T12:00:00Z",
        "info": {}
      }
    ],
    "count": 1
  }
}

Portfolio Margin Endpoints (Binance)

The following endpoints are specific to Binance Portfolio Margin accounts. Portfolio Margin is a unified margin account that combines cross margin, USDⓈ-M Futures, and COIN-M Futures.

GET /oems/execution/portfolio-margin/balance

Get Portfolio Margin balance from Binance PAPI. Returns detailed breakdown of:
  • Cross Margin: Total, free, locked, borrowed, interest
  • USDⓈ-M Futures: Wallet balance, unrealized PnL
  • COIN-M Futures: Wallet balance, unrealized PnL

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID (must be a Binance PM account)

Request Example

curl "https://api.renesis.fi/order-execution/execution/portfolio-margin/balance?exchange_account_id=binance-pm-001" \
  -H "Authorization: Bearer $TOKEN"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "exchange_account_id": "binance-pm-001",
    "assets": {
      "USDT": {
        "cross_margin": {
          "total": 10000.00,
          "free": 8500.00,
          "locked": 1500.00,
          "borrowed": 0,
          "interest": 0
        },
        "um_futures": {
          "wallet": 2500.00,
          "unrealized_pnl": 125.50
        },
        "cm_futures": {
          "wallet": 0,
          "unrealized_pnl": 0
        },
        "total_wallet_balance": 12500.00,
        "negative_balance": 0
      },
      "BTC": {
        "cross_margin": {
          "total": 0.5,
          "free": 0.45,
          "locked": 0.05,
          "borrowed": 0,
          "interest": 0
        },
        "um_futures": {
          "wallet": 0,
          "unrealized_pnl": 0
        },
        "cm_futures": {
          "wallet": 0.1,
          "unrealized_pnl": 0.005
        },
        "total_wallet_balance": 0.6,
        "negative_balance": 0
      }
    }
  }
}

GET /oems/execution/portfolio-margin/account

Get Portfolio Margin account info from Binance PAPI. Returns raw PAPI balance and UM account data.

Query Parameters

  • exchange_account_id (string, required): The exchange account UUID (must be a Binance PM account)

Request Example

curl "https://api.renesis.fi/order-execution/execution/portfolio-margin/account?exchange_account_id=binance-pm-001" \
  -H "Authorization: Bearer $TOKEN"

Response Example

{
  "isError": false,
  "message": "Success",
  "statusCode": 200,
  "data": {
    "exchange": "binance",
    "exchange_account_id": "binance-pm-001",
    "papi_balance": [
      {
        "asset": "USDT",
        "crossMarginAsset": "10000.00",
        "crossMarginFree": "8500.00",
        "crossMarginLocked": "1500.00",
        "umWalletBalance": "2500.00",
        "umUnrealizedPNL": "125.50",
        "cmWalletBalance": "0",
        "cmUnrealizedPNL": "0",
        "totalWalletBalance": "12500.00"
      }
    ],
    "papi_um_account": {
      "totalInitialMargin": "1000.00",
      "totalMaintMargin": "200.00",
      "totalWalletBalance": "12500.00",
      "totalUnrealizedProfit": "125.50",
      "totalMarginBalance": "12625.50",
      "availableBalance": "11500.00",
      "maxWithdrawAmount": "11500.00"
    }
  }
}

POST /oems/execution/portfolio-margin/auto-collection

Trigger auto-collection for Portfolio Margin account. Transfers all positive balances from USDⓈ-M and COIN-M Futures Wallets to Cross Margin Wallet.
BNB in USDⓈ-M Futures Wallet will NOT be transferred.

Request Body (JSON)

  • exchange_account_id (string, required): The exchange account UUID (must be a Binance PM account)

Request Example

curl -X POST "https://api.renesis.fi/order-execution/execution/portfolio-margin/auto-collection" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-pm-001"
  }'

Response Example

{
  "isError": false,
  "message": "Auto-collection triggered successfully",
  "statusCode": 200,
  "data": {
    "success": true,
    "exchange": "binance",
    "exchange_account_id": "binance-pm-001",
    "response": {}
  }
}

POST /oems/execution/portfolio-margin/asset-collection

Trigger asset-specific collection for Portfolio Margin account. Transfers a specific asset from Futures Account to Margin account.
BNB transfer is NOT supported.

Request Body (JSON)

  • exchange_account_id (string, required): The exchange account UUID (must be a Binance PM account)
  • asset (string, required): Asset to transfer (e.g., “USDT”, “BTC”)

Request Example

curl -X POST "https://api.renesis.fi/order-execution/execution/portfolio-margin/asset-collection" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_account_id": "binance-pm-001",
    "asset": "USDT"
  }'

Response Example

{
  "isError": false,
  "message": "Asset-collection triggered for USDT",
  "statusCode": 200,
  "data": {
    "success": true,
    "exchange": "binance",
    "exchange_account_id": "binance-pm-001",
    "asset": "USDT",
    "response": {}
  }
}

Portfolio Margin Notes

What is Portfolio Margin?

Portfolio Margin is a margin system that calculates margin requirements based on the overall risk of your portfolio, rather than individual positions. This typically results in lower margin requirements compared to traditional isolated margin.

Key Concepts

ConceptDescription
Cross MarginShared margin pool across all positions
USDⓈ-M FuturesUSD-margined perpetual/delivery contracts
COIN-M FuturesCoin-margined perpetual/delivery contracts
Auto-CollectionMoves funds from Futures to Cross Margin automatically
uniMMRUnified Maintenance Margin Ratio across all accounts

Setting Up Portfolio Margin

To use Portfolio Margin endpoints, your Binance account must:
  1. Have Portfolio Margin enabled on Binance (requires manual application)
  2. Be registered in Renesis with portfolio_margin: true
  3. Meet Binance’s minimum equity requirements ($100,000+ in some regions)

PAPI Endpoints Used

These endpoints call Binance’s Portfolio Margin API (PAPI):
EndpointPAPI EndpointDescription
/portfolio-margin/balanceGET /papi/v1/balanceFull balance breakdown
/portfolio-margin/accountGET /papi/v1/um/accountUM account info
/portfolio-margin/auto-collectionPOST /papi/v1/auto-collectionTransfer all assets
/portfolio-margin/asset-collectionPOST /papi/v1/asset-collectionTransfer specific asset