Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Campaign ¶
type Campaign struct { ID int `storm:"id,increment" json:"id"` Provider string `storm:"index" json:"provider"` ProviderRef string `json:"provider_ref"` ProductID string `storm:"index" json:"product_id"` Volume float64 `json:"volume"` BuyLimit float64 `json:"buy_limit"` SellLimit float64 `json:"sell_limit"` SellLimitUnit string `json:"sell_limit_unit"` CreatedAt std.DateTime `json:"created_at"` UpdatedAt std.DateTime `json:"updated_at"` BuyOrder *Order `json:"buy_order"` SellOrder *Order `json:"sell_order"` Orders []*Order `json:"orders"` State CampaignState `storm:"index" json:"state"` SellAlgorithm string `json:"sell_algorithm"` SellAlgorithmOptions map[string]interface{} `json:"sell_algorithm_options"` BuyAlgorithm string `json:"buy_algorithm"` BuyAlgorithmOptions map[string]interface{} `json:"buy_algorithm_options"` }
Campaign struct
func (Campaign) IsState ¶
func (c Campaign) IsState(state CampaignState) bool
IsState check if this state is eq to state param
type CampaignState ¶
type CampaignState string
CampaignState type
const ( CampaignStateSell CampaignState = "sell" CampaignStateSelling CampaignState = "selling" CampaignStateBuy CampaignState = "buy" CampaignStateBuying CampaignState = "buying" )
CampaignState enum
type Order ¶
type Order struct { Provider string `json:"provider"` ID int `storm:"id,increment" json:"id"` TradeID string `json:"trade_id"` Side exchanges.SideType `json:"side"` Size float64 `json:"size"` ProductID string `json:"product_id"` Price float64 `json:"price"` CreatedAt std.DateTime `json:"created_at"` UpdatedAt std.DateTime `json:"updated_at"` DeletedAt std.DateTime `json:"deleted_at"` }
Order struct
func (Order) GetBuyingMarketPrice ¶
GetBuyingMarketPrice func
func (Order) GetCurrentPrice ¶
GetCurrentPrice from market price
func (Order) GetMarginInCurrency ¶
GetMarginInCurrency from market price
func (Order) GetMarginInPercent ¶
GetMarginInPercent from market price
type User ¶
type User struct { ID int `storm:"id" json:"id"` Email string `storm:"email" json:"email"` FirstName std.String `storm:"firstname" json:"firstname,omitempty"` LastName std.String `storm:"lastname" json:"lastname,omitempty"` NickName string `storm:"nickname" json:"nickname"` UserName string `storm:"username" json:"username"` Password string `storm:"password" json:"-"` Salt string `storm:"salt" json:"salt"` IsEnabled bool `storm:"enabled" json:"enabled"` IsExpired bool `storm:"expired" json:"expired"` IsLocked bool `storm:"locked" json:"locked"` Timezone std.String `storm:"timezone" json:"timezone,omitempty"` Locale std.String `storm:"locale" json:"locale,omitempty"` CreatedAt std.DateTime `storm:"created_at" json:"created_at"` UpdatedAt std.DateTime `storm:"updated_at" json:"updated_at"` DeletedAt std.DateTime `storm:"deleted_at" json:"deleted_at"` }
User struct