Documentation
¶
Index ¶
Constants ¶
const MarketParamIndex = "params"
MarketParamIndex is the index into the research json market-structure under which the market's parameters are stored.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeConfigJson ¶
type ExchangeConfigJson struct {
Exchanges []ExchangeMarketConfigJson `json:"exchanges"`
}
ExchangeConfigJson demarshals the exchange configuration json for a particular market. The result is a list of parameters that define how the market is resolved on each supported exchange.
This struct stores data in an intermediate form as it's being assigned to various `ExchangeMarketConfig` objects, which are keyed by exchange id. These objects are not kept past the time the `GetAllMarketParams` API response is parsed, and do not contain an id because the id is expected to be known at the time the object is in use.
type ExchangeMarketConfigJson ¶
type ExchangeMarketConfigJson struct { ExchangeName string `json:"exchangeName"` Ticker string `json:"ticker"` AdjustByMarket string `json:"adjustByMarket,omitempty"` Invert bool `json:"invert,omitempty"` }
ExchangeMarketConfigJson captures per-exchange information for resolving a market, including the ticker and conversion details. It demarshals JSON parameters from the chain for a particular market on a specific exchange.
type MarketParam ¶
type MarketParam struct { // Unique, sequentially-generated value. Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint // The human-readable name of the market pair (e.g. `BTC-USD`). Pair string `protobuf:"bytes,2,opt,name=pair,proto3" json:"pair,omitempty"` // Static value. The exponent of the price. // For example if `Exponent == -5` then a `Value` of `1,000,000,000` // represents “$10,000`. Therefore `10 ^ Exponent` represents the smallest // price step (in dollars) that can be recorded. Exponent int32 `protobuf:"zigzag32,3,opt,name=exponent,proto3" json:"exponent,omitempty"` // The minimum number of exchanges that should be reporting a live price for // a price update to be considered valid. MinExchanges uint32 `protobuf:"varint,4,opt,name=min_exchanges,json=minExchanges,proto3" json:"min_exchanges,omitempty"` // The minimum allowable change in `price` value that would cause a price // update on the network. Measured as `1e-6` (parts per million). MinPriceChangePpm uint32 `protobuf:"varint,5,opt,name=min_price_change_ppm,json=minPriceChangePpm,proto3" json:"min_price_change_ppm,omitempty"` // A string of json that encodes the configuration for resolving the price // of this market on various exchanges. ExchangeConfigJson string `protobuf:"bytes,6,opt,name=exchange_config_json,json=exchangeConfigJson,proto3" json:"exchange_config_json,omitempty"` //nolint }
MarketParam represents the x/prices configuration for markets, including representing price values, resolving markets on individual exchanges, and generating price updates. This configuration is specific to the quote currency.
type Params ¶
type Params struct { ResearchJSONMarketParam `json:"params"` MetaData `json:"meta"` }
type QueryAllMarketParamsResponse ¶
type QueryAllMarketParamsResponse struct {
MarketParams []MarketParam `protobuf:"bytes,1,rep,name=market_params,json=marketParams,proto3" json:"market_params"`
}
QueryAllMarketParamsResponse is response type for the Query/Params `AllMarketParams` RPC method.
type ResearchJSON ¶
ResearchJSON is the go-struct that encompasses the dydx research json, as hosted on [github](https://raw.githubusercontent.com/dydxprotocol/v4-web/main/public/configs/otherMarketData.json)
type ResearchJSONMarketParam ¶
type ResearchJSONMarketParam struct { // Id is the unique identifier for the market ID uint32 `json:"id"` // Pair is the ticker symbol for the market Pair string `json:"ticker"` // Exponent is the number of decimal places to shift the price by Exponent float64 `json:"priceExponent"` // MinExchanges is the minimum number of exchanges that must provide data for the market MinExchanges uint32 `json:"minExchanges"` // MinPriceChangePpm is the minimum price change that must be observed for the market MinPriceChangePpm uint32 `json:"minPriceChange"` // ExchangeConfigJSON is the json object that contains the exchange configuration for the market ExchangeConfigJSON []ExchangeMarketConfigJson `json:"exchangeConfigJson"` }