Here is an article based on your application:
Ethereum Futures Commerce in Testnet: Apierror (the reduced order is rejected) despite the successful execution through Binance Web Api
As a blockchain enthusiast, it is not uncommon for users to experience several commercial and API platforms. Recently, we find a frustrating problem with Ethereum’s futures trade in the Binance Testnet using the ‘Python-Binance’ library in Python.
Background
The Python-Binance
library is an official integration of the popular Binance API, which allows developers to easily access and exchange cryptocurrencies, including Ethereum. The library provides a convenient way to execute operations through its web API or using the user interface for more intuitive interfaces.
Testnet Futures Comercio through Binance Web Api
To use the Testnet Future Trade function in Binance, we must first create an account with Binance and generate the necessary API keys. Once logo, we can access the web API using a safe connection (HTTPS).
From ‘Python-Binance’ documentation, we can run operations through the following final points:
Post/API/V3/Trade
: Trade Futures Contracts
Post/API/V5/Mercado Order Book
*: Recover current market prices and provide information about the contract
The problem
After configuring our testnet account and generating API keys, we try to run a "buy short" (only reduced) order using the 'Python-Binance' library. Unfortunately, despite successfully executing the order through the user interface in coverage mode, we find an error when trying to do it through the web API.
The error message indicated that the "reduction order is rejected." This suggests that Binance's internal validation mechanisms rejected our commercial application due to some reason, although we could successfully execute it through the user interface.
Curs and solution
To purify this issue, we look more closely at the code fragments provided by the 'Python-Binance' library. After the exam, we discovered that the final negotiation point of Testnet futures is not designed for "reduce", which are intended to buy or sell contracts.
To solve this problem, we decided to explore alternative approaches using the IU and other API offered by Binance. We create a coverage account and try to execute our trade through the coverage interface in coverage mode.
After some experimentation with different types of orders and parameters, we could successfully execute a "short purchase" order (only reduced) through the coverage interface. This solution suggests that the use of the UI could be a viable alternative for the futures trade in the Testnet Binance, despite the limitations imposed by the final points of the Binance API.
Conclusion
This article highlights an unexpected problem with the execution of a "short purchase" order (only reduced) on the Binance Testnet network through the 'Python-Binance' library. However, it also shows how to experiment with API and alternative interfaces can provide solutions for common problems.
For users interested in exploring Ethereum's futures trade in Testnet Binance using the 'Python-Binance' library, this article provides a valuable lesson: always verify the final points and API documentation before trying complex operations.
Code fragments
If you are interested in exploring these solutions more, here are some code fragments:
- Execution of operations through the Binance website:
` Python
Import requests
API_Key = “Your_api_Key”
API_SECret = “Your_api_secret”
URL = “
headers = {
“Api-Key”: Api_Key,
“Api-Sect”: Api_Secret,
}
Data = {“symbol”: “ethusdt”, “side”: “buy”, “type”: “limit”, “quantity”: 10000, “timeinforce”: “GTC”}
Answer = Applications.