binance: fix futures position

This commit is contained in:
ankion 2022-06-18 02:54:33 +08:00
parent ffd46fd71d
commit 69e03c8428
2 changed files with 6 additions and 3 deletions

View File

@ -41,7 +41,12 @@ func toGlobalFuturesPositions(futuresPositions []*futures.AccountPosition) types
retFuturesPositions := make(types.FuturesPositionMap)
for _, futuresPosition := range futuresPositions {
retFuturesPositions[futuresPosition.Symbol] = types.FuturesPosition{ // TODO: types.FuturesPosition
Isolated: futuresPosition.Isolated,
Isolated: futuresPosition.Isolated,
AverageCost: fixedpoint.MustNewFromString(futuresPosition.EntryPrice),
ApproximateAverageCost: fixedpoint.MustNewFromString(futuresPosition.EntryPrice),
Base: fixedpoint.MustNewFromString(futuresPosition.PositionAmt),
Quote: fixedpoint.MustNewFromString(futuresPosition.Notional),
PositionRisk: &types.PositionRisk{
Leverage: fixedpoint.MustNewFromString(futuresPosition.Leverage),
},

View File

@ -257,8 +257,6 @@ type FuturesPosition struct {
Isolated bool `json:"isolated"`
UpdateTime int64 `json:"updateTime"`
PositionRisk *PositionRisk
sync.Mutex
}
func NewPositionFromMarket(market Market) *Position {