diff --git a/pkg/types/account.go b/pkg/types/account.go index 31015b0cf..8edf10f01 100644 --- a/pkg/types/account.go +++ b/pkg/types/account.go @@ -217,7 +217,6 @@ type Account struct { TotalAccountValue fixedpoint.Value `json:"totalAccountValue,omitempty"` - // Futures fields CanDeposit bool `json:"canDeposit"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` @@ -227,18 +226,18 @@ type Account struct { type FuturesAccountInfo struct { // Futures fields - Assets []FuturesUserAsset `json:"assets"` - FeeTier int `json:"feeTier"` - MaxWithdrawAmount fixedpoint.Value `json:"maxWithdrawAmount"` - Positions PositionMap `json:"positions"` - TotalInitialMargin fixedpoint.Value `json:"totalInitialMargin"` - TotalMaintMargin fixedpoint.Value `json:"totalMaintMargin"` - TotalMarginBalance fixedpoint.Value `json:"totalMarginBalance"` - TotalOpenOrderInitialMargin fixedpoint.Value `json:"totalOpenOrderInitialMargin"` - TotalPositionInitialMargin fixedpoint.Value `json:"totalPositionInitialMargin"` - TotalUnrealizedProfit fixedpoint.Value `json:"totalUnrealizedProfit"` - TotalWalletBalance fixedpoint.Value `json:"totalWalletBalance"` - UpdateTime int64 `json:"updateTime"` + Assets map[Asset]FuturesUserAsset `json:"assets"` + FeeTier int `json:"feeTier"` + MaxWithdrawAmount fixedpoint.Value `json:"maxWithdrawAmount"` + Positions PositionMap `json:"positions"` + TotalInitialMargin fixedpoint.Value `json:"totalInitialMargin"` + TotalMaintMargin fixedpoint.Value `json:"totalMaintMargin"` + TotalMarginBalance fixedpoint.Value `json:"totalMarginBalance"` + TotalOpenOrderInitialMargin fixedpoint.Value `json:"totalOpenOrderInitialMargin"` + TotalPositionInitialMargin fixedpoint.Value `json:"totalPositionInitialMargin"` + TotalUnrealizedProfit fixedpoint.Value `json:"totalUnrealizedProfit"` + TotalWalletBalance fixedpoint.Value `json:"totalWalletBalance"` + UpdateTime int64 `json:"updateTime"` } func NewAccount() *Account { diff --git a/pkg/types/position.go b/pkg/types/position.go index 2c25a61e3..e7aff235f 100644 --- a/pkg/types/position.go +++ b/pkg/types/position.go @@ -39,20 +39,9 @@ type Position struct { ExchangeFeeRates map[ExchangeName]ExchangeFee `json:"exchangeFeeRates"` // Futures data fields - Isolated bool `json:"isolated"` - InitialMargin fixedpoint.Value `json:"initialMargin"` - MaintMargin fixedpoint.Value `json:"maintMargin"` - OpenOrderInitialMargin fixedpoint.Value `json:"openOrderInitialMargin"` - PositionInitialMargin fixedpoint.Value `json:"positionInitialMargin"` - UnrealizedProfit fixedpoint.Value `json:"unrealizedProfit"` - EntryPrice fixedpoint.Value `json:"entryPrice"` - MaxNotional fixedpoint.Value `json:"maxNotional"` - PositionSide string `json:"positionSide"` - PositionAmt fixedpoint.Value `json:"positionAmt"` - Notional fixedpoint.Value `json:"notional"` - IsolatedWallet fixedpoint.Value `json:"isolatedWallet"` - UpdateTime int64 `json:"updateTime"` - PositionRisk PositionRisk + Isolated bool `json:"isolated"` + UpdateTime int64 `json:"updateTime"` + PositionRisk *PositionRisk sync.Mutex }