Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 68 additions & 1 deletion docs/v5/enum.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -846,4 +846,71 @@ with the example of BTCUSDT:
* `Pending`
* `Success`
* `Settled`
* `Fail`
* `Fail`

### stocks

### stocks-side
* `BUY` Buy
* `SELL` Sell

### stocks-type
* `MARKET` Market order. Uses `notional` (USDC amount) when `BUY`; uses `qty` (shares) when `SELL`
* `LIMIT` Limit order. Requires `qty` and `limitPrice`
* `STOP` Stop order. Requires `qty` and `stopPrice`. Executes as market after the trigger
* `STOP_LIMIT` Stop-limit order. Requires `qty`, `stopPrice` and `limitPrice`. Places a limit order after the trigger

### stocks-timeInForce
* `DAY` Day order. Auto-cancelled at the main US market close
* `GTC` Good Till Cancelled
* `IOC` Immediate or Cancel. Any unfilled portion is cancelled immediately

**Note:** `SELL` only supports `DAY` and `GTC`. `IOC` is supported but constrained to `LIMIT` + whole-share + `RTH`.

### stocks-tradingSession
* `RTH` Regular Trading Hours (default)
* `24H` 24-hour session, including pre-market, post-market and overnight. Non-`RTH` sessions accept `LIMIT` orders only

### stocks-orderStatus
* `PENDING` Order accepted and queued for execution. Returned as the initial status by Place Order
* `queued` Queued — order submitted, waiting for market open to execute
* `active` Active — order is live and waiting for fill conditions
* `filled` Filled — order fully filled
* `partial_filled` Cancelled after partial fill — order was cancelled/failed with some prior fills
* `cancelled` Cancelled — order was cancelled/failed with no fills

### stocks-convertType
* `MINT` Underlying → mStocks Token
* `REDEEM` mStocks Token → Underlying

### stocks-convertStatus
* `PENDING` Processing
* `SUCCESS` Completed
* `FAILED` Failed

### stocks-accountType
* `all` Auto-select account (default)
* `uta` Route into the Unified Trading Account (UTA)
* `fund` Route into the Funding Account

### stocks-flow
* `CEX` Centralized exchange flow. Both Mint and Burn are processed through the Bybit main site
* `DEX` Decentralized flow. Mint to the specified contract address; Burn flow depends on `burnScene`

### stocks-burnScene
* `DEP` Burn through the Bybit main site (Deposit)
* `NDP` Burn without going through the main site (Non-Deposit)

### stocks-symbolType
* `US_STOCK` US stock. Currently the only supported instrument type

### stocks-statusCode
* `1` Pre-market (04:00–09:30 ET, XNYS/XNAS only)
* `2` Regular hours (09:30–16:00 ET, XNYS/XNAS)
* `3` Post-market (16:00–20:00 ET, XNYS/XNAS only)
* `4` Overnight session (20:00 ET–next day 04:00 ET, OCEA)
* `5` Closed (weekends, holidays, off-hours)

### stocks-tradingHolidayType
* `HOLIDAY` Statutory holiday. Market closed all day
* `EARLY_CLOSE` Early close. `endTime` is the actual close time of that day
63 changes: 63 additions & 0 deletions docs/v5/stocks/cancel-order.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: Cancel Stock Order
sidebar_label: Cancel Stock Order
sidebar_position: 2
---
Cancel a stock buy or sell order by order number.

:::info important
- This endpoint is only available for Market Maker.
- Only non-terminal orders (`queued` / `active`) can be cancelled.
- The cancel request is dispatched asynchronously to the router. A successful response does not mean the order has been cancelled on the venue. Please poll the [Get Stock Order Detail](./order-detail) endpoint to confirm the final status.
:::

### HTTP Request
<APIEndpoint method="POST" url="/v5/rwa/stocks/order/cancel" />

### Request Parameters
| Parameter | Required | Type | Comments|
|:----- |:-------|:-----|------ |
|orderNo |**true** |string |System order number |

### Response Parameters
| Parameter | Type | Comments|
|:----- |:-----|----- |
|orderNo |string |Echo of the order number |

---

### Request Example

<Tabs groupId="programming-languages">
<TabItem value="http" label="HTTP">

```http
POST /v5/rwa/stocks/order/cancel HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1787657753833
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXX
Content-Type: application/json

{
"orderNo": "SB227696733955111526412"
}
```

</TabItem>
</Tabs>

### Response Example

```json
{
"retCode": 0,
"retMsg": "ok",
"result": {
"orderNo": "SB227696733955111526412"
},
"retExtInfo": {},
"time": 1787657753833
}
```
80 changes: 80 additions & 0 deletions docs/v5/stocks/convert-detail.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Get Convert Detail
sidebar_label: Get Convert Detail
sidebar_position: 6
---
Query the full status and settlement result of a single Convert order by order number or idempotency key. Used for MM reconciliation, status polling and failure diagnosis.

:::info
This endpoint is only available for Market Maker.
:::

### HTTP Request
<APIEndpoint method="GET" url="/v5/rwa/stocks/convert/detail" />

### Request Parameters
| Parameter | Required | Type | Comments|
|:----- |:-------|:-----|------ |
|orderNo |false |string |Convert order number. Either `orderNo` or `requestId` is **required** |
|requestId |false |string |Idempotency key used at submission. Either `orderNo` or `requestId` is **required** |

### Response Parameters
| Parameter | Type | Comments|
|:----- |:-----|----- |
|orderNo |string |Convert order number |
|requestId |string |Client idempotency key |
|[status](../enum#stocks-convertstatus) |string |Current order status |
|[convertType](../enum#stocks-converttype) |string |Direction |
|symbol |string |Underlying stock symbol |
|tokenSymbol |string |Corresponding mStocks Token |
|inputAmount |string |Input amount |
|outputAmount |string |Actual output amount. Estimated value when not settled |
|appliedMultiplier |string |Actually applied conversion ratio |
|[accountType](../enum#stocks-accounttype) |string |Account type. Only effective for `REDEEM` |
|failReason |string |Failure reason. Non-empty when `status=FAILED` |
|submittedAt |integer |Server accepted timestamp in milliseconds |
|updatedAt |integer |Last update timestamp in milliseconds |

---

### Request Example

<Tabs groupId="programming-languages">
<TabItem value="http" label="HTTP">

```http
GET /v5/rwa/stocks/convert/detail?orderNo=CVT1755590600987654321 HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1787657753833
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXX
```

</TabItem>
</Tabs>

### Response Example

```json
{
"retCode": 0,
"retMsg": "ok",
"result": {
"orderNo": "CVT1755590600987654321",
"requestId": "mm-cvt-20260819-0007",
"status": "SUCCESS",
"convertType": "MINT",
"symbol": "AAPL-US",
"tokenSymbol": "AAPLM",
"inputAmount": "5",
"outputAmount": "50",
"appliedMultiplier": "10",
"accountType": null,
"failReason": null,
"submittedAt": 1755590600180,
"updatedAt": 1755590620400
},
"time": 1724534400123
}
```
71 changes: 71 additions & 0 deletions docs/v5/stocks/convert-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: Get Convert List
sidebar_label: Get Convert List
sidebar_position: 4
---
Query the currently supported Convert symbols and live rate snapshots. Used for quote display and front-end snapshot validation before submitting a Convert request.

:::info
This endpoint is only available for Market Maker.
:::

### HTTP Request
<APIEndpoint method="GET" url="/v5/rwa/stocks/convert/list" />

### Request Parameters
| Parameter | Required | Type | Comments|
|:----- |:-------|:-----|------ |
|symbol |false |string |Filter by symbol, e.g. `AAPL-US`. Returns all supported symbols if omitted |

### Response Parameters
| Parameter | Type | Comments|
|:----- |:-----|----- |
|data |array&lt;object&gt; |Convert symbol list |
|> symbol |string |Underlying stock symbol, e.g. `AAPL-US` |
|> tokenSymbol |string |Corresponding mStocks Token, e.g. `AAPLM` |
|> multiplier |string |Currently effective conversion ratio (1 share of underlying → N Tokens) |
|> mintEnabled |boolean |Whether MINT (underlying → Token) is allowed |
|> redeemEnabled |boolean |Whether REDEEM (Token → underlying) is allowed |
|> minInputAmount |string |Minimum input amount per submission |

---

### Request Example

<Tabs groupId="programming-languages">
<TabItem value="http" label="HTTP">

```http
GET /v5/rwa/stocks/convert/list HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1787657753833
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXX
```

</TabItem>
</Tabs>

### Response Example

```json
{
"retCode": 0,
"retMsg": "ok",
"result": {
"data": [
{
"symbol": "AAPL-US",
"tokenSymbol": "AAPLM",
"multiplier": "10",
"mintEnabled": true,
"redeemEnabled": true,
"minInputAmount": "0.1"
}
]
},
"retExtInfo": {},
"time": 1787657753833
}
```
Loading