Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
add query trading fee rate endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dextertd committed Feb 28, 2022
1 parent c2fd2fc commit 9ddf2a3
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.6] - 2022-02-28
### Changed
- Added `query_trading_fee_rate()`

## [1.3.5] - 2022-01-12
### Changed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Usage examples on the `WebSocket` methods can be found at:
| User Leverage (deprecated) | `user_leverage()` |
| User Trade Records | `user_trade_records()` |
| Closed Profit and Loss | `closed_profit_and_loss()` |
| Query Trading Fee Rate | `query_trading_fee_rate()` |

#### Risk Limit

Expand Down
15 changes: 15 additions & 0 deletions docs/HTTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,21 @@ def closed_profit_and_loss(self, **kwargs):
:returns: Request results as dictionary.
"""

def query_trading_fee_rate(self, **kwargs):
"""
Query trading fee rate.
:param kwargs: See
https://bybit-exchange.github.io/docs/inverse/#t-queryfeerate.
:returns: Request results as dictionary.
"""
return self._submit_request(
method='GET',
path=self.endpoint + '/v2/private/position/fee-rate',
query=kwargs,
auth=True
)

def get_risk_limit(self, **kwargs):
"""
Get risk limit.
Expand Down
2 changes: 2 additions & 0 deletions examples/http_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
change_margin()
set_trading_stop()
query_trading_fee_rate()
get_risk_limit()
set_risk_limit()
Expand Down
17 changes: 16 additions & 1 deletion pybit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from json.decoder import JSONDecodeError

# Versioning.
VERSION = '1.3.5'
VERSION = '1.3.6'


class HTTP:
Expand Down Expand Up @@ -1254,6 +1254,21 @@ def closed_profit_and_loss(self, **kwargs):
auth=True
)

def query_trading_fee_rate(self, **kwargs):
"""
Query trading fee rate.
:param kwargs: See
https://bybit-exchange.github.io/docs/inverse/#t-queryfeerate.
:returns: Request results as dictionary.
"""
return self._submit_request(
method='GET',
path=self.endpoint + '/v2/private/position/fee-rate',
query=kwargs,
auth=True
)

def get_risk_limit(self, endpoint="", **kwargs):
"""
Get risk limit.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='pybit',
version='1.3.5',
version='1.3.6',
description='Python3 Bybit HTTP/WebSocket API Connector',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 9ddf2a3

Please sign in to comment.