Documentation ¶
Overview ¶
Package config contains structures used in retrieving app configuration from disk.
Package config contains structures and functions for configuring the app.
Index ¶
- Variables
- func CheckConfig(cfg *Config) error
- func ConfigureLogging(cfg *ServerConfig) error
- func ReadFloat64(details map[string]string, key string) (v float64, err error)
- func ReadUint64(details map[string]string, key string) (v uint64, err error)
- type BotConfig
- type Config
- type LimitOrderDistParams
- type LiquidityOrder
- type PricingConfig
- type ServerConfig
- type Shape
- type Strategy
- type Uint
- type WalletConfig
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNil indicates that a nil/null pointer was encountered. ErrNil = errors.New("nil pointer") // ErrMissingEmptyConfigSection indicates that a required config file section is missing (not present) or empty (zero-length). ErrMissingEmptyConfigSection = errors.New("config file section is missing/empty") // ErrInvalidValue indicates that a value was invalid. ErrInvalidValue = errors.New("invalid value") )
Functions ¶
func CheckConfig ¶
CheckConfig checks the config for valid structure and values.
func ConfigureLogging ¶
func ConfigureLogging(cfg *ServerConfig) error
ConfigureLogging configures logging.
func ReadFloat64 ¶
ReadFloat64 extracts a float64 from a strategy config map.
Types ¶
type BotConfig ¶
type BotConfig struct { // Name is the name of the bot. It is also used as the wallet name. // It is *not* a public key seen by Vega. Name string `yaml:"name"` // Location points to a Vega node gRPC endpoint (host:port). Location string `yaml:"location"` // ConnectTimeout is the timeout (in milliseconds) for connecting to the Vega node gRPC endpoint. ConnectTimeout int `yaml:"connectTimeout"` // CallTimeout is the per-call timeout (in milliseconds) for communicating with the Vega node gRPC endpoint. CallTimeout int `yaml:"callTimeout"` // InstrumentBase is the base asset of the instrument. InstrumentBase string `yaml:"instrumentBase"` // InstrumentQuote is the quote asset of the instrument. InstrumentQuote string `yaml:"instrumentQuote"` // Strategy specifies which algorithm the bot is to use. Strategy string `yaml:"strategy"` // StrategyDetails contains the parameters needed by the strategy algorithm. StrategyDetails Strategy `yaml:"strategyDetails"` // Additional metadata filters for the selecting markets MetadataFilters []string `yaml:"metadataFilters"` }
BotConfig specifies the configuration parameters for one bot, which talks to one market on one Vega node.
type Config ¶
type Config struct { Server *ServerConfig `yaml:"server"` Pricing *PricingConfig `yaml:"pricing"` Wallet *WalletConfig `yaml:"wallet"` Bots []BotConfig `yaml:"bots"` }
Config describes the top level config file format.
type LimitOrderDistParams ¶ added in v0.37.0
type LimitOrderDistParams struct { Method string `yaml:"method"` GttLength uint64 `yaml:"gttLengthSeconds"` TgtTimeHorizonHours float64 `yaml:"tgtTimeHorizonHours"` NumTicksFromMid uint64 `yaml:"numTicksFromMid"` NumIdenticalBots int `yaml:"numIdenticalBots"` }
LimitOrderDistParams for configuring the way price steering orders are sent.
type LiquidityOrder ¶
type LiquidityOrder struct { Reference string `yaml:"reference"` Proportion uint32 `yaml:"proportion"` Offset string `yaml:"offset"` }
LiquidityOrder describes ...
type PricingConfig ¶
PricingConfig describes the settings for contacting the price proxy.
type ServerConfig ¶
ServerConfig describes the settings for running the liquidity bot.
type Shape ¶
type Shape struct { Sells []LiquidityOrder `yaml:"sells"` Buys []LiquidityOrder `yaml:"buys"` }
Shape describes the buy and sell sides of a Liquidity Provision instruction.
type Strategy ¶
type Strategy struct { ExpectedMarkPrice Uint `yaml:"expectedMarkPrice"` AuctionVolume Uint `yaml:"auctionVolume"` MaxLong Uint `yaml:"maxLong"` MaxShort Uint `yaml:"maxShort"` PosManagementFraction float64 `yaml:"posManagementFraction"` StakeFraction float64 `yaml:"stakeFraction"` OrdersFraction float64 `yaml:"ordersFraction"` CommitmentFraction float64 `yaml:"commitmentFraction"` Fee string `yaml:"fee"` PosManagementSleepMilliseconds int `yaml:"posManagementSleepMilliseconds"` MarketPriceSteeringRatePerSecond float64 `yaml:"marketPriceSteeringRatePerSecond"` MinPriceSteerFraction float64 `yaml:"minPriceSteerFraction"` PriceSteerOrderScale float64 `yaml:"priceSteerOrderScale"` LimitOrderDistributionParams LimitOrderDistParams `yaml:"limitOrderDistributionParams"` TargetLNVol float64 `yaml:"targetLNVol"` ShorteningShape Shape `yaml:"shorteningShape"` LongeningShape Shape `yaml:"longeningShape"` }
Strategy describes parameters for the bot's strategy.
type Uint ¶ added in v0.41.0
type Uint struct {
// contains filtered or unexported fields
}
Uint is for storing a num.Uint as a string in a config file.
func (Uint) MarshalText ¶ added in v0.41.0
MarshalText converts a Uint to a string.
func (*Uint) UnmarshalText ¶ added in v0.41.0
UnmarshalText converts a string to a nun.Uint.
type WalletConfig ¶
WalletConfig describes the settings for running an internal wallet server.