Cannot redeem USDT using Binance API in C#

64 Views Asked by At

While trying to redeem USDT from my binance account using RedeemFlexibleProductAsync method but I'm getting :

'Error: daily product not exist'

as result.

  1. I can redeem the amount using the Binance App
  2. I have checked on typo for string ProductId(which is "USDT")
  3. The connection with the exchange server is successful
  4. I can read all flexible balances from that connection, including USDT
  5. I have enabled Trading and Withdrawal for my API
  6. I have tried different receiveWindows, now it's set at maximum of 60000

Here is my code:

private async Task<bool> RedeemFromEarn(string coin,decimal redeemAmount)
        {
            var earn = await client.GeneralApi.Savings.GetFlexibleProductPositionAsync();
            var earnBalance = JsonConvert.DeserializeObject(earn.Data.First(x => x.Asset.Equals(coin)).TotalQuantity.ToString());
            if(Convert.ToDecimal(earnBalance) > redeemAmount)
            {
                var redeem = await client.GeneralApi.Savings.RedeemFlexibleProductAsync(coin, redeemAmount,RedeemType.Normal,60000);

                if (redeem.Success)
                {
                    Debug.Print($"Redeem successful. Transaction ID: {redeem.Data}");
                }
                else
                {
                    Debug.Print($"Error: {redeem.Error.Message}");
                }
            }
            else
            {
                Debug.Print($"Not enough {coin} in Earn, try redeeming max {earnBalance}");
                return false;
            }
            return true;
        }
0

There are 0 best solutions below