-
Notifications
You must be signed in to change notification settings - Fork 0
/
pool.go
27 lines (22 loc) · 948 Bytes
/
pool.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
poolmanagertypes "github.com/merlinslair/merlin/x/poolmanager/types"
)
type ConcentratedPoolExtension interface {
poolmanagertypes.PoolI
// TODO: move these to separate interfaces
GetToken0() string
GetToken1() string
GetCurrentSqrtPrice() sdk.Dec
GetCurrentTick() sdk.Int
GetPrecisionFactorAtPriceOne() sdk.Int
GetTickSpacing() uint64
GetLiquidity() sdk.Dec
SetCurrentSqrtPrice(newSqrtPrice sdk.Dec)
SetCurrentTick(newTick sdk.Int)
UpdateLiquidity(newLiquidity sdk.Dec)
ApplySwap(newLiquidity sdk.Dec, newCurrentTick sdk.Int, newCurrentSqrtPrice sdk.Dec) error
CalcActualAmounts(ctx sdk.Context, lowerTick, upperTick int64, sqrtRatioLowerTick, sqrtRatioUpperTick sdk.Dec, liquidityDelta sdk.Dec) (actualAmountDenom0 sdk.Dec, actualAmountDenom1 sdk.Dec)
UpdateLiquidityIfActivePosition(ctx sdk.Context, lowerTick, upperTick int64, liquidityDelta sdk.Dec) bool
}