Cryptocurrency | Bybit

This document outlines the appropriate format that the traders must follow while writing the webhook payload for setting up the following types of cryptocurrency orders to be executed into ByBit.

Let’s get started 🚀

Market Order

The traders can write the webhook payload for setting up market orders using these three payload fields:

  • Symbol
  • Action
  • Quantity

Symbol

The ticker symbol of the cryptocurrency. ByBit represents this asset class by pairing cryptocurrency ticker symbols E.g. BTCUSDT, ETHUSDT, etc.

Action

The signal action indicates the type of trade to be executed. It can be one of the following three:

  • Buy: Triggers an action to purchase the asset.
  • Sell: Triggers an action to sell the asset.
  • Close: Triggers an action to close an existing open position and exit the trade.

Quantity

The number of assets to be traded. If omitted, the quantity will be dynamically calculated or defaulted to 1.

EXAMPLE

I. Buy

{
  "symbol": "BTCUSDT",
  "action": "buy",
  "quantity": 123
}

II. Sell

{
  "symbol": "BTCUSDT",
  "action": "sell",
  "quantity": 123
}

III. Close

{
  "symbol": "BTCUSDT",
  "action": "close",
}

Limit Order

The traders can write the webhook payload for setting up Limit orders using these four payload fields:

  • Symbol
  • Action
  • Quantity
  • Limit_price

Symbol

The ticker symbol of the cryptocurrency. ByBit represents this asset class by pairing cryptocurrency ticker symbols E.g. BTCUSDT, ETHUSDT, etc.

Action

The signal action indicates the type of trade to be executed. It can be one of the following three:

  • Buy: Triggers an action to purchase the asset.
  • Sell: Triggers an action to sell the asset.
  • Close: Triggers an action to close an existing open position and exit the trade.

Quantity

The number of assets to be traded. If omitted, the quantity will be dynamically calculated or defaulted to 1.

Limit_price

An optional field specifying the execution price for a “buy” or  “sell” trade. If you specify the limit price the trade will be executed at the specified limit price. Or If you choose not to specify a limit price, the trade will be executed at the current market price.

EXAMPLE

I. Buy

{
  "symbol": "BTCUSDT",
  "action": "buy",
  "quantity": 123,
  "limit_price": 123.98
}

II. Sell

{
  "symbol": "BTCUSDT",
  "action": "sell",
  "quantity": 123,
  "limit_price": 123.98
}

III. Close

{
  "symbol": "BTCUSDT",
  "action": "close",
  "limit_price": 123.98
}




Contact Us

Not finding what you're looking for? Contact Us Directly