Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
MtkN1 opened this issue May 5, 2021 · 0 comments
Closed
2 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@MtkN1
Copy link
Member

MtkN1 commented May 5, 2021

課題

  • データストアはWebSocket受信時のデータ処理にソートは特に行っていない
  • しかし板情報を利用するユースケースは基本的には価格降順でソート済みのデータを参照する
  • ソートは殆ど同様な実装になるはずなのでユーザーが個々に行うのではなくデータストア側でメソッドを持たせる
  • 参考スレッド https://twitter.com/MtkN1XBt/status/1389402735301206016?s=20
  • (Bybitは pybybit からの移植で一部実装が入っている)

実装

  • 固有のデータストアモデルに専用のメソッドを準備用意してその中で実装する

# Bybit
store = pybotters.BybitDataStore()
store.orderbook.getsorted()
# {
#     'Sell': [{...: ..., 'price': 1234.5, ...: ...}],
#     'Buy': [{...: ..., 'price': 1234.0, ...: ...}],
# }

# FTX
store = pybotters.FXXDataStore()
store.orderbook.getsorted()
# {
#     'asks': [{...: ..., 'price': 1234.5, ...: ...}],
#     'bids': [{...: ..., 'price': 1234.0, ...: ...}],
# }

チェックリスト

  • 実装
  • Wiki
@MtkN1 MtkN1 added the enhancement New feature or request label May 5, 2021
@MtkN1 MtkN1 self-assigned this May 5, 2021
MtkN1 added a commit that referenced this issue May 23, 2021
MtkN1 added a commit that referenced this issue May 23, 2021
✨v0.2.2リリース

データストアでソート済みの板情報の取得可能にする #40
Bybitデータストアのinitializeメソッド引数仕様の変更漏れ #41
@MtkN1 MtkN1 closed this as completed May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant