exproc

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

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

func NewFinder

func NewFinder(cli *chatexsdk.Client, collector *chatex.OrdersCollector, tradeOpts *chatex.TradeOpts, sender Sender) *Finder

func (*Finder) OnSnapshot

func (f *Finder) OnSnapshot(snap chatex.OrdersSnapshot)

type OrderCalc added in v0.3.1

type OrderCalc struct {
	MidAmount1  decimal.Decimal
	MidAmount2  decimal.Decimal
	MidAmount   decimal.Decimal
	StartAmount decimal.Decimal
	NextAmount  decimal.Decimal
	LastAmount  decimal.Decimal

	MaxStartAmount *decimal.Decimal
	StartCoin      chatexsdk.Coin
	NextCoin       chatexsdk.Coin
}

func (OrderCalc) CalcTrades added in v0.3.1

func (o OrderCalc) CalcTrades(order1, order2 chatexsdk.Order) OrderCalc

calcOrders calculates amounts to do trades with order1, and then with order2.

order1 allows to exchange start -> next. order2 allows to exchange next -> start.

order1 => next/start order2 => start/next

Order X/Y allows to buy X, and sell Y. order.Amount is the maximum X amount can buy. order.Rate is how much Y you need to sell to get one X.

type Pair added in v0.3.1

type Pair struct {
	Buy  string
	Sell string
}

type Sender

type Sender interface {
	Send(text string)
}

Jump to

Keyboard shortcuts

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