Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blockapi/test/v2/api/debank/data/bio_pools.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
},
"asset_token_list":[
{
"amount":988622.9649515124,
"amount":-988622.9649515124,
"chain":"eth",
"claimable_amount":4902.29790749049,
"decimals":18,
Expand Down
4 changes: 4 additions & 0 deletions blockapi/test/v2/api/debank/test_debank_portfolio_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,7 @@ def test_parse_pools(debank_api, bio_polls):
assert parsed
for data_item in parsed.data:
assert data_item.items

for data_item in parsed.data:
for item in data_item.items:
assert item.balance > Decimal('0')
4 changes: 4 additions & 0 deletions blockapi/v2/api/debank.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ def parse_item(
asset_type = AssetType.DEBT
amount = -amount

if amount < 0:
logger.info(f'Fixing negative item asset_type={asset_type}')
amount = -amount

if raw_amount == 0 and amount != 0:
raw_amount = decimals_to_raw(amount, coin.decimals)

Expand Down