This commit is contained in:
2025-02-18 15:40:45 +08:00
parent 08a7da607f
commit 935fc36b5a
7 changed files with 95 additions and 53 deletions

View File

@ -158,6 +158,7 @@ func handleReduceFilled(db *gorm.DB, preOrder *DbModels.LinePreOrder) {
}
totalNum := getFuturesPositionAvailableQuantity(db, apiUserInfo, preOrder, tradeSet)
totalNum = totalNum.Truncate(int32(tradeSet.AmountDigit))
futApi := FutRestApi{}
for _, v := range orders {
if v.OrderType == 1 {
@ -383,10 +384,10 @@ func handleFutMainOrderFilled(db *gorm.DB, preOrder *models.LinePreOrder) {
futApi := FutRestApi{}
num := getFuturesPositionAvailableQuantity(db, apiInfo, preOrder, tradeSet)
num = num.Truncate(int32(tradeSet.AmountDigit))
for _, order := range orders {
price := utility.StrToDecimal(order.Price).Truncate(int32(tradeSet.PriceDigit))
num = num.Truncate(int32(tradeSet.AmountDigit))
order.Price = price.String()
if order.OrderType == 4 {