Documentation ¶
Index ¶
- func AllInvariants(keeper Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func TotalSuperfluidDelegationInvariant(keeper Keeper) sdk.Invariant
- func ValidatorAddressFromSyntheticDenom(syntheticDenom string) (string, error)
- type Hooks
- func (h Hooks) AfterAddTokensToLock(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins)
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)
- func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, infractionHeight int64, ...)
- func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
- func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, infractionHeight int64, ...)
- func (h Hooks) OnStartUnlock(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins, ...)
- func (h Hooks) OnTokenLocked(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins, ...)
- func (h Hooks) OnTokenSlashed(ctx sdk.Context, lockID uint64, amount sdk.Coins)
- func (h Hooks) OnTokenUnlocked(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins, ...)
- type Keeper
- func (k Keeper) AddNewSuperfluidAsset(ctx sdk.Context, asset types.SuperfluidAsset)
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64)
- func (k Keeper) AfterEpochStartBeginBlock(ctx sdk.Context)
- func (k Keeper) AllAssets(goCtx context.Context, req *types.AllAssetsRequest) (*types.AllAssetsResponse, error)
- func (k Keeper) AllIntermediaryAccounts(goCtx context.Context, req *types.AllIntermediaryAccountsRequest) (*types.AllIntermediaryAccountsResponse, error)
- func (k Keeper) AssetMultiplier(goCtx context.Context, req *types.AssetMultiplierRequest) (*types.AssetMultiplierResponse, error)
- func (k Keeper) AssetType(goCtx context.Context, req *types.AssetTypeRequest) (*types.AssetTypeResponse, error)
- func (k Keeper) BeginUnwindSuperfluidAsset(ctx sdk.Context, epochNum int64, asset types.SuperfluidAsset)
- func (k Keeper) ConnectedIntermediaryAccount(goCtx context.Context, req *types.ConnectedIntermediaryAccountRequest) (*types.ConnectedIntermediaryAccountResponse, error)
- func (k Keeper) DeleteIntermediaryAccount(ctx sdk.Context, address sdk.AccAddress)
- func (k Keeper) DeleteLockIdIntermediaryAccountConnection(ctx sdk.Context, lockId uint64)
- func (k Keeper) DeleteOsmoEquivalentMultiplier(ctx sdk.Context, denom string)
- func (k Keeper) DeleteSuperfluidAsset(ctx sdk.Context, denom string)
- func (k Keeper) EstimateSuperfluidDelegatedAmountByValidatorDenom(goCtx context.Context, ...) (*types.EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, error)
- func (k Keeper) GetAllIntermediaryAccounts(ctx sdk.Context) []types.SuperfluidIntermediaryAccount
- func (k Keeper) GetAllLockIdIntermediaryAccountConnections(ctx sdk.Context) []types.LockIdIntermediaryAccountConnection
- func (k Keeper) GetAllOsmoEquivalentMultipliers(ctx sdk.Context) []types.OsmoEquivalentMultiplierRecord
- func (k Keeper) GetAllSuperfluidAssets(ctx sdk.Context) []types.SuperfluidAsset
- func (k Keeper) GetEpochIdentifier(ctx sdk.Context) (epochIdentifier string)
- func (k Keeper) GetExpectedDelegationAmount(ctx sdk.Context, acc types.SuperfluidIntermediaryAccount) sdk.Int
- func (k Keeper) GetIntermediaryAccount(ctx sdk.Context, address sdk.AccAddress) types.SuperfluidIntermediaryAccount
- func (k Keeper) GetIntermediaryAccountFromLockId(ctx sdk.Context, lockId uint64) (types.SuperfluidIntermediaryAccount, bool)
- func (k Keeper) GetIntermediaryAccountsForVal(ctx sdk.Context, valAddr sdk.ValAddress) []types.SuperfluidIntermediaryAccount
- func (k Keeper) GetLockIdIntermediaryAccountConnection(ctx sdk.Context, lockId uint64) sdk.AccAddress
- func (k Keeper) GetOrCreateIntermediaryAccount(ctx sdk.Context, denom, valAddr string) (types.SuperfluidIntermediaryAccount, error)
- func (k Keeper) GetOsmoEquivalentMultiplier(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRiskAdjustedOsmoValue(ctx sdk.Context, asset types.SuperfluidAsset, amount sdk.Int) sdk.Int
- func (k Keeper) GetSuperfluidAsset(ctx sdk.Context, denom string) types.SuperfluidAsset
- func (k Keeper) GetSuperfluidOSMOTokens(ctx sdk.Context, denom string, amount sdk.Int) sdk.Int
- func (k Keeper) GetTotalSyntheticAssetsLocked(ctx sdk.Context, denom string) sdk.Int
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncreaseSuperfluidDelegation(ctx sdk.Context, lockID uint64, amount sdk.Coins) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MoveSuperfluidDelegationRewardToGauges(ctx sdk.Context)
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RefreshIntermediaryDelegationAmounts(ctx sdk.Context)
- func (k Keeper) SetIntermediaryAccount(ctx sdk.Context, acc types.SuperfluidIntermediaryAccount)
- func (k Keeper) SetLockIdIntermediaryAccountConnection(ctx sdk.Context, lockId uint64, acc types.SuperfluidIntermediaryAccount)
- func (k Keeper) SetOsmoEquivalentMultiplier(ctx sdk.Context, epoch int64, denom string, multiplier sdk.Dec)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetSuperfluidAsset(ctx sdk.Context, asset types.SuperfluidAsset)
- func (k Keeper) SlashLockupsForValidatorSlash(ctx sdk.Context, valAddr sdk.ValAddress, infractionHeight int64, ...)
- func (k Keeper) SuperfluidDelegate(ctx sdk.Context, sender string, lockID uint64, valAddr string) error
- func (k Keeper) SuperfluidDelegationAmount(goCtx context.Context, req *types.SuperfluidDelegationAmountRequest) (*types.SuperfluidDelegationAmountResponse, error)
- func (k Keeper) SuperfluidDelegationsByDelegator(goCtx context.Context, req *types.SuperfluidDelegationsByDelegatorRequest) (*types.SuperfluidDelegationsByDelegatorResponse, error)
- func (k Keeper) SuperfluidDelegationsByValidatorDenom(goCtx context.Context, req *types.SuperfluidDelegationsByValidatorDenomRequest) (*types.SuperfluidDelegationsByValidatorDenomResponse, error)
- func (k Keeper) SuperfluidUnbondLock(ctx sdk.Context, underlyingLockId uint64, sender string) error
- func (k Keeper) SuperfluidUndelegate(ctx sdk.Context, sender string, lockID uint64) error
- func (k Keeper) SuperfluidUndelegationsByDelegator(goCtx context.Context, req *types.SuperfluidUndelegationsByDelegatorRequest) (*types.SuperfluidUndelegationsByDelegatorResponse, error)
- func (k Keeper) TotalSuperfluidDelegations(goCtx context.Context, req *types.TotalSuperfluidDelegationsRequest) (*types.TotalSuperfluidDelegationsResponse, error)
- func (k Keeper) UnriskAdjustOsmoValue(ctx sdk.Context, amount sdk.Dec) sdk.Dec
- func (k Keeper) UpdateOsmoEquivalentMultipliers(ctx sdk.Context, asset types.SuperfluidAsset, newEpochNumber int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶ added in v7.1.0
AllInvariants runs all invariants of the gamm module
func NewMsgServerImpl ¶
NewMsgServerImpl returns an instance of MsgServer
func RegisterInvariants ¶ added in v7.1.0
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all governance invariants
func TotalSuperfluidDelegationInvariant ¶ added in v7.1.0
TotalSuperfluidDelegationInvariant checks the sum of intermediary account delegation is same as sum of individual lockup delegation
func ValidatorAddressFromSyntheticDenom ¶
quick fix for getting the validator addresss from a synthetic denom
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentives keeper
func (Hooks) AfterAddTokensToLock ¶
func (h Hooks) AfterAddTokensToLock(ctx sdk.Context, address sdk.AccAddress, lockID uint64, amount sdk.Coins)
lockup hooks if you add tokens to a lock that is superfluid unbonding, nothing happens superfluid side. This lock does as an edge case take on the slashing risk as well for historical slashes. This is deemed as fine, governance can re-pay if it occurs on mainnet.
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) AfterEpochEnd ¶
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) AfterValidatorCreated ¶
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
staking hooks
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) AfterValidatorSlashed ¶ added in v7.1.0
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeEpochStart ¶
epochs hooks Don't do anything pre epoch start
func (Hooks) BeforeValidatorModified ¶
func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
func (Hooks) BeforeValidatorSlashed ¶
func (Hooks) OnStartUnlock ¶
func (Hooks) OnTokenLocked ¶
func (Hooks) OnTokenSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper provides a way to manage module storage
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, ak authkeeper.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, dk types.DistrKeeper, ek types.EpochKeeper, lk types.LockupKeeper, gk types.GammKeeper, ik types.IncentivesKeeper, lms types.LockupMsgServer) *Keeper
NewKeeper returns an instance of Keeper
func (Keeper) AddNewSuperfluidAsset ¶
func (k Keeper) AddNewSuperfluidAsset(ctx sdk.Context, asset types.SuperfluidAsset)
func (Keeper) AfterEpochEnd ¶
func (Keeper) AfterEpochStartBeginBlock ¶
func (Keeper) AllAssets ¶
func (k Keeper) AllAssets(goCtx context.Context, req *types.AllAssetsRequest) (*types.AllAssetsResponse, error)
AllAssets Returns all superfluid assets info
func (Keeper) AllIntermediaryAccounts ¶
func (k Keeper) AllIntermediaryAccounts(goCtx context.Context, req *types.AllIntermediaryAccountsRequest) (*types.AllIntermediaryAccountsResponse, error)
AllIntermediaryAccounts returns all superfluid intermediary accounts
func (Keeper) AssetMultiplier ¶
func (k Keeper) AssetMultiplier(goCtx context.Context, req *types.AssetMultiplierRequest) (*types.AssetMultiplierResponse, error)
AssetMultiplier returns superfluid asset multiplier
func (Keeper) AssetType ¶
func (k Keeper) AssetType(goCtx context.Context, req *types.AssetTypeRequest) (*types.AssetTypeResponse, error)
AssetType Returns superfluid asset type
func (Keeper) BeginUnwindSuperfluidAsset ¶
func (k Keeper) BeginUnwindSuperfluidAsset(ctx sdk.Context, epochNum int64, asset types.SuperfluidAsset)
BeginUnwindSuperfluidAsset starts the deletion process for a superfluid asset. This current method is a stub, but is called when: * Governance removes a superfluid asset * A severe error in gamm occurs
It should eventually begin unwinding all of the synthetic lockups for that asset and queue them for deletion. See https://github.com/osmosis-labs/osmosis/issues/864
func (Keeper) ConnectedIntermediaryAccount ¶
func (k Keeper) ConnectedIntermediaryAccount(goCtx context.Context, req *types.ConnectedIntermediaryAccountRequest) (*types.ConnectedIntermediaryAccountResponse, error)
ConnectedIntermediaryAccount returns intermediary account connected to a superfluid staked lock by id
func (Keeper) DeleteIntermediaryAccount ¶
func (k Keeper) DeleteIntermediaryAccount(ctx sdk.Context, address sdk.AccAddress)
func (Keeper) DeleteLockIdIntermediaryAccountConnection ¶
func (Keeper) DeleteOsmoEquivalentMultiplier ¶
func (Keeper) DeleteSuperfluidAsset ¶
func (Keeper) EstimateSuperfluidDelegatedAmountByValidatorDenom ¶
func (k Keeper) EstimateSuperfluidDelegatedAmountByValidatorDenom(goCtx context.Context, req *types.EstimateSuperfluidDelegatedAmountByValidatorDenomRequest) (*types.EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, error)
EstimateSuperfluidDelegatedAmountByValidatorDenom returns the amount of a specific denom delegated to a specific validator This is labeled an estimate, because the way it calculates the amount can lead rounding errors from the true delegated amount
func (Keeper) GetAllIntermediaryAccounts ¶
func (k Keeper) GetAllIntermediaryAccounts(ctx sdk.Context) []types.SuperfluidIntermediaryAccount
func (Keeper) GetAllLockIdIntermediaryAccountConnections ¶ added in v7.1.0
func (k Keeper) GetAllLockIdIntermediaryAccountConnections(ctx sdk.Context) []types.LockIdIntermediaryAccountConnection
func (Keeper) GetAllOsmoEquivalentMultipliers ¶
func (k Keeper) GetAllOsmoEquivalentMultipliers(ctx sdk.Context) []types.OsmoEquivalentMultiplierRecord
func (Keeper) GetAllSuperfluidAssets ¶
func (k Keeper) GetAllSuperfluidAssets(ctx sdk.Context) []types.SuperfluidAsset
func (Keeper) GetEpochIdentifier ¶
GetParams returns the total set params
func (Keeper) GetExpectedDelegationAmount ¶
func (Keeper) GetIntermediaryAccount ¶
func (k Keeper) GetIntermediaryAccount(ctx sdk.Context, address sdk.AccAddress) types.SuperfluidIntermediaryAccount
func (Keeper) GetIntermediaryAccountFromLockId ¶
func (k Keeper) GetIntermediaryAccountFromLockId(ctx sdk.Context, lockId uint64) (types.SuperfluidIntermediaryAccount, bool)
Returns Superfluid Intermediate Account and a bool if found / not found
func (Keeper) GetIntermediaryAccountsForVal ¶
func (k Keeper) GetIntermediaryAccountsForVal(ctx sdk.Context, valAddr sdk.ValAddress) []types.SuperfluidIntermediaryAccount
func (Keeper) GetLockIdIntermediaryAccountConnection ¶
func (Keeper) GetOrCreateIntermediaryAccount ¶
func (Keeper) GetOsmoEquivalentMultiplier ¶
func (Keeper) GetRiskAdjustedOsmoValue ¶
func (k Keeper) GetRiskAdjustedOsmoValue(ctx sdk.Context, asset types.SuperfluidAsset, amount sdk.Int) sdk.Int
Returns amount * (1 - k.RiskFactor(asset)) Fow now, the risk factor is a global constant. It will move towards per pool functions.
func (Keeper) GetSuperfluidAsset ¶
func (Keeper) GetSuperfluidOSMOTokens ¶
func (Keeper) GetTotalSyntheticAssetsLocked ¶
func (Keeper) IncreaseSuperfluidDelegation ¶
func (Keeper) MoveSuperfluidDelegationRewardToGauges ¶
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns the superfluid module params
func (Keeper) RefreshIntermediaryDelegationAmounts ¶
func (Keeper) SetIntermediaryAccount ¶
func (k Keeper) SetIntermediaryAccount(ctx sdk.Context, acc types.SuperfluidIntermediaryAccount)
func (Keeper) SetLockIdIntermediaryAccountConnection ¶
func (Keeper) SetOsmoEquivalentMultiplier ¶
func (Keeper) SetSuperfluidAsset ¶
func (k Keeper) SetSuperfluidAsset(ctx sdk.Context, asset types.SuperfluidAsset)
func (Keeper) SlashLockupsForValidatorSlash ¶
func (k Keeper) SlashLockupsForValidatorSlash(ctx sdk.Context, valAddr sdk.ValAddress, infractionHeight int64, slashFactor sdk.Dec)
SlashLockupsForValidatorSlash should be called before the validator at valAddr is slashed. This function is responsible for inspecting every intermediate account to valAddr. For each intermediate account IA, it slashes every constituent delegation behind IA. Furthermore, if the infraction height is sufficiently old, slashes unbondings Note: Based on sdk.staking.Slash function review, slashed tokens are burnt not sent to community pool we ignore that, and send the underliyng tokens to the community pool anyway.
func (Keeper) SuperfluidDelegate ¶
func (k Keeper) SuperfluidDelegate(ctx sdk.Context, sender string, lockID uint64, valAddr string) error
TODO: Merge a lot of logic with IncreaseSuperfluidDelegation
func (Keeper) SuperfluidDelegationAmount ¶
func (k Keeper) SuperfluidDelegationAmount(goCtx context.Context, req *types.SuperfluidDelegationAmountRequest) (*types.SuperfluidDelegationAmountResponse, error)
SuperfluidDelegationAmount returns the coins superfluid delegated for a delegator, validator, denom triplet
func (Keeper) SuperfluidDelegationsByDelegator ¶
func (k Keeper) SuperfluidDelegationsByDelegator(goCtx context.Context, req *types.SuperfluidDelegationsByDelegatorRequest) (*types.SuperfluidDelegationsByDelegatorResponse, error)
SuperfluidDelegationsByDelegator returns all the superfluid poistions for a specific delegator
func (Keeper) SuperfluidDelegationsByValidatorDenom ¶
func (k Keeper) SuperfluidDelegationsByValidatorDenom(goCtx context.Context, req *types.SuperfluidDelegationsByValidatorDenomRequest) (*types.SuperfluidDelegationsByValidatorDenomResponse, error)
SuperfluidDelegationsByValidatorDenom returns all the superfluid positions of a specific denom delegated to one validator
func (Keeper) SuperfluidUnbondLock ¶
func (Keeper) SuperfluidUndelegate ¶
func (Keeper) SuperfluidUndelegationsByDelegator ¶
func (k Keeper) SuperfluidUndelegationsByDelegator(goCtx context.Context, req *types.SuperfluidUndelegationsByDelegatorRequest) (*types.SuperfluidUndelegationsByDelegatorResponse, error)
SuperfluidUndelegationsByDelegator returns total amount undelegating by delegator
func (Keeper) TotalSuperfluidDelegations ¶
func (k Keeper) TotalSuperfluidDelegations(goCtx context.Context, req *types.TotalSuperfluidDelegationsRequest) (*types.TotalSuperfluidDelegationsResponse, error)
TotalSuperfluidDelegations returns total amount of osmo delegated via superfluid staking