Skip to content

BETA v0.2.2 リリース

Pre-release
Pre-release
Compare
Choose a tag to compare
@MtkN1 MtkN1 released this 23 May 12:27
· 339 commits to main since this release
d399787

🚀 New Experience

データストアでソート済みの板情報の取得可能にする #40

✨ ソート済みの板情報が取得できるようになりました

FTXの例

async def main():
    store = pybotters.FTXDataStore()
    ws = await client.ws_connect(
        'wss://ftx.com/ws',
        send_json={'op': 'subscribe', 'channel': 'orderbook', 'market': 'BTC-PERP'},
        hdlr_json=store.onmessage,
    )
    pybotters.print(store.orderbook.sorted())
# {
#     'asks': [
#         [35389.0, 0.38],
#         [35392.0, 0.05],
#         [35393.0, 0.39],
#         ...
#     ],
#     'bids': [
#         [35388.0, 0.6244],
#         [35386.0, 0.1177],
#         [35382.0, 0.2],
#         ...
#     ]
# }

Bybitの例

async def main():
    store = pybotters.BybitDataStore()
    ws = await client.ws_connect(
        'wss://stream.bybit.com/realtime',
        send_json={'op': 'subscribe', 'args': ['orderBookL2_25.BTCUSD']},
        hdlr_json=store.onmessage,
    )
    pybotters.print(store.orderbook.sorted())
# {
#     'Sell': [
#         {'price': '35508.50', 'symbol': 'BTCUSD', 'id': 355085000, 'side': 'Sell', 'size': 432225},
#         {'price': '35509.00', 'symbol': 'BTCUSD', 'id': 355090000, 'side': 'Sell', 'size': 1},
#         {'price': '35514.50', 'symbol': 'BTCUSD', 'id': 355145000, 'side': 'Sell', 'size': 213690},
#         ...
#     ],
#     'Buy': [
#         {'price': '35508.00', 'symbol': 'BTCUSD', 'id': 355080000, 'side': 'Buy', 'size': 1004576},
#         {'price': '35507.50', 'symbol': 'BTCUSD', 'id': 355075000, 'side': 'Buy', 'size': 88192},
#         {'price': '35507.00', 'symbol': 'BTCUSD', 'id': 355070000, 'side': 'Buy', 'size': 86766},
#         ...
#     ]
# }

🐛 Bugfix

Bybitデータストアのinitializeメソッド引数仕様の変更漏れ #41

🐛 Bybitデータストアのinitializeメソッド引数仕様

v0.2.0リリースの実装が変更漏れとなっていました。
変更点はv0.2.0のリリースノートを参照してください。

https://github.com/MtkN1/pybotters/releases/tag/v0.2.0