Skip to content
Merged
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
843 changes: 422 additions & 421 deletions docs/endpointFunctionList.md

Large diffs are not rendered by default.

13,115 changes: 6,670 additions & 6,445 deletions llms.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bybit-api",
"version": "4.8.2",
"version": "4.8.3",
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
24 changes: 23 additions & 1 deletion src/rest-client-v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ import {
GetIndexPriceComponentsParamsV5,
GetIndexPriceKlineParamsV5,
GetInstrumentsInfoParamsV5,
GetInstrumentSummaryParamsV5,
GetInsuranceParamsV5,
GetInternalDepositRecordParamsV5,
GetInternalTransferParamsV5,
Expand Down Expand Up @@ -434,6 +435,7 @@ import {
InstitutionalLendingProductInfoV5,
InstitutionalLoanLTVV5,
InstrumentInfoResponseV5,
InstrumentSummaryResponseV5,
InsuranceResponseV5,
InternalDepositRecordV5,
InternalTransferRecordV5,
Expand Down Expand Up @@ -1012,6 +1014,20 @@ export class RestClientV5 extends BaseRestClient {
return this.get('/v5/market/instruments-info', params);
}

/**
* Query summary information and trading increments for linear and option instruments.
*
* Covers: Linear contract / Option
*
* `category` is required (`linear` or `option`). Page with `cursor` set to
* `nextPageCursor` from the previous response. `limit` is [1, 1000], default 500.
*/
getInstrumentSummary(
params: GetInstrumentSummaryParamsV5,
): Promise<APIResponseV3WithTime<InstrumentSummaryResponseV5>> {
return this.get('/v5/market/instrument-summary', params);
}

/**
* Query orderbook data
*
Expand Down Expand Up @@ -3504,7 +3520,13 @@ export class RestClientV5 extends BaseRestClient {
}

/**
* Get max borrowable amount
* Get max borrowable amount.
*
* `maxLoan` can be `"0"` when spot margin mode is off, or when no collateral
* coins are enabled. The app can still show a borrow amount after a collateral
* coin is selected. Undocumented; Bybit API staff confirmed this on 15 Oct 2026.
* Check `getSpotMarginState()`, `setCollateralCoin()`
* (`POST /v5/account/set-collateral-switch`), and `toggleSpotMarginTrade()` first.
*/
getMaxBorrowableAmount(
params: GetMaxBorrowableAmountParamsV5,
Expand Down
21 changes: 21 additions & 0 deletions src/types/request/v5-market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,27 @@ export interface GetInstrumentsInfoParamsV5 {
cursor?: string;
}

/**
* GET /v5/market/instrument-summary
*
* `category` is required. Page with `cursor` = previous `nextPageCursor`.
*/
export interface GetInstrumentSummaryParamsV5 {
/** Product type. `linear` or `option`. */
category: 'linear' | 'option';
symbol?: string;
/** Instrument type. */
symbolType?: string;
/** Market region, for example `HK`, `US`, `CN`, `KR`. */
marketRegion?: string;
/** Base coin, for example `NVDA` or `TSLA`. */
baseCoin?: string;
/** Page size. Range [1, 1000]. Default 500. */
limit?: number;
/** Cursor. Use `nextPageCursor` from the previous response. */
cursor?: string;
}

export interface GetOrderbookParamsV5 {
category: CategoryV5;
symbol: string;
Expand Down
54 changes: 54 additions & 0 deletions src/types/response/v5-market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,20 @@ export interface SpotInstrumentInfoV5 {
lotSizeFilter: {
basePrecision: string;
quotePrecision: string;
/**
* @deprecated Spot order size is enforced by `minOrderAmt` only.
* Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer
* applies for spot. Undocumented: broker and CCXT users have a 1 USDT
* minimum; direct API users have a 5 USDT minimum.
*/
minOrderQty: string;
maxOrderQty: string;
/**
* Minimum order amount in the quote coin. This is the spot minimum that
* applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that
* broker and CCXT users have a 1 USDT minimum, and direct API users have
* a 5 USDT minimum.
*/
minOrderAmt: string;
maxOrderAmt: string;
maxLimitOrderQty: string;
Expand All @@ -180,6 +192,48 @@ type InstrumentInfoV5Mapping = {
export type InstrumentInfoResponseV5<C extends CategoryV5> =
CategoryCursorListV5<InstrumentInfoV5Mapping[C], C>;

/**
* One row from GET /v5/market/instrument-summary.
*
* Several fields are an empty string when they do not apply (`fullName`,
* `marketRegion`, and `underlyingTicker` for option; `priceIndex` for linear).
*/
export interface InstrumentSummaryV5 {
symbol: string;
/** Instrument type. May be an empty string. */
symbolType: string;
/** Display name shown in the UI. */
displayName: string;
baseCoin: string;
settleCoin: string;
/** Full name. Empty string for `option`. */
fullName: string;
/**
* Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others).
* Empty string for `option` or when not applicable.
*/
marketRegion: string;
/**
* Stock ticker, security code, or asset symbol in the underlying market.
* Empty string for `option`.
*/
underlyingTicker: string;
/**
* TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`.
* Empty string for `linear`.
*/
priceIndex: string;
qtyStep: string;
tickSize: string;
/** Delivery timestamp in milliseconds. `"0"` for `linear`. */
deliveryTime: string;
}

export type InstrumentSummaryResponseV5 = CategoryCursorListV5<
InstrumentSummaryV5[],
'linear' | 'option'
>;

// Account Instruments Info (includes RPI permissions)
export interface AccountSpotInstrumentInfoV5 extends SpotInstrumentInfoV5 {
isPublicRpi: boolean;
Expand Down
8 changes: 8 additions & 0 deletions src/types/response/v5-spot-leverage-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ export interface ManualBorrowResultV5 {

export interface MaxBorrowableAmountV5 {
currency: string;
/**
* Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or
* when no collateral coins are enabled. The app can still show a borrow
* amount after a collateral coin is selected. Undocumented; Bybit API staff
* confirmed this on 15 Oct 2026. Check `getSpotMarginState()`,
* `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and
* `toggleSpotMarginTrade()` first.
*/
maxLoan: string;
}

Expand Down
32 changes: 31 additions & 1 deletion src/types/shared-v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,26 @@ export type TransactionTypeV5 =
| 'PLATFORM_TOKEN_MNT_LIQRECALLEDMMNT'
| 'PLATFORM_TOKEN_MNT_LIQRETURNEDMNT'
| 'DIVIDEND_SETTLEMENT'
/**
* Forward stock split settlement. Closes the entire existing position; the
* new position is opened as `FORWARD_SPLIT_OPEN`.
*
* Changelog 2026-10-13 updated this description. The enum glossary still
* lists the older wording "fractional share settlement".
*/
| 'FORWARD_SPLIT_SETTLE'
| 'REVERSE_SPLIT_SETTLE';
/** Forward stock split position opening after the existing position is settled and closed. */
| 'FORWARD_SPLIT_OPEN'
/**
* Reverse stock split settlement. Closes the entire existing position; the
* new position is opened as `REVERSE_SPLIT_OPEN`.
*
* Changelog 2026-10-13 updated this description. The enum glossary still
* lists the older wording "fractional share settlement".
*/
| 'REVERSE_SPLIT_SETTLE'
/** Reverse stock split position opening after the existing position is settled and closed. */
| 'REVERSE_SPLIT_OPEN';

export type PermissionTypeV5 =
| 'ContractTrade'
Expand Down Expand Up @@ -375,8 +393,20 @@ export type ExecTypeV5 =
| 'MovePosition'
/** @deprecated Removed from Bybit execType; kept for older payloads. */
| 'CorporateAction'
/**
* Forward stock split settlement and closure of the entire existing position,
* followed by opening a new position (`ForwardSplitOpen`).
*/
| 'ForwardSplitSettle'
/** Forward stock split position opening after the existing position is settled and closed. */
| 'ForwardSplitOpen'
/**
* Reverse stock split settlement and closure of the entire existing position,
* followed by opening a new position (`ReverseSplitOpen`).
*/
| 'ReverseSplitSettle'
/** Reverse stock split position opening after the existing position is settled and closed. */
| 'ReverseSplitOpen'
| 'Dividend'
| 'UNKNOWN';

Expand Down
40 changes: 40 additions & 0 deletions test/v5/public.read.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,46 @@ describe('Public V5 REST API Endpoints', () => {
).toMatchObject(successResponseObjectV3());
});

it('getInstrumentSummary()', async () => {
const firstPage = await api.getInstrumentSummary({
category: 'linear',
limit: 1,
});
expect(firstPage).toMatchObject(successResponseObjectV3());
expect(firstPage.result.category).toBe('linear');
expect(firstPage.result.list).toEqual(
expect.arrayContaining([
expect.objectContaining({
symbol: expect.any(String),
qtyStep: expect.any(String),
tickSize: expect.any(String),
deliveryTime: expect.any(String),
}),
]),
);

const cursor = firstPage.result.nextPageCursor;
expect(typeof cursor).toBe('string');
expect(cursor && cursor.length).toBeGreaterThan(0);

const secondPage = await api.getInstrumentSummary({
category: 'linear',
limit: 1,
cursor,
});
expect(secondPage).toMatchObject(successResponseObjectV3());
expect(secondPage.result.list[0]?.symbol).not.toBe(
firstPage.result.list[0]?.symbol,
);

const optionPage = await api.getInstrumentSummary({
category: 'option',
limit: 1,
});
expect(optionPage).toMatchObject(successResponseObjectV3());
expect(optionPage.result.category).toBe('option');
});

it('getOrderbook()', async () => {
expect(
await api.getOrderbook({
Expand Down
Loading