Injective is a community-run blockchain and users who have staked INJ are able to participate in governance as it relates to the blockchain. Proposals can be submitted to make revisions to Injective programs, tech upgrades, or any other Injective related changes that impact the entire Injective ecosystem.
For every proposal you create, we require you to deposit at least 1 INJ. This is to ensure that you are an active participant of the Injective community and you are eligible to make proposals and govern the protocol moving forward. For the proposal to pass to the voting stage, it must have 500 INJ deposited. You can deposit the 500 INJ yourself or collaborate with the community to deposit them collectively.
Messages
Let's explore (and provide examples) the messages that the Governance module exports and we can use to interact with the Injective chain. For example, you can use these messages to propose new spot, perpetual, or futures markets.
MsgGovDeposit
This message can be used to deposit towards an existing proposal.
This message allows you to propose a new spot market. Ensure that the ticker is accurate and provide the base asset denom followed by the quote asset denom. Base denom refers to the asset you would like to trade and quote denom refers to the asset by which your base asset is denominated. For instance, in the INJ/USDT market you would buy or sell INJ using USDT.
This message allows you to propose a new perpetual market. perpetual futures contracts, or perps, are derivative futures contracts that allow users to buy or sell the value of an underlying base asset without actually owning it. This is the message you can use to create a perp market for a specified token pair.
An expiry futures contract is an agreement between two counterparties to buy and sell a specific amount of an underlying base asset at a specific future price, which is set to expire at a specified date in the future. This is the message you can use to create a futures market for a specified token pair.
import { DenomClientAsync, MsgBroadcasterWithPk, MsgSubmitProposalExpiryFuturesMarketLaunch} from"@injectivelabs/sdk-ts";import { BigNumberInBase } from"@injectivelabs/utils";import { getNetworkEndpoints, Network } from"@injectivelabs/networks";constinjectiveAddress="inj...";constprivateKey="0x...";constINJ_DENOM='inj'constamount=newBigNumberInBase(1).toWei().toFixed()constmarket= { title:'INJ/USDT Futures Market Launch', description: 'This proposal will launch the INJ/USDT Spot Market with maker and taker fees 0.001% and 0.002% respectively',
ticker:'INJ/USDT 24-MAR-2023', quoteDenom:'peggy0x...', oracleBase:'INJ', oracleQuote:'USDT', expiry:1000000,// when the market will expire, in ms oracleScaleFactor:6, oracleType:10,// BAND IBC initialMarginRatio:'0.05', maintenanceMarginRatio:'0.02', makerFeeRate:'0.01', takerFeeRate:'0.02', minPriceTickSize:'0.01', minQuantityTickSize:'0.01'}constdenomClient=newDenomClientAsync(NETWORK.Testnet, { endpoints:getNetworkEndpoints(Network.Testnet) })constquoteDenom=awaitdenomClient.getDenomToken(market.quoteDenom)constmarketWithDecimals= {...market, quoteTokenDecimals: quoteDenom ?quoteDenom.decimals :6 }constmarketWithTickSizes= {...market, minPriceTickSize:newBigNumberInBase(marketWithDecimals.minPriceTickSize ).toWei(marketWithDecimals.quoteTokenDecimals).toFixed()}constmessage=MsgSubmitProposalExpiryFuturesMarketLaunch.fromJSON({ market: marketWithTickSizes, proposer: injectiveAddress, deposit: { denom:INJ_DENOM, amount:deposit.toWei().toFixed() }})consttxHash=awaitnewMsgBroadcasterWithPk({ privateKey, network:Network.Testnet}).broadcast({ msgs: message});
MsgSubmitProposalSpotMarketParamUpdate
This message can be used to update the params of a spot market.
import { MsgBroadcasterWithPk, MsgSubmitProposalSpotMarketParamUpdate} from"@injectivelabs/sdk-ts";import { BigNumberInBase } from"@injectivelabs/utils";import { Network } from"@injectivelabs/networks";import { MarketStatusMap } from'@injectivelabs/chain-api';constinjectiveAddress="inj...";constprivateKey="0x...";constINJ_DENOM='inj'constamount=newBigNumberInBase(1).toWei().toFixed()constmarket= { title:'INJ/USDT Spot Market Launch', description: 'This proposal will launch the INJ/USDT Spot Market with maker and taker fees 0.001% and 0.002% respectively',
marketId:'0x...', makerFeeRate:'0.02', takerFeeRate:'0.03', relayerFeeShareRate:'0.4',// 40%, the percent of tsx fees that go to the relayers minPriceTickSize:'0.002', minQuantityTickSize:'0.002', status:MarketStatusMap.Active}constmessage=MsgSubmitProposalSpotMarketParamUpdate.fromJSON({ market, proposer: injectiveAddress, deposit: { denom:INJ_DENOM, amount }})consttxHash=awaitnewMsgBroadcasterWithPk({ privateKey, network:Network.Testnet}).broadcast({ msgs: message});