From 38daeea11248d01fa5c8584ecb314b21b1150be6 Mon Sep 17 00:00:00 2001 From: Henk van Ramshorst Date: Wed, 19 Jun 2024 14:26:19 +0100 Subject: [PATCH 1/3] add instrument_type field to instrument --- models/instrument.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/instrument.go b/models/instrument.go index 09712e0..567ad64 100644 --- a/models/instrument.go +++ b/models/instrument.go @@ -10,6 +10,7 @@ type Instrument struct { Kind string `json:"kind"` IsActive bool `json:"is_active"` InstrumentName string `json:"instrument_name"` + InstrumentType string `json:"instrument_type"` ExpirationTimestamp int64 `json:"expiration_timestamp"` CreationTimestamp int64 `json:"creation_timestamp"` ContractSize float64 `json:"contract_size"` From 757ae83e8618ee82465877b154f84b84d819e940 Mon Sep 17 00:00:00 2001 From: Henk van Ramshorst Date: Wed, 19 Jun 2024 15:37:14 +0100 Subject: [PATCH 2/3] add get_index_price endpoint --- api_market.go | 5 +++++ models/get_index_price_params.go | 5 +++++ models/get_index_price_response.go | 6 ++++++ 3 files changed, 16 insertions(+) create mode 100644 models/get_index_price_params.go create mode 100644 models/get_index_price_response.go diff --git a/api_market.go b/api_market.go index 78c2cac..eae66ad 100644 --- a/api_market.go +++ b/api_market.go @@ -37,6 +37,11 @@ func (c *Client) GetIndex(params *models.GetIndexParams) (result models.GetIndex return } +func (c *Client) GetIndexPrice(params *models.GetIndexPriceParams) (result models.GetIndexPriceResponse, err error) { + err = c.Call("public/get_index_price", params, &result) + return +} + func (c *Client) GetInstruments(params *models.GetInstrumentsParams) (result []models.Instrument, err error) { err = c.Call("public/get_instruments", params, &result) return diff --git a/models/get_index_price_params.go b/models/get_index_price_params.go new file mode 100644 index 0000000..0c40571 --- /dev/null +++ b/models/get_index_price_params.go @@ -0,0 +1,5 @@ +package models + +type GetIndexPriceParams struct { + IndexName string `json:"index_name"` +} diff --git a/models/get_index_price_response.go b/models/get_index_price_response.go new file mode 100644 index 0000000..3cff36f --- /dev/null +++ b/models/get_index_price_response.go @@ -0,0 +1,6 @@ +package models + +type GetIndexPriceResponse struct { + EstimatedDeliveryPrice float64 `json:"estimated_delivery_price"` + IndexPrice float64 `json:"index_price"` +} From 81d54675036f79f75dc790f26a8975eabf22fb7f Mon Sep 17 00:00:00 2001 From: Henk van Ramshorst Date: Wed, 19 Jun 2024 15:43:51 +0100 Subject: [PATCH 3/3] add price_index field to instrument --- models/instrument.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/instrument.go b/models/instrument.go index 567ad64..06cb57b 100644 --- a/models/instrument.go +++ b/models/instrument.go @@ -11,6 +11,7 @@ type Instrument struct { IsActive bool `json:"is_active"` InstrumentName string `json:"instrument_name"` InstrumentType string `json:"instrument_type"` + PriceIndex string `json:"price_index"` ExpirationTimestamp int64 `json:"expiration_timestamp"` CreationTimestamp int64 `json:"creation_timestamp"` ContractSize float64 `json:"contract_size"`