Documentation
¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AddVaultToAddressStore(ctx sdk.Context, vaultId types.VaultId)
- func (k Keeper) AllVaults(c context.Context, req *types.QueryAllVaultsRequest) (*types.QueryAllVaultsResponse, error)
- func (k Keeper) AllocateToVault(ctx sdk.Context, vaultId types.VaultId, quantums *big.Int) error
- func (k Keeper) CancelVaultClobOrder(ctx sdk.Context, vaultId types.VaultId, orderId *clobtypes.OrderId, ...) error
- func (k Keeper) DecommissionNonPositiveEquityVaults(ctx sdk.Context)
- func (k Keeper) DecommissionVault(ctx sdk.Context, vaultId types.VaultId)
- func (k Keeper) DepositToMegavault(ctx sdk.Context, fromSubaccount satypes.SubaccountId, quoteQuantums *big.Int) (mintedShares *big.Int, err error)
- func (k Keeper) GetAllOwnerShareUnlocks(ctx sdk.Context) []types.OwnerShareUnlocks
- func (k Keeper) GetAllOwnerShares(ctx sdk.Context) []types.OwnerShare
- func (k Keeper) GetAllVaults(ctx sdk.Context) []types.Vault
- func (k Keeper) GetDefaultQuotingParams(ctx sdk.Context) (params types.QuotingParams)
- func (k Keeper) GetIndexerEventManager() indexer_manager.IndexerEventManager
- func (k Keeper) GetMegavaultEquity(ctx sdk.Context) (*big.Int, error)
- func (k Keeper) GetMostRecentClientIds(ctx sdk.Context, vaultId types.VaultId) []uint32
- func (k Keeper) GetOperatorParams(ctx sdk.Context) (params types.OperatorParams)
- func (k Keeper) GetOwnerShareUnlocks(ctx sdk.Context, owner string) (val types.OwnerShareUnlocks, exists bool)
- func (k Keeper) GetOwnerShares(ctx sdk.Context, owner string) (val types.NumShares, exists bool)
- func (k Keeper) GetSubaccountEquity(ctx sdk.Context, subaccountId satypes.SubaccountId) (*big.Int, error)
- func (k Keeper) GetTotalShares(ctx sdk.Context) (totalShares types.NumShares)
- func (k Keeper) GetVaultAndQuotingParams(ctx sdk.Context, vaultId types.VaultId) (vaultParams types.VaultParams, quotingParams types.QuotingParams, exists bool)
- func (k Keeper) GetVaultClobOrderIds(ctx sdk.Context, vaultId types.VaultId) (orderIds []*clobtypes.OrderId)
- func (k Keeper) GetVaultClobOrders(ctx sdk.Context, vaultId types.VaultId) (orders []*clobtypes.Order, err error)
- func (k Keeper) GetVaultClobPerpAndMarket(ctx sdk.Context, vaultId types.VaultId) (clobPair clobtypes.ClobPair, perpetual perptypes.Perpetual, ...)
- func (k Keeper) GetVaultEquity(ctx sdk.Context, vaultId types.VaultId) (*big.Int, error)
- func (k Keeper) GetVaultInventoryInPerpetual(ctx sdk.Context, vaultId types.VaultId, perpId uint32) *big.Int
- func (k Keeper) GetVaultLeverageAndEquity(ctx sdk.Context, vaultId types.VaultId, perpetual *perptypes.Perpetual, ...) (leverage *big.Rat, equity *big.Int, err error)
- func (k Keeper) GetVaultParams(ctx sdk.Context, vaultId types.VaultId) (vaultParams types.VaultParams, exists bool)
- func (k Keeper) GetVaultWithdrawalSlippage(ctx sdk.Context, vaultId types.VaultId, sharesToWithdraw *big.Int, ...) (*big.Rat, error)
- func (k Keeper) HasAuthority(authority string) bool
- func (k Keeper) InitializeForGenesis(ctx sdk.Context)
- func (k Keeper) IsVault(ctx sdk.Context, address string) bool
- func (k Keeper) LockShares(ctx sdk.Context, ownerAddress string, sharesToLock types.NumShares, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MegavaultAllOwnerShares(c context.Context, req *types.QueryMegavaultAllOwnerSharesRequest) (*types.QueryMegavaultAllOwnerSharesResponse, error)
- func (k Keeper) MegavaultOwnerShares(c context.Context, req *types.QueryMegavaultOwnerSharesRequest) (*types.QueryMegavaultOwnerSharesResponse, error)
- func (k Keeper) MegavaultTotalShares(c context.Context, _ *types.QueryMegavaultTotalSharesRequest) (*types.QueryMegavaultTotalSharesResponse, error)
- func (k Keeper) MegavaultWithdrawalInfo(goCtx context.Context, req *types.QueryMegavaultWithdrawalInfoRequest) (*types.QueryMegavaultWithdrawalInfoResponse, error)
- func (k Keeper) MintShares(ctx sdk.Context, owner string, quantumsToDeposit *big.Int) (mintedShares *big.Int, err error)
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PlaceVaultClobOrder(ctx sdk.Context, vaultId types.VaultId, order *clobtypes.Order) error
- func (k Keeper) RedeemFromMainAndSubVaults(ctx sdk.Context, shares *big.Int, simulate bool) (redeemedQuoteQuantums *big.Int, megavaultEquity *big.Int, totalShares *big.Int, ...)
- func (k Keeper) RefreshAllVaultOrders(ctx sdk.Context)
- func (k Keeper) RefreshVaultClobOrders(ctx sdk.Context, vaultId types.VaultId) (err error)
- func (k Keeper) ReplaceVaultClobOrder(ctx sdk.Context, vaultId types.VaultId, oldOrderId *clobtypes.OrderId, ...) error
- func (k Keeper) SetDefaultQuotingParams(ctx sdk.Context, params types.QuotingParams) error
- func (k Keeper) SetMostRecentClientIds(ctx sdk.Context, vaultId types.VaultId, clientIds []uint32)
- func (k Keeper) SetOperatorParams(ctx sdk.Context, params types.OperatorParams) error
- func (k Keeper) SetOwnerShareUnlocks(ctx sdk.Context, owner string, ownerShareUnlocks types.OwnerShareUnlocks) error
- func (k Keeper) SetOwnerShares(ctx sdk.Context, owner string, ownerShares types.NumShares) error
- func (k Keeper) SetTotalShares(ctx sdk.Context, totalShares types.NumShares) error
- func (k Keeper) SetVaultParams(ctx sdk.Context, vaultId types.VaultId, vaultParams types.VaultParams) error
- func (k Keeper) SetVaultStatus(ctx sdk.Context, vaultId types.VaultId, status types.VaultStatus) error
- func (k Keeper) SweepMainVaultBankBalance(ctx sdk.Context)
- func (k Keeper) TryToCancelVaultClobOrder(ctx sdk.Context, vaultId types.VaultId, clientId uint32, ...) (orderExists bool, err error)
- func (k Keeper) UnlockShares(ctx sdk.Context, ownerAddress string) (unlockedShares types.NumShares, err error)
- func (k Keeper) UnsafeDeleteAllVaultOwnerShares(ctx sdk.Context)
- func (k Keeper) UnsafeDeleteAllVaultTotalShares(ctx sdk.Context)
- func (k Keeper) UnsafeDeleteParams(ctx sdk.Context)
- func (k Keeper) UnsafeDeleteQuotingParams(ctx sdk.Context, vaultId types.VaultId)
- func (k Keeper) UnsafeGetAllOwnerEquities(ctx sdk.Context) map[string]*big.Rat
- func (k Keeper) UnsafeGetAllOwnerShares(ctx sdk.Context, vaultId types.VaultId) []*types.OwnerShare
- func (k Keeper) UnsafeGetAllVaultIds(ctx sdk.Context) []types.VaultId
- func (k Keeper) UnsafeGetParams(ctx sdk.Context) (params types.QuotingParams)
- func (k Keeper) UnsafeGetQuotingParams(ctx sdk.Context, vaultId types.VaultId) (quotingParams types.QuotingParams, exists bool)
- func (k Keeper) UnsafeGetTotalShares(ctx sdk.Context, vaultId types.VaultId) (val types.NumShares, exists bool)
- func (k Keeper) UnsafeSetQuotingParams(ctx sdk.Context, vaultId types.VaultId, quotingParams types.QuotingParams) error
- func (k Keeper) Vault(goCtx context.Context, req *types.QueryVaultRequest) (*types.QueryVaultResponse, error)
- func (k Keeper) VaultParams(goCtx context.Context, req *types.QueryVaultParamsRequest) (*types.QueryVaultParamsResponse, error)
- func (k Keeper) WithdrawFromMegavault(ctx sdk.Context, toSubaccount satypes.SubaccountId, sharesToWithdraw *big.Int, ...) (redeemedQuoteQuantums *big.Int, err error)
Constants ¶
const ( // Deprecated: For use by the v7.x upgrade handler // QuotingParamsKeyPrefix is the prefix to retrieve all QuotingParams. // QuotingParams store: vaultId VaultId -> QuotingParams. QuotingParamsKeyPrefix = "QuotingParams:" // TotalSharesKeyPrefix is the prefix to retrieve all TotalShares. TotalSharesKeyPrefix = "TotalShares:" // OwnerSharesKeyPrefix is the prefix to retrieve all OwnerShares. // OwnerShares store: vaultId VaultId -> owner string -> shares NumShares. OwnerSharesKeyPrefix = "OwnerShares:" )
Deprecated state keys
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, assetsKeeper types.AssetsKeeper, bankKeeper types.BankKeeper, clobKeeper types.ClobKeeper, delayMsgKeeper types.DelayMsgKeeper, perpetualsKeeper types.PerpetualsKeeper, pricesKeeper types.PricesKeeper, sendingKeeper types.SendingKeeper, subaccountsKeeper types.SubaccountsKeeper, indexerEventManager indexer_manager.IndexerEventManager, authorities []string, ) *Keeper
func (Keeper) AddVaultToAddressStore ¶
AddVaultToAddressStore adds a vault's address to the vault address store.
func (Keeper) AllVaults ¶
func (k Keeper) AllVaults( c context.Context, req *types.QueryAllVaultsRequest, ) (*types.QueryAllVaultsResponse, error)
func (Keeper) AllocateToVault ¶
AllocateToVault transfers funds from main vault to a specified vault.
func (Keeper) CancelVaultClobOrder ¶
func (k Keeper) CancelVaultClobOrder( ctx sdk.Context, vaultId types.VaultId, orderId *clobtypes.OrderId, orderExpirationSeconds uint32, ) error
CancelVaultClobOrder cancels a vault CLOB order.
func (Keeper) DecommissionNonPositiveEquityVaults ¶
DecommissionVaults decommissions all deactivated vaults that have non-positive equities.
func (Keeper) DecommissionVault ¶
DecommissionVault decommissions a vault by deleting it from vault address store and vault params store.
func (Keeper) DepositToMegavault ¶
func (k Keeper) DepositToMegavault( ctx sdk.Context, fromSubaccount satypes.SubaccountId, quoteQuantums *big.Int, ) (mintedShares *big.Int, err error)
DepositToMegavault deposits from a subaccount to megavault by 1. Minting shares for owner address of `fromSubaccount`. 2. Transferring `quoteQuantums` from `fromSubaccount` to megavault subaccount 0.
func (Keeper) GetAllOwnerShareUnlocks ¶
func (k Keeper) GetAllOwnerShareUnlocks(ctx sdk.Context) []types.OwnerShareUnlocks
GetAllOwnerShareUnlocks gets all `OwnerShareUnlocks`.
func (Keeper) GetAllOwnerShares ¶
func (k Keeper) GetAllOwnerShares(ctx sdk.Context) []types.OwnerShare
GetAllOwnerShares gets all owner shares.
func (Keeper) GetAllVaults ¶
GetAllVaults returns all vaults with their vault params and most recent client IDs. Note: This function is only used for exporting module state.
func (Keeper) GetDefaultQuotingParams ¶
func (k Keeper) GetDefaultQuotingParams( ctx sdk.Context, ) ( params types.QuotingParams, )
GetDefaultQuotingParams returns `DefaultQuotingParams` in state.
func (Keeper) GetIndexerEventManager ¶
func (k Keeper) GetIndexerEventManager() indexer_manager.IndexerEventManager
func (Keeper) GetMegavaultEquity ¶
GetMegavaultEquity returns the equity of the megavault (in quote quantums), which consists of - equity of the megavault main subaccount - equity of all vaults (if not-deactivated and positive)
func (Keeper) GetMostRecentClientIds ¶
GetMostRecentClientIds returns the most recent client IDs for a vault.
func (Keeper) GetOperatorParams ¶
func (k Keeper) GetOperatorParams( ctx sdk.Context, ) ( params types.OperatorParams, )
GetOperatorParams returns `OperatorParams` in state.
func (Keeper) GetOwnerShareUnlocks ¶
func (k Keeper) GetOwnerShareUnlocks( ctx sdk.Context, owner string, ) (val types.OwnerShareUnlocks, exists bool)
GetOwnerShareUnlocks gets share unlocks for an owner.
func (Keeper) GetOwnerShares ¶
GetOwnerShares gets owner shares for an owner.
func (Keeper) GetSubaccountEquity ¶
func (k Keeper) GetSubaccountEquity( ctx sdk.Context, subaccountId satypes.SubaccountId, ) (*big.Int, error)
GetSubaccountEquity returns the equity of a subaccount (in quote quantums).
func (Keeper) GetTotalShares ¶
GetTotalShares gets total shares.
func (Keeper) GetVaultAndQuotingParams ¶
func (k Keeper) GetVaultAndQuotingParams( ctx sdk.Context, vaultId types.VaultId, ) ( vaultParams types.VaultParams, quotingParams types.QuotingParams, exists bool, )
GetVaultAndQuotingParams returns vault params and quoting parameters for a given vault. Quoting parameters is - `VaultParams.QuotingParams` if set - `DefaultQuotingParams` otherwise `exists` is false if `VaultParams` does not exist for the given vault.
func (Keeper) GetVaultClobOrderIds ¶
func (k Keeper) GetVaultClobOrderIds( ctx sdk.Context, vaultId types.VaultId, ) (orderIds []*clobtypes.OrderId)
GetVaultClobOrderIds returns a list of order IDs for a given CLOB vault. Let n be number of layers, then the function returns order IDs [a_0, b_0, a_1, b_1, ..., a_{n-1}, b_{n-1}] where a_i and b_i are respectively ask and bid order IDs at the i-th layer.
func (Keeper) GetVaultClobOrders ¶
func (k Keeper) GetVaultClobOrders( ctx sdk.Context, vaultId types.VaultId, ) (orders []*clobtypes.Order, err error)
GetVaultClobOrders returns a list of long term orders for a given CLOB vault. Let n be number of layers, then the function returns orders at [a_0, b_0, a_1, b_1, ..., a_{n-1}, b_{n-1}] where a_i and b_i are the ask price and bid price at i-th layer. To compute a_i and b_i: - a_i = oraclePrice * (1 + ask_spread_i) - b_i = oraclePrice * (1 - bid_spread_i)
- ask_spread_i = (1 + skew_i) * spread - bid_spread_i = (1 - skew_i) * spread
- skew_i is computed differently based on order side and leverage_i:
- ask, leverage_i < 0: (skew_factor * leverage_i - 1)^2 - 1
- bid, leverage_i < 0: -skew_factor * leverage_i
- ask, leverage_i >= 0: -skew_factor * leverage_i
- bid, leverage_i >= 0: -((skew_factor * leverage_i + 1)^2 - 1)
- leverage_i = leverage +/- i * order_size_pct\ (- for ask and + for bid) - leverage = open notional / equity
- spread = max(spread_min, spread_buffer + min_price_change)
size of each order is calculated as `order_size_pct * equity / oraclePrice`.
func (Keeper) GetVaultClobPerpAndMarket ¶
func (k Keeper) GetVaultClobPerpAndMarket( ctx sdk.Context, vaultId types.VaultId, ) ( clobPair clobtypes.ClobPair, perpetual perptypes.Perpetual, marketParam pricestypes.MarketParam, marketPrice pricestypes.MarketPrice, err error, )
GetVaultClobPerpAndMarket returns the clob pair, perpetual, market param, and market price that correspond to a vault.
func (Keeper) GetVaultEquity ¶
GetVaultEquity returns the equity of a vault (in quote quantums).
func (Keeper) GetVaultInventoryInPerpetual ¶
func (k Keeper) GetVaultInventoryInPerpetual( ctx sdk.Context, vaultId types.VaultId, perpId uint32, ) *big.Int
GetVaultInventory returns the inventory of a vault in a given perpeutal (in base quantums).
func (Keeper) GetVaultLeverageAndEquity ¶
func (k Keeper) GetVaultLeverageAndEquity( ctx sdk.Context, vaultId types.VaultId, perpetual *perptypes.Perpetual, marketPrice *pricestypes.MarketPrice, ) ( leverage *big.Rat, equity *big.Int, err error, )
GetVaultLeverageAndEquity returns a vault's leverage and equity. - leverage = open notional / equity. Note that an error is returned if equity is non-positive.
func (Keeper) GetVaultParams ¶
func (k Keeper) GetVaultParams( ctx sdk.Context, vaultId types.VaultId, ) ( vaultParams types.VaultParams, exists bool, )
GetVaultParams returns `VaultParams` in state for a given vault.
func (Keeper) GetVaultWithdrawalSlippage ¶
func (k Keeper) GetVaultWithdrawalSlippage( ctx sdk.Context, vaultId types.VaultId, sharesToWithdraw *big.Int, totalShares *big.Int, leverage *big.Rat, perpetual *perptypes.Perpetual, marketParam *pricestypes.MarketParam, ) (*big.Rat, error)
GetVaultWithdrawalSlippage returns the slippage that should be incurred from the specified vault on withdrawing `sharesToWithdraw` shares. For example, if `sharesToWithdraw = 100` and `0.2` is returned, it means that withdrawing 100 shares has a 20% slippage for the given `vaultId`.
Slippage is calculated as `min(simple_slippage, estimated_slippage)` where: - simple_slippage = leverage * initial_margin - estimated_slippage = spread * (1 + average_skew) * leverage
- average_skew = integral / (posterior_leverage - leverage)
- integral = skew_antiderivative(skew_factor, posterior_leverage) - skew_antiderivative(skew_factor, leverage)
- posterior_leverage = leverage / (1 - withdrawal_portion) = leverage / (1 - shares_to_withdraw / total_shares) = leverage * total_shares / (total_shares - shares_to_withdraw)
To simplify above formula, let l = leverage, n = total_shares, m = shares_to_withdraw
estimated_slippage = spread * (1 + integral / (posterior_leverage - leverage)) * leverage = spread * (1 + integral * (n - m) / (ln - l(n - m))) * l = spread * (1 + integral * (n - m) / lm) * l = spread * (l + integral * (n - m) / m)
func (Keeper) HasAuthority ¶
func (Keeper) InitializeForGenesis ¶
func (Keeper) LockShares ¶
func (k Keeper) LockShares( ctx sdk.Context, ownerAddress string, sharesToLock types.NumShares, tilBlock uint32, ) error
LockShares locks `sharesToLock` for `ownerAddress` until height `tilBlock`. Note: cannot lock more than the total number of shares that owner has.
func (Keeper) MegavaultAllOwnerShares ¶
func (k Keeper) MegavaultAllOwnerShares( c context.Context, req *types.QueryMegavaultAllOwnerSharesRequest, ) (*types.QueryMegavaultAllOwnerSharesResponse, error)
func (Keeper) MegavaultOwnerShares ¶
func (k Keeper) MegavaultOwnerShares( c context.Context, req *types.QueryMegavaultOwnerSharesRequest, ) (*types.QueryMegavaultOwnerSharesResponse, error)
func (Keeper) MegavaultTotalShares ¶
func (k Keeper) MegavaultTotalShares( c context.Context, _ *types.QueryMegavaultTotalSharesRequest, ) (*types.QueryMegavaultTotalSharesResponse, error)
func (Keeper) MegavaultWithdrawalInfo ¶
func (k Keeper) MegavaultWithdrawalInfo( goCtx context.Context, req *types.QueryMegavaultWithdrawalInfoRequest, ) (*types.QueryMegavaultWithdrawalInfoResponse, error)
func (Keeper) MintShares ¶
func (k Keeper) MintShares( ctx sdk.Context, owner string, quantumsToDeposit *big.Int, ) (mintedShares *big.Int, err error)
MintShares mints shares for `owner` based on `quantumsToDeposit` by: 1. Increasing total shares. 2. Increasing owner shares for given `owner`.
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) PlaceVaultClobOrder ¶
func (k Keeper) PlaceVaultClobOrder( ctx sdk.Context, vaultId types.VaultId, order *clobtypes.Order, ) error
PlaceVaultClobOrder places a vault CLOB order internal to the protocol, skipping various logs, metrics, and validations
func (Keeper) RedeemFromMainAndSubVaults ¶
func (k Keeper) RedeemFromMainAndSubVaults( ctx sdk.Context, shares *big.Int, simulate bool, ) ( redeemedQuoteQuantums *big.Int, megavaultEquity *big.Int, totalShares *big.Int, err error, )
RedeemFromMainAndSubVaults redeems `shares` number of shares from main and sub vaults. If and only if `simulate` is false, logs are enabled and quote quantums redeemed from each sub vault are transferred to the main vault.
func (Keeper) RefreshAllVaultOrders ¶
RefreshAllVaultOrders refreshes all orders for all vaults by 1. Cancelling all existing orders. 2. Placing new orders.
func (Keeper) RefreshVaultClobOrders ¶
RefreshVaultClobOrders refreshes orders of a CLOB vault. Note: Client IDs are deterministically constructed based on layer and side. A client ID has its last bit flipped only upon order replacement.
func (Keeper) ReplaceVaultClobOrder ¶
func (k Keeper) ReplaceVaultClobOrder( ctx sdk.Context, vaultId types.VaultId, oldOrderId *clobtypes.OrderId, newOrder *clobtypes.Order, ) error
ReplaceVaultClobOrder replaces a vault CLOB order internal to the protocol and emits order replacement indexer event.
func (Keeper) SetDefaultQuotingParams ¶
SetDefaultQuotingParams updates `DefaultQuotingParams` in state. Returns an error if validation fails.
func (Keeper) SetMostRecentClientIds ¶
func (k Keeper) SetMostRecentClientIds( ctx sdk.Context, vaultId types.VaultId, clientIds []uint32, )
SetMostRecentClientIds sets the most recent client IDs for a vault.
func (Keeper) SetOperatorParams ¶
SetOperatorParams sets `OperatorParams` in state. Returns an error if validation fails.
func (Keeper) SetOwnerShareUnlocks ¶
func (k Keeper) SetOwnerShareUnlocks( ctx sdk.Context, owner string, ownerShareUnlocks types.OwnerShareUnlocks, ) error
SetOwnerShareUnlocks sets share unlocks for an owner.
func (Keeper) SetOwnerShares ¶
SetOwnerShares sets owner shares for an owner. Returns error if `ownerShares` is negative.
func (Keeper) SetTotalShares ¶
SetTotalShares sets total shares. Returns error if `totalShares` is negative.
func (Keeper) SetVaultParams ¶
func (k Keeper) SetVaultParams( ctx sdk.Context, vaultId types.VaultId, vaultParams types.VaultParams, ) error
SetVaultParams sets `VaultParams` in state for a given vault. Returns an error if validation fails.
func (Keeper) SetVaultStatus ¶
func (k Keeper) SetVaultStatus( ctx sdk.Context, vaultId types.VaultId, status types.VaultStatus, ) error
SetVaultStatus sets `VaultParams.Status` in state for a given vault.
func (Keeper) SweepMainVaultBankBalance ¶
SweepMainVaultBankBalances deposits any usdc balance from the Megavault main vault bank balance into the Megavault main vault subaccount balance.
func (Keeper) TryToCancelVaultClobOrder ¶
func (k Keeper) TryToCancelVaultClobOrder( ctx sdk.Context, vaultId types.VaultId, clientId uint32, orderExpirationSeconds uint32, ) ( orderExists bool, err error, )
TryToCancelVaultClobOrder tries to cancel a vault CLOB order. Returns whether the order exists and whether cancellation errors.
func (Keeper) UnlockShares ¶
func (k Keeper) UnlockShares( ctx sdk.Context, ownerAddress string, ) (unlockedShares types.NumShares, err error)
UnlockShares unlocks all shares of an owner that are due to unlock at or before current block height.
func (Keeper) UnsafeDeleteAllVaultOwnerShares ¶
UnsafeDeleteVaultOwnerShares deletes all owner shares of a given vault from state. Used for v7.x upgrade handler
func (Keeper) UnsafeDeleteAllVaultTotalShares ¶
UnsafeDeleteVaultTotalShares deletes total shares of a given vault from state. Used for v7.x upgrade handler
func (Keeper) UnsafeDeleteParams ¶
UnsafeDeleteParams deletes `Params` in state. Used for v6.x upgrade handler.
func (Keeper) UnsafeDeleteQuotingParams ¶
UnsafeDeleteQuotingParams deletes quoting parameters for a given vault from state. Used for v7.x upgrade handler
func (Keeper) UnsafeGetAllOwnerEquities ¶
UnsafeGetAllOwnerEquities returns equity that belongs to each owner across all vaults using the deprecated owner shares and total shares state. Deprecated and used for v7.x upgrade handler
func (Keeper) UnsafeGetAllOwnerShares ¶
func (k Keeper) UnsafeGetAllOwnerShares( ctx sdk.Context, vaultId types.VaultId, ) []*types.OwnerShare
UnsafeGetAllOwnerShares gets all owner shares of a given vault. Deprecated and used for v7.x upgrade handler
func (Keeper) UnsafeGetAllVaultIds ¶
UnsafeGetAllVaultIds returns all vault ids from state using the deprecated total shares state.
func (Keeper) UnsafeGetParams ¶
func (k Keeper) UnsafeGetParams( ctx sdk.Context, ) ( params types.QuotingParams, )
UnsafeGetParams returns `Params` in state. Used for v6.x upgrade handler.
func (Keeper) UnsafeGetQuotingParams ¶
func (k Keeper) UnsafeGetQuotingParams( ctx sdk.Context, vaultId types.VaultId, ) ( quotingParams types.QuotingParams, exists bool, )
UnsafeGetQuotingParams returns quoting parameters for a given vault from state. Used for v7.x upgrade handler
func (Keeper) UnsafeGetTotalShares ¶
func (k Keeper) UnsafeGetTotalShares( ctx sdk.Context, vaultId types.VaultId, ) (val types.NumShares, exists bool)
GetTotalShares gets TotalShares for a vault. Deprecated and used for v7.x upgrade handler
func (Keeper) UnsafeSetQuotingParams ¶
func (k Keeper) UnsafeSetQuotingParams( ctx sdk.Context, vaultId types.VaultId, quotingParams types.QuotingParams, ) error
UnsafeSetQuotingParams sets quoting parameters for a given vault from state. Used for v7.x upgrade handler
func (Keeper) Vault ¶
func (k Keeper) Vault( goCtx context.Context, req *types.QueryVaultRequest, ) (*types.QueryVaultResponse, error)
func (Keeper) VaultParams ¶
func (k Keeper) VaultParams( goCtx context.Context, req *types.QueryVaultParamsRequest, ) (*types.QueryVaultParamsResponse, error)
Source Files
¶
- deposit.go
- deprecated_state.go
- grpc_query.go
- grpc_query_shares.go
- grpc_query_vault.go
- grpc_query_vault_params.go
- grpc_query_withdrawal_info.go
- keeper.go
- msg_server.go
- msg_server_allocate_to_vault.go
- msg_server_deposit_to_megavault.go
- msg_server_retrieve_from_vault.go
- msg_server_set_vault_params.go
- msg_server_unlock_shares.go
- msg_server_update_default_quoting_params.go
- msg_server_update_operator_params.go
- msg_server_withdraw_from_megavault.go
- orders.go
- params.go
- shares.go
- sweep_funds.go
- vault.go
- withdraw.go