---
title: "Binance REST Future Bracket Order Example | Siebly"
description: "Binance Futures REST future bracket order JavaScript example for the Siebly Binance SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs."
canonical: "https://siebly.io/examples/Binance/Rest/Futures/rest-future-bracket-order"
robots: "index,follow"
---

# Binance REST Future Bracket Order Example

Binance Futures REST future bracket order JavaScript example for the Siebly Binance SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs.

**Path:** [Home](/) / [Examples](/examples) / [Binance](/examples/Binance) / [Rest](/examples/Binance/Rest) / [Futures](/examples/Binance/Rest/Futures) / [rest-future-bracket-order.ts](/examples/Binance/Rest/Futures/rest-future-bracket-order)

[View source on GitHub](https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Binance/Rest/Futures/rest-future-bracket-order.ts)

[Open the Binance JavaScript SDK guide](/sdk/binance/javascript)

## rest-future-bracket-order.ts

```typescript
import { NewFuturesOrderParams, USDMClient } from 'binance';

const key = process.env.API_KEY_COM || 'APIKEY';
const secret = process.env.API_SECRET_COM || 'APISECRET';

const client = new USDMClient({
  api_key: key,
  api_secret: secret,
  beautifyResponses: true,
});

(async () => {
  try {
    // TODO: check balance and do other validations

    const assetPrices = await client.getMarkPrice({
      symbol: 'ETHUSDT',
    });
    const markPrice: number = Number(assetPrices.markPrice);
    const stopLossPrice = Number((markPrice * 99.9) / 100).toFixed(2);
    const takeProfitPrice = Number((markPrice * 100.1) / 100).toFixed(2);

    // create three orders
    // 1. entry order (GTC),
    // 2. take profit order (GTE_GTC),
    // 3. stop loss order (GTE_GTC)

    const entryOrder: NewFuturesOrderParams<string> = {
      positionSide: 'BOTH',
      quantity: '0.01',
      reduceOnly: 'false',
      side: 'BUY',
      symbol: 'ETHUSDT',
      type: 'MARKET',
    };

    const takeProfitOrder: NewFuturesOrderParams<string> = {
      positionSide: 'BOTH',
      priceProtect: 'TRUE',
      quantity: '0.01',
      side: 'SELL',
      stopPrice: takeProfitPrice,
      symbol: 'ETHUSDT',
      timeInForce: 'GTE_GTC',
      type: 'TAKE_PROFIT_MARKET',
      workingType: 'MARK_PRICE',
      closePosition: 'true',
    };

    const stopLossOrder: NewFuturesOrderParams<string> = {
      positionSide: 'BOTH',
      priceProtect: 'TRUE',
      quantity: '0.01',
      side: 'SELL',
      stopPrice: stopLossPrice,
      symbol: 'ETHUSDT',
      timeInForce: 'GTE_GTC',
      type: 'STOP_MARKET',
      workingType: 'MARK_PRICE',
      closePosition: 'true',
    };

    const openedOrder = await client
      .submitMultipleOrders([entryOrder, takeProfitOrder, stopLossOrder])
      .catch((e) => console.log(e?.body || e));
    console.log(openedOrder);
  } catch (e) {
    console.log(e);
  }
})();
```
