From d706f35668b9ac6b5e5b464c18f46b5d11ea1da4 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 24 Sep 2021 11:47:38 -0400 Subject: [PATCH] Keep slots ratio of 1 on derivs at startup --- piker/clearing/_allocate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/clearing/_allocate.py b/piker/clearing/_allocate.py index f6c9eee1..c14b92d5 100644 --- a/piker/clearing/_allocate.py +++ b/piker/clearing/_allocate.py @@ -287,6 +287,7 @@ def mk_allocator( asset_type = symbol.type_key + # specific configs by asset class / type if asset_type in ('future', 'option', 'futures_option'): @@ -308,9 +309,12 @@ def mk_allocator( alloc.currency_limit = round(startup_size, ndigits=2) else: - startup_size = startup_pp.size + startup_size = abs(startup_pp.size) if startup_size > alloc.units_limit: alloc.units_limit = startup_size + if asset_type in ('future', 'option', 'futures_option'): + alloc.slots = alloc.units_limit + return alloc