package sentio import ( "context" "errors" ) 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) (Order, error) Sell(ctx context.Context, symbol string, ratio float64) (Order, error) CancelOrder(id string) error Orders() ([]Order, error) Portfolio() (Portfolio, error) PortfolioHistory() ([]PortfolioRecord, error) Cash() (float64, error) Equity() (float64, error) MaxBudget() float64 }