Skip to content

Commit

Permalink
kraken: ignore mismatched zero-ed pps (for now)
Browse files Browse the repository at this point in the history
See more details in the GH comment:
#373 (comment)

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.
  • Loading branch information
goodboy committed Jan 12, 2023
1 parent cd930d6 commit 6a6828e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion piker/brokers/kraken/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,21 @@ def has_pp(
):
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)
Expand Down Expand Up @@ -590,7 +605,7 @@ def has_pp(
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'
Expand Down

0 comments on commit 6a6828e

Please sign in to comment.