File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -575,8 +575,18 @@ func (p *poolsUseCase) GetPools(opts ...domain.PoolsOption) ([]ingesttypes.PoolI
575575// StorePools implements mvc.PoolsUsecase.
576576func (p * poolsUseCase ) StorePools (pools []ingesttypes.PoolI ) error {
577577 for _ , pool := range pools {
578- // Store pool
578+ // Set liquidity capitalization for the pool to previous value if it is nil or zero.
579+ // This value will be used for candidate route search and will be recomputed later.
579580 poolID := pool .GetId ()
581+ oldPool , err := p .GetPool (poolID )
582+ if err == nil {
583+ liquidityCap := pool .GetLiquidityCap ()
584+ if liquidityCap .IsNil () || liquidityCap .Equal (osmomath .ZeroInt ()) {
585+ pool .SetLiquidityCap (oldPool .GetLiquidityCap ())
586+ pool .SetLiquidityCapError (oldPool .GetLiquidityCapError ())
587+ }
588+ }
589+
580590 p .pools .Store (poolID , pool )
581591
582592 // If orderbook, update top liquidity pool for base and quote denom if it has higher liquidity capitalization.
You can’t perform that action at this time.
0 commit comments