@ AE client devs:
What data about a trade do u need? Is this enough:
- asset
- quantity
- price
- block (to get timestamp)
- position relative to other trades from the same block
- account of the seller
- account of the buyer
?
yes, I have something important. Include the ORDERIDS of the two orders that have been used to create the trade!!!!
There is a very important extra information in each TRADE. The timestamps of the two orders are important,
Let me try to explain. In a limit order book with resident limit orders and instant market orders, we have the mechanism as follows: LimitOrders do nothing when they are not matched, but will NOT execute above or below their limit (not above for buy orders, or not below for sell orders).
Now consider the Market Orders: They get the next best OPPOSITE limit order for execution.
That means:
If I buy using a market order, I get the LOWEST sell limit order, i.e. I have to BUY ONE TICK UP
If I sell using a market order, I get the HIGHETS buy limit order, i.e. I have to sell ONE TICK DOWN
Do a roundtrip: example: buy at lowest sell = buy at 101
immediately sell again at lowest buy = sell at 100 ---> INSTANT MONEY LOST!
(DON'T DO THIS AT HOME!
)
The logic behind this is the following: A trade always has two counterparties, the buyer and the seller.
One of them is 'resident', the other is 'initiator'.
The 'initiator' always thinks that his wish to trade is more urgent than the 'resident'. This is reflected by the fact, that the 'resident' GETS THE BETTER DEAL of the two, because the 'initiator' has to pay the 'residents' price.
Sort of like a 'goes the mountain to the prophet, or the prophet to the mountain' - game. That's the market for you in a nutshell.
In the market, this will be reflected as follows:
When people are BUYING, it is lots of BUYERS who go to the SELLERS. THE PRICE GOES UP.
When people are SELLING, it is lots of SELLERS who go to the BUYERS THE PRICE GOES DOWN.
This is the result of many trades.
Thus, when looking at a TRADE, it is very important to be able to tell which of the two parties was the 'initiator', and which was the 'resident'!!!
NXT does not seem to have market orders, but market orders are emulated by limit orders, that simply cross the threshold of the other side.
But in order to be able to gather this important information, it should be enough to include the two order ids that have been matched into a trade, and extract their timestamps.
However, if the orders are destroyed when thay are matched, I think it is crucial to include the timestamps of the two orders in the TRANSACTION!!
(I'll just post this this, and if the layout explodes I'll edit it afterwards)