Skip to content

fix mex token previous24hVolume values#1493

Merged
dragos-rebegea merged 1 commit intodevelopmentfrom
API-590-fix-mex-token-previous-24-h-volume-values
Jun 2, 2025
Merged

fix mex token previous24hVolume values#1493
dragos-rebegea merged 1 commit intodevelopmentfrom
API-590-fix-mex-token-previous-24-h-volume-values

Conversation

@cfaur09
Copy link
Copy Markdown
Contributor

@cfaur09 cfaur09 commented May 7, 2025

Reasoning

  • The current implementation only takes volume24h from a single pair for each token, which is incorrect
  • A token can be traded in multiple pairs (as base or quote token), so its total volume should be the sum of all its pair volumes

Proposed Changes

  • Added a tokenVolumes map to track total volume for each token across all pairs
  • Modified getAllMexTokensRaw to first calculate aggregated volumes for each token (both as base and quote)
  • Updated volume assignment to use the pre-calculated aggregated volumes from tokenVolumes map

How to test

  • <api>/mex/tokens/EMR-d10ed9 -> should have correct previous24hVolume value

… and quote tokens in getAllMexTokensRaw method
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2025

k6 load testing comparison.
Base Commit Hash: 10f304b
Target Commit Hash: 41fd3e4

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Pool49.77457.1353.9655.9048.15584.6051.5453.42-3.26% ✅+27.88% 🔴-4.48% ✅-4.42% ✅
Mex49.51421.5353.9255.7647.82140.3151.5553.46-3.42% ✅-66.71% ✅-4.40% ✅-4.13% ✅
Tokens50.09745.9354.0055.8247.90348.5151.5353.43-4.37% ✅-53.28% ✅-4.56% ✅-4.28% ✅
Nodes49.75444.0753.9355.8048.08405.9251.5453.37-3.35% ✅-8.59% ✅-4.43% ✅-4.34% ✅
Transactions61.761109.2454.8357.4060.831088.1752.1054.63-1.50% ✅-1.90% ✅-4.97% ✅-4.83% ✅
Accounts50.03658.0354.0555.8848.04778.6851.5253.49-3.98% ✅+18.33% 🔴-4.69% ✅-4.27% ✅
Blocks55.751351.8654.7657.3554.621375.7052.0454.47-2.04% ✅+1.76% 🔴-4.95% ✅-5.02% ✅
Test Run Duration60002.4760005.11

Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile
All times are in milliseconds.

@cfaur09 cfaur09 self-assigned this May 7, 2025
@dragos-rebegea dragos-rebegea merged commit b956bbf into development Jun 2, 2025
6 checks passed
@dragos-rebegea dragos-rebegea deleted the API-590-fix-mex-token-previous-24-h-volume-values branch June 2, 2025 13:58
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.

4 participants