package sentio import ( "context" "errors" "time" ) var ( ErrMarketClosed = errors.New("market is closed") ErrTooSmallOrder = errors.New("too small order size") ) type Market interface { Connect(done chan struct{}) (chan MarketConnection, error) Subscribe(symbol string) error IsMarketOpened() bool Time() Clock Buy(ctx context.Context, symbol string, ratio float64) (float64, Order, error) Sell(ctx context.Context, symbol string, ratio float64) (float64, Order, error) CancelOrder(id string) error Orders() ([]Order, error) Portfolio() (Portfolio, error) PortfolioHistory() ([]PortfolioRecord, error) HistoricalBars(symbol string, interval time.Duration, from *time.Time) ([]Bar, error) Quote(symbol string) (*Quote, error) Account() (MarketAccount, error) MaxBudget() float64 Cooldown() uint8 }