Open extra topbar

Negative Balance & Request for a 'Pending Balance' feature

If you are new here, please see some information on how to ask for support. Thank you!

Negative Balance & Request for a 'Pending Balance' feature

dashed-slug.net Forums Exchange extension support Negative Balance & Request for a 'Pending Balance' feature

This topic contains 9 replies, has 2 voices, and was last updated by  alexg 1 year, 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4269

    jongydeleon1
    Participant

    Hi Alex,

    I am not sure how my Dogecoin currently sits at a negative balance.

    Upon checking, I found out that my users traded with one another & withdrawn right after. But am still not sure how a negative balance could be displayed?

    Perhaps when a user requests for a withdraw, his/her balance is still shown on the wallet and they are able to trade with it? It would be nice to have a ‘pending balance’ feature so that when a user requests a withdrawal, his balance is transferred to the ‘pending’ section.

    Attached are some screenshots showing the negative balance & the trades.

    Attachments:
    You must be logged in to view attached files.
    #4272

    alexg
    Keymaster

    Hello,

    Thank you I will investigate.

    It does not matter if the balance is displayed negative, the balance is checked again on the server side before any withdrawal. Additionally the tables are locked during each operation so that it is not possible to have race conditions.

    Could you please post again the second attachment? It was deleted (my mistake)

    thanks

    #4274

    jongydeleon1
    Participant

    sure. Here it is. So it seems like these 2 users traded DOGE & then have withdrawn them right after.

    Attachments:
    You must be logged in to view attached files.
    #4277

    alexg
    Keymaster

    OK since this is such a serious error I would ask that you help me investigate. Please do the following:

    1. Find out the numeric WordPress IDs for these two users. Let’s say the IDs are 111 and 222.

    2. Enter the following two queries into your SQL console and email me the result:

    
    SELECT category,amount,fee,status,account FROM wp_wallets_txs WHERE account IN (111,222) and symbol='DOGE';
    
    
    SELECT * FROM wp_wallets_orders WHERE account in (111,222) and quote_symbol='DOGE';
    

    Please keep in mind that the exchange is still in beta.

    Looking forward to your reply.

    thank you

    #4278

    jongydeleon1
    Participant

    Here it is!

    Attachments:
    You must be logged in to view attached files.
    #4283

    alexg
    Keymaster

    Thank you.

    Are you using the latest version of the CoinPayments adapter? The latest version is 1.0.7.

    #4284

    jongydeleon1
    Participant

    Hey Alex, yes it is 1.0.7

    #4285

    alexg
    Keymaster

    I have an explanation. It does not seem like this is an issue with the exchange.

    In version 1.0.7 of the CoinPayments adapter, the deposit fees that the platform incurs are saved into the deposit transaction records. These fees are taken into account since the latest version 3.6.4 of the parent plugin. 3.6.4 was released on the 28th of August. On the 1st of September your user #7 did a withdrawal that was their balance plus the deposit fees (49 DOGE) that were not subtracted from their balance. If you had not applied the latest version 3.6.4. at that time, it would explain the problem. It would also mean that this will not happen again.

    My apologies for the trouble.

    Is it possible that you had not yet applied version 3.6.4 of the parent plugin on the 1st of September?

    #4296

    jongydeleon1
    Participant

    Yes that explains it… thank you.

    So how can I reset this negative balance?

    #4369

    alexg
    Keymaster

    You could reset the balances to 0 but it would have to be done manually.

    You see, the negative balance in this case is correct, i.e. there are 50 DOGE missing from this user’s account due to the bug not being fixed at the time when the user did their withdrawal.

    One way would be to set the fees of all deposits before that time to zero. This is how you would do it from your MySQL console, assuming your DB prefix is wp_:

    1. Backup your database

    2. Assuming that you upgraded to 3.6.4 on the 2nd of September, execute this:

    UPDATE wp_wallets_txs SET fee = 0 WHERE category='deposit' AND created_time <= '2018-09-02';

    This would force all of the deposits before that date to not have any fees.

    Hope this helps. Again, my apologies for the mistake on my part.

    Let me know if you have any further questions about this.

    kind regards

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.