State
Genesis state defines the initial state of the module to be used to setup the module.Params
Params is a module-wide configuration that stores system parameters and defines overall functioning of the exchange module.
This configuration is modifiable by governance using params update proposal natively supported by gov module.
It defines default fee objects to be used for spot and derivative markets and funding parameters for derivative markets and instant listing fees.
Protobuf interface for the exchange module params store.
Balance
Balance is to manage balances of accounts. The module is storing the whole balance in the module account, while the balance of each account is managed just as a record.
The Balance object is stored by subaccount_id and denom.
SubaccountNonce
SubaccountNonce is used to express unique order hashes.
Order
There are a number of structures used to store the orders into the store.SpotMarket
SpotMarket is the structure to store all the required information and state for a spot market.
Spot markets are stored by hash of the market to query the market efficiently.
SpotOrderBook
SpotOrderBook is a structure to store spot limit orders for a specific market.
Two objects are created, one for buy orders and one for sell orders.
DerivativeMarket
DerivativeMarket is the structure to store all the required information and state for a derivative market.
Derivative markets are stored by hash of the market to query the market efficiently.
DerivativeOrderBook
DerivativeOrderBook is a structure to store derivative limit orders for a specific market.
Two objects are created, one for buy orders and one for sell orders.
DerivativePosition
DerivativePosition is a structure to store derivative positions for a subaccount on a specific market.
Note: Derivative orders represent intent while positions represent possession.
ExpiryFuturesMarketInfo
ExpiryFuturesMarketInfo is a structure to keep the information of expiry futures market.
It is stored by the id of the market.
PerpetualMarketInfo
PerpetualMarketInfo is a structure to keep the information of perpetual market.
PerpetualMarketFunding
PerpetualMarketFunding is a structure to manage perpetual market fundings info.
Trading Rewards
CampaignRewardPool
CampaignRewardPool is a structure to be used for getting the upcoming trading reward pools.
TradingRewardCampaignInfo
TradingRewardCampaignInfo is a structure to be used for getting the trading reward campaign info.
FeeDiscountProposal
FeeDiscountProposal is a structure to be used for proposing a new fee discount schedule and durations.
DerivativeMarketSettlementInfo
DerivativeMarketSettlementInfo is a structure to be used for the scheduled markets for settlement.
TradeLog
Trade logs are emitted in events to track the trading history.Enums
Enums are used to describe the order types, execution types and market status.GrantAuthorization
GrantAuthorization is used to track the grantee’s address and amount of the granted stake that has been authorized by the granter for trading fee discounts.
ActiveGrant
ActiveGrant is used to track the granter’s address and amount of the granted stake (for trading fee discounts) in the grant that has been activated by the grantee.
EffectiveGrant
EffectiveGrant is used to track the total amount of stake a granter has authorized in stake grants for trading fee discounts.
