forkdelta / classic-frontend

https://forkdelta.app
97 stars 130 forks source link

Order already traded #161

Closed woniesong92 closed 6 years ago

woniesong92 commented 6 years ago

Take a look at this buy order

Buy: { id: '0xfe2c6eb049011dee9326f8b16552110b8c79ae8437fcdc2d2c1e75ac6d992a7b_buy',
user: '0x605b524a7eaf563282c822205bc8f2836f748023',
state: 'OPEN',
tokenGet: '0xe3818504c1b32bf1557b16c238b2e01fd3149c17',
amountGet: '1.0e+21',
tokenGive: '0x0000000000000000000000000000000000000000',
amountGive: '5.0e+17',
expires: '2.4000E+20',
nonce: '8.765082988059393600e+34',
v: null,
r: null,
s: null,
date: '2018-05-05T22:56:14',
updated: '2018-05-05T22:56:14',
availableVolume: '1.0e+21',
ethAvailableVolume: '1000.000000',
availableVolumeBase: '5.0e+17',
ethAvailableVolumeBase: '0.5000000000',
amount: '-1.0e+21',
amountFilled: '0',
price: '0.0005' }

The state is open but when I try it from the UI, it says "You cannot trade this order because it already traded. Someone else already traded this order and the order book hasn't updated yet."

image

I am curious based on what the frontend knows that the order has already been fulfilled (which I believe is true). I assume that the backend API (socket API) doesn't provide the most up-to-date orderbook information and want to know what's the alternative or how I can ensure to filter the orders that are already filled.

freeatnet commented 6 years ago

@woniesong92 Sounds like you're looking at the information through the API, is that correct? You might be interested in looking at how backend updates orders here and query order fills on your side to get more up-to-date information in case FD backend is lagging or bugging out.