Skip to content

fix: GMX live rate broken by non-USDC collateral decimals - #2076

Merged
Flotapponnier merged 1 commit into
devfrom
fix/gmx-usdc-collateral-filter
Aug 26, 2026
Merged

fix: GMX live rate broken by non-USDC collateral decimals#2076
Flotapponnier merged 1 commit into
devfrom
fix/gmx-usdc-collateral-filter

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

positionFeeAmount in Subsquid is denominated in the collateral token's native decimals (6 for USDC, 18 for ETH/WBTC etc.). Dividing all values by 1e6 produces astronomically wrong rates for non-USDC trades.

Fix: filter initialCollateralTokenAddress_in to native USDC and USDC.e on Arbitrum. Result: ~4.4 bps vs the previous 340M bps.

Same filter applied to fetchGmxTrades (wallet analysis) for the same reason.

@Flotapponnier
Flotapponnier merged commit 5368178 into dev Aug 26, 2026
@Flotapponnier
Flotapponnier deleted the fix/gmx-usdc-collateral-filter branch August 26, 2026 14:05
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.

1 participant