Skip to content

Commit

Permalink
wtf osmosis
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 20, 2024
1 parent ea50688 commit 5773384
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mantis/blackbox/cvm_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def find_asset_by_token(token: str) -> Optional[AssetItem]:
indexer = [c for c in indexers_2.root if c.id == str(pool_id) or c.pool_id == str(pool_id)]
if any(indexer):
indexer = indexer[0]
token_a = indexer.token0 if indexer.token0 else indexer.pool_assets[0].token.denom
token_b = indexer.token1 if indexer.token1 else indexer.pool_assets[1].token.denom
token_a = indexer.token0 if indexer.token0 else indexer.pool_assets[0].token.denom if indexer.pool_assets else indexer.tokens[0].denom
token_b = indexer.token1 if indexer.token1 else indexer.pool_assets[1].token.denom if indexer.pool_assets else indexer.tokens[1].denom
asset_a = find_asset_by_token(token_a)
asset_b = find_asset_by_token(token_b)

Expand All @@ -160,10 +160,10 @@ def find_asset_by_token(token: str) -> Optional[AssetItem]:
continue

token_a_amount = (
int(indexer.token0Amount) if indexer.token0Amount else indexer.pool_assets[0].token.amount
int(indexer.token0Amount) if indexer.token0Amount else indexer.pool_assets[0].token.amount if indexer.pool_assets else indexer.tokens[0].amount
)
token_b_amount = (
int(indexer.token1Amount) if indexer.token1Amount else indexer.pool_assets[1].token.amount
int(indexer.token1Amount) if indexer.token1Amount else indexer.pool_assets[1].token.amount if indexer.pool_assets else indexer.tokens[1].amount
)
weight_a = 1
weight_b = 1
Expand Down

0 comments on commit 5773384

Please sign in to comment.