After some time I made it to sign and send Swap API requests with Python. Unfortunately I have the problem that every second transaction fails with an error (losing the high transaction fee of course…).
Since I never got failing transactions from the UI interface I guess I do something wrong with the parameters.
I only use high liquidity pairs like BUSD/BTCB. This is one request which sometimes fails:
https://api.1inch.exchange/v3.0/56/swap?fromTokenAddress=0xe9e7cea3dedca5984780bafc599bd69add087d56&toTokenAddress=0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c&amount=1000000000000000000000&fromAddress=XXX&slippage=0.25
Transaction which failed with “ORDER_UNFILLABLE” or “Return amount is not enough”:
0xd4efc7b38101baa96e1b5f2f605e81f3a9bd3a04768a69e0393b17c6395a0e63
0x13c3528d71872f7b5d799086fafa486a67cbe6cc734b7ade5837029ae59ac119
I sign and send those transaction as is. I don’t change the estimated gas of the transaction or anything. I don’t wait, I send them immediately.
Do you have any tips for my API calls which could reduce the likelyness of failing?