Open ghost opened 4 years ago
We just discussed adding a basic /trades
endpoint which takes a date range as filter and accepts above proposed granularity, e.g. as /trades?startDate=20200101&endDate=20201231
returning data of the executed CEX trades, along with the uuid of the related OpenDEX trade + arbitrage profit.
Data fields this should return:
This feature is needed for the "Closed CEX Trades" view in the Arby/MM Bot secion in xud-ui, which only shows closed arby trades on the CEX side + how much profit was made with the arbitrage to the OpenDEX trade:
It also composes some of this info into a graph:
What does order side mean under closed trades? It's always both - either buy on CEX and sell on DEX or vice versa.
Very good point! How about now?
For the chart we'll need to data in the following format:
/profit?startDate=xyz&endDate=zyx&granularity=day
{
result: [
{ label: '1st of Jan', profit: 0.1},
{ label: '2nd of Jan', profit: 0.025},
...
]
}
Thinking it might make sense to have a separate endpoint for the closed trades info since it's on a separate screen and does not need granularity.
Very good point! How about now?
That works.
Same question for the amount. Is it always the non-BTC asset?
Thinking it might make sense to have a separate endpoint for the closed trades info since it's on a separate screen and does not need granularity.
It might in future...
Thinking it might make sense to have a separate endpoint for the closed trades info since it's on a separate screen and does not need granularity.
It might in future...
It just needs the date range though? startDate
and endDate
?
Or limit
(show last 100 trades).
Same question for the amount. Is it always the non-BTC asset?
Oh damn, that took a while. So we discussed at some point to expose CEX data only here on that mm bot page along with the profit info, since all OpenDEX trade data can be looked up in Tradehistory
and we don't want to have that double.
Updated.
Thinking it might make sense to have a separate endpoint for the closed trades info since it's on a separate screen and does not need granularity.
It might in future...
It just needs the date range though?
startDate
andendDate
?Or
limit
(show last 100 trades).
True. Adjusted to date range only in https://github.com/ExchangeUnion/market-maker-bot/issues/85#issuecomment-743145652
I just onboarded @rsercano to this @erkarl - any questions/implementation proposal - let's track it here
Hi, this's complicated for a single issue imo, and I guess either we need to split it into PRs, or sub issues somehow. So I was thinking to split into below PRs.
arby-order.ts
arby-order.ts
. (Open to suggestions about async process, if it can be done on rx-js)/trades
endpoint as explained above.or maybe two by combining implementing & introducing parts
wdyt? @erkarl @kilrau
Introducing sequelize and a new db type arby-order.ts
Let's start with adding sequelize support and define what we're going to save to the database.
Edited my comment to be brief, @erkarl started to implement db model
As just discussed with @erkarl and @rsercano :
Removed Wireframe adjusted too.
This issue is about adding basic accounting capabilities to arby for the end user. Details below.