Module perp

Source

Modules§

genesis_state
Nested message and enum types in GenesisState.
liquidation_failed_event
Nested message and enum types in LiquidationFailedEvent.
msg_multi_liquidate
Nested message and enum types in MsgMultiLiquidate.
msg_multi_liquidate_response
Nested message and enum types in MsgMultiLiquidateResponse.

Structs§

AccountWithBalance
Amm
AmmMarket
AmmUpdatedEvent
This event is emitted when the amm is updated, which can be triggered by the following events:
DnrAllocation
DNRAllocation represents a rebates allocation for a given epoch.
EventShiftPegMultiplier
EventShiftPegMultiplier: ABCI event emitted from MsgShiftPegMultiplier
EventShiftSwapInvariant
EventShiftSwapInvariant: ABCI event emitted from MsgShiftSwapInvariant
FundingRateChangedEvent
Emitted when the funding rate changes for a market.
GenesisMarketLastVersion
GenesisMarketLastVersion is the last version including pair only used for genesis
GenesisPosition
GenesisState
GenesisState defines the perp module’s genesis state. Thge genesis state is used not only to start the network but also useful for exporting and importing state during network upgrades.
LiquidationFailedEvent
Emitted when liquidation fails.
Market
MarketLastVersion
MarketLastVersion is used to store the last version of the market
MarketUpdatedEvent
This event is emitted at the end of every block for persisting market changes off-chain
MsgAddMargin
MsgAddMargin: Msg to remove margin.
MsgAddMarginResponse
MsgAllocateEpochRebates
––––––––––––– AllocateEpochRebates –––––––––––––
MsgAllocateEpochRebatesResponse
MsgChangeCollateralDenom
MsgChangeCollateralDenom: Changes the collateral denom for the module. [SUDO] Only callable by sudoers.
MsgChangeCollateralDenomResponse
MsgCloseMarket
CloseMarket: gRPC tx msg for closing a market. Admin-only.
MsgCloseMarketResponse
MsgClosePosition
MsgClosePositionResponse
MsgDonateToEcosystemFund
MsgDonateToEcosystemFundResponse
MsgMarketOrder
MsgMarketOrderResponse
MsgMultiLiquidate
MsgMultiLiquidateResponse
MsgPartialClose
MsgPartialCloseResponse
MsgRemoveMargin
MsgRemoveMargin: Msg to remove margin.
MsgRemoveMarginResponse
MsgSettlePosition
MsgSettlePosition: Msg to remove margin.
MsgShiftPegMultiplier
MsgShiftPegMultiplier: gRPC tx msg for changing the peg multiplier. [SUDO] Only callable sudoers.
MsgShiftPegMultiplierResponse
MsgShiftSwapInvariant
MsgShiftSwapInvariant: gRPC tx msg for changing the swap invariant. [SUDO] Only callable sudoers.
MsgShiftSwapInvariantResponse
MsgWithdrawEpochRebates
––––––––––––– WithdrawEpochRebates –––––––––––––
MsgWithdrawEpochRebatesResponse
MsgWithdrawFromPerpFund
MsgWithdrawFromPerpFund: gRPC tx msg for changing the swap invariant. [SUDO] Only callable sudoers.
MsgWithdrawFromPerpFundResponse
Position
PositionChangedEvent
Emitted when a position changes.
PositionLiquidatedEvent
Emitted when a position is liquidated. Wraps a PositionChanged event since a liquidation causes position changes.
PositionSettledEvent
Emitted when a position is settled.
QueryCollateralRequest
QueryCollateralRequest: Request type for the “nibiru.perp.v2.Query/Collateral” gRPC service method
QueryCollateralResponse
QueryCollateralRequest: Response type for the “nibiru.perp.v2.Query/Collateral” gRPC service method
QueryMarketsRequest
QueryMarketsResponse
QueryModuleAccountsRequest
QueryModuleAccountsRequest: Request type for the “nibiru.perp.v2.Query/ModuleAccounts” gRPC service method
QueryModuleAccountsResponse
QueryModuleAccountsResponse: Response type for the “nibiru.perp.v2.Query/ModuleAccounts” gRPC service method
QueryPositionRequest
QueryPositionRequest: Request type for the “nibiru.perp.v2.Query/Position” gRPC service method
QueryPositionResponse
QueryPositionResponse: Response type for the “nibiru.perp.v2.Query/Position” gRPC service method
QueryPositionStoreRequest
QueryPositionStoreRequest: Request type for the “nibiru.perp.v2.Query/PositionStore” gRPC service method
QueryPositionStoreResponse
QueryPositionStoreResponse: Response type for the “nibiru.perp.v2.Query/PositionStore” gRPC service method
QueryPositionsRequest
QueryPositionsRequest: Request type for the “nibiru.perp.v2.Query/Positions” gRPC service method
QueryPositionsResponse
QueryPositionsResponse: Response type for the “nibiru.perp.v2.Query/Positions” gRPC service method
ReserveSnapshot
a snapshot of the perp.amm’s reserves at a given point in time

Enums§

Direction
The direction that the user is trading in LONG means the user is going long the base asset (e.g. buy BTC) SHORT means the user is shorting the base asset (e.g. sell BTC)
TwapCalcOption
Enumerates different options of calculating twap.