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

Conversation

@ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Oct 3, 2025

This PR adds summary statistics info into getSummaryByAsset endpoint


Basic changes:

  • adds allFeesUsd taken from the ledgers with 201, 204, 207, 222, 224, 228, 241, 243, 251, 254, 255, 258, 905 categories to be used in UI as Fees occurred field
  • adds depositsWithdrawalsUsd to be used in UI as Deposits/Withdrawals field
  • adds plUsd to be used in UI as Profit field
  • adds volatilityPerc to be used in UI as Volatility field
  • adds sharpeRatio to be used in UI as Sharpe Ratio field
  • adds sortinoRatio to be used in UI as Sortino Ratio field
  • adds maxDrawdownPerc to be used in UI as Max Drawdown field
  • adds support for isUnrealizedProfitExcluded flag, it's the same flag that we use for Account Balance and Profits charts
  • adds the corresponding test coverage

Also for the Balance and Volume fields of the statistics can be used the already done response of the same getSummaryByAsset endpoint:

  • volumeUsd
  • balanceUsd

Request example:

{
  "auth": {
    "token": "auth-token"
  },
  "method": "getSummaryByAsset",
  "params": {
    "start": 1727775188000,
    "end": 1759397588266,
    "isUnrealizedProfitExcluded": true // or false, the same flag that we use for `Account Balance` and `Profits` charts
  }
}

Response example:

{
    "jsonrpc": "2.0",
    "result": {
        "summaryByAsset": [
            {
                "currency": "LEO",
                "balance": 1.23,
                "balanceUsd": 32.1,
                "balanceChange": 0,
                "balanceChangePerc": 0,
                "volume": 0,
                "volumeUsd": 0,
                "tradingFees": 0,
                "marginFundingPayment": 0
            },
            // ...
        ],
        "total": {
            "balanceUsd": 32.1,
            "balanceChangeUsd": 32.1,
            "balanceChangePerc": 1.23,
            "volumeUsd": 32.1,
            "tradingFeesUsd": 1.23,
            "allFeesUsd": 12.3,
            "depositsWithdrawalsUsd": -12.3,
            "plUsd": 12.3,
            "volatilityPerc": 12.3,
            "sharpeRatio": 1.23,
            "sortinoRatio": 1.23,
            "maxDrawdownPerc": 12.3
        }
    },
    "id": null
}

@tarcisiozf tarcisiozf merged commit d5182a5 into bitfinexcom:staging Oct 3, 2025
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.

3 participants