code.vegaprotocol.io/vega@v0.79.0/protos/sources/vega/governance.proto (about)

     1  syntax = "proto3";
     2  
     3  package vega;
     4  
     5  import "vega/assets.proto";
     6  import "vega/data_source.proto";
     7  import "vega/markets.proto";
     8  import "vega/vega.proto";
     9  
    10  option go_package = "code.vegaprotocol.io/vega/protos/vega";
    11  
    12  // Spot product configuration
    13  message SpotProduct {
    14    // Base asset ID.
    15    string base_asset = 1;
    16    // Quote asset ID.
    17    string quote_asset = 2;
    18  }
    19  
    20  // Future product configuration
    21  message FutureProduct {
    22    // Asset ID for the product's settlement asset.
    23    string settlement_asset = 1;
    24    // Product quote name.
    25    string quote_name = 2;
    26    // Data source spec describing the data source for settlement.
    27    vega.DataSourceDefinition data_source_spec_for_settlement_data = 3;
    28    // The external data source spec describing the data source of trading termination.
    29    vega.DataSourceDefinition data_source_spec_for_trading_termination = 4;
    30    // Binding between the data source spec and the settlement data.
    31    DataSourceSpecToFutureBinding data_source_spec_binding = 5;
    32    // If set, this product creates a capped future market.
    33    optional FutureCap cap = 6;
    34  }
    35  
    36  // Perpetual product configuration
    37  message PerpetualProduct {
    38    // Asset ID for the product's settlement asset.
    39    string settlement_asset = 1;
    40    // Product quote name.
    41    string quote_name = 2;
    42    // Controls how much the upcoming funding payment liability contributes to party's margin, in the range [0, 1].
    43    string margin_funding_factor = 3;
    44    // Continuously compounded interest rate used in funding rate calculation, in the range [-1, 1].
    45    string interest_rate = 4;
    46    // Lower bound for the clamp function used as part of the funding rate calculation, in the range [-1, 1].
    47    string clamp_lower_bound = 5;
    48    // Upper bound for the clamp function used as part of the funding rate calculation, in the range [-1, 1].
    49    string clamp_upper_bound = 6;
    50    // Data source spec describing the data source for settlement schedule.
    51    vega.DataSourceDefinition data_source_spec_for_settlement_schedule = 7;
    52    // Data source spec describing the data source for settlement.
    53    vega.DataSourceDefinition data_source_spec_for_settlement_data = 8;
    54    // Binding between the data source spec and the settlement data.
    55    DataSourceSpecToPerpetualBinding data_source_spec_binding = 9;
    56    // Factor applied to funding-rates. This scales the impact that spot price deviations have on funding payments.
    57    optional string funding_rate_scaling_factor = 10;
    58    // Lower bound for the funding-rate such that the funding-rate will never be lower than this value.
    59    optional string funding_rate_lower_bound = 11;
    60    // Upper bound for the funding-rate such that the funding-rate will never be higher than this value.
    61    optional string funding_rate_upper_bound = 12;
    62    // Composite price configuration to drive the calculation of the internal composite price used for funding payments. If undefined the default mark price of the market is used.
    63    optional CompositePriceConfiguration internal_composite_price_configuration = 13;
    64  }
    65  
    66  // Instrument configuration
    67  message InstrumentConfiguration {
    68    // Instrument name.
    69    string name = 1;
    70    // Instrument code, human-readable shortcode used to describe the instrument.
    71    string code = 2;
    72    // Product specification.
    73    oneof product {
    74      // Future.
    75      FutureProduct future = 100;
    76      // Spot.
    77      SpotProduct spot = 101;
    78      // Perpetual.
    79      PerpetualProduct perpetual = 102;
    80    }
    81  }
    82  
    83  // Configuration for a new spot market on Vega
    84  message NewSpotMarketConfiguration {
    85    // New spot market instrument configuration.
    86    InstrumentConfiguration instrument = 1;
    87    // Decimal places used for the new spot market, sets the smallest price increment on the book.
    88    uint64 price_decimal_places = 2;
    89    // Optional new spot market metadata, tags.
    90    repeated string metadata = 3;
    91    // Price monitoring parameters.
    92    PriceMonitoringParameters price_monitoring_parameters = 4;
    93    // Specifies parameters related to target stake calculation.
    94    TargetStakeParameters target_stake_parameters = 5;
    95    // New spot market risk model parameters.
    96    oneof risk_parameters {
    97      // Simple risk model parameters, valid only if MODEL_SIMPLE is selected.
    98      SimpleModelParams simple = 100;
    99      // Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected.
   100      LogNormalRiskModel log_normal = 101;
   101    }
   102    // Decimal places for order sizes, sets what size the smallest order / position on the spot market can be.
   103    int64 size_decimal_places = 6;
   104    // Specifies the liquidity provision SLA parameters.
   105    LiquiditySLAParameters sla_params = 7;
   106    // Specifies how the liquidity fee for the market will be calculated.
   107    LiquidityFeeSettings liquidity_fee_settings = 8;
   108    // The market tick size defines the minimum change in quote price for the market
   109    string tick_size = 9;
   110    // If enabled aggressive orders sent to the market will be delayed by the configured number of blocks
   111    bool enable_transaction_reordering = 10;
   112    // Allowed sellers
   113    repeated string allowed_sellers = 11;
   114  }
   115  
   116  // Configuration for a new futures market on Vega
   117  message NewMarketConfiguration {
   118    // New futures market instrument configuration.
   119    InstrumentConfiguration instrument = 1;
   120    // Decimal places used for the new futures market, sets the smallest price increment on the book.
   121    uint64 decimal_places = 2;
   122    // Optional new futures market metadata, tags.
   123    repeated string metadata = 3;
   124    // Price monitoring parameters.
   125    PriceMonitoringParameters price_monitoring_parameters = 4;
   126    // Liquidity monitoring parameters.
   127    LiquidityMonitoringParameters liquidity_monitoring_parameters = 5;
   128    // New futures market risk model parameters.
   129    oneof risk_parameters {
   130      // Simple risk model parameters, valid only if MODEL_SIMPLE is selected.
   131      SimpleModelParams simple = 100;
   132      // Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected.
   133      LogNormalRiskModel log_normal = 101;
   134    }
   135    // Decimal places for order sizes, sets what size the smallest order / position on the futures market can be.
   136    int64 position_decimal_places = 6;
   137    // DEPRECATED: Use liquidity SLA parameters instead.
   138    // Percentage move up and down from the mid price which specifies the range of
   139    // price levels over which automated liquidity provisions will be deployed.
   140    optional string lp_price_range = 8;
   141    // Linear slippage factor is used to cap the slippage component of maintenance margin - it is applied to the slippage volume.
   142    string linear_slippage_factor = 9;
   143    // Quadratic slippage factor is used to cap the slippage component of maintenance margin - it is applied to the square of the slippage volume.
   144    string quadratic_slippage_factor = 10 [deprecated = true];
   145    // Successor configuration. If this proposal is meant to succeed a given market, then this should be set.
   146    optional SuccessorConfiguration successor = 11;
   147    // Liquidity SLA parameters
   148    LiquiditySLAParameters liquidity_sla_parameters = 12;
   149    // Specifies how the liquidity fee for the market will be calculated.
   150    LiquidityFeeSettings liquidity_fee_settings = 13;
   151    // Liquidation strategy for this market.
   152    LiquidationStrategy liquidation_strategy = 14;
   153    // Mark price configuration.
   154    CompositePriceConfiguration mark_price_configuration = 15;
   155    // The market tick size defines the minimum change in quote price for the market
   156    string tick_size = 16;
   157    // If enabled aggressive orders sent to the market will be delayed by the configured number of blocks
   158    bool enable_transaction_reordering = 17;
   159    // Number of allowed price levels between an AMM's fair price and its quote prices. An AMM definition that exceeds this will be rejected at submission.
   160    optional uint64 allowed_empty_amm_levels = 18;
   161  }
   162  
   163  // New spot market on Vega
   164  message NewSpotMarket {
   165    // Configuration of the new spot market.
   166    NewSpotMarketConfiguration changes = 1;
   167  }
   168  
   169  // Configuration required to turn a new market proposal in to a successor market proposal.
   170  message SuccessorConfiguration {
   171    // ID of the market that the successor should take over from.
   172    string parent_market_id = 1;
   173    // A decimal value between or equal to 0 and 1, specifying the fraction of the insurance pool balance that is carried over from the parent market to the successor.
   174    string insurance_pool_fraction = 2;
   175  }
   176  
   177  // New market on Vega
   178  message NewMarket {
   179    // Configuration of the new market.
   180    NewMarketConfiguration changes = 1;
   181  }
   182  
   183  // Update an existing market on Vega
   184  message UpdateMarket {
   185    // Market ID the update is for.
   186    string market_id = 1;
   187    // Updated configuration of the futures market.
   188    UpdateMarketConfiguration changes = 2;
   189  }
   190  
   191  // Update an existing spot market on Vega
   192  message UpdateSpotMarket {
   193    // Market ID the update is for.
   194    string market_id = 1;
   195    // Updated configuration of the spot market.
   196    UpdateSpotMarketConfiguration changes = 2;
   197  }
   198  
   199  // Configuration to update a futures market on Vega
   200  message UpdateMarketConfiguration {
   201    // Updated futures market instrument configuration.
   202    UpdateInstrumentConfiguration instrument = 1;
   203    // Optional futures market metadata, tags.
   204    repeated string metadata = 2;
   205    // Price monitoring parameters.
   206    PriceMonitoringParameters price_monitoring_parameters = 3;
   207    // Liquidity monitoring parameters.
   208    LiquidityMonitoringParameters liquidity_monitoring_parameters = 4;
   209    // Updated futures market risk model parameters.
   210    oneof risk_parameters {
   211      // Simple risk model parameters, valid only if MODEL_SIMPLE is selected.
   212      SimpleModelParams simple = 100;
   213      // Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected.
   214      LogNormalRiskModel log_normal = 101;
   215    }
   216    // DEPRECATED: Use liquidity SLA parameters instead.
   217    // Percentage move up and down from the mid price which specifies the range of
   218    // price levels over which automated liquidity provisions will be deployed.
   219    optional string lp_price_range = 5;
   220    // Linear slippage factor is used to cap the slippage component of maintenance margin - it is applied to the slippage volume.
   221    string linear_slippage_factor = 6;
   222    // Quadratic slippage factor is used to cap the slippage component of maintenance margin - it is applied to the square of the slippage volume.
   223    string quadratic_slippage_factor = 7 [deprecated = true];
   224    // Liquidity SLA parameters
   225    LiquiditySLAParameters liquidity_sla_parameters = 8;
   226    // Specifies how the liquidity fee for the market will be calculated.
   227    LiquidityFeeSettings liquidity_fee_settings = 9;
   228    // Liquidation strategy parameters
   229    LiquidationStrategy liquidation_strategy = 10;
   230    // Mark price configuration.
   231    CompositePriceConfiguration mark_price_configuration = 11;
   232    // The market tick size defines the minimum change in quote price for the market
   233    string tick_size = 12;
   234    // If enabled aggressive orders sent to the market will be delayed by the configured number of blocks
   235    bool enable_transaction_reordering = 13;
   236    // Number of allowed price levels between an AMM's fair price and its quote prices. An AMM definition that exceeds this will be rejected at submission.
   237    optional uint64 allowed_empty_amm_levels = 14;
   238  }
   239  
   240  // Configuration to update a spot market on Vega
   241  message UpdateSpotMarketConfiguration {
   242    // Optional spot market metadata, tags.
   243    repeated string metadata = 1;
   244    // Price monitoring parameters.
   245    PriceMonitoringParameters price_monitoring_parameters = 2;
   246    // Specifies parameters related to target stake calculation.
   247    TargetStakeParameters target_stake_parameters = 3;
   248    // Update spot market risk model parameters.
   249    oneof risk_parameters {
   250      // Simple risk model parameters, valid only if MODEL_SIMPLE is selected.
   251      SimpleModelParams simple = 100;
   252      // Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected.
   253      LogNormalRiskModel log_normal = 101;
   254    }
   255    // Specifies the liquidity provision SLA parameters.
   256    LiquiditySLAParameters sla_params = 4;
   257    // Specifies how the liquidity fee for the market will be calculated.
   258    LiquidityFeeSettings liquidity_fee_settings = 5;
   259    // The market tick size defines the minimum change in quote price for the market
   260    string tick_size = 6;
   261    // Specifies the name and code of the spot instrument.
   262    UpdateSpotInstrumentConfiguration instrument = 7;
   263    // If enabled aggressive orders sent to the market will be delayed by the configured number of blocks
   264    bool enable_transaction_reordering = 8;
   265    // Allowed sellers
   266    repeated string allowed_sellers = 9;
   267  }
   268  
   269  message UpdateSpotInstrumentConfiguration {
   270    // Instrument code, human-readable shortcode used to describe the instrument.
   271    string code = 1;
   272    // Instrument name
   273    string name = 2;
   274  }
   275  
   276  // Instrument configuration
   277  message UpdateInstrumentConfiguration {
   278    // Instrument code, human-readable shortcode used to describe the instrument.
   279    string code = 1;
   280    // Instrument name
   281    string name = 2;
   282    // Product specification.
   283    oneof product {
   284      // Future.
   285      UpdateFutureProduct future = 100;
   286      // Perpetual.
   287      UpdatePerpetualProduct perpetual = 101;
   288    }
   289  }
   290  
   291  // Future product configuration
   292  message UpdateFutureProduct {
   293    // Human-readable name/abbreviation of the quote name.
   294    string quote_name = 1;
   295    // The data source spec describing the data of settlement data.
   296    vega.DataSourceDefinition data_source_spec_for_settlement_data = 2;
   297    // The data source spec describing the data source for trading termination.
   298    vega.DataSourceDefinition data_source_spec_for_trading_termination = 3;
   299    // The binding between the data source spec and the settlement data.
   300    DataSourceSpecToFutureBinding data_source_spec_binding = 4;
   301  }
   302  
   303  // Perpetual product configuration
   304  message UpdatePerpetualProduct {
   305    // Human-readable name/abbreviation of the quote name.
   306    string quote_name = 1;
   307    // Controls how much the upcoming funding payment liability contributes to party's margin, in the range [0, 1].
   308    string margin_funding_factor = 2;
   309    // Continuously compounded interest rate used in funding rate calculation, in the range [-1, 1].
   310    string interest_rate = 3;
   311    // Lower bound for the clamp function used as part of the funding rate calculation, in the range [-1, 1].
   312    string clamp_lower_bound = 4;
   313    // Upper bound for the clamp function used as part of the funding rate calculation, in the range [-1, 1].
   314    string clamp_upper_bound = 5;
   315    // Data source spec describing the data source for settlement schedule.
   316    vega.DataSourceDefinition data_source_spec_for_settlement_schedule = 6;
   317    // Data source spec describing the data source for settlement.
   318    vega.DataSourceDefinition data_source_spec_for_settlement_data = 7;
   319    // Binding between the data source spec and the settlement data.
   320    DataSourceSpecToPerpetualBinding data_source_spec_binding = 8;
   321    // Factor applied to funding-rates. This scales the impact that spot price deviations have on funding payments.
   322    optional string funding_rate_scaling_factor = 9;
   323    // Lower bound for the funding-rate such that the funding-rate will never be lower than this value.
   324    optional string funding_rate_lower_bound = 10;
   325    // Upper bound for the funding-rate such that the funding-rate will never be higher than this value.
   326    optional string funding_rate_upper_bound = 11;
   327    // Configuration for the internal composite price used in funding payment calculation.
   328    optional CompositePriceConfiguration internal_composite_price_configuration = 13;
   329  }
   330  
   331  // Update network configuration on Vega
   332  message UpdateNetworkParameter {
   333    // The network parameter to update.
   334    NetworkParameter changes = 1;
   335  }
   336  
   337  // New asset on Vega
   338  message NewAsset {
   339    // Configuration of the new asset.
   340    AssetDetails changes = 1;
   341  }
   342  
   343  // Update an existing asset on Vega
   344  message UpdateAsset {
   345    // Asset ID the update is for.
   346    string asset_id = 1;
   347    // Changes to apply on an existing asset.
   348    AssetDetailsUpdate changes = 2;
   349  }
   350  
   351  // Freeform proposal
   352  // This message is just used as a placeholder to sort out the nature of the
   353  // proposal once parsed.
   354  message NewFreeform {}
   355  
   356  // Terms for a governance proposal on Vega
   357  message ProposalTerms {
   358    // Timestamp as Unix time in seconds when voting closes for this proposal,
   359    // constrained by `minClose` and `maxClose` network parameters.
   360    int64 closing_timestamp = 1;
   361    // Timestamp as Unix time in seconds when proposal gets enacted if passed,
   362    // constrained by `minEnact` and `maxEnact` network parameters.
   363    int64 enactment_timestamp = 2;
   364    // Validation timestamp as Unix time in seconds.
   365    int64 validation_timestamp = 3;
   366    // Changes being proposed.
   367    oneof change {
   368      // Proposal change for modifying an existing futures market on Vega.
   369      UpdateMarket update_market = 101;
   370      // Proposal change for creating new futures market on Vega.
   371      NewMarket new_market = 102;
   372      // Proposal change for updating Vega network parameters.
   373      UpdateNetworkParameter update_network_parameter = 103;
   374      // Proposal change for creating new assets on Vega.
   375      NewAsset new_asset = 104;
   376      // Proposal change for a freeform request, which can be voted on but does not change the behaviour of the system,
   377      // and can be used to gauge community sentiment.
   378      NewFreeform new_freeform = 105;
   379      // Proposal change for updating an asset.
   380      UpdateAsset update_asset = 106;
   381      // Proposal change for creating new spot market on Vega.
   382      NewSpotMarket new_spot_market = 107;
   383      // Proposal change for modifying an existing spot market on Vega.
   384      UpdateSpotMarket update_spot_market = 108;
   385      // Proposal change for a governance transfer.
   386      NewTransfer new_transfer = 109;
   387      // Cancel a governance transfer.
   388      CancelTransfer cancel_transfer = 110;
   389      // Proposal change for updating the state of a market.
   390      UpdateMarketState update_market_state = 111;
   391      // Proposal change for updating the referral program.
   392      UpdateReferralProgram update_referral_program = 112;
   393      // Proposal change for updating the volume discount program.
   394      UpdateVolumeDiscountProgram update_volume_discount_program = 113;
   395      // Proposal change for updating the volume rebate program.
   396      UpdateVolumeRebateProgram update_volume_rebate_program = 114;
   397      // Proposal for a new automated purchase auction
   398      NewProtocolAutomatedPurchase new_protocol_automated_purchase = 115;
   399    }
   400  }
   401  
   402  // Terms change for a batch governance proposal
   403  message BatchProposalTermsChange {
   404    // Timestamp as Unix time in seconds when proposal terms gets enacted if proposal passed the vote,
   405    // constrained by `minEnact` and `maxEnact` network parameters.
   406    int64 enactment_timestamp = 1;
   407    // Validation timestamp as Unix time in seconds.
   408    int64 validation_timestamp = 2;
   409  
   410    // Changes being proposed.
   411    oneof change {
   412      // Proposal change for modifying an existing futures market.
   413      UpdateMarket update_market = 101;
   414      // Proposal change for creating new futures market.
   415      NewMarket new_market = 102;
   416      // Proposal change for updating Vega network parameters.
   417      UpdateNetworkParameter update_network_parameter = 103;
   418      // Proposal change for a freeform request, which can be voted on but does not change the behaviour of the system,
   419      // and can be used to gauge community sentiment.
   420      NewFreeform new_freeform = 104;
   421      // Proposal change for updating an asset.
   422      UpdateAsset update_asset = 105;
   423      // Proposal change for creating new spot market.
   424      NewSpotMarket new_spot_market = 106;
   425      // Proposal change for modifying an existing spot market.
   426      UpdateSpotMarket update_spot_market = 107;
   427      // Proposal change for a governance initiated transfer.
   428      NewTransfer new_transfer = 108;
   429      // Proposal change to cancel a governance initiated transfe.
   430      CancelTransfer cancel_transfer = 109;
   431      // Proposal change for updating the state of a market.
   432      UpdateMarketState update_market_state = 110;
   433      // Proposal change for updating the referral program.
   434      UpdateReferralProgram update_referral_program = 111;
   435      // Proposal change for updating the volume discount program.
   436      UpdateVolumeDiscountProgram update_volume_discount_program = 112;
   437      // Proposal change for adding a new asset.
   438      NewAsset new_asset = 113;
   439      // Proposal change for updating the volume rebate program.
   440      UpdateVolumeRebateProgram update_volume_rebate_program = 114;
   441      // Proposal for a new automated purchase auction
   442      NewProtocolAutomatedPurchase new_protocol_automated_purchase = 115;
   443    }
   444  }
   445  
   446  message ProposalParameters {
   447    // Represents the minimum time before a proposal can be closed for voting.
   448    int64 min_close = 1;
   449    // Represents the maximum time that a proposal can be open for voting.
   450    int64 max_close = 2;
   451    // Represents the minimum time before an enacted proposal takes effect.
   452    int64 min_enact = 3;
   453    // Represents the maximum time before an enacted proposal must take effect.
   454    int64 max_enact = 4;
   455    // Specifies the required percentage of eligible participants that must partake in the proposal for it to be valid.
   456    string required_participation = 5;
   457    // Specifies the required percentage of votes a proposal needs to be approved.
   458    string required_majority = 6;
   459    // Specifies the minimum governance token balance a proposer must hold to initiate a proposal.
   460    string min_proposer_balance = 7;
   461    // Specifies the minimum governance token balance a voter must hold to participate in voting.
   462    string min_voter_balance = 8;
   463    // Specifies the required percentage of participation from liquidity providers for the proposal to be valid.
   464    string required_participation_lp = 9;
   465    // Specifies the required majority percentage from liquidity providers for a proposal to be approved.
   466    string required_majority_lp = 10;
   467    // Specifies the minimum share that is akin to equity, which a participant must hold for their vote to be eligible.
   468    string min_equity_like_share = 11;
   469  }
   470  
   471  // Terms for a batch governance proposal on Vega
   472  message BatchProposalTerms {
   473    // Closing timestamp in Unix time; adheres to `minClose` and `maxClose` limits.
   474    int64 closing_timestamp = 1;
   475    // Specific parameters defining the proposal's characteristics used for validation.
   476    ProposalParameters proposal_params = 2;
   477    // List of individual changes included in the batch proposal.
   478    repeated BatchProposalTermsChange changes = 3;
   479  }
   480  
   481  // Rationale behind a proposal.
   482  message ProposalRationale {
   483    reserved 2, 3;
   484    // Description to show a short title / something in case the link goes offline.
   485    // This is to be between 0 and 20k unicode characters.
   486    // This is mandatory for all proposals.
   487    string description = 1;
   488    // Title to be used to give a short description of the proposal in lists.
   489    // This is to be between 0 and 100 unicode characters.
   490    // This is mandatory for all proposals.
   491    string title = 4;
   492  }
   493  
   494  // Governance data
   495  message GovernanceData {
   496    // Proposal type
   497    enum Type {
   498      // Single proposal only. In case it has not been specified, for example in older proposals, then this is the default.
   499      TYPE_SINGLE_OR_UNSPECIFIED = 0;
   500      // Proposal contains a batch of proposals or a proposal that should be treated as part of a batch.
   501      TYPE_BATCH = 1;
   502    }
   503  
   504    // Governance proposal that is being voted on.
   505    Proposal proposal = 1;
   506    // All YES votes in favour of the proposal above.
   507    repeated Vote yes = 2;
   508    // All NO votes against the proposal above.
   509    repeated Vote no = 3;
   510    // All latest YES votes by party which is guaranteed to be unique,
   511    // where key (string) is the party ID i.e. public key and
   512    // value (Vote) is the vote cast by the given party.
   513    map<string, Vote> yes_party = 4;
   514    // All latest NO votes by party which is guaranteed to be unique,
   515    // where key (string) is the party ID i.e. public key and
   516    // value (Vote) is the vote cast by the given party.
   517    map<string, Vote> no_party = 5;
   518    // Type of proposal this data is for.
   519    Type proposal_type = 6;
   520    // If proposal type is batch, proposals will contain all the proposals that are make up the batch.
   521    repeated Proposal proposals = 7;
   522  }
   523  
   524  // Governance proposal
   525  message Proposal {
   526    // Proposal state transition:
   527    // Open ->
   528    //   - Passed -> Enacted.
   529    //   - Passed -> Failed.
   530    //   - Declined
   531    // Rejected
   532    // Proposal can enter Failed state from any other state
   533    enum State {
   534      // Default value, always invalid
   535      STATE_UNSPECIFIED = 0;
   536      // Proposal enactment has failed - even though proposal has passed, its execution could not be performed
   537      STATE_FAILED = 1;
   538      // Proposal is open for voting
   539      STATE_OPEN = 2;
   540      // Proposal has gained enough support to be executed
   541      STATE_PASSED = 3;
   542      // Proposal wasn't accepted i.e. proposal terms failed validation due to wrong configuration or failed to meet network requirements.
   543      STATE_REJECTED = 4;
   544      // Proposal didn't get enough votes, e.g. either failed to gain required participation or majority level.
   545      STATE_DECLINED = 5;
   546      // Proposal enacted.
   547      STATE_ENACTED = 6;
   548      // Waiting for node validation of the proposal
   549      STATE_WAITING_FOR_NODE_VOTE = 7;
   550  
   551      // Note: If adding an enum value, add a matching entry in:
   552      //       - gateway/graphql/helpers_enum.go
   553      //       - gateway/graphql/schema.graphql (enum ProposalState)
   554    }
   555  
   556    // Unique proposal ID.
   557    string id = 1;
   558    // Proposal reference.
   559    string reference = 2;
   560    // Party ID i.e. public key of the party submitting the proposal.
   561    string party_id = 3;
   562    // Current state of the proposal, i.e. open, passed, failed etc.
   563    State state = 4;
   564    // Proposal timestamp for date and time as Unix time in nanoseconds when proposal was submitted to the network.
   565    int64 timestamp = 5;
   566    // Proposal configuration and the actual change that is meant to be executed when proposal is enacted.
   567    // Single proposal term.
   568    optional ProposalTerms terms = 6;
   569    // Reason for the current state of the proposal, this may be set in case of REJECTED and FAILED statuses.
   570    optional ProposalError reason = 7;
   571    // Detailed error associated to the reason.
   572    optional string error_details = 8;
   573    // Rationale behind a proposal.
   574    ProposalRationale rationale = 9;
   575    // Required vote participation for this proposal.
   576    string required_participation = 10;
   577    // Required majority for this proposal.
   578    string required_majority = 11;
   579    // Required participation from liquidity providers, optional but is required for market update proposal.
   580    optional string required_liquidity_provider_participation = 12;
   581    // Required majority from liquidity providers, optional but is required for market update proposal.
   582    optional string required_liquidity_provider_majority = 13;
   583    // Batch proposal terms.
   584    optional BatchProposalTerms batch_terms = 14;
   585    // ID of a batch proposal that this proposal is part of.
   586    optional string batch_id = 15;
   587  }
   588  
   589  // List of possible errors that can cause a proposal to be in state rejected or failed
   590  enum ProposalError {
   591    // Default value
   592    PROPOSAL_ERROR_UNSPECIFIED = 0;
   593    // Specified close time is too early based on network parameters
   594    PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON = 1;
   595    // Specified close time is too late based on network parameters
   596    PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE = 2;
   597    // Specified enactment time is too early based on network parameters
   598    PROPOSAL_ERROR_ENACT_TIME_TOO_SOON = 3;
   599    // Specified enactment time is too late based on network parameters
   600    PROPOSAL_ERROR_ENACT_TIME_TOO_LATE = 4;
   601    // Proposer for this proposal has insufficient tokens
   602    PROPOSAL_ERROR_INSUFFICIENT_TOKENS = 5;
   603    // Instrument quote name and base name were the same
   604    PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY = 6;
   605    // Proposal has no product
   606    PROPOSAL_ERROR_NO_PRODUCT = 7;
   607    // Specified product is not supported
   608    PROPOSAL_ERROR_UNSUPPORTED_PRODUCT = 8;
   609    // Proposal has no trading mode
   610    PROPOSAL_ERROR_NO_TRADING_MODE = 11;
   611    // Proposal has an unsupported trading mode
   612    PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE = 12;
   613    // Proposal failed node validation
   614    PROPOSAL_ERROR_NODE_VALIDATION_FAILED = 13;
   615    // Field is missing in a builtin asset source
   616    PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD = 14;
   617    // Contract address is missing in the ERC20 asset source
   618    PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS = 15;
   619    // Asset ID is invalid or does not exist on the Vega network
   620    PROPOSAL_ERROR_INVALID_ASSET = 16;
   621    // Proposal terms timestamps are not compatible (Validation < Closing < Enactment)
   622    PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS = 17;
   623    // No risk parameters were specified
   624    PROPOSAL_ERROR_NO_RISK_PARAMETERS = 18;
   625    // Invalid key in update network parameter proposal
   626    PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY = 19;
   627    // Invalid value in update network parameter proposal
   628    PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE = 20;
   629    // Validation failed for network parameter proposal
   630    PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED = 21;
   631    // Opening auction duration is less than the network minimum opening auction time
   632    PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL = 22;
   633    // Opening auction duration is more than the network minimum opening auction time
   634    PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE = 23;
   635    // Market proposal market could not be instantiated in execution
   636    PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET = 25;
   637    // Market proposal market contained invalid product definition
   638    PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT = 26;
   639    // Market proposal has invalid risk parameter
   640    PROPOSAL_ERROR_INVALID_RISK_PARAMETER = 30;
   641    // Proposal was declined because vote didn't reach the majority threshold required
   642    PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED = 31;
   643    // Proposal declined because the participation threshold was not reached
   644    PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED = 32;
   645    // Asset proposal has invalid asset details
   646    PROPOSAL_ERROR_INVALID_ASSET_DETAILS = 33;
   647    // Proposal is an unknown type
   648    PROPOSAL_ERROR_UNKNOWN_TYPE = 34;
   649    // Proposal has an unknown risk parameter type
   650    PROPOSAL_ERROR_UNKNOWN_RISK_PARAMETER_TYPE = 35;
   651    // Validation failed for freeform proposal
   652    PROPOSAL_ERROR_INVALID_FREEFORM = 36;
   653    // Party doesn't have enough equity-like share to propose an update on the market
   654    // targeted by the proposal
   655    PROPOSAL_ERROR_INSUFFICIENT_EQUITY_LIKE_SHARE = 37;
   656    // Market targeted by the proposal does not exist or is not eligible for modification
   657    PROPOSAL_ERROR_INVALID_MARKET = 38;
   658    // Market proposal decimal place is higher than the market settlement asset decimal places
   659    PROPOSAL_ERROR_TOO_MANY_MARKET_DECIMAL_PLACES = 39;
   660    // Market proposal contains too many price monitoring triggers
   661    PROPOSAL_ERROR_TOO_MANY_PRICE_MONITORING_TRIGGERS = 40;
   662    // Market proposal contains too many price monitoring triggers
   663    PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE = 41;
   664    // LP price range must be larger than 0
   665    PROPOSAL_ERROR_LP_PRICE_RANGE_NONPOSITIVE = 42;
   666    // LP price range must not be larger than 100
   667    PROPOSAL_ERROR_LP_PRICE_RANGE_TOO_LARGE = 43;
   668    // Linear slippage factor is out of range, either negative or too large
   669    PROPOSAL_ERROR_LINEAR_SLIPPAGE_FACTOR_OUT_OF_RANGE = 44;
   670    // Quadratic slippage factor is out of range, either negative or too large
   671    PROPOSAL_ERROR_QUADRATIC_SLIPPAGE_FACTOR_OUT_OF_RANGE = 45;
   672    // Validation failed for spot proposal
   673    PROPOSAL_ERROR_INVALID_SPOT = 46;
   674    // Spot trading not enabled
   675    PROPOSAL_ERROR_SPOT_PRODUCT_DISABLED = 47;
   676    // Market proposal is invalid, either invalid insurance pool fraction, or it specifies a parent market that it can't succeed.
   677    PROPOSAL_ERROR_INVALID_SUCCESSOR_MARKET = 48;
   678    // Governance transfer proposal is invalid
   679    PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_FAILED = 49;
   680    // Governance transfer proposal failed
   681    PROPOSAL_ERROR_GOVERNANCE_TRANSFER_PROPOSAL_INVALID = 50;
   682    // Proposal for cancelling transfer is invalid, check proposal ID
   683    PROPOSAL_ERROR_GOVERNANCE_CANCEL_TRANSFER_PROPOSAL_INVALID = 51;
   684    // Proposal for updating market state is invalid
   685    PROPOSAL_ERROR_INVALID_MARKET_STATE_UPDATE = 52;
   686    // Liquidity provision SLA parameters are invalid
   687    PROPOSAL_ERROR_INVALID_SLA_PARAMS = 53;
   688    // Mandatory liquidity provision SLA parameters are missing
   689    PROPOSAL_ERROR_MISSING_SLA_PARAMS = 54;
   690    // Perpetual market proposal contained invalid product definition
   691    PROPOSAL_ERROR_INVALID_PERPETUAL_PRODUCT = 55;
   692    // Referral program proposal is invalid
   693    PROPOSAL_ERROR_INVALID_REFERRAL_PROGRAM = 56;
   694    // Volume discount program proposal is invalid
   695    PROPOSAL_ERROR_INVALID_VOLUME_DISCOUNT_PROGRAM = 57;
   696    // One or more proposals in a batch has been rejected
   697    PROPOSAL_ERROR_PROPOSAL_IN_BATCH_REJECTED = 58;
   698    // One or more proposals in a batch has been declined
   699    PROPOSAL_ERROR_PROPOSAL_IN_BATCH_DECLINED = 59;
   700    // Spot market decimal places cannot be greater than the base asset’s decimal places
   701    PROPOSAL_ERROR_INVALID_SIZE_DECIMAL_PLACES = 60;
   702    // Volume rebate program proposal is invalid
   703    PROPOSAL_ERROR_INVALID_VOLUME_REBATE_PROGRAM = 61;
   704    // Automated purchase proposal is invalid
   705    PROPOSAL_ERROR_INVALID_PROTOCOL_AUTOMATED_PURCHASE = 62;
   706  }
   707  
   708  // Governance vote
   709  message Vote {
   710    // Vote value
   711    enum Value {
   712      // Default value, always invalid
   713      VALUE_UNSPECIFIED = 0;
   714      // Vote against the proposal
   715      VALUE_NO = 1;
   716      // Vote in favour of the proposal
   717      VALUE_YES = 2;
   718  
   719      // Note: If adding an enum value, add a matching entry in:
   720      //       - gateway/graphql/helpers_enum.go
   721      //       - gateway/graphql/schema.graphql (enum VoteValue)
   722    }
   723  
   724    // Voter's party ID.
   725    string party_id = 1;
   726    // Which way the party voted.
   727    Value value = 2;
   728    // Proposal ID being voted on.
   729    string proposal_id = 3;
   730    // Timestamp in Unix nanoseconds when the vote was acknowledged by the network.
   731    int64 timestamp = 4;
   732    // Total number of governance token for the party that cast the vote.
   733    string total_governance_token_balance = 5;
   734    // The weight of this vote based on the total number of governance tokens.
   735    string total_governance_token_weight = 6;
   736    // The weight of the vote compared to the total amount of equity-like share on the market. It is only populated if the vote is for a single type proposal.
   737    string total_equity_like_share_weight = 7;
   738    // The per market weight of the vote compared to the total amount of equity-like share on the market.. It is only populated if the vote is for a batch type proposal.
   739    repeated VoteELSPair els_per_market = 8;
   740  }
   741  
   742  message VoteELSPair {
   743    // The market ID.
   744    string market_id = 1;
   745    // The equity-like share weight for this market.
   746    string els = 2;
   747  }
   748  
   749  message UpdateVolumeDiscountProgram {
   750    // Configuration for a change to update a volume discount program
   751    VolumeDiscountProgramChanges changes = 1;
   752  }
   753  
   754  message VolumeDiscountProgramChanges {
   755    // Defined benefit tiers in increasing order. First element will give Tier 1,
   756    // second element will give Tier 2, and so on. Determines the level of
   757    // benefit a party can expect based on performance criteria.
   758    repeated VolumeBenefitTier benefit_tiers = 1;
   759    // Timestamp as Unix time in seconds, after which when the current epoch
   760    // ends, the program will end and benefits will be disabled.
   761    int64 end_of_program_timestamp = 2;
   762    // Number of epochs over which to evaluate a referral set's running volume.
   763    uint64 window_length = 3;
   764  }
   765  
   766  message UpdateVolumeRebateProgram {
   767    // Configuration for a change to update a volume rebate program
   768    VolumeRebateProgramChanges changes = 1;
   769  }
   770  
   771  message VolumeRebateProgramChanges {
   772    // Defined benefit tiers in increasing order. First element will give Tier 1,
   773    // second element will give Tier 2, and so on. Determines the level of
   774    // benefit a party can expect based on performance criteria.
   775    repeated VolumeRebateBenefitTier benefit_tiers = 1;
   776    // Timestamp as Unix time in seconds, after which when the current epoch
   777    // ends, the program will end and benefits will be disabled.
   778    int64 end_of_program_timestamp = 2;
   779    // Number of epochs over which to evaluate a referral set's running volume.
   780    uint64 window_length = 3;
   781  }
   782  
   783  message UpdateReferralProgram {
   784    // Configuration for change to update a referral program.
   785    ReferralProgramChanges changes = 1;
   786  }
   787  
   788  message ReferralProgramChanges {
   789    // Defined benefit tiers in increasing order. First element will give Tier 1,
   790    // second element will give Tier 2, and so on. Determines the level of
   791    // benefit a party can expect based on performance criteria.
   792    repeated BenefitTier benefit_tiers = 1;
   793    // Timestamp as Unix time in seconds, after which when the current epoch
   794    // ends, the program will end and benefits will be disabled.
   795    int64 end_of_program_timestamp = 2;
   796    // Number of epochs over which to evaluate a referral set's running volume.
   797    uint64 window_length = 3;
   798    // Defined staking tiers in increasing order. First element will give Tier 1,
   799    // second element will give Tier 2, and so on. Determines the level of
   800    // benefit a party can expect based on their staking.
   801    repeated StakingTier staking_tiers = 4;
   802  }
   803  
   804  message UpdateMarketState {
   805    // Configuration for governance-initiated change of a market's state
   806    UpdateMarketStateConfiguration changes = 1;
   807  }
   808  
   809  enum MarketStateUpdateType {
   810    // Default value, always invalid
   811    MARKET_STATE_UPDATE_TYPE_UNSPECIFIED = 0;
   812    // Request to terminate a market via governance
   813    MARKET_STATE_UPDATE_TYPE_TERMINATE = 1;
   814    // Request to suspend a market via governance
   815    MARKET_STATE_UPDATE_TYPE_SUSPEND = 2;
   816    // Request to resume a market via governance
   817    MARKET_STATE_UPDATE_TYPE_RESUME = 3;
   818  }
   819  
   820  message UpdateMarketStateConfiguration {
   821    // ID of the market
   822    string market_id = 1;
   823    // Type of the market update
   824    MarketStateUpdateType update_type = 2;
   825    // Settlement price, relevant only for market termination for futures markets
   826    optional string price = 3;
   827  }
   828  
   829  message CancelTransfer {
   830    // Configuration for cancellation of a governance-initiated transfer
   831    CancelTransferConfiguration changes = 1;
   832  }
   833  
   834  message CancelTransferConfiguration {
   835    // ID of the governance transfer proposal.
   836    string transfer_id = 1;
   837  }
   838  
   839  // New governance transfer
   840  message NewTransfer {
   841    // Configuration for a new transfer.
   842    NewTransferConfiguration changes = 1;
   843  }
   844  
   845  enum GovernanceTransferType {
   846    GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED = 0;
   847    GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING = 1;
   848    GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT = 2;
   849  }
   850  
   851  message NewTransferConfiguration {
   852    // Source account type, such as network treasury, market insurance pool
   853    vega.AccountType source_type = 1;
   854    // If network treasury, field is empty, otherwise uses the market ID
   855    string source = 2;
   856    // "All or nothing" or "best effort":
   857    // All or nothing: Transfers the specified amount or does not transfer anything
   858    // Best effort: Transfers the specified amount or the max allowable amount if this is less than the specified amount
   859    GovernanceTransferType transfer_type = 3;
   860    // Maximum amount to transfer
   861    string amount = 4;
   862    // ID of asset to transfer
   863    string asset = 5;
   864    // Maximum fraction of the source account's balance to transfer as a decimal - i.e. 0.1 = 10% of the balance
   865    string fraction_of_balance = 6;
   866    // Specifies the account type to transfer to: reward pool, party, network insurance pool, market insurance pool
   867    vega.AccountType destination_type = 7;
   868    // Specifies the account to transfer to, depending on the account type:
   869    // Network treasury: leave empty
   870    // Party: party's public key
   871    // Market insurance pool: market ID
   872    string destination = 8;
   873    // Specific details of the transfer.
   874    oneof kind {
   875      OneOffTransfer one_off = 101;
   876      RecurringTransfer recurring = 102;
   877    }
   878  }
   879  
   880  // Specific details for a one off transfer
   881  message OneOffTransfer {
   882    // Timestamp in Unix nanoseconds for when the transfer should be delivered into the receiver's account.
   883    int64 deliver_on = 1;
   884  }
   885  
   886  // Specific details for a recurring transfer
   887  message RecurringTransfer {
   888    // First epoch from which this transfer shall be paid.
   889  
   890    uint64 start_epoch = 1;
   891    // Last epoch at which this transfer shall be paid.
   892    optional uint64 end_epoch = 2;
   893    // Optional parameter defining how a transfer is dispatched.
   894    optional vega.DispatchStrategy dispatch_strategy = 3;
   895    // Factor that the initial transfer amount is multiplied by for each epoch that it is executed.
   896    // For example if the initial transfer amount is 1000 and the factor is 0.5, then the amounts transferred per epoch will be 1000, 500, 250, 125, etc.
   897    string factor = 4;
   898  }
   899  
   900  message NewProtocolAutomatedPurchase {
   901    // Configuration for a change to create a new automated purchase auction
   902    NewProtocolAutomatedPurchaseChanges changes = 1;
   903  }
   904  
   905  message NewProtocolAutomatedPurchaseChanges {
   906    // The source token that will be swapped
   907    string from = 1;
   908    // The account type for the network from which the tokens will be sourced
   909    vega.AccountType from_account_type = 2;
   910    // The account type for the network to which the purchased tokens will be sent
   911    vega.AccountType to_account_type = 3;
   912    // The market that will be used to enact the purchase/sale
   913    string market_id = 4;
   914    // The oracle which will define an approximate acceptable price for the transaction
   915    vega.DataSourceDefinition price_oracle = 5;
   916    // The spec binding for the price oracle
   917    vega.SpecBindingForCompositePrice price_oracle_spec_binding = 6;
   918    // The final acceptable price is the price oracle value weighted by this factor (e.g. 1.05 to allow for 5% slippage on the purchase)
   919    string oracle_offset_factor = 7;
   920    // A time based oracle for when auctions will occur
   921    vega.DataSourceDefinition auction_schedule = 8;
   922    // A time based oracle for when an observation will be taken of the balance of the source account. This will emit an event notifying of the balance planned to exchange, along with storing this value. When an auction occurs, the latest reading for this value will be used for the volume to trade, rather than the full balance of the account.
   923    vega.DataSourceDefinition auction_volume_snapshot_schedule = 9;
   924    // The spec binding for the auction schedule and volume snapshot schedule
   925    vega.DataSourceSpecToAutomatedPurchaseBinding automated_purchase_spec_binding = 10;
   926    // The duration of the auction
   927    string auction_duration = 11;
   928    // Minimum number of tokens to be sold (specified in asset decimals). If less than this are available in the account at the last snapshot before auction, no auction will occur and the balance will roll over to the next scheduled auction.
   929    string minimum_auction_size = 12;
   930    // Maximum number of tokens to be sold (specified in asset decimals). If more than this are available in the account at the last snapshot before auction, this maximum value will be used instead, and the remainder will be rolled over to the next scheduled auction.
   931    string maximum_auction_size = 13;
   932    // Timestamp in Unix seconds, when the automated purchase is stopped. If an auction is in action it will be removed when the auction is finished.
   933    int64 expiry_timestamp = 14;
   934    // For how long the oracle price source is considered valid
   935    string oracle_price_staleness_tolerance = 15;
   936  }