pybinbot 2.1.13__tar.gz → 2.1.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. {pybinbot-2.1.13/pybinbot.egg-info → pybinbot-2.1.14}/PKG-INFO +1 -1
  2. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/bot_base.py +9 -3
  3. {pybinbot-2.1.13 → pybinbot-2.1.14/pybinbot.egg-info}/PKG-INFO +1 -1
  4. {pybinbot-2.1.13 → pybinbot-2.1.14}/pyproject.toml +1 -1
  5. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_conditional_entry.py +4 -2
  6. {pybinbot-2.1.13 → pybinbot-2.1.14}/LICENSE +0 -0
  7. {pybinbot-2.1.13 → pybinbot-2.1.14}/MANIFEST.in +0 -0
  8. {pybinbot-2.1.13 → pybinbot-2.1.14}/README.md +0 -0
  9. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/__init__.py +0 -0
  10. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binance/base.py +0 -0
  11. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binance/exceptions.py +0 -0
  12. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binbot/base.py +0 -0
  13. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binbot/exceptions.py +0 -0
  14. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/coingecko.py +0 -0
  15. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/base.py +0 -0
  16. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/exceptions.py +0 -0
  17. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/futures.py +0 -0
  18. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/market.py +0 -0
  19. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/orders.py +0 -0
  20. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/rest.py +0 -0
  21. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/__init__.py +0 -0
  22. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/autotrade_settings.py +0 -0
  23. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/bot.py +0 -0
  24. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/cvd.py +0 -0
  25. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/deal.py +0 -0
  26. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/derivatives.py +0 -0
  27. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/fastest_movers.py +0 -0
  28. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/grid_ladder.py +0 -0
  29. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/order.py +0 -0
  30. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/routes.py +0 -0
  31. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/signals.py +0 -0
  32. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/symbol.py +0 -0
  33. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/py.typed +0 -0
  34. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/__init__.py +0 -0
  35. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/beta.py +0 -0
  36. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/breadth.py +0 -0
  37. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/cache.py +0 -0
  38. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/candles.py +0 -0
  39. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/enums.py +0 -0
  40. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/handlers.py +0 -0
  41. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/heikin_ashi.py +0 -0
  42. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/indicators.py +0 -0
  43. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/logging_config.py +0 -0
  44. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/maths.py +0 -0
  45. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/price_crossings.py +0 -0
  46. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/telegram_delivery.py +0 -0
  47. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/timestamps.py +0 -0
  48. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/types.py +0 -0
  49. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/utils.py +0 -0
  50. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/beta.py +0 -0
  51. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/breadth.py +0 -0
  52. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/price_crossings.py +0 -0
  53. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/swing_protection.py +0 -0
  54. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/binance/async_socket_client.py +0 -0
  55. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/binance/socket_client.py +0 -0
  56. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/binance/socket_manager.py +0 -0
  57. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/kucoin/kucoin_async_client.py +0 -0
  58. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/SOURCES.txt +0 -0
  59. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/dependency_links.txt +0 -0
  60. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/requires.txt +0 -0
  61. {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/top_level.txt +0 -0
  62. {pybinbot-2.1.13 → pybinbot-2.1.14}/setup.cfg +0 -0
  63. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_beta.py +0 -0
  64. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_binbot_api.py +0 -0
  65. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_bot_futures_leverage.py +0 -0
  66. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_breadth.py +0 -0
  67. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_candles.py +0 -0
  68. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_closed_bot_status.py +0 -0
  69. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_coingecko.py +0 -0
  70. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_conditional_futures_orders.py +0 -0
  71. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_cvd_api.py +0 -0
  72. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_deal_model.py +0 -0
  73. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_derivatives_api.py +0 -0
  74. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_fastest_movers.py +0 -0
  75. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_futures_place_order.py +0 -0
  76. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_grid_ladder.py +0 -0
  77. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_handlers.py +0 -0
  78. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_heikin_ashi.py +0 -0
  79. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_indicators.py +0 -0
  80. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_kucoin_api.py +0 -0
  81. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_logging_config.py +0 -0
  82. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_matching_engine.py +0 -0
  83. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_maths.py +0 -0
  84. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_price_crossings.py +0 -0
  85. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_swing_protection.py +0 -0
  86. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_symbol_model.py +0 -0
  87. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_telegram_delivery.py +0 -0
  88. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_timestamps.py +0 -0
  89. {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pybinbot
3
- Version: 2.1.13
3
+ Version: 2.1.14
4
4
  Summary: Utility functions for the binbot project.
5
5
  Author-email: Carlos Wu <carkodw@gmail.com>
6
6
  Requires-Python: >=3.15
@@ -15,6 +15,8 @@ from pybinbot.shared.enums import (
15
15
  from pybinbot.shared.timestamps import timestamp, ts_to_humandate
16
16
  from pybinbot.shared.types import Amount
17
17
 
18
+ DEFAULT_ENTRY_EXPIRY_MS = 15 * 60 * 1000
19
+
18
20
 
19
21
  class RecoveryParams(BaseModel):
20
22
  reversal_path: Literal["source", "recovery"] = "source"
@@ -50,10 +52,10 @@ class BotBase(BaseModel):
50
52
  entry_mode: EntryMode = Field(default=EntryMode.immediate, validate_default=True)
51
53
  entry_price: float | None = Field(default=None, ge=0, allow_inf_nan=False)
52
54
  entry_expires_at: float = Field(
53
- default_factory=lambda data: data["created_at"] + 6 * 60 * 60 * 1000,
55
+ default_factory=lambda data: data["created_at"] + DEFAULT_ENTRY_EXPIRY_MS,
54
56
  gt=0,
55
57
  allow_inf_nan=False,
56
- description="Absolute entry deadline in Unix milliseconds; defaults to creation + 6 hours",
58
+ description="Absolute entry deadline in Unix milliseconds; defaults to creation + 15 minutes",
57
59
  )
58
60
  dynamic_trailing: bool = Field(default=False)
59
61
  dynamic_position_sizing: bool = Field(default=False)
@@ -121,7 +123,11 @@ class BotBase(BaseModel):
121
123
  @field_validator("entry_expires_at", mode="before")
122
124
  @classmethod
123
125
  def default_entry_expiry(cls, value, info: ValidationInfo):
124
- return info.data["created_at"] + 6 * 60 * 60 * 1000 if value is None else value
126
+ return (
127
+ info.data["created_at"] + DEFAULT_ENTRY_EXPIRY_MS
128
+ if value is None
129
+ else value
130
+ )
125
131
 
126
132
  @model_validator(mode="after")
127
133
  def validate_conditional_entry(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pybinbot
3
- Version: 2.1.13
3
+ Version: 2.1.14
4
4
  Summary: Utility functions for the binbot project.
5
5
  Author-email: Carlos Wu <carkodw@gmail.com>
6
6
  Requires-Python: >=3.15
@@ -23,7 +23,7 @@ build-backend = "setuptools.build_meta"
23
23
 
24
24
  [project]
25
25
  name = "pybinbot"
26
- version = "2.1.13"
26
+ version = "2.1.14"
27
27
  description = "Utility functions for the binbot project."
28
28
  authors = [
29
29
  { name="Carlos Wu", email="carkodw@gmail.com" }
@@ -8,10 +8,12 @@ from pybinbot import BotBase, EntryMode, MarketType
8
8
  "overrides",
9
9
  [{}, {"entry_mode": None, "entry_expires_at": None, "entry_price": None}],
10
10
  )
11
- def test_omitted_or_null_entry_fields_default_to_immediate_and_six_hours(overrides):
11
+ def test_omitted_or_null_entry_fields_default_to_immediate_and_fifteen_minutes(
12
+ overrides,
13
+ ):
12
14
  bot = BotBase(pair="XBTUSDTM", created_at=1000, **overrides)
13
15
  assert bot.entry_mode == EntryMode.immediate
14
- assert bot.entry_expires_at == 21_601_000
16
+ assert bot.entry_expires_at == 901_000
15
17
  assert bot.entry_price is None
16
18
  assert bot.model_dump(mode="json")["entry_price"] is None
17
19
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes