Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: unblock ww pools #7716

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from 1 commit
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
Next Next commit
feat: unblock ww pools
  • Loading branch information
p0mvn committed Mar 12, 2024
commit 9570073e2b67f57d833186d923a7a2750b0f55a0
22 changes: 10 additions & 12 deletions ingest/sqs/pools/ingester/pool_ingester.go
Original file line number Diff line number Diff line change
@@ -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"
)

@@ -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)
@@ -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()