ftx: add greek field support for GetFutureStats function (#864)

* ftx: update with greeks @romano thankyou

* ftx: fix nits
This commit is contained in:
Ryan O'Hara-Reid
2021-12-31 15:18:58 +11:00
committed by GitHub
parent b2797b181a
commit 008d2a9418
2 changed files with 14 additions and 0 deletions

View File

@@ -230,6 +230,15 @@ func TestGetFutureStats(t *testing.T) {
if err != nil {
t.Error(err)
}
future, err := f.GetFutureStats(context.Background(), "BTC-MOVE-2021Q4")
if err != nil {
t.Error(err)
}
if future.Greeks == nil {
t.Fatal("no greeks returned for futures contract")
}
}
func TestGetFundingRates(t *testing.T) {

View File

@@ -163,6 +163,11 @@ type FutureStatsData struct {
PredictedExpirationPrice float64 `json:"predictedExpirationPrice"`
OpenInterest float64 `json:"openInterest"`
StrikePrice float64 `json:"strikePrice"`
Greeks *struct {
ImpliedVolatility float64 `json:"impliedVolatility"`
Delta float64 `json:"delta"`
Gamma float64 `json:"gamma"`
} `json:"greeks"`
}
// FundingRatesData stores data on funding rates