diff --git a/BinomoAPI/models.py b/BinomoAPI/models.py index ec5509e..14d33f9 100644 --- a/BinomoAPI/models.py +++ b/BinomoAPI/models.py @@ -73,6 +73,9 @@ def to_payload(self, ref: int, created_at: Optional[int] = None, join_ref: Optio # expire_at must be aligned to the next candle boundary (in seconds) now_seconds = int(now) expire_at = now_seconds - (now_seconds % self.duration_seconds) + self.duration_seconds + + while (expire_at - now) < 30: + expire_at += self.duration_seconds return { "topic": "bo",