| | |
| | | package com.xcong.excoin.modules.okxNewPrice.okxWs; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.modules.okxNewPrice.okxWs.enums.CoinEnums; |
| | |
| | | import com.xcong.excoin.modules.okxNewPrice.okxpi.MallUtils; |
| | | import com.xcong.excoin.modules.okxNewPrice.utils.WsMapBuild; |
| | | import com.xcong.excoin.modules.okxNewPrice.utils.WsParamBuild; |
| | | import io.micrometer.core.instrument.util.JsonUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.java_websocket.client.WebSocketClient; |
| | | |
| | |
| | | |
| | | for (int j = 0; j < detailsArray.size(); j++) { |
| | | JSONObject detail = detailsArray.getJSONObject(j); |
| | | log.info("账户详情: {}", JSONUtil.formatJsonStr(String.valueOf(detail))); |
| | | //需要获取的参数 |
| | | String ccyKey = "ccy"; |
| | | String availBalKey = "availBal"; |
| | |
| | | // 根据可用余额计算下单总保证金 |
| | | String total_order_usdtpecent = InstrumentsWs.INSTRUMENTSWSMAP.get(CoinEnums.TOTAL_ORDER_USDTPECENT.name()); |
| | | BigDecimal total_order_usdt_factor = WsMapBuild.parseBigDecimalSafe(total_order_usdtpecent); |
| | | BigDecimal totalOrderUsdt = cashBalDecimal.divide(total_order_usdt_factor, 4, RoundingMode.DOWN); |
| | | BigDecimal totalOrderUsdt = cashBalDecimal.multiply(total_order_usdt_factor).setScale(2, RoundingMode.DOWN); |
| | | WsMapBuild.saveStringToMap(ACCOUNTWSMAP, CoinEnums.TOTAL_ORDER_USDT.name(), String.valueOf(totalOrderUsdt)); |
| | | |
| | | log.info( |