Bitvavo exchange: Unable to create trade due to clientOrderId parameter invalid error
Describe your environment
- Operating system: Debian Bookworm 64-bit
- Python Version: 3.11.2
- CCXT version: 4.4.29
- Freqtrade Version: 2024.10
Describe the problem:
When attempting to execute live trades on Bitvavo exchange, the bot is unable to create trades due to an invalid clientOrderId parameter error. The bot successfully detects signals and attempts to create trades with a stake amount of 50.0 EUR, but each attempt fails with the same error.
Steps to reproduce:
- Configure freqtrade with Bitvavo exchange using the provided config
- Set up static pair list including XRP/EUR
- Start the bot in live trading mode
- Bot detects long signal for XRP/EUR
- Bot attempts to create trade but fails with clientOrderId error
Observed Results:
-
What happened? The bot repeatedly fails to create trades with the error: "Unable to create trade for XRP/EUR: Could not place buy order due to BadRequest. Message: bitvavo {"errorCode":205,"error":"clientOrderId parameter is invalid"}"
-
What did you expect to happen? The bot should successfully place buy orders when signals are detected.
Relevant code exceptions or logs
Log
2024-11-15 21:58:56,170 - freqtrade.freqtradebot - INFO - Long signal found: about create a new trade for XRP/EUR with stake_amount: 50.0 ...
2024-11-15 21:58:56,234 - freqtrade.freqtradebot - WARNING - Unable to create trade for XRP/EUR: Could not place buy order due to BadRequest. Message: bitvavo {"errorCode":205,"error":"clientOrderId parameter is invalid."}
Configuration
{
"max_open_trades": 5,
"stake_currency": "EUR",
"stake_amount": "unlimited",
"stake_amount_decimals": 4,
"tradable_balance_ratio": 0.99,
"available_capital": 350,
"fiat_display_currency": "EUR",
"dry_run": false,
"trading_mode": "spot",
"exchange": {
"name": "bitvavo",
"ccxt_config": {},
"ccxt_async_config": {},
"pair_whitelist": [
"ETH/EUR",
"BTC/EUR",
"XRP/EUR",
"SOL/EUR",
"DOGE/EUR",
"ADA/EUR",
"TRX/EUR",
"LINK/EUR"
],
"pair_blacklist": []
},
"pairlists": [
{
"method": "StaticPairList"
}
]
}
To be quite honest, this feels like a ccxt bug (though one i'll struggle to assist you with, as i've got no bitvavo account).
Freqtrade doesn't really do anything other than the following (using ccxt plain code).
Please make sure to update amount and price to something matching both your account and the pair!
import ccxt
exchange = ccxt.bitvavo({
'apiKey': '<yourApiKey>',
'secret': '<yoursecret>',
})
lm = exchange.load_markets()
exchange.verbose = True
res = exchange.create_order(
'<pair of your liking',
'limit',
'buy',
amount,
20.2, # or a rate if using limit
)
print(res)
If this code raises the same issue - i'm going to have to ask you to open an issue against ccxt ...
An alternative is to run freqtrade with -vvv and perform a forcebuy (you don't want to run freqtrade with -vvv for a longer period of time). what's important is the call to the exchange on create-order and it's response -).
Have you found a solution? I am facing exactly the same problem while using docker with the freqtrade:stable image.
@gp2001 well did you try what i suggested above? If you encounter the same problem - you can provide the requested information just as well.
considering the issue is still open - there's been no solution apparently :)
I manually upgraded CCXT to 4.4.33 and now it is working.