xarb

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XArb

type XArb struct {
	strategy.StrategyActorBase

	// Algo parameters
	Side              common.Side
	ProfitBps         float64
	Qty               float64
	PriceToleranceBps float64
	OrderTTLNs        uint64
	// contains filtered or unexported fields
}

XArb is a cross-exchange arbitrage strategy.

func NewXArb

func NewXArb(catalog *catalog.Catalog, msgbus *msgbus.MsgBus, cache *cache.Cache) *XArb

NewXArb creates a new XArb strategy.

func (*XArb) Handle

func (x *XArb) Handle(ev msgbus.Event, bus *msgbus.MsgBus)

Handle overrides StrategyBase.Handle to dispatch events to XArb's typed callbacks. This is necessary because Go doesn't have virtual method dispatch.

func (*XArb) OnDepthUpdate

func (x *XArb) OnDepthUpdate(update event.DepthUpdate)

func (*XArb) OnExecution

func (x *XArb) OnExecution(exec event.Execution)

func (*XArb) OnInit

func (x *XArb) OnInit(config map[string]any)

OnInit initializes the strategy with configuration.

func (*XArb) OnOrderAccepted

func (x *XArb) OnOrderAccepted(orderAccepted event.OrderAccepted)

func (*XArb) OnOrderCanceled

func (x *XArb) OnOrderCanceled(orderCanceled event.OrderCanceled)

func (*XArb) OnOrderError

func (x *XArb) OnOrderError(orderError event.OrderError)

func (*XArb) OnOrderFilled

func (x *XArb) OnOrderFilled(orderFilled event.OrderFilled)

func (*XArb) OnOrderNew

func (x *XArb) OnOrderNew(orderNew event.OrderNew)

func (*XArb) OnOrderRejected

func (x *XArb) OnOrderRejected(orderRejected event.OrderRejected)

func (*XArb) OnOrderRiskInvalid

func (x *XArb) OnOrderRiskInvalid(orderRiskInvalid event.OrderRiskInvalid)

func (*XArb) OnStart

func (x *XArb) OnStart()

func (*XArb) OnStop

func (x *XArb) OnStop()

OnStop is called when the strategy stops.

type XArbConfig

type XArbConfig struct {
	QuotingSymbolUniversalTicker string `yaml:"quoting_symbol_universal_ticker"`
	HedgingSymbolUniversalTicker string `yaml:"hedging_symbol_universal_ticker"`

	// Wallet configuration for trading
	// QuotingWallet is the wallet used for placing quotes (making markets)
	QuotingWallet string `yaml:"quoting_wallet,omitempty"`
	// HedgingWallet is the wallet used for hedging trades
	HedgingWallet string `yaml:"hedging_wallet,omitempty"`

	// Algo parameters
	Side              string  `yaml:"side"`
	ProfitBps         float64 `yaml:"profit_bps"`
	Qty               float64 `yaml:"qty"`
	PriceToleranceBps float64 `yaml:"price_tolerance_bps"`
	OrderTTL          string  `yaml:"order_ttl,omitempty"`
}

XArbConfig contains strategy-specific configuration for the XArb strategy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址