plugins

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exchanges

func Exchanges() map[string]string

Exchanges returns the list of exchanges along with the description

func MakeExchange

func MakeExchange(exchangeType string) api.Exchange

MakeExchange is a factory method to make an exchange based on a given type

func MakeFeedPair

func MakeFeedPair(dataTypeA, dataFeedAUrl, dataTypeB, dataFeedBUrl string) *api.FeedPair

MakeFeedPair is the factory method that we expose

func MakePriceFeed

func MakePriceFeed(feedType string, url string) api.PriceFeed

MakePriceFeed makes a PriceFeed

func MakeStrategy

func MakeStrategy(
	sdex *SDEX,
	assetBase *horizon.Asset,
	assetQuote *horizon.Asset,
	strategy string,
	stratConfigPath string,
) api.Strategy

MakeStrategy makes a strategy

func Strategies

func Strategies() map[string]StrategyContainer

Strategies returns the list of strategies along with metadata

Types

type SDEX

type SDEX struct {
	API                         *horizon.Client
	SourceAccount               string
	TradingAccount              string
	SourceSeed                  string
	TradingSeed                 string
	Network                     build.Network
	FractionalReserveMultiplier int8
	// contains filtered or unexported fields
}

SDEX helps with building and submitting transactions to the Stellar network

func MakeSDEX

func MakeSDEX(
	api *horizon.Client,
	sourceSeed string,
	tradingSeed string,
	sourceAccount string,
	tradingAccount string,
	network build.Network,
	fractionalReserveMultiplier int8,
	operationalBuffer float64,
	simMode bool,
) *SDEX

MakeSDEX is a factory method for SDEX

func (*SDEX) CreateBuyOffer

func (sdex *SDEX) CreateBuyOffer(base horizon.Asset, counter horizon.Asset, price float64, amount float64) *build.ManageOfferBuilder

CreateBuyOffer creates a buy offer

func (*SDEX) CreateSellOffer

func (sdex *SDEX) CreateSellOffer(base horizon.Asset, counter horizon.Asset, price float64, amount float64) *build.ManageOfferBuilder

CreateSellOffer creates a sell offer

func (*SDEX) DeleteAllOffers

func (sdex *SDEX) DeleteAllOffers(offers []horizon.Offer) []build.TransactionMutator

DeleteAllOffers is a helper that accumulates delete operations for the passed in offers

func (*SDEX) DeleteOffer

func (sdex *SDEX) DeleteOffer(offer horizon.Offer) build.ManageOfferBuilder

DeleteOffer returns the op that needs to be submitted to the network in order to delete the passed in offer

func (*SDEX) ModifyBuyOffer

func (sdex *SDEX) ModifyBuyOffer(offer horizon.Offer, price float64, amount float64) *build.ManageOfferBuilder

ModifyBuyOffer modifies a buy offer

func (*SDEX) ModifySellOffer

func (sdex *SDEX) ModifySellOffer(offer horizon.Offer, price float64, amount float64) *build.ManageOfferBuilder

ModifySellOffer modifies a sell offer

func (*SDEX) ParseOfferAmount

func (sdex *SDEX) ParseOfferAmount(amt string) (float64, error)

ParseOfferAmount is a convenience method to parse an offer amount

func (*SDEX) ResetCachedXlmExposure

func (sdex *SDEX) ResetCachedXlmExposure()

ResetCachedXlmExposure resets the cache

func (*SDEX) SubmitOps

func (sdex *SDEX) SubmitOps(ops []build.TransactionMutator) error

SubmitOps submits the passed in operations to the network asynchronously in a single transaction

type StrategyContainer

type StrategyContainer struct {
	SortOrder   uint8
	Description string
	NeedsConfig bool
	Complexity  string
	// contains filtered or unexported fields
}

StrategyContainer contains the strategy factory method along with some metadata

Jump to

Keyboard shortcuts

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