Skip to content

v1.1.16

Choose a tag to compare

@tigusigalpa tigusigalpa released this 18 Jan 09:24
· 23 commits to main since this release

Release Notes - v1.1.16

🎉 What's New

This release significantly expands the Bybit PHP SDK with comprehensive market data endpoints and full demo trading support, bringing the library closer to feature parity with the official Bybit V5 API.


✨ New Features

📊 Market Data Endpoints

Added six new market data endpoints for comprehensive market analysis:

  • getOpenInterest() - Retrieve open interest data for derivatives markets

    • Supports multiple interval times: 5min, 15min, 30min, 1h, 4h, 1d
    • Essential for analyzing market sentiment and positioning
  • getRecentTrades() - Fetch recent public trades

    • Access up to 1000 recent trades per request
    • Real-time market activity monitoring
  • getFundingRateHistory() - Get historical funding rate data

    • Track funding rates over time for perpetual contracts
    • Up to 200 records per request with pagination support
  • getHistoricalVolatility() - Retrieve historical volatility for options

    • Multiple period options: 7, 14, 21, 30, 60, 90, 180, 270 days
    • Critical for options pricing and risk assessment
  • getInsurancePool() - Access insurance pool data

    • Monitor the health of Bybit's insurance fund
    • Available for all supported coins
  • getRiskLimit() - Get risk limit information

    • Understand position size limits and margin requirements
    • Essential for risk management

🎮 Demo Trading Support

Full implementation of Bybit's demo trading environment:

  • Demo Trading Mode - New demoTrading parameter in BybitClient constructor

    • Automatically routes requests to https://api-demo.bybit.com
    • Seamless switching between live and demo environments
  • createDemoAccount() - Programmatically create demo trading accounts

    • Use production API keys to generate demo accounts
    • Returns demo account UID for API key creation
  • requestDemoFunds() - Request virtual funds for demo trading

    • Add or reduce demo funds for any supported coin
    • Rate limit: 1 request per minute
  • Laravel Integration - New BYBIT_DEMO_TRADING environment variable

    • Easy configuration via .env file
    • Works seamlessly with facades and dependency injection

🔧 Improvements

Configuration Enhancements

  • Added demo_trading configuration option in config/bybit.php
  • Added BYBIT_DEMO_TRADING environment variable support
  • Updated BybitServiceProvider to pass demo trading flag to client instances

Code Architecture

  • Extended baseUri() method to support demo trading domain
  • Maintained backward compatibility - all existing code continues to work
  • No breaking changes to existing API

📚 Documentation Updates

README.md & README-ru.md

  • New Market Data Section - Comprehensive examples for all 6 new endpoints
  • Demo Trading Section - Complete guide with Pure PHP and Laravel examples
  • Configuration Table - Updated with BYBIT_DEMO_TRADING parameter
  • Environment Variables - Added demo trading configuration examples

Code Examples

Added practical examples for:

  • Open interest analysis
  • Recent trades monitoring
  • Funding rate tracking
  • Historical volatility analysis
  • Insurance pool monitoring
  • Risk limit management
  • Demo account creation and funding

🚀 Usage Examples

Market Data

// Get open interest
$openInterest = $client->getOpenInterest([
    'category' => 'linear',
    'symbol' => 'BTCUSDT',
    'intervalTime' => '5min'
]);

// Get recent trades
$trades = $client->getRecentTrades([
    'category' => 'linear',
    'symbol' => 'BTCUSDT',
    'limit' => 60
]);

// Get funding rate history
$funding = $client->getFundingRateHistory([
    'category' => 'linear',
    'symbol' => 'BTCUSDT',
    'limit' => 200
]);

Demo Trading

// Pure PHP
$demoClient = new BybitClient(
    apiKey: 'your_demo_api_key',
    apiSecret: 'your_demo_api_secret',
    testnet: false,
    region: 'global',
    recvWindow: 5000,
    signature: 'hmac',
    rsaPrivateKey: null,
    http: null,
    fees: null,
    demoTrading: true
);

// Request demo funds
$demoClient->requestDemoFunds([
    'adjustType' => 0,
    'utaDemoApplyMoney' => [
        ['coin' => 'USDT', 'amountStr' => '10000'],
        ['coin' => 'BTC', 'amountStr' => '1']
    ]
]);

// Laravel - Just set in .env
BYBIT_DEMO_TRADING=true

📋 API Reference

New Methods

Method Endpoint Description
getOpenInterest() GET /v5/market/open-interest Get open interest data
getRecentTrades() GET /v5/market/recent-trade Get recent public trades
getFundingRateHistory() GET /v5/market/funding/history Get funding rate history
getHistoricalVolatility() GET /v5/market/historical-volatility Get historical volatility
getInsurancePool() GET /v5/market/insurance Get insurance pool data
getRiskLimit() GET /v5/market/risk-limit Get risk limit info
createDemoAccount() POST /v5/user/create-demo-member Create demo account
requestDemoFunds() POST /v5/account/demo-apply-money Request demo funds

🔄 Migration Guide

From v1.1.15 to v1.1.16

No breaking changes! This is a backward-compatible release.

To Use New Market Data Endpoints

Simply call the new methods - they follow the same pattern as existing methods:

$result = $client->getOpenInterest(['category' => 'linear', 'symbol' => 'BTCUSDT']);

To Enable Demo Trading

Pure PHP:

$client = new BybitClient($key, $secret, false, 'global', 5000, 'hmac', null, null, null, true);

Laravel:

BYBIT_DEMO_TRADING=true

📖 Documentation


🙏 Acknowledgments

This release implements functionality based on:

  • Bybit V5 API official documentation
  • Community feedback and feature requests
  • Best practices from pybit (official Python SDK)

📦 Installation

composer require tigusigalpa/bybit-php

For Laravel:

composer require tigusigalpa/bybit-php
php artisan vendor:publish --tag=bybit-config

🐛 Bug Fixes

None in this release - focus was on new features.


⚠️ Known Issues

None reported.


🔮 What's Next?

Future releases may include:

  • Additional account management endpoints
  • Batch operations support
  • Enhanced WebSocket features
  • More comprehensive error handling

📝 Full Changelog

Added

  • Market data endpoint: getOpenInterest()
  • Market data endpoint: getRecentTrades()
  • Market data endpoint: getFundingRateHistory()
  • Market data endpoint: getHistoricalVolatility()
  • Market data endpoint: getInsurancePool()
  • Market data endpoint: getRiskLimit()
  • Demo trading support with demoTrading parameter
  • Demo trading endpoint: createDemoAccount()
  • Demo trading endpoint: requestDemoFunds()
  • Configuration option: BYBIT_DEMO_TRADING
  • Comprehensive documentation for all new features
  • Usage examples in both English and Russian READMEs

Changed

  • Updated baseUri() to support demo trading domain
  • Extended BybitClient constructor with demoTrading parameter
  • Updated BybitServiceProvider to support demo trading configuration
  • Enhanced configuration file with demo trading option

Fixed

  • None

Deprecated

  • None

Removed

  • None

Security

  • No security-related changes

Release Date: January 18, 2026
Author: Igor Sazonov (tigusigalpa)
License: MIT