trader

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const XLM = "XLM"

Variables

This section is empty.

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	SOURCE_SECRET_SEED    string `valid:"-"`
	TRADING_SECRET_SEED   string `valid:"-"`
	ASSET_CODE_A          string `valid:"-"`
	ISSUER_A              string `valid:"-"`
	ASSET_CODE_B          string `valid:"-"`
	ISSUER_B              string `valid:"-"`
	TICK_INTERVAL_SECONDS int32  `valid:"-"`
	HORIZON_URL           string `valid:"-"`
	// contains filtered or unexported fields
}

BotConfig represents the configuration params for the bot

func (*BotConfig) AssetBase

func (b *BotConfig) AssetBase() horizon.Asset

AssetBase returns the config's assetBase

func (*BotConfig) AssetQuote

func (b *BotConfig) AssetQuote() horizon.Asset

AssetQuote returns the config's assetQuote

func (*BotConfig) Init

func (b *BotConfig) Init() error

Init initializes this config

func (*BotConfig) SourceAccount

func (b *BotConfig) SourceAccount() string

SourceAccount returns the config's source account

func (BotConfig) String

func (b BotConfig) String() string

String impl.

func (*BotConfig) TradingAccount

func (b *BotConfig) TradingAccount() string

TradingAccount returns the config's trading account

type Trader

type Trader struct {
	// contains filtered or unexported fields
}

Trader represents a market making bot, which is composed of various parts include the strategy and various APIs.

func MakeBot

func MakeBot(
	api *horizon.Client,
	assetBase horizon.Asset,
	assetQuote horizon.Asset,
	tradingAccount string,
	sdex *plugins.SDEX,
	strat api.Strategy,
	tickIntervalSeconds int32,
	dataKey *model.BotKey,
) *Trader

MakeBot is the factory method for the Trader struct

func (*Trader) Start

func (t *Trader) Start()

Start starts the bot with the injected strategy

Jump to

Keyboard shortcuts

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