Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hoa/update-lo' into hoa/update-lo
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanguyenkh committed Dec 9, 2024
2 parents c2f2aaa + 5a42c6c commit ed01331
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/liquidity-source/algebra/integral/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ func getOutputTokenDelta10(to, from, liquidity *uint256.Int) (*uint256.Int, erro
func getToken0Delta(priceLower, priceUpper, liquidity *uint256.Int, roundUp bool) (*uint256.Int, error) {
priceDelta := new(uint256.Int).Sub(priceUpper, priceLower)
if priceDelta.Cmp(priceUpper) >= 0 {
return nil, errors.New("price delta must be greater than price upper")
return nil, errors.New("price delta must be smaller than price upper")
}

liquidityShifted := new(uint256.Int).Lsh(liquidity, RESOLUTION)
Expand Down Expand Up @@ -570,7 +570,7 @@ func getToken0Delta(priceLower, priceUpper, liquidity *uint256.Int, roundUp bool

func getToken1Delta(priceLower, priceUpper, liquidity *uint256.Int, roundUp bool) (*uint256.Int, error) {
if priceUpper.Cmp(priceLower) < 0 {
return nil, errors.New("price upper must be greater than price lower")
return nil, errors.New("price upper must be greater or equal than price lower")
}

priceDelta := new(uint256.Int).Sub(priceUpper, priceLower)
Expand Down
2 changes: 1 addition & 1 deletion pkg/liquidity-source/algebra/integral/pool_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (d *PoolTracker) fetchRPCData(ctx context.Context, p entity.Pool, blockNumb

res.State = GlobalState{
Price: uint256.MustFromBig(rpcState.Price),
Tick: int32(rpcState.Tick.Uint64()),
Tick: int32(rpcState.Tick.Int64()),
LastFee: rpcState.LastFee,
PluginConfig: rpcState.PluginConfig,
CommunityFee: rpcState.CommunityFee,
Expand Down

0 comments on commit ed01331

Please sign in to comment.