Skip to content

Commit

Permalink
feat: unblock ww pools
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Mar 12, 2024
1 parent 9269f6f commit 9570073
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions ingest/sqs/pools/ingester/pool_ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import (
poolsredisrepo "github.com/osmosis-labs/sqs/sqsdomain/repository/redis/pools"
routerredisrepo "github.com/osmosis-labs/sqs/sqsdomain/repository/redis/router"

cosmwasmpooltypes "github.com/osmosis-labs/osmosis/v23/x/cosmwasmpool/types"

"github.com/osmosis-labs/osmosis/osmomath"
"github.com/osmosis-labs/osmosis/v23/ingest/sqs/domain"

"github.com/osmosis-labs/osmosis/v23/x/concentrated-liquidity/client/queryproto"
concentratedtypes "github.com/osmosis-labs/osmosis/v23/x/concentrated-liquidity/types"
"github.com/osmosis-labs/osmosis/v23/x/cosmwasmpool/model"
poolmanagertypes "github.com/osmosis-labs/osmosis/v23/x/poolmanager/types"
)

Expand Down Expand Up @@ -201,17 +202,6 @@ func (pi *poolIngester) processPoolState(ctx sdk.Context, tx repository.Tx) erro
}

for _, pool := range cosmWasmPools {
// The logic below is to skip mainnet WhiteWhale pools that were instantiated while
// borne
cwPool, ok := pool.(*model.Pool)
if !ok {
return errors.New("fail to cast cw pool")
}

// White whale pool code ID
if cwPool.CodeId == whiteWhalePoolCodeID {
continue
}

// Parse cosmwasm pool to the standard SQS types.
pool, err := pi.convertPool(ctx, pool, denomToRoutablePoolIDMap, denomPairToTakerFeeMap, tokenPrecisionMap)
Expand Down Expand Up @@ -330,6 +320,14 @@ func (pi *poolIngester) convertPool(
}()

balances := pi.bankKeeper.GetAllBalances(ctx, pool.GetAddress())
if pool.GetType() == poolmanagertypes.CosmWasm {
cwPool, ok := pool.(cosmwasmpooltypes.CosmWasmExtension)
if !ok {
return nil, fmt.Errorf("pool (%d) with type (%d) is not a CosmWasmExtension", pool.GetId(), pool.GetType())
}

balances = cwPool.GetTotalPoolLiquidity(ctx)
}

osmoPoolTVL := osmomath.ZeroInt()

Expand Down

0 comments on commit 9570073

Please sign in to comment.