# Market

{% hint style="warning" %}
**All parameters  of type INTEGER listed in the Bybit API docs need to be passed in as a string.**
{% endhint %}

## Get Kline

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/kline>
{% endhint %}

#### Function name:

```javascript
getKline(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getKline(exchange, options) {
    try {
        let result = await exchange.getKline(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getKline(myByBitAccount , 
    {
       category: 'linear',
       symbol: 'BTCUSD',
       interval: '60'
     });
```

## Get Mark Price Kline

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/mark-kline>
{% endhint %}

#### Function name:

```javascript
getMarkPriceKline(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
       
      passphrase: "myPassphrase",
      label: "bybit",
      marginType: "usdt",
      testnet: "false"
});

async function getMarkPriceKline(exchange, options) {
    try {
        let result = await exchange.getMarkPriceKline(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getMarkPriceKline(myByBitAccount , 
    {
       category: 'linear',
       symbol: 'BTCUSD',
       interval: '60'
     });
```

## Get Index Price Kleine

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/index-kline>
{% endhint %}

#### Function name:

```javascript
placeOrderFutures(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getKline(exchange, options) {
    try {
        let result = await exchange.getKline(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getKline(myByBitAccount , 
    {
       category: 'linear',
       symbol: 'BTCUSD',
       interval: '60'
     });
```

## Get Premium Index Price Kline

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline>
{% endhint %}

#### Function name:

```javascript
getPremiumIndexPriceKline(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getPremiumIndexPriceKline(exchange, options) {
    try {
        let result = await exchange.getPremiumIndexPriceKline(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getPremiumIndexPriceKline(myByBitAccount , 
    {
       category: 'linear',
       symbol: 'BTCUSD',
       interval: '60'
     });
```

## Get Instruments Info

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/instrument>
{% endhint %}

#### Function name:

```javascript
getInstrumentsInfo(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getInstrumentsInfo(exchange, options) {
    try {
        let result = await exchange.getInstrumentsInfo(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getInstrumentsInfo(myByBitAccount, 
    {
        category: 'linear'
    });
```

## Get Orderbook

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/orderbook>
{% endhint %}

#### Function name:

```javascript
getOrderbook(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getOrderbook(exchange, options) {
    try {
        let result = await exchange.getOrderbook(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getOrderbook(myByBitAccount, 
    {
        category: 'linear',
        symbol: 'BTCUSD'
    });
```

## Get Tickers

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/tickers>
{% endhint %}

#### Function name:

```javascript
getTickers(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getTickers(exchange, options) {
    try {
        let result = await exchange.getTickers(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getTickers(myByBitAccount, 
    {
        category: 'linear'
    });
```

## Get Funding Rate History

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/history-fund-rate>
{% endhint %}

#### Function name:

```javascript
getFundingRateHistory(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getFundingRateHistory(exchange, options) {
    try {
        let result = await exchange.getFundingRateHistory(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getFundingRateHistory(myByBitAccount, 
    {
        category: 'linear',
        symbol: 'BTCUSD'
    });
```

## Get Public Trading History

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/recent-trade>
{% endhint %}

#### Function name:

```javascript
getPublicTradingHistory(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getPublicTradingHistory(exchange, options) {
    try {
        let result = await exchange.getPublicTradingHistory(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getPublicTradingHistory(myByBitAccount, 
    {
        category: 'linear',
        symbol: 'BTCUSD'
    });
```

## Get Open Interest

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/open-interest>
{% endhint %}

#### Function name:

```javascript
getOpenInterest(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getOpenInterest(exchange, options) {
    try {
        let result = await exchange.getOpenInterest(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getOpenInterest(myByBitAccount, 
    {
        category: 'linear',
        symbol: 'BTCUSDT',
        intervalTime: '5min'
    });
```

## Get Historical Volatility

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/iv>
{% endhint %}

#### Function name:

```javascript
getHistoricalVolatility(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getHistoricalVolatility(exchange, options) {
    try {
        let result = await exchange.getHistoricalVolatility(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getHistoricalVolatility(myByBitAccount, 
    {
        category: 'option'
    });
```

## Get Insurance

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/insurance>
{% endhint %}

#### Function name:

```javascript
getInsurance(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getInsurance(exchange, options) {
    try {
        let result = await exchange.getInsurance(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getInsurance(myByBitAccount);
```

## Get Risk Limit

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/risk-limit>
{% endhint %}

#### Function name:

```javascript
getRiskLimit(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getRiskLimit(exchange, options) {
    try {
        let result = await exchange.getRiskLimit(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getRiskLimit(myByBitAccount, 
    {
        category: 'linear'
    });
```

## Get Delivery Price

{% hint style="info" %}
Please refer to the official ByBit API Docs for the required parameters.

<https://bybit-exchange.github.io/docs/v5/market/delivery-price>
{% endhint %}

#### Function name:

```javascript
getDeliveryPrice(options)
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getDeliveryPrice(exchange, options) {
    try {
        let result = await exchange.getDeliveryPrice(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getDeliveryPrice(myByBitAccount, 
    {
        category: 'linear'
    });
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/bybit-functions/market.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
