API: Unsynchronization between wallet balance and trade response

Hey @Ducky,

Could you forward my question to the devs?

After I request a trade, I get its response (refunded or accepted) via getpdetradestatus API. This is OK but when I receive the response, the wallet balance is not updated simultaneously. How can I ensure that the wallet balance is updated after I receive the trade response?

One more question: is there any API to get the exact trade result? For example, when I request 1.2 usdt for 1 prv, how can I know that the trade gives me 1.23 usdt or 1.19 usdt for 1 prv? Currently, getpdetradestatus gives just “refunded” or “accepted”.

2 Likes

Hi @abduraman, I took your questions to the team. Hope that a dev will help to clarify things for you soon. :wink:

3 Likes

Hey @17Strife It has been reported and will be working as expected shortly, could you try again in a few hours? Hopefully by then it is working.

Hey @17Strife ,

They are not the same problem. In fact, your problem is about the fullnode which has a problem currently. Mine is a programming question.

Btw, I wish the team could give me or us (Trust Level 3) grant to fix the image sizes in someone else’s posts :slight_smile: @ning My eyes are bleeding :slight_smile:

1 Like

@Chucky I appreciate your response. What I don’t really understand is why many other trades are being processed according to incscan. Are there multiple full-nodes?

To be completely honest, im not 100% sure why, but it may be due to apis not pulling prices correctly and by having price discrepencys trades end up in failed status. Maybe not all assets, lets wait until one of our developers gives us an update and ill have more accurate information to share with you. Appreciate the patience.

2 Likes

I have the same issue… tried 3 times to trade PRV to ETH and failed.

1 Like

Hey @ducky,

Is there any progress on my questions?

Best.

1 Like

How can I ensure that the wallet balance is updated after I receive the trade response?

It would take a few minutes for the response tx to be included in a block so you can check your wallet balance then.

One more question: is there any API to get the exact trade result? For example, when I request 1.2 usdt for 1 prv, how can I know that the trade gives me 1.23 usdt or 1.19 usdt for 1 prv? Currently, getpdetradestatus gives just “refunded” or “accepted”.

We’ve not exposed that API yet. However, you can see “MinAcceptableAmount” in the trade payload, right? If a trade gets accepted then you should receive an amount that >= MinAcceptableAmount.

Or you also can use extractpdeinstsfrombeaconblock api to extract pdex information from beacon blocks. By using the api, you’ll be able to get your desired info but it would require a bit engineering I guess…

3 Likes

I thought this but the problem raises if a (un)shielding occurs simultaneously. Then, checking wallet balance may not give the exact result.

Thanks. I’ll examine it.