mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
ftx: replace query markets api
This commit is contained in:
parent
883f0ed83a
commit
e9e1127d3e
|
@ -126,16 +126,14 @@ func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) {
|
|||
}
|
||||
|
||||
func (e *Exchange) _queryMarkets(ctx context.Context) (MarketMap, error) {
|
||||
resp, err := e.newRest().Markets(ctx)
|
||||
req := e.client.NewGetMarketsRequest()
|
||||
ftxMarkets,err := req.Do(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !resp.Success {
|
||||
return nil, fmt.Errorf("ftx returns querying markets failure")
|
||||
}
|
||||
|
||||
markets := MarketMap{}
|
||||
for _, m := range resp.Result {
|
||||
for _, m := range ftxMarkets {
|
||||
symbol := toGlobalSymbol(m.Name)
|
||||
symbolMap[symbol] = m.Name
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ type Market struct {
|
|||
Underlying string `json:"underlying"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Ask fixedpoint.Value `json:"ask"`
|
||||
Bid int `json:"bid"`
|
||||
Bid fixedpoint.Value `json:"bid"`
|
||||
Last fixedpoint.Value `json:"last"`
|
||||
PostOnly bool `json:"postOnly"`
|
||||
Price fixedpoint.Value `json:"price"`
|
||||
|
|
Loading…
Reference in New Issue
Block a user