Documentation ¶
Index ¶
- func Exchanges() map[string]string
- func MakeExchange(exchangeType string) (api.Exchange, error)
- func MakeFeedPair(dataTypeA, dataFeedAUrl, dataTypeB, dataFeedBUrl string) (*api.FeedPair, error)
- func MakePriceFeed(feedType string, url string) (api.PriceFeed, error)
- func MakeStrategy(sdex *SDEX, assetBase *horizon.Asset, assetQuote *horizon.Asset, ...) (api.Strategy, error)
- func Strategies() map[string]StrategyContainer
- type Balance
- type Liabilities
- type SDEX
- func (sdex *SDEX) AddLiabilities(selling horizon.Asset, buying horizon.Asset, incrementalSell float64, ...)
- func (sdex *SDEX) AvailableCapacity(asset horizon.Asset, incrementalNativeAmountRaw float64) (*Liabilities, error)
- func (sdex *SDEX) ComputeIncrementalNativeAmountRaw(isNewOffer bool) float64
- func (sdex *SDEX) CreateBuyOffer(base horizon.Asset, counter horizon.Asset, price float64, amount float64, ...) (*build.ManageOfferBuilder, error)
- func (sdex *SDEX) CreateSellOffer(base horizon.Asset, counter horizon.Asset, price float64, amount float64, ...) (*build.ManageOfferBuilder, error)
- func (sdex *SDEX) DeleteAllOffers(offers []horizon.Offer) []build.TransactionMutator
- func (sdex *SDEX) DeleteOffer(offer horizon.Offer) build.ManageOfferBuilder
- func (sdex *SDEX) LogAllLiabilities(assetBase horizon.Asset, assetQuote horizon.Asset)
- func (sdex *SDEX) ModifyBuyOffer(offer horizon.Offer, price float64, amount float64, ...) (*build.ManageOfferBuilder, error)
- func (sdex *SDEX) ModifySellOffer(offer horizon.Offer, price float64, amount float64, ...) (*build.ManageOfferBuilder, error)
- func (sdex *SDEX) ParseOfferAmount(amt string) (float64, error)
- func (sdex *SDEX) RecomputeAndLogCachedLiabilities(assetBase horizon.Asset, assetQuote horizon.Asset)
- func (sdex *SDEX) ResetCachedBalances()
- func (sdex *SDEX) ResetCachedLiabilities(assetBase horizon.Asset, assetQuote horizon.Asset) error
- func (sdex *SDEX) SubmitOps(ops []build.TransactionMutator, asyncCallback func(hash string, e error)) error
- type StrategyContainer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeExchange ¶
MakeExchange is a factory method to make an exchange based on a given type
func MakeFeedPair ¶
MakeFeedPair is the factory method that we expose
func MakePriceFeed ¶
MakePriceFeed makes a PriceFeed
func MakeStrategy ¶
func MakeStrategy( sdex *SDEX, assetBase *horizon.Asset, assetQuote *horizon.Asset, strategy string, stratConfigPath string, ) (api.Strategy, error)
MakeStrategy makes a strategy
func Strategies ¶
func Strategies() map[string]StrategyContainer
Strategies returns the list of strategies along with metadata
Types ¶
type Liabilities ¶
type Liabilities struct { Buying float64 // affects how much more can be bought Selling float64 // affects how much more can be sold }
Liabilities represents the "committed" units of an asset on both the buy and sell sides
type SDEX ¶
type SDEX struct { API *horizon.Client SourceAccount string TradingAccount string SourceSeed string TradingSeed string Network build.Network // 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, operationalBuffer float64, simMode bool, ) *SDEX
MakeSDEX is a factory method for SDEX
func (*SDEX) AddLiabilities ¶
func (sdex *SDEX) AddLiabilities(selling horizon.Asset, buying horizon.Asset, incrementalSell float64, incrementalBuy float64, incrementalNativeAmountRaw float64)
AddLiabilities updates the cached liabilities, units are in their respective assets
func (*SDEX) AvailableCapacity ¶
func (sdex *SDEX) AvailableCapacity(asset horizon.Asset, incrementalNativeAmountRaw float64) (*Liabilities, error)
AvailableCapacity returns the buying and selling amounts available for a given asset
func (*SDEX) ComputeIncrementalNativeAmountRaw ¶
ComputeIncrementalNativeAmountRaw returns the native amount that will be added to liabilities because of fee and min-reserve additions
func (*SDEX) CreateBuyOffer ¶
func (sdex *SDEX) CreateBuyOffer(base horizon.Asset, counter horizon.Asset, price float64, amount float64, incrementalNativeAmountRaw float64) (*build.ManageOfferBuilder, error)
CreateBuyOffer creates a buy offer
func (*SDEX) CreateSellOffer ¶
func (sdex *SDEX) CreateSellOffer(base horizon.Asset, counter horizon.Asset, price float64, amount float64, incrementalNativeAmountRaw float64) (*build.ManageOfferBuilder, error)
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) LogAllLiabilities ¶
LogAllLiabilities logs the liabilities for the two assets along with the native asset
func (*SDEX) ModifyBuyOffer ¶
func (sdex *SDEX) ModifyBuyOffer(offer horizon.Offer, price float64, amount float64, incrementalNativeAmountRaw float64) (*build.ManageOfferBuilder, error)
ModifyBuyOffer modifies a buy offer
func (*SDEX) ModifySellOffer ¶
func (sdex *SDEX) ModifySellOffer(offer horizon.Offer, price float64, amount float64, incrementalNativeAmountRaw float64) (*build.ManageOfferBuilder, error)
ModifySellOffer modifies a sell offer
func (*SDEX) ParseOfferAmount ¶
ParseOfferAmount is a convenience method to parse an offer amount
func (*SDEX) RecomputeAndLogCachedLiabilities ¶
func (sdex *SDEX) RecomputeAndLogCachedLiabilities(assetBase horizon.Asset, assetQuote horizon.Asset)
RecomputeAndLogCachedLiabilities clears the cached liabilities and recomputes from the network before logging
func (*SDEX) ResetCachedBalances ¶
func (sdex *SDEX) ResetCachedBalances()
ResetCachedBalances resets the cached balances map
func (*SDEX) ResetCachedLiabilities ¶
ResetCachedLiabilities resets the cache to include only the two assets passed in
Source Files ¶
- balancedLevelProvider.go
- balancedStrategy.go
- buysellStrategy.go
- ccxtExchange.go
- cmcFeed.go
- composeStrategy.go
- deleteSideStrategy.go
- deleteStrategy.go
- exchangeFeed.go
- factory.go
- fiatFeed.go
- fixedFeed.go
- krakenExchange.go
- mirrorStrategy.go
- priceFeed.go
- sdex.go
- sellSideStrategy.go
- sellStrategy.go
- staticSpreadLevelProvider.go