From fdbc5ddd2097000082298249e6b6d26b8087e125 Mon Sep 17 00:00:00 2001 From: gavinphr Date: Tue, 14 May 2024 16:24:18 +0100 Subject: [PATCH 1/3] update position to 0 when position is empty --- examples/basic_adding.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/basic_adding.py b/examples/basic_adding.py index 6000e14b..37573a31 100644 --- a/examples/basic_adding.py +++ b/examples/basic_adding.py @@ -166,6 +166,8 @@ def poll(self): self.position = float(position["position"]["szi"]) print(f"set position to {self.position}") break + if self.position is None: + self.position = 0.0 time.sleep(10) From 15b69130d082bc749ce89e8f10ab26ef1e3e950d Mon Sep 17 00:00:00 2001 From: gavinphr Date: Tue, 14 May 2024 16:28:12 +0100 Subject: [PATCH 2/3] reduce MAX_POSITION to 0.01 --- examples/basic_adding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/basic_adding.py b/examples/basic_adding.py index 37573a31..1e8cbaf6 100644 --- a/examples/basic_adding.py +++ b/examples/basic_adding.py @@ -33,7 +33,7 @@ # The maximum absolute position value the strategy can accumulate in units of the coin. # i.e. the strategy will place orders such that it can long up to 1 ETH or short up to 1 ETH -MAX_POSITION = 1.0 +MAX_POSITION = 0.01 # The coin to add liquidity on COIN = "ETH" From f5c47d0fa1b82440a2d8e00fdcf0c2be9d0d235b Mon Sep 17 00:00:00 2001 From: gavinphr Date: Tue, 14 May 2024 17:59:18 +0100 Subject: [PATCH 3/3] Revert "reduce MAX_POSITION to 0.01" This reverts commit 15b69130d082bc749ce89e8f10ab26ef1e3e950d. --- examples/basic_adding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/basic_adding.py b/examples/basic_adding.py index 1e8cbaf6..37573a31 100644 --- a/examples/basic_adding.py +++ b/examples/basic_adding.py @@ -33,7 +33,7 @@ # The maximum absolute position value the strategy can accumulate in units of the coin. # i.e. the strategy will place orders such that it can long up to 1 ETH or short up to 1 ETH -MAX_POSITION = 0.01 +MAX_POSITION = 1.0 # The coin to add liquidity on COIN = "ETH"