Merge pull request from pikers/paper_clear_logics_fix

Oof, reverse clearing logic-routines in paper eng
kraken_fill_bugs
goodboy 2022-09-11 22:20:04 -04:00 committed by GitHub
commit c724117c1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions
piker/clearing

View File

@ -333,7 +333,7 @@ async def simulate_fills(
key=itemgetter(0), key=itemgetter(0),
)) ))
def sell_on_bid(our_price): def buy_on_ask(our_price):
return tick_price <= our_price return tick_price <= our_price
sells: bidict[str, tuple] = client._sells[sym] sells: bidict[str, tuple] = client._sells[sym]
@ -342,7 +342,7 @@ async def simulate_fills(
key=itemgetter(0) key=itemgetter(0)
) )
def buy_on_ask(our_price): def sell_on_bid(our_price):
return tick_price >= our_price return tick_price >= our_price
match tick: match tick:
@ -358,7 +358,7 @@ async def simulate_fills(
iter_entries = zip( iter_entries = zip(
iter_buys, iter_buys,
itertools.repeat(sell_on_bid) itertools.repeat(buy_on_ask)
) )
case { case {
@ -373,7 +373,7 @@ async def simulate_fills(
iter_entries = zip( iter_entries = zip(
iter_sells, iter_sells,
itertools.repeat(buy_on_ask) itertools.repeat(sell_on_bid)
) )
case { case {
@ -394,7 +394,7 @@ async def simulate_fills(
): ):
for order_info, pred in zip( for order_info, pred in zip(
pair, pair,
itertools.cycle([sell_on_bid, buy_on_ask]), itertools.cycle([buy_on_ask, sell_on_bid]),
): ):
yield order_info, pred yield order_info, pred