这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Jun 20, 2024

This PR adds currency conversion to USD and stores cached exactUsdValue field in appropriate tables for Transaction Tax Report. For currency conversion uses the priority currency list: ['BTC', 'ETH', 'UST']


It's a 4-part of the feature, the main idea taken from these PRs: #373, #378, #379

  • separates into small parts
  • improves and speeds up the currency conversion approach

The ccy conversion approach is the following:

eg we have trades (BTC/ETH):
2024-05-15T15:02:10 -> Starts here, requests 10K trades starting at 2024-05-15T15:02:09.99
Reply includes trades up to 2024-05-15T15:02:40
2024-05-15T15:02:12 -> Included in trade before
2024-05-15T15:02:50 -> Request new 10K from 2024-05-15T15:02:49.99
Note that the space between  2024-05-15T15:02:40 and 2024-05-15T15:02:49.99 would be empty.

Copy link
Contributor

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!


// TODO:
async #convertCurrencies (trxs, opts) {}
async #convertCurrencies (trxs, opts) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we using # in the functions names?

@@ -0,0 +1,23 @@
'use strict'

module.exports = (pubTrades, mts) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants