`kraken`: ignore mismatched zero-ed pps (for now)

See more details in the GH comment:
https://github.com/pikers/piker/issues/373#issuecomment-1380988581

More or less we need to pull and include the transfer fees for
withdrawals in our ledger tracking but this serves as a sloppy
workaround for the moment.
misc_brokerd_backend_repairs
Tyler Goodlet 2023-01-12 15:59:37 -05:00
parent 73379d3627
commit 94290c7d8b
1 changed files with 16 additions and 1 deletions

View File

@ -534,6 +534,21 @@ async def trades_dialogue(
):
return pp
elif (
size == 0
and pp.size
):
log.warning(
f'`kraken` account says you have a ZERO '
f'balance for {bsuid}:{pair}\n'
f'but piker seems to think `{pp.size}`\n'
'This is likely a discrepancy in piker '
'accounting if the above number is'
"large,' though it's likely to due lack"
"f tracking xfers fees.."
)
return pp
return False
pos = has_pp(dst, size)
@ -590,7 +605,7 @@ async def trades_dialogue(
f'{pformat(updated)}'
)
if not has_pp(dst, size):
if has_pp(dst, size):
raise ValueError(
'Could not reproduce balance:\n'
f'dst: {dst}, {size}\n'