mexcdevelop / mexc-api-sdk

MIT License
173 stars 70 forks source link

API response for new MARKET order is sending wrong execution price #77

Open vzubach opened 4 weeks ago

vzubach commented 4 weeks ago

I send a request to open a new order on the market with quoteOrderQty = 6 USDT

tstmp=$(date +%s%N | cut -b1-13)
querystr="symbol=KASUSDT&side=BUY&type=MARKET&quoteOrderQty=6&&timestamp=$tstmp"
sign=$(echo -n $querystr | openssl dgst -sha256 -hmac "$SKey" | awk '{print $2}')
NewOrder=$(curl -sLH "x-mexc-apikey: $AKey" -H "Content-Type: application/json" -X POST "$url/api/v3/order?$querystr&signature=$sign")
echo "$NewOrder" | jq -r .
{
  "symbol": "KASUSDT",
  "orderId": "C02__427495284067573760015",
  "orderListId": -1,
  "price": "0.183503",   <----- WRONG PRICE! The actual strike price was 0.175137
  "origQty": "32.69",
  "type": "MARKET",
  "side": "BUY",
  "transactTime": 1717705054066
}

Query Order with "orderId": "C02__427495284067573760015" response:

{
  "symbol": "KASUSDT",
  "orderId": "C02__427495284067573760015",
  "orderListId": -1,
  "clientOrderId": null,
  "price": "0.183503",   <----- Wrong executed price. The actual strike price was 0.175137 = (5.72522853 / 32.69)
  "origQty": "32.69",
  "executedQty": "32.69",
  "cummulativeQuoteQty": "5.72522853",    <----- Real executed quantity
  "status": "FILLED",
  "timeInForce": null,
  "type": "MARKET",
  "side": "BUY",
  "stopPrice": null,
  "icebergQty": null,
  "time": 1717705054000,
  "updateTime": 1717705054000,
  "isWorking": true,
  "origQuoteOrderQty": "5.99871307"   <----- Actual purchase quantity requested
}
khoangkhac118 commented 3 weeks ago

I send a request to open a new order on the market with quoteOrderQty = 6 USDT

tstmp=$(date +%s%N | cut -b1-13)
querystr="symbol=KASUSDT&side=BUY&type=MARKET&quoteOrderQty=6&&timestamp=$tstmp"
sign=$(echo -n $querystr | openssl dgst -sha256 -hmac "$SKey" | awk '{print $2}')
NewOrder=$(curl -sLH "x-mexc-apikey: $AKey" -H "Content-Type: application/json" -X POST "$url/api/v3/order?$querystr&signature=$sign")
echo "$NewOrder" | jq -r .
{
  "symbol": "KASUSDT",
  "orderId": "C02__427495284067573760015",
  "orderListId": -1,
  "price": "0.183503",   <----- WRONG PRICE! The actual strike price was 0.175137
  "origQty": "32.69",
  "type": "MARKET",
  "side": "BUY",
  "transactTime": 1717705054066
}

Query Order with "orderId": "C02__427495284067573760015" response:

{
  "symbol": "KASUSDT",
  "orderId": "C02__427495284067573760015",
  "orderListId": -1,
  "clientOrderId": null,
  "price": "0.175137",   
  "origQty": "32.69",
  "executedQty": "32.69",
  "cummulativeQuoteQty": "5.72522853",    <----- Real executed quantity
  "status": "FILLED",
  "timeInForce": null,
  "type": "MARKET",
  "side": "BUY",
  "stopPrice": null,
  "icebergQty": null,
  "time": 1717705054000,
  "updateTime": 1717705054000,
  "isWorking": true,
  "origQuoteOrderQty": "5.99871307"   <----- Actual purchase quantity requested
}
khoangkhac118 commented 3 weeks ago

I send a request to open a new order on the market with quoteOrderQty = 6 USDT

tstmp=$(date +%s%N | cut -b1-13)
querystr="symbol=KASUSDT&side=BUY&type=MARKET&quoteOrderQty=6&&timestamp=$tstmp"
sign=$(echo -n $querystr | openssl dgst -sha256 -hmac "$SKey" | awk '{print $2}')
NewOrder=$(curl -sLH "x-mexc-apikey: $AKey" -H "Content-Type: application/json" -X POST "$url/api/v3/order?$querystr&signature=$sign")
echo "$NewOrder" | jq -r .
{
  "symbol": "KASUSDT",
  "orderId": "C02__427495284067573760015",
  "orderListId": -1,
  "price": "0.183503",   <----- WRONG PRICE! The actual strike price was 0.175137
  "origQty": "32.69",
  "type": "MARKET",
  "side": "BUY",
  "transactTime": 1717705054066
}

Query Order with "orderId": "C02__427495284067573760015" response:

{
  "symbol": "KASUSDT",
  "orderId": "C02__427495284067573760015",
  "orderListId": -1,
  "clientOrderId": null,
  "price": "0.183503",   <----- Wrong executed price. The actual strike price was 0.175137 = (5.72522853 / 32.69)
  "origQty": "32.69",
  "executedQty": "32.69",
  "cummulativeQuoteQty": "5.72522853",    <----- Real executed quantity
  "status": "FILLED",
  "timeInForce": null,
  "type": "MARKET",
  "side": "BUY",
  "stopPrice": null,
  "icebergQty": null,
  "time": 1717705054000,
  "updateTime": 1717705054000,
  "isWorking": true,
  "origQuoteOrderQty": "5.99871307"   <----- Actual purchase quantity requested
}