ftx: replace query markets api

This commit is contained in:
c9s 2022-03-02 14:41:13 +08:00
parent 883f0ed83a
commit e9e1127d3e
2 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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"`