Skip to content

Commit 554c8c6

Browse files
committed
models: linting
1 parent 63c7fc3 commit 554c8c6

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

bfxapi/models/funding_ticker.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,23 @@ class FundingTickerModel:
2525

2626
class FundingTicker:
2727
"""
28-
FRR float Flash Return Rate - average of all fixed rate funding over the last hour (funding tickers only)
28+
FRR float Flash Return Rate - average of all fixed rate funding over the last hour
29+
(funding tickers only)
2930
BID float Price of last highest bid
3031
BID_PERIOD int Bid period covered in days (funding tickers only)
3132
BID_SIZE float Sum of the 25 highest bid sizes
3233
ASK float Price of last lowest ask
3334
ASK_PERIOD int Ask period covered in days (funding tickers only)
3435
ASK_SIZE float Sum of the 25 lowest ask sizes
3536
DAILY_CHANGE float Amount that the last price has changed since yesterday
36-
DAILY_CHANGE_RELATIVE float Relative price change since yesterday (*100 for percentage change)
37+
DAILY_CHANGE_RELATIVE float Relative price change since yesterday
38+
(*100 for percentage change)
3739
LAST_PRICE float Price of the last trade
3840
VOLUME float Daily volume
3941
HIGH float Daily high
4042
LOW float Daily low
41-
FRR_AMOUNT_AVAILABLE float The amount of funding that is available at the Flash Return Rate (funding tickers only)
43+
FRR_AMOUNT_AVAILABLE float The amount of funding that is available at the
44+
Flash Return Rate (funding tickers only)
4245
"""
4346

4447
def __init__(self, pair, frr, bid, bid_period, bid_size, ask, ask_period, ask_size,
@@ -64,7 +67,8 @@ def from_raw_ticker(raw_ticker, pair):
6467
"""
6568
Generate a Ticker object from a raw ticker array
6669
"""
67-
# [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7,6167.26141685,6964.2,6710.8]]
70+
# [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7,
71+
# 6167.26141685,6964.2,6710.8]]
6872

6973
return FundingTicker(
7074
pair,

bfxapi/models/position.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ class Position:
3030
"""
3131
SYMBOL string Pair (tBTCUSD, …).
3232
STATUS string Status (ACTIVE, CLOSED).
33-
±AMOUNT float Size of the position. A positive value indicates a long position; a negative value indicates a short position.
34-
BASE_PRICE float Base price of the position. (Average traded price of the previous orders of the position)
33+
±AMOUNT float Size of the position. A positive value indicates a
34+
long position; a negative value indicates a short position.
35+
BASE_PRICE float Base price of the position. (Average traded price
36+
of the previous orders of the position)
3537
MARGIN_FUNDING float The amount of funding being used for this position.
3638
MARGIN_FUNDING_TYPE int 0 for daily, 1 for term.
3739
PL float Profit & Loss
@@ -41,14 +43,15 @@ class Position:
4143
POSITION_ID int64 Position ID
4244
MTS_CREATE int Millisecond timestamp of creation
4345
MTS_UPDATE int Millisecond timestamp of update
44-
TYPE int Identifies the type of position, 0 = Margin position, 1 = Derivatives position
46+
TYPE int Identifies the type of position, 0 = Margin position,
47+
1 = Derivatives position
4548
COLLATERAL float The amount of collateral applied to the open position
4649
COLLATERAL_MIN float The minimum amount of collateral required for the position
4750
META json string Additional meta information about the position
4851
"""
4952

5053
def __init__(self, symbol, status, amount, b_price, m_funding, m_funding_type,
51-
profit_loss, profit_loss_perc, l_price, lev, id, mts_create, mts_update,
54+
profit_loss, profit_loss_perc, l_price, lev, pid, mts_create, mts_update,
5255
p_type, collateral, collateral_min, meta):
5356
self.symbol = symbol
5457
self.status = status
@@ -60,7 +63,7 @@ def __init__(self, symbol, status, amount, b_price, m_funding, m_funding_type,
6063
self.profit_loss_percentage = profit_loss_perc
6164
self.liquidation_price = l_price
6265
self.leverage = lev
63-
self.id = id
66+
self.id = pid
6467
self.mts_create = mts_create
6568
self.mts_update = mts_update
6669
self.type = p_type

bfxapi/models/ticker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def from_raw_ticker(raw_ticker, pair):
5050
"""
5151
Generate a Ticker object from a raw ticker array
5252
"""
53-
# [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7,6167.26141685,6964.2,6710.8]]
53+
# [72128,[6914.5,28.123061460000002,6914.6,22.472037289999996,175.8,0.0261,6915.7,
54+
# 6167.26141685,6964.2,6710.8]]
5455

5556
return Ticker(
5657
pair,

0 commit comments

Comments
 (0)