lukechilds / hyperdex-bugtracker

0 stars 1 forks source link

Implement filtering of the 'Swaps' list #12

Closed jansako closed 6 years ago

jansako commented 6 years ago

Ideally, it could only show trades for the current pair & change as you switch pairs. Maybe a 'show all' control to turn off the filter, as well as 'show failed', 'show pending' and 'show completed' to make viewing the list easier.

Sorting would also be helpful, clicking the column headers would sort by the respective column (like Windows Explorer).

Use case: Myself I often have dozens, if not hundreds of swaps on my list.

sindresorhus commented 6 years ago

Are you talking about the swaps list in the "Trades" tab or the small one in the "Exchange" tab?

jansako commented 6 years ago

Both.

For filtering, mainly the list on the 'exchange tab'. Why am I seeing completed/failed swaps for Supernet when I am trading REVS?

The 'Trades' tab would also benefit from both sorting and filtering ability. This is how mine looks after 2 days of testing: image

Now imagine an active trader after a few weeks. I routinely clear out my swaps DB folder in BarterDEX cause it slows it down so much with having hundreds of swaps there.

sindresorhus commented 6 years ago

For filtering, mainly the list on the 'exchange tab'. Why am I seeing completed/failed swaps for Supernet when I am trading REVS?

By default, it shows all trades, try clicking the tab on the right side of the All tab, to filter it down to the current coin you're trading.

The 'Trades' tab would also benefit from both sorting and filtering ability. This is how mine looks after 2 days of testing:

Yeah, I agree, I'll add it as a feature request internally.

In the next build (probably out tomorrow), we'll show all swaps for a specific coin in the Dashboard view in the "Recent Activity" tab, so you can kinda filter it down by coin for now.

I routinely clear out my swaps DB folder in BarterDEX cause it slows it down so much with having hundreds of swaps there.

HyperDEX should be able to list thousands of swaps without a sweat, since we store the swaps in our own database and use React for rendering.

lukechilds commented 6 years ago

HyperDEX should be able to list thousands of swaps without a sweat, since we store the swaps in our own database and use React for rendering.

I benchmarked this a while ago:

// Filled the DB with 1,000 fake swaps
swapDB.getSwaps().then(swaps => console.log(swaps.length))
// => 1000

// Takes 97ms to return all 1,000 swaps
swapDB.getSwaps()
// => time: 97.48291015625ms

// Takes 282ms to query the entire dataset of 1,000 swaps, sort them by start date, then return them
swapDB.getSwaps({sort: 'date'})
// => time: 282.89306640625ms

// Takes 226ms to search the entire dataset of 1,000 swaps for specific swap
swapDB.getSwap({requestId: 323706239, quoteId: 437134979})
// => time: 226.4150390625ms

Should be even quicker now we only need a UUID as a unique reference.

sindresorhus commented 6 years ago

Moved to https://github.com/lukechilds/hyperdex/issues/281