mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 23:16:53 +00:00
exchanges: Use singular futures settlement currency (#2092)
* Change settlement to singular currency * whoops.go * bitmex fix * minor updates * 64 divided by 2 * whoops2.go * ROBOT ROCK Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ROCK ROCK ROCK ROCK ROBOT Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * shazNit * currencies unmarshal and code use * Update currency/currencies.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/btse/btse_wrapper.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * reuse comment for better clarity * collapses entire thing * shazLint --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
This commit is contained in:
@@ -192,31 +192,31 @@ type IndexPriceData struct {
|
||||
|
||||
// InstrumentData gets data for instruments
|
||||
type InstrumentData struct {
|
||||
InstrumentName string `json:"instrument_name"`
|
||||
BaseCurrency string `json:"base_currency"`
|
||||
Kind string `json:"kind"`
|
||||
OptionType string `json:"option_type"`
|
||||
QuoteCurrency string `json:"quote_currency"`
|
||||
BlockTradeCommission float64 `json:"block_trade_commission"`
|
||||
ContractSize float64 `json:"contract_size"`
|
||||
CreationTimestamp types.Time `json:"creation_timestamp"`
|
||||
ExpirationTimestamp types.Time `json:"expiration_timestamp"`
|
||||
IsActive bool `json:"is_active"`
|
||||
Leverage float64 `json:"leverage"`
|
||||
MaxLeverage float64 `json:"max_leverage"`
|
||||
MakerCommission float64 `json:"maker_commission"`
|
||||
MinimumTradeAmount float64 `json:"min_trade_amount"`
|
||||
TickSize float64 `json:"tick_size"`
|
||||
TakerCommission float64 `json:"taker_commission"`
|
||||
Strike float64 `json:"strike"`
|
||||
SettlementPeriod string `json:"settlement_period"`
|
||||
SettlementCurrency string `json:"settlement_currency"`
|
||||
RequestForQuote bool `json:"rfq"`
|
||||
PriceIndex string `json:"price_index"`
|
||||
InstrumentID int64 `json:"instrument_id"`
|
||||
CounterCurrency string `json:"counter_currency"`
|
||||
MaximumLiquidationCommission float64 `json:"max_liquidation_commission"`
|
||||
FutureType string `json:"future_type"`
|
||||
InstrumentName string `json:"instrument_name"`
|
||||
BaseCurrency currency.Code `json:"base_currency"`
|
||||
Kind string `json:"kind"`
|
||||
OptionType string `json:"option_type"`
|
||||
QuoteCurrency currency.Code `json:"quote_currency"`
|
||||
BlockTradeCommission float64 `json:"block_trade_commission"`
|
||||
ContractSize float64 `json:"contract_size"`
|
||||
CreationTimestamp types.Time `json:"creation_timestamp"`
|
||||
ExpirationTimestamp types.Time `json:"expiration_timestamp"`
|
||||
IsActive bool `json:"is_active"`
|
||||
Leverage float64 `json:"leverage"`
|
||||
MaxLeverage float64 `json:"max_leverage"`
|
||||
MakerCommission float64 `json:"maker_commission"`
|
||||
MinimumTradeAmount float64 `json:"min_trade_amount"`
|
||||
TickSize float64 `json:"tick_size"`
|
||||
TakerCommission float64 `json:"taker_commission"`
|
||||
Strike float64 `json:"strike"`
|
||||
SettlementPeriod string `json:"settlement_period"`
|
||||
SettlementCurrency currency.Code `json:"settlement_currency"`
|
||||
RequestForQuote bool `json:"rfq"`
|
||||
PriceIndex string `json:"price_index"`
|
||||
InstrumentID int64 `json:"instrument_id"`
|
||||
CounterCurrency string `json:"counter_currency"`
|
||||
MaximumLiquidationCommission float64 `json:"max_liquidation_commission"`
|
||||
FutureType string `json:"future_type"`
|
||||
TickSizeSteps []struct {
|
||||
AbovePrice float64 `json:"above_price"`
|
||||
TickSize float64 `json:"tick_size"`
|
||||
|
||||
@@ -1177,18 +1177,18 @@ func (e *Exchange) GetFuturesContractDetails(ctx context.Context, item asset.Ite
|
||||
contractSettlementType = futures.Linear
|
||||
}
|
||||
resp = append(resp, futures.Contract{
|
||||
Exchange: e.Name,
|
||||
Name: cp,
|
||||
Underlying: currency.NewPair(currency.NewCode(inst.BaseCurrency), currency.NewCode(inst.QuoteCurrency)),
|
||||
Asset: item,
|
||||
SettlementCurrencies: []currency.Code{currency.NewCode(inst.SettlementCurrency)},
|
||||
StartDate: inst.CreationTimestamp.Time(),
|
||||
EndDate: inst.ExpirationTimestamp.Time(),
|
||||
Type: ct,
|
||||
SettlementType: contractSettlementType,
|
||||
IsActive: inst.IsActive,
|
||||
MaxLeverage: inst.MaxLeverage,
|
||||
Multiplier: inst.ContractSize,
|
||||
Exchange: e.Name,
|
||||
Name: cp,
|
||||
Underlying: currency.NewPair(inst.BaseCurrency, inst.QuoteCurrency),
|
||||
Asset: item,
|
||||
SettlementCurrency: inst.SettlementCurrency,
|
||||
StartDate: inst.CreationTimestamp.Time(),
|
||||
EndDate: inst.ExpirationTimestamp.Time(),
|
||||
Type: ct,
|
||||
SettlementType: contractSettlementType,
|
||||
IsActive: inst.IsActive,
|
||||
MaxLeverage: inst.MaxLeverage,
|
||||
Multiplier: inst.ContractSize,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user