package
0.79.0-preview.4
Repository: https://github.com/vegaprotocol/vega.git
Documentation: pkg.go.dev

# README

Governance engine

The governance engine receives proposals that have passed through consensus (meaning they come from the chain). For each block, the OnChainTimeUpdate function is called, which will have the engine check currently active proposals to see if the voting period for these proposals has expired. Once the voting period has expired, the engine will check to see if the proposal was accepted or rejected. Rejected proposals, obviously, have reached the end of their useful lives. Accepted ones, however, are fed back into the execution engine to be enacted.

Votes will also be fed into this engine. Votes are expected to be cast on proposals by ID (a vote can only be cast on a proposal once it's considered valid). We track all votes (yes/no votes).

Dependencies

The Governance engine needs to be able to check the accounts of parties (seeing how many tokens a given party has, and how many total tokens are in the system). This information is currently accessible through the collateral engine.

To expose the proposals API (gRPC), we'll create a buffer which will allow the governance service to stream updates regarding proposals over a gRPC call, should this be required.

Accepted proposals

Accepted proposals are returned from the OnChainTimeUpdate call, for the execution engine to act on them.

Convenience

For the governance service to more easily return the requested data (e.g. GetProposalByReference), there are some convenience functions available to expose active proposals by reference and id.

# Packages

Package mocks is a generated GoMock package.

# Functions

NewDefaultConfig creates an instance of the package specific configuration.
No description provided by the author
No description provided by the author

# Variables

ErrDataSourceSpecTerminationTimeBeforeEnactment is returned when termination time is before enactment for time triggered termination condition.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrInternalTimeTriggerForFuturesInNotAllowed is returned when a proposal containing timetrigger terminaiton type of data is received.
No description provided by the author
ErrInvalidInsurancePoolFraction is returned if the insurance pool fraction parameter is outside of the 0-1 range.
ErrInvalidRiskParameter ...
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrMissingDataSourceSpecBinding is returned when the data source spec binding is absent.
ErrMissingDataSourceSpecForSettlementData is returned when the data source spec for settlement data is absent.
ErrMissingDataSourceSpecForSettlementSchedule is returned when the data source spec for trading termination is absent.
ErrMissingDataSourceSpecForTradingTermination is returned when the data source spec for trading termination is absent.
ErrMissingFutureProduct is returned when future product is absent from the instrument.
ErrMissingPerpsProduct is returned when perps product is absent from the instrument.
ErrMissingProduct is returned if selected product is nil.
ErrMissingRiskParameters ...
ErrMissingSpotProduct is returned when spot product is absent from the instrument.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrMissingDataSourceSpecForSettlementData is returned when the data source spec for settlement data is absent.
No description provided by the author
ErrUnsupportedProduct is returned if selected product is not supported.
No description provided by the author
ErrUnsupportedRiskParameters is returned if risk parameters supplied via governance are not yet supported.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Config represents governance specific configuration.
Engine is the governance engine that handles proposal and vote lifecycle.
No description provided by the author
No description provided by the author
ToEnact wraps the proposal in a type that has a convenient interface to quickly work out what change we're dealing with, and get the data.
No description provided by the author
No description provided by the author
ToEnactFreeform there is nothing to enact with a freeform proposal.
No description provided by the author
ToEnactNewMarket is just a empty struct, to signal an enacted market.
No description provided by the author
No description provided by the author
ToSubmit wraps the proposal in a type that has a convenient interface to quickly work out what change we're dealing with, and get the data This cover every kind of proposal which requires action after a proposal is submitted.
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
Broker - event bus.
Markets allows to get the market data for use in the market update proposal computation.
No description provided by the author
StakingAccounts ...
TimeService ...
Witness ...