Documentation ¶
Index ¶
- Variables
- type Keeper
- func (k Keeper) ConcentratedLiquidityListener() concentratedliquiditytypes.ConcentratedLiquidityListener
- func (k Keeper) DeleteHistoricalRecord(ctx sdk.Context, twap types.TwapRecord)
- func (k Keeper) DeleteMostRecentRecord(ctx sdk.Context, twap types.TwapRecord)
- func (k Keeper) EndBlock(ctx sdk.Context)
- func (k Keeper) EpochHooks() epochtypes.EpochHooks
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GammHooks() gammtypes.GammHooks
- func (k Keeper) GetAllHistoricalPoolIndexedTWAPsForPoolId(ctx sdk.Context, poolId uint64) ([]types.TwapRecord, error)
- func (k Keeper) GetAllHistoricalTimeIndexedTWAPs(ctx sdk.Context) ([]types.TwapRecord, error)
- func (k Keeper) GetAllMostRecentRecordsForPool(ctx sdk.Context, poolId uint64) ([]types.TwapRecord, error)
- func (k Keeper) GetAllMostRecentRecordsForPoolWithDenoms(ctx sdk.Context, poolId uint64, denoms []string) ([]types.TwapRecord, error)
- func (k Keeper) GetArithmeticStrategy() *arithmetic
- func (k Keeper) GetArithmeticTwap(ctx sdk.Context, poolId uint64, baseAssetDenom string, quoteAssetDenom string, ...) (osmomath.Dec, error)
- func (k Keeper) GetArithmeticTwapToNow(ctx sdk.Context, poolId uint64, baseAssetDenom string, quoteAssetDenom string, ...) (osmomath.Dec, error)
- func (k Keeper) GetBeginBlockAccumulatorRecord(ctx sdk.Context, poolId uint64, asset0Denom string, asset1Denom string) (types.TwapRecord, error)
- func (k Keeper) GetGeometricStrategy() *geometric
- func (k Keeper) GetGeometricTwap(ctx sdk.Context, poolId uint64, baseAssetDenom string, quoteAssetDenom string, ...) (osmomath.Dec, error)
- func (k Keeper) GetGeometricTwapToNow(ctx sdk.Context, poolId uint64, baseAssetDenom string, quoteAssetDenom string, ...) (osmomath.Dec, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPruningState(ctx sdk.Context) types.PruningState
- func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
- func (k *Keeper) PruneEpochIdentifier(ctx sdk.Context) string
- func (k *Keeper) RecordHistoryKeepPeriod(ctx sdk.Context) time.Duration
- func (k Keeper) SetParam(ctx sdk.Context, key []byte, value interface{})
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPruningState(ctx sdk.Context, state types.PruningState)
- func (k Keeper) StoreHistoricalTWAP(ctx sdk.Context, twap types.TwapRecord)
- func (k Keeper) StoreNewRecord(ctx sdk.Context, twap types.TwapRecord)
Constants ¶
This section is empty.
Variables ¶
var NumRecordsToPrunePerBlock uint16 = 1000
NumRecordsToPrunePerBlock is the number of records to prune per block. Two records are deleted per incentive record: 1. by time index 2. by pool index Therefore, setting this to 1000 means 500 complete incentive records are deleted per block.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(storeKey storetypes.StoreKey, transientKey *storetypes.TransientStoreKey, paramSpace paramtypes.Subspace, poolmanagerKeeper types.PoolManagerInterface) *Keeper
func (Keeper) ConcentratedLiquidityListener ¶
func (k Keeper) ConcentratedLiquidityListener() concentratedliquiditytypes.ConcentratedLiquidityListener
func (Keeper) DeleteHistoricalRecord ¶
func (k Keeper) DeleteHistoricalRecord(ctx sdk.Context, twap types.TwapRecord)
func (Keeper) DeleteMostRecentRecord ¶
func (k Keeper) DeleteMostRecentRecord(ctx sdk.Context, twap types.TwapRecord)
DeleteMostRecentRecord deletes a given record in most recent record store. Note that if there are entries in historical indexes for this record, they are not deleted by this method.
func (Keeper) EpochHooks ¶
func (k Keeper) EpochHooks() epochtypes.EpochHooks
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the twap module's exported genesis.
func (Keeper) GetAllHistoricalPoolIndexedTWAPsForPoolId ¶
func (k Keeper) GetAllHistoricalPoolIndexedTWAPsForPoolId(ctx sdk.Context, poolId uint64) ([]types.TwapRecord, error)
GetAllHistoricalPoolIndexedTWAPsForPoolId returns HistoricalTwapRecord for a pool give poolId.
func (Keeper) GetAllHistoricalTimeIndexedTWAPs ¶
getAllHistoricalTimeIndexedTWAPs returns all historical TWAPs indexed by time.
func (Keeper) GetAllMostRecentRecordsForPool ¶
func (k Keeper) GetAllMostRecentRecordsForPool(ctx sdk.Context, poolId uint64) ([]types.TwapRecord, error)
GetAllMostRecentRecordsForPool returns all most recent twap records (in state representation) for the provided pool id.
func (Keeper) GetAllMostRecentRecordsForPoolWithDenoms ¶
func (k Keeper) GetAllMostRecentRecordsForPoolWithDenoms(ctx sdk.Context, poolId uint64, denoms []string) ([]types.TwapRecord, error)
GetAllMostRecentRecordsForPool returns all most recent twap records (in state representation) for the provided pool id.
func (Keeper) GetArithmeticStrategy ¶
func (k Keeper) GetArithmeticStrategy() *arithmetic
GetArithmeticStrategy gets arithmetic TWAP keeper.
func (Keeper) GetArithmeticTwap ¶
func (k Keeper) GetArithmeticTwap( ctx sdk.Context, poolId uint64, baseAssetDenom string, quoteAssetDenom string, startTime time.Time, endTime time.Time, ) (osmomath.Dec, error)
N.B. If there is a notable use case, the state machine could maintain more historical records, e.g. at one per hour.
func (Keeper) GetArithmeticTwapToNow ¶
func (k Keeper) GetArithmeticTwapToNow( ctx sdk.Context, poolId uint64, baseAssetDenom string, quoteAssetDenom string, startTime time.Time, ) (osmomath.Dec, error)
GetArithmeticTwapToNow returns arithmetic twap from start time until the current block time for quote and base assets in a given pool.
func (Keeper) GetBeginBlockAccumulatorRecord ¶
func (k Keeper) GetBeginBlockAccumulatorRecord(ctx sdk.Context, poolId uint64, asset0Denom string, asset1Denom string) (types.TwapRecord, error)
GetBeginBlockAccumulatorRecord returns a TwapRecord struct corresponding to the state of pool `poolId` as of the beginning of the block this is called on.
func (Keeper) GetGeometricStrategy ¶
func (k Keeper) GetGeometricStrategy() *geometric
GetGeometricStrategy gets geometric TWAP keeper.
func (Keeper) GetGeometricTwap ¶
func (Keeper) GetGeometricTwapToNow ¶
func (Keeper) GetPruningState ¶
func (k Keeper) GetPruningState(ctx sdk.Context) types.PruningState
GetPruningState gets the current pruning state, which is used to determine whether to prune historical records in the EndBlock. This allows us to spread out the computational cost of pruning over time rather than all at once at epoch.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
InitGenesis initializes the twap module's state from a provided genesis state.
func (*Keeper) RecordHistoryKeepPeriod ¶
func (Keeper) SetParam ¶
SetParam sets a specific twap module's parameter with the provided parameter.
func (Keeper) SetPruningState ¶
func (k Keeper) SetPruningState(ctx sdk.Context, state types.PruningState)
func (Keeper) StoreHistoricalTWAP ¶
func (k Keeper) StoreHistoricalTWAP(ctx sdk.Context, twap types.TwapRecord)
storeHistoricalTWAP writes a twap to the store, in all needed indexing.
func (Keeper) StoreNewRecord ¶
func (k Keeper) StoreNewRecord(ctx sdk.Context, twap types.TwapRecord)
StoreNewRecord stores a record, in both the most recent record store and historical stores.
Directories ¶
Path | Synopsis |
---|---|
queryproto
Package queryproto is a reverse proxy.
|
Package queryproto is a reverse proxy. |