Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swap StartFailed because total required amount is larger than available #732

Open
cipig opened this issue Oct 15, 2020 · 3 comments
Open
Assignees
Labels
bug Something isn't working P1

Comments

@cipig
Copy link
Member

cipig commented Oct 15, 2020

found 3 failed swaps with

maker_swap:254] !check_balance_for_maker_swap maker_swap:1346] The total required KMD amount 6.162357815 is larger than available 0.31337041, balance: 0.31337041, locked by swaps: 0

https://dexapi.cipig.net/public/error.php?uuid=ed261d00-8035-4dc9-86d2-34ba2a552b7a
https://dexapi.cipig.net/public/error.php?uuid=d30827cb-dcc5-4629-ba52-800c7ff9fcbd
https://dexapi.cipig.net/public/error.php?uuid=306e0bba-505c-4977-8ef2-b9a0f84d6f5a

they are all from the same maker 2.0.2422_mm2_31d1803b0, the diff between 6.162357815 and 0.31337041 is pretty big and the actual balance is the same with all 3 0.31337041

@artemii235 artemii235 added the P1 label Dec 22, 2020
@cipig
Copy link
Member Author

cipig commented Mar 22, 2021

a new example using latest mm2:

{
   "uuid" : "6982ecbe-9929-4819-8db4-d3ddda29a933",
   "maker_amount" : "2.81776082",
   "error_events" : [
      "StartFailed",
      "NegotiateFailed",
      "TakerFeeValidateFailed",
      "MakerPaymentTransactionFailed",
      "MakerPaymentDataSendFailed",
      "MakerPaymentWaitConfirmFailed",
      "TakerPaymentValidateFailed",
      "TakerPaymentWaitConfirmFailed",
      "TakerPaymentSpendFailed",
      "TakerPaymentSpendConfirmFailed",
      "MakerPaymentWaitRefundStarted",
      "MakerPaymentRefunded",
      "MakerPaymentRefundFailed"
   ],
   "mm_version" : "8faf62398",
   "success_events" : [
      "Started",
      "Negotiated",
      "TakerFeeValidated",
      "MakerPaymentSent",
      "TakerPaymentReceived",
      "TakerPaymentWaitConfirmStarted",
      "TakerPaymentValidatedAndConfirmed",
      "TakerPaymentSpent",
      "TakerPaymentSpendConfirmStarted",
      "TakerPaymentSpendConfirmed",
      "Finished"
   ],
   "my_order_uuid" : "6ea2ef0f-ad12-4100-b797-e95d726426d2",
   "gui" : "mpm",
   "taker_amount" : "337.696787706072515",
   "type" : "Maker",
   "taker_coin" : "KMD",
   "events" : [
      {
         "event" : {
            "data" : {
               "error" : "maker_swap:315] !check_balance_for_maker_swap maker_swap:1508] Not sufficient balance: lp_swap:561] The total required DASH amount 2.81827142 is larger than available 2.81823405, balance: 2.81823405, locked by swaps: 0"
            },
            "type" : "StartFailed"
         },
         "timestamp" : 1616442657218
      },
      {
         "timestamp" : 1616442657218,
         "event" : {
            "type" : "Finished"
         }
      }
   ],
   "maker_coin" : "DASH"
}

i was maker and this is my DASH address: https://chainz.cryptoid.info/dash/address.dws?XtZ1a6kWyiwjc4pwjS6cwoDSr6vm6hWmiy.htm

console on maker showed this:

22 19:50:57, mm2src/lp_ordermatch.rs:2172] INFO Entering the maker_swap_loop DASH/KMD with uuid: 6982ecbe-9929-4819-8db4-d3ddda29a933
22 19:50:57, mm2src/gossipsub/src/behaviour.rs:191] INFO Subscribed to topic: swap/6982ecbe-9929-4819-8db4-d3ddda29a933
22 19:50:57, mm2src/database/stats_swaps.rs:113] ERROR Error maker_swap:1299] First swap event must be Started on getting swap 6982ecbe-9929-4819-8db4-d3ddda29a933 data
· 2021-03-22 19:50:57 +0000 [swap uuid=6982ecbe-9929-4819-8db4-d3ddda29a933] Finished

@artemii235 artemii235 self-assigned this Mar 24, 2021
@artemii235 artemii235 added the bug Something isn't working label Mar 24, 2021
@artemii235
Copy link
Member

The problem with DASH can be it uses a dynamic fee - if it increases between order creation and swap start it can lead to this error. I'm unsure if we can eliminate this error completely but will check what we can do to at least reduce the possibility.

@cipig
Copy link
Member Author

cipig commented Jul 24, 2024

with latest mm2:
https://dexapi.cipig.net/public/error.php?uuid=5cacaa65-f170-4d84-99b0-927c55a2b1a3

maker_swap:516] !check_balance_for_maker_swap check_balance:75] Not enough LTC-segwit for swap: available 0.183626609, required at least 1.652657281, locked by swaps Some(BigDecimal("1.652657281"))

i guess it's because mm2 used the LTC in some other swap that was running in parallel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
None yet
Development

No branches or pull requests

2 participants