From 008d2a9418cc598c2066d3c656ec33c6f719cf09 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Fri, 31 Dec 2021 15:18:58 +1100 Subject: [PATCH] ftx: add greek field support for GetFutureStats function (#864) * ftx: update with greeks @romano thankyou * ftx: fix nits --- exchanges/ftx/ftx_test.go | 9 +++++++++ exchanges/ftx/ftx_types.go | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/exchanges/ftx/ftx_test.go b/exchanges/ftx/ftx_test.go index d5032e6a..5e5dda5b 100644 --- a/exchanges/ftx/ftx_test.go +++ b/exchanges/ftx/ftx_test.go @@ -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) { diff --git a/exchanges/ftx/ftx_types.go b/exchanges/ftx/ftx_types.go index 6f7e789f..d9124935 100644 --- a/exchanges/ftx/ftx_types.go +++ b/exchanges/ftx/ftx_types.go @@ -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