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) error
- 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) error
- 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) OnLockupExtend(ctx sdk.Context, lockID uint64, oldDuration, newDuration time.Duration)
- 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) error
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64) error
- func (k Keeper) AfterEpochStartBeginBlock(ctx sdk.Context)
- func (k Keeper) BeginUnwindSuperfluidAsset(ctx sdk.Context, epochNum int64, asset types.SuperfluidAsset)
- func (k Keeper) DeleteIntermediaryAccount(ctx sdk.Context, address sdk.AccAddress)
- func (k Keeper) DeleteLockIdIntermediaryAccountConnection(ctx sdk.Context, lockId uint64)
- func (k Keeper) DeletePercoEquivalentMultiplier(ctx sdk.Context, denom string)
- func (k Keeper) DeleteSuperfluidAsset(ctx sdk.Context, denom string)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllIntermediaryAccounts(ctx sdk.Context) []types.SuperfluidIntermediaryAccount
- func (k Keeper) GetAllLockIdIntermediaryAccountConnections(ctx sdk.Context) []types.LockIdIntermediaryAccountConnection
- func (k Keeper) GetAllPercoEquivalentMultipliers(ctx sdk.Context) []types.PercoEquivalentMultiplierRecord
- 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, error)
- 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) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPercoEquivalentMultiplier(ctx sdk.Context, denom string) sdk.Dec
- func (k Keeper) GetRiskAdjustedPercoValue(ctx sdk.Context, amount sdk.Int) sdk.Int
- func (k Keeper) GetSuperfluidAsset(ctx sdk.Context, denom string) (types.SuperfluidAsset, error)
- func (k Keeper) GetSuperfluidPERCOTokens(ctx sdk.Context, denom string, amount sdk.Int) (sdk.Int, error)
- func (k Keeper) GetTotalSyntheticAssetsLocked(ctx sdk.Context, denom string) sdk.Int
- func (k Keeper) GetUnpoolAllowedPools(ctx sdk.Context) []uint64
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncreaseSuperfluidDelegation(ctx sdk.Context, lockID uint64, amount sdk.Coins) error
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(int64, stakingtypes.ValidatorI) bool)
- func (k Keeper) IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MoveSuperfluidDelegationRewardToGauges(ctx sdk.Context)
- func (k Keeper) RefreshIntermediaryDelegationAmounts(ctx sdk.Context)
- func (k Keeper) RouteLockedBalancerToConcentratedMigration(ctx sdk.Context, sender sdk.AccAddress, providedLockId int64, ...) (positionId uint64, amount0, amount1 sdk.Int, liquidity sdk.Dec, ...)
- 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) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPercoEquivalentMultiplier(ctx sdk.Context, epoch int64, denom string, multiplier sdk.Dec)
- func (k Keeper) SetSuperfluidAsset(ctx sdk.Context, asset types.SuperfluidAsset)
- func (k Keeper) SetUnpoolAllowedPools(ctx sdk.Context, poolIds []uint64)
- 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) SuperfluidUnbondLock(ctx sdk.Context, underlyingLockId uint64, sender string) error
- func (k Keeper) SuperfluidUndelegate(ctx sdk.Context, sender string, lockID uint64) error
- func (k Keeper) SuperfluidUndelegateAndUnbondLock(ctx sdk.Context, lockID uint64, sender string, amount sdk.Int) (uint64, error)
- func (k Keeper) SuperfluidUndelegateToConcentratedPosition(ctx sdk.Context, sender string, gammLockID uint64) (types.SuperfluidIntermediaryAccount, error)
- func (k Keeper) TotalBondedTokens(ctx sdk.Context) sdk.Int
- func (k Keeper) UnpoolAllowedPools(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, lockId uint64) ([]uint64, error)
- func (k Keeper) UnriskAdjustPercoValue(ctx sdk.Context, amount sdk.Dec) sdk.Dec
- func (k Keeper) UpdatePercoEquivalentMultipliers(ctx sdk.Context, asset types.SuperfluidAsset, newEpochNumber int64) error
- type MigrationType
- type Querier
- func (q Querier) AllAssets(goCtx context.Context, _ *types.AllAssetsRequest) (*types.AllAssetsResponse, error)
- func (q Querier) AllIntermediaryAccounts(goCtx context.Context, req *types.AllIntermediaryAccountsRequest) (*types.AllIntermediaryAccountsResponse, error)
- func (q Querier) AssetMultiplier(goCtx context.Context, req *types.AssetMultiplierRequest) (*types.AssetMultiplierResponse, error)
- func (q Querier) AssetType(goCtx context.Context, req *types.AssetTypeRequest) (*types.AssetTypeResponse, error)
- func (q Querier) ConnectedIntermediaryAccount(goCtx context.Context, req *types.ConnectedIntermediaryAccountRequest) (*types.ConnectedIntermediaryAccountResponse, error)
- func (q Querier) EstimateSuperfluidDelegatedAmountByValidatorDenom(goCtx context.Context, ...) (*types.EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, error)
- func (q Querier) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (q Querier) SuperfluidDelegationAmount(goCtx context.Context, req *types.SuperfluidDelegationAmountRequest) (*types.SuperfluidDelegationAmountResponse, error)
- func (q Querier) SuperfluidDelegationsByDelegator(goCtx context.Context, req *types.SuperfluidDelegationsByDelegatorRequest) (*types.SuperfluidDelegationsByDelegatorResponse, error)
- func (q Querier) SuperfluidDelegationsByValidatorDenom(goCtx context.Context, req *types.SuperfluidDelegationsByValidatorDenomRequest) (*types.SuperfluidDelegationsByValidatorDenomResponse, error)
- func (q Querier) SuperfluidUndelegationsByDelegator(goCtx context.Context, req *types.SuperfluidUndelegationsByDelegatorRequest) (*types.SuperfluidUndelegationsByDelegatorResponse, error)
- func (q Querier) TotalDelegationByDelegator(goCtx context.Context, req *types.QueryTotalDelegationByDelegatorRequest) (*types.QueryTotalDelegationByDelegatorResponse, error)
- func (q Querier) TotalDelegationByValidatorForDenom(goCtx context.Context, ...) (*types.QueryTotalDelegationByValidatorForDenomResponse, error)
- func (q Querier) TotalSuperfluidDelegations(goCtx context.Context, _ *types.TotalSuperfluidDelegationsRequest) (*types.TotalSuperfluidDelegationsResponse, error)
- func (q Querier) UnpoolWhitelist(goCtx context.Context, req *types.QueryUnpoolWhitelistRequest) (*types.QueryUnpoolWhitelistResponse, error)
- func (q Querier) UserConcentratedSuperfluidPositionsDelegated(goCtx context.Context, ...) (*types.UserConcentratedSuperfluidPositionsDelegatedResponse, error)
- func (q Querier) UserConcentratedSuperfluidPositionsUndelegating(goCtx context.Context, ...) (*types.UserConcentratedSuperfluidPositionsUndelegatingResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the gamm module.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an instance of MsgServer.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all governance invariants.
func TotalSuperfluidDelegationInvariant ¶
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 ¶
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) OnLockupExtend ¶
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(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, ak authkeeper.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, dk types.CommunityPoolKeeper, ek types.EpochKeeper, lk types.LockupKeeper, gk types.GammKeeper, ik types.IncentivesKeeper, lms types.LockupMsgServer, clk types.ConcentratedKeeper) *Keeper
NewKeeper returns an instance of Keeper.
func (Keeper) AddNewSuperfluidAsset ¶
func (Keeper) AfterEpochEnd ¶
func (Keeper) AfterEpochStartBeginBlock ¶
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/percosis-labs/percosis/issues/864
func (Keeper) DeleteIntermediaryAccount ¶
func (k Keeper) DeleteIntermediaryAccount(ctx sdk.Context, address sdk.AccAddress)
func (Keeper) DeleteLockIdIntermediaryAccountConnection ¶
func (Keeper) DeletePercoEquivalentMultiplier ¶
func (Keeper) DeleteSuperfluidAsset ¶
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the capability module's exported genesis.
func (Keeper) GetAllIntermediaryAccounts ¶
func (k Keeper) GetAllIntermediaryAccounts(ctx sdk.Context) []types.SuperfluidIntermediaryAccount
func (Keeper) GetAllLockIdIntermediaryAccountConnections ¶
func (k Keeper) GetAllLockIdIntermediaryAccountConnections(ctx sdk.Context) []types.LockIdIntermediaryAccountConnection
func (Keeper) GetAllPercoEquivalentMultipliers ¶
func (k Keeper) GetAllPercoEquivalentMultipliers(ctx sdk.Context) []types.PercoEquivalentMultiplierRecord
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 (k Keeper) GetExpectedDelegationAmount(ctx sdk.Context, acc types.SuperfluidIntermediaryAccount) (sdk.Int, error)
GetExpectedDelegationAmount returns the total number of perco the intermediary account has delegated using the most recent perco equivalent multiplier. This is labeled as expected because the way it calculates the amount can lead rounding errors from the true delegated amount.
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) GetPercoEquivalentMultiplier ¶
func (Keeper) GetRiskAdjustedPercoValue ¶
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) GetSuperfluidPERCOTokens ¶
func (Keeper) GetTotalSyntheticAssetsLocked ¶
GetTotalSyntheticAssetsLocked returns the total amount of the given denom locked.
func (Keeper) GetUnpoolAllowedPools ¶
func (Keeper) IncreaseSuperfluidDelegation ¶
func (k Keeper) IncreaseSuperfluidDelegation(ctx sdk.Context, lockID uint64, amount sdk.Coins) error
IncreaseSuperfluidDelegation increases the amount of existing superfluid delegation. This method would return an error if the lock has not been superfluid delegated before.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the capability module's state from a provided genesis state.
func (Keeper) IterateBondedValidatorsByPower ¶
func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(int64, stakingtypes.ValidatorI) bool)
IterateBondedValidatorsByPower implements govtypes.StakingKeeper
func (Keeper) IterateDelegations ¶
func (k Keeper) IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(int64, stakingtypes.DelegationI) bool)
IterateDelegations implements govtypes.StakingKeeper Iterates through staking keeper's delegations, and then all of the superfluid delegations.
func (Keeper) MoveSuperfluidDelegationRewardToGauges ¶
func (Keeper) RefreshIntermediaryDelegationAmounts ¶
RefreshIntermediaryDelegationAmounts refreshes the amount of delegation for all intermediary accounts. This method includes minting new perco if the refreshed delegation amount has increased, and instantly undelegating and burning if the refreshed delgation has decreased.
func (Keeper) RouteLockedBalancerToConcentratedMigration ¶
func (k Keeper) RouteLockedBalancerToConcentratedMigration(ctx sdk.Context, sender sdk.AccAddress, providedLockId int64, sharesToMigrate sdk.Coin, tokenOutMins sdk.Coins) (positionId uint64, amount0, amount1 sdk.Int, liquidity sdk.Dec, poolIdLeaving, poolIdEntering, concentratedLockId uint64, err error)
RouteLockedBalancerToConcentratedMigration routes the provided lock to the proper migration function based on the lock status. The testing conditions and scope for the different lock status are as follows: Lock Status = Superfluid delegated - Instantly undelegate which will bypass unbonding time. - Create new CL Lock and Re-delegate it as a concentrated liquidity position.
Lock Status = Superfluid undelegating - Continue undelegating as superfluid unbonding CL Position. - Lock the tokens and create an unlocking syntheticLock (to handle cases of slashing)
Lock Status = Locked or unlocking (no superfluid delegation/undelegation) - Force unlock tokens from gamm shares. - Create new CL lock and starts unlocking or unlocking where it left off.
Lock Status = Unlocked - For ex: LP shares - Create new CL lock and starts unlocking or unlocking where it left off.
Errors if the lock is not found, if the lock is not a balancer pool lock, or if the lock is not owned by the sender.
func (Keeper) SetIntermediaryAccount ¶
func (k Keeper) SetIntermediaryAccount(ctx sdk.Context, acc types.SuperfluidIntermediaryAccount)
func (Keeper) SetLockIdIntermediaryAccountConnection ¶
func (Keeper) SetPercoEquivalentMultiplier ¶
func (Keeper) SetSuperfluidAsset ¶
func (k Keeper) SetSuperfluidAsset(ctx sdk.Context, asset types.SuperfluidAsset)
func (Keeper) SetUnpoolAllowedPools ¶
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
SuperfluidDelegate superfluid delegates perco equivalent amount the given lock holds. The actual delegation is done by using/creating an intermediary account for the (denom, validator) pair and having the intermediary account delegate to the designated validator, not by the sender themselves. A state entry of IntermediaryAccountConnection is stored to store the connection between the lock ID and the intermediary account, as an intermediary account does not serve for delegations from a single delegator. The actual amount of delegation is not equal to the equivalent amount of perco the lock has. That is, the actual amount of delegation is amount * perco equivalent multiplier * (1 - k.RiskFactor(asset)).
func (Keeper) SuperfluidUnbondLock ¶
SuperfluidUnbondLock unbonds the lock that has been used for superfluid staking. This method would return an error if the underlying lock is not superfluid undelegating.
func (Keeper) SuperfluidUndelegate ¶
SuperfluidUndelegate starts undelegating superfluid delegated position for the given lock. Undelegation is done instantly and the equivalent amount is sent to the module account where it is burnt. Note that this method does not include unbonding the lock itself.
func (Keeper) SuperfluidUndelegateAndUnbondLock ¶
func (k Keeper) SuperfluidUndelegateAndUnbondLock(ctx sdk.Context, lockID uint64, sender string, amount sdk.Int) (uint64, error)
SuperfluidUndelegateAndUnbondLock unbonds given amount from the underlying lock that has been used for superfluid staking. This method returns the lock id, same lock id if unlock amount is equal to the underlying lock amount. Otherwise it returns the newly created lock id. Note that we can either partially or fully undelegate and unbond lock using this method.
func (Keeper) SuperfluidUndelegateToConcentratedPosition ¶
func (k Keeper) SuperfluidUndelegateToConcentratedPosition(ctx sdk.Context, sender string, gammLockID uint64) (types.SuperfluidIntermediaryAccount, error)
SuperfluidUndelegateToConcentratedPosition starts undelegating superfluid delegated position for the given lock. It behaves similarly to SuperfluidUndelegate, however it does not create a new synthetic lockup representing the unstaking side. This is because after the time this function is called, we might want to perform more operations prior to creating a lock. Once the actual lock is created, the synthetic lockup representing the unstaking side should eventually be created as well. Use this function with caution to avoid accidentally missing synthetic lock creation.
func (Keeper) TotalBondedTokens ¶
TotalBondedTokens implements govtypes.StakingKeeper
func (Keeper) UnpoolAllowedPools ¶
func (k Keeper) UnpoolAllowedPools(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, lockId uint64) ([]uint64, error)
Returns a list of newly created lockIDs, or an error.
func (Keeper) UnriskAdjustPercoValue ¶
func (Keeper) UpdatePercoEquivalentMultipliers ¶
type MigrationType ¶
type MigrationType int
const ( SuperfluidBonded MigrationType = iota SuperfluidUnbonding NonSuperfluid Unlocked Unsupported )
type Querier ¶
type Querier struct {
Keeper
}
Querier defines a wrapper around the x/superfluid keeper providing gRPC method handlers.
func NewQuerier ¶
func (Querier) AllAssets ¶
func (q Querier) AllAssets(goCtx context.Context, _ *types.AllAssetsRequest) (*types.AllAssetsResponse, error)
AllAssets Returns all superfluid assets info.
func (Querier) AllIntermediaryAccounts ¶
func (q Querier) AllIntermediaryAccounts(goCtx context.Context, req *types.AllIntermediaryAccountsRequest) (*types.AllIntermediaryAccountsResponse, error)
AllIntermediaryAccounts returns all superfluid intermediary accounts.
func (Querier) AssetMultiplier ¶
func (q Querier) AssetMultiplier(goCtx context.Context, req *types.AssetMultiplierRequest) (*types.AssetMultiplierResponse, error)
AssetMultiplier returns superfluid asset multiplier.
func (Querier) AssetType ¶
func (q Querier) AssetType(goCtx context.Context, req *types.AssetTypeRequest) (*types.AssetTypeResponse, error)
AssetType Returns superfluid asset type.
func (Querier) ConnectedIntermediaryAccount ¶
func (q Querier) ConnectedIntermediaryAccount(goCtx context.Context, req *types.ConnectedIntermediaryAccountRequest) (*types.ConnectedIntermediaryAccountResponse, error)
ConnectedIntermediaryAccount returns intermediary account connected to a superfluid staked lock by id.
func (Querier) EstimateSuperfluidDelegatedAmountByValidatorDenom ¶
func (q Querier) 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 (Querier) Params ¶
func (q Querier) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns the superfluid module params.
func (Querier) SuperfluidDelegationAmount ¶
func (q Querier) SuperfluidDelegationAmount(goCtx context.Context, req *types.SuperfluidDelegationAmountRequest) (*types.SuperfluidDelegationAmountResponse, error)
func (Querier) SuperfluidDelegationsByDelegator ¶
func (q Querier) SuperfluidDelegationsByDelegator(goCtx context.Context, req *types.SuperfluidDelegationsByDelegatorRequest) (*types.SuperfluidDelegationsByDelegatorResponse, error)
SuperfluidDelegationsByDelegator returns all the superfluid poistions for a specific delegator.
func (Querier) SuperfluidDelegationsByValidatorDenom ¶
func (q Querier) 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 (Querier) SuperfluidUndelegationsByDelegator ¶
func (q Querier) SuperfluidUndelegationsByDelegator(goCtx context.Context, req *types.SuperfluidUndelegationsByDelegatorRequest) (*types.SuperfluidUndelegationsByDelegatorResponse, error)
SuperfluidUndelegationsByDelegator returns total amount undelegating by delegator.
func (Querier) TotalDelegationByDelegator ¶
func (q Querier) TotalDelegationByDelegator(goCtx context.Context, req *types.QueryTotalDelegationByDelegatorRequest) (*types.QueryTotalDelegationByDelegatorResponse, error)
func (Querier) TotalDelegationByValidatorForDenom ¶
func (q Querier) TotalDelegationByValidatorForDenom(goCtx context.Context, req *types.QueryTotalDelegationByValidatorForDenomRequest) (*types.QueryTotalDelegationByValidatorForDenomResponse, error)
func (Querier) TotalSuperfluidDelegations ¶
func (q Querier) TotalSuperfluidDelegations(goCtx context.Context, _ *types.TotalSuperfluidDelegationsRequest) (*types.TotalSuperfluidDelegationsResponse, error)
TotalSuperfluidDelegations returns total amount of perco delegated via superfluid staking.
func (Querier) UnpoolWhitelist ¶
func (q Querier) UnpoolWhitelist(goCtx context.Context, req *types.QueryUnpoolWhitelistRequest) (*types.QueryUnpoolWhitelistResponse, error)
func (Querier) UserConcentratedSuperfluidPositionsDelegated ¶
func (q Querier) UserConcentratedSuperfluidPositionsDelegated(goCtx context.Context, req *types.UserConcentratedSuperfluidPositionsDelegatedRequest) (*types.UserConcentratedSuperfluidPositionsDelegatedResponse, error)
UserConcentratedSuperfluidPositionsDelegated returns all the cl superfluid positions for the specified delegator across all concentrated pools that are bonded.
func (Querier) UserConcentratedSuperfluidPositionsUndelegating ¶
func (q Querier) UserConcentratedSuperfluidPositionsUndelegating(goCtx context.Context, req *types.UserConcentratedSuperfluidPositionsUndelegatingRequest) (*types.UserConcentratedSuperfluidPositionsUndelegatingResponse, error)
UserConcentratedSuperfluidPositionsUndelegating returns all the cl superfluid positions for the specified delegator across all concentrated pools that are unbonding.