Documentation ¶
Index ¶
- func ConvertSignedBundle(sb *wallet.SignedBundle) *proto.SignedBundle
- func DiscreteThreeLevelProbabilities(V []float64, muHat float64, sigmaHat float64) ([]float64, error)
- func GeneratePriceUsingDiscreteThreeLevel(M0, delta, sigma, tgtTimeHorizonYrFrac, N float64) (price float64, err error)
- type Bot
- type LODParamsConfig
- type Node
- type PricingEngine
- type ShapeConfig
- type SteeringMethod
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertSignedBundle ¶
func ConvertSignedBundle(sb *wallet.SignedBundle) *proto.SignedBundle
ConvertSignedBundle converts from trading-core.wallet.SignedBundle to trading-core.proto.api.SignedBundle
func DiscreteThreeLevelProbabilities ¶ added in v0.37.0
func DiscreteThreeLevelProbabilities(V []float64, muHat float64, sigmaHat float64) ([]float64, error)
DiscreteThreeLevelProbabilities is a method for calculating price levels
func GeneratePriceUsingDiscreteThreeLevel ¶ added in v0.37.0
func GeneratePriceUsingDiscreteThreeLevel(M0, delta, sigma, tgtTimeHorizonYrFrac, N float64) (price float64, err error)
GeneratePriceUsingDiscreteThreeLevel is a method for calculating price levels input is a float price (so divide uint64 price by 10^{num of decimals}) it returns a float price which you want to multiply by 10^{num of decimals} and then round
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot represents one Normal liquidity bot.
func New ¶
func New(config config.BotConfig, pe PricingEngine, ws wallet.WalletHandler) (b *Bot, err error)
New returns a new instance of Bot.
func (*Bot) GetRealisticOrderDetails ¶ added in v0.37.0
GetRealisticOrderDetails uses magic to return a realistic order price and size
func (*Bot) GetTraderDetails ¶ added in v0.36.0
GetTraderDetails returns information relating to the trader
type LODParamsConfig ¶
type LODParamsConfig struct { Method SteeringMethod GttLength uint64 TgtTimeHorizonHours float64 NumTicksFromMid uint64 NumIdenticalBots int }
LODParamsConfig is a little data structure which sets the algo and params for how limits orders are generated.
type Node ¶
type Node interface { GetAddress() (url.URL, error) // Trading SubmitTransaction(req *api.SubmitTransactionRequest) (resp *api.SubmitTransactionResponse, err error) // Trading Data GetVegaTime() (time.Time, error) LiquidityProvisions(req *api.LiquidityProvisionsRequest) (response *api.LiquidityProvisionsResponse, err error) MarketByID(req *api.MarketByIDRequest) (response *api.MarketByIDResponse, err error) MarketDataByID(req *api.MarketDataByIDRequest) (response *api.MarketDataByIDResponse, err error) PartyAccounts(req *api.PartyAccountsRequest) (response *api.PartyAccountsResponse, err error) PositionsByParty(req *api.PositionsByPartyRequest) (response *api.PositionsByPartyResponse, err error) AssetByID(assetID string) (response *api.AssetByIDResponse, err error) // Events ObserveEventBus() (stream api.TradingDataService_ObserveEventBusClient, err error) PositionsSubscribe(req *api.PositionsSubscribeRequest) (stream api.TradingDataService_PositionsSubscribeClient, err error) }
Node is a Vega gRPC node
type PricingEngine ¶
type PricingEngine interface {
GetPrice(pricecfg ppconfig.PriceConfig) (pi ppservice.PriceResponse, err error)
}
PricingEngine is the source of price information from the price proxy.
type ShapeConfig ¶
type ShapeConfig struct { Sells []*proto.LiquidityOrder Buys []*proto.LiquidityOrder }
ShapeConfig is the top level definition of a liquidity shape
type SteeringMethod ¶ added in v0.37.0
type SteeringMethod int
SteeringMethod is an enum for all the possible price calculations methods for price steering
const ( // NotSet for when we cannot parse the input string NotSet SteeringMethod = iota // DiscreteThreeLevel uses the discrete three level method DiscreteThreeLevel // CoinAndBinomial uses the coin and binomial method CoinAndBinomial )
type Strategy ¶
type Strategy struct { // ExpectedMarkPrice (optional) specifies the expected mark price for a market that may not yet // have a mark price. It is used to calculate margin cost of orders meeting liquidity // requirement. ExpectedMarkPrice uint64 // AuctionVolume ... AuctionVolume uint64 // CommitmentFraction is the fractional amount of stake for the LP CommitmentFraction float64 // Fee is the 0->1 fee for supplying liquidity Fee float64 // MaxLong specifies the maximum long position that the bot will tolerate. MaxLong uint64 // MaxShort specifies the maximum short position that the bot will tolerate. MaxShort uint64 // PosManagementFraction controls the size of market orders used to manage the bot's position. PosManagementFraction float64 // StakeFraction (along with OrdersFraction) is used in rule-of-thumb heuristics to decide how // the bot should deploy collateral. StakeFraction float64 // OrdersFraction (along with StakeFraction) is used in rule-of-thumb heuristics to decide how // the bot should deploy collateral. OrdersFraction float64 // ShorteningShape (which includes both sides of the book) specifies the shape used when the bot // is trying to shorten its position. ShorteningShape *ShapeConfig // LongeningShape (which includes both sides of the book) specifies the shape used when the bot // is trying to lengthen its position. Note that the initial shape used by the bot is always the // longening shape, because being long is a little cheaper in position margin than being short. LongeningShape *ShapeConfig // PosManagementSleepMilliseconds is the sleep time, in milliseconds, between position management PosManagementSleepMilliseconds uint64 // MarketPriceSteeringRatePerSecond ... MarketPriceSteeringRatePerSecond float64 // MinPriceSteerFraction is the minimum difference between external and current price that will // allow a price steering order to be placed. MinPriceSteerFraction float64 // PriceSteerOrderScale is the scaling factor used when placing a steering order PriceSteerOrderScale float64 // LimitOrderDistributionParams ... LimitOrderDistributionParams *LODParamsConfig // TargetLNVol specifies the target log-normal volatility (e.g. 0.5 for 50%). TargetLNVol float64 }
Strategy configures the normal strategy.