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

[BUG] The Trade History shows your own trades from the wrong trading side #155

Open
Nesh-01 opened this issue May 16, 2020 · 4 comments
Open
Labels
bug Something isn't working

Comments

@Nesh-01
Copy link

Nesh-01 commented May 16, 2020

Describe the bug
This bug report is NOT about the tab "My Trade History", which is working as expected.
Your own trades are potentially shown as trades from the wrong trading side in the tab "Trade History", i.e. a "buy" trade is shown as "sell" when you are in the sell side of the trade and a "sell" trade is shown as "buy" when you are on the buy side of the trade. "Trade History" should show all trades from the point of view of a third party, no matter if you took part in those trades or not. This also leads to a different Trade History depending on whether you are logged in or not, as can be seen in the screenshot below.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'wallet.turtlenetwork.eu'
  2. Create a sell order (taker order, i.e. your order stays on the orderbook)
  3. Let someone fill your order
  4. Go to the tab "Trade History"

Expected behavior
The trade is shown as Type "Buy".

Actual behavior
The trade is shown as Type "Sell".

Screenshots
tn_trade_type_bug

Desktop (please complete the following information):

  • OS: Windows
  • Browser/JVM: Firefox
  • Version: 75.0

Additional context
If this is intended behavior I suggest to reconsider it as to my knowledge no other exchanges behaves that way. The (general) Trade History should show all trades from a third party perspective.

@Nesh-01 Nesh-01 added the bug Something isn't working label May 16, 2020
@BlackTurtle123
Copy link

@Nesh-01 so what is the third party view?
How would you define the third party view?
Because every buy is a sell at the same time.

@Nesh-01
Copy link
Author

Nesh-01 commented Jun 6, 2020

The third party is one not involved in this specific trade. The side of the maker, i.e. the one filling orders existing on the order book, is the one deciding the type of the trade (buy or sell) from the market's/third party view. That's how it is done on every exchange.

@BlackTurtle123
Copy link

The third party is one not involved in this specific trade. The side of the maker, i.e. the one filling orders existing on the order book, is the one deciding the type of the trade (buy or sell) from the market's/third party view. That's how it is done on every exchange.

I am not fully sure if the blockchain knows if it's maker or taker is

@Nesh-01
Copy link
Author

Nesh-01 commented Jun 6, 2020

The third party is one not involved in this specific trade. The side of the maker, i.e. the one filling orders existing on the order book, is the one deciding the type of the trade (buy or sell) from the market's/third party view. That's how it is done on every exchange.

I am not fully sure if the blockchain knows if it's maker or taker is

It can be derived from the timestamp.

If you want it to behave like other exchanges (loosely speaking, I haven't looked into side effects):

  1. Delete this else branch (and the if clause) for the "Trade History" tab:

    return getMineOrder(order1, order2, sender).orderType;

  2. Use getMineOrder() function for "My Trade History" tab:

    function getMineOrder(order1: IExchangeOrder, order2: IExchangeOrder, sender: string): IExchangeOrder {

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

No branches or pull requests

2 participants