Don't raise on missing position for now, just error log

doin_the_splits
Tyler Goodlet 2022-08-15 13:35:43 -04:00
parent 941a2196b3
commit 23ba0e5e69
1 changed files with 5 additions and 3 deletions

View File

@ -405,11 +405,12 @@ async def update_and_audit_msgs(
avg_price=p.ppu, avg_price=p.ppu,
) )
if validate and p.size: if validate and p.size:
raise ValueError( # raise ValueError(
f'UNEXPECTED POSITION ib <-> piker ledger:\n' log.error(
f'UNEXPECTED POSITION says ib:\n'
f'piker: {msg}\n' f'piker: {msg}\n'
'YOU SHOULD FIGURE OUT WHY TF YOUR LEDGER IS OFF!?\n' 'YOU SHOULD FIGURE OUT WHY TF YOUR LEDGER IS OFF!?\n'
'MAYBE THEY LIQUIDATED YOU BRO!??!' 'THEY LIQUIDATED YOU OR YOUR MISSING LEDGER RECORDS!?'
) )
msgs.append(msg) msgs.append(msg)
@ -506,6 +507,7 @@ async def trades_dialogue(
): ):
trans = norm_trade_records(ledger) trans = norm_trade_records(ledger)
table.update_from_trans(trans) table.update_from_trans(trans)
# update trades ledgers for all accounts from connected # update trades ledgers for all accounts from connected
# api clients which report trades for **this session**. # api clients which report trades for **this session**.
trades = await proxy.trades() trades = await proxy.trades()