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

Conversation

@ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Dec 11, 2023

This PR adds exchange volume and trading fee values to the summary by asset


Adds the following:

  • volume: takes from trades, should be in base currency, eg BTC
  • volumeUsd: amountUsd, the same as for getTradedVolume endpoint
  • tradingFees: takes from ledgers category 201, should be in base currency, eg BTC
  • tradingFeesUsd: the same as tradingFees but uses amountUsd field to take into account the price for the timestamp of the transaction
  • marginFundingPayment: takes from ledgers category 28, should be in base currency, eg BTC

Response example:

{
  "jsonrpc": "2.0",
  "result": {
    "summaryByAsset": [
      {
        "currency": "XDC",
        "balance": 0.123,
        "balanceUsd": 0.123,
        "balanceChange": 0.123,
        "balanceChangePerc": 123,
        "volume": 12.123,
        "volumeUsd": 12.123,
        "tradingFees": 0.123,
        "marginFundingPayment": 0
      }
    ],
    "total": {
      "balanceUsd": 12.123,
      "balanceChangeUsd": 12.123,
      "balanceChangePerc": 123.123,
      "volumeUsd": 1234.123,
      "tradingFeesUsd": 1.123
    }
  },
  "id": null
}

@ZIMkaRU ZIMkaRU force-pushed the feature/add-exchange-volume-and-trading-fee-values-to-summary-by-asset branch from 2543bdd to 8f27a1d Compare December 12, 2023 09:13
@ZIMkaRU ZIMkaRU force-pushed the feature/add-exchange-volume-and-trading-fee-values-to-summary-by-asset branch from 0f89ba2 to 036821e Compare December 13, 2023 07:56
@ZIMkaRU ZIMkaRU force-pushed the feature/add-exchange-volume-and-trading-fee-values-to-summary-by-asset branch from 036821e to c226e93 Compare December 13, 2023 08:03
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.

looks good to me!

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