convert_raw_price_to_usd
Documentation for eth_defi.gmx.utils.convert_raw_price_to_usd function.
- convert_raw_price_to_usd(raw_price, token_decimals)
Convert GMX raw price to human-readable USD.
- GMX stores prices in 30-decimal PRECISION format. The conversion formula is:
price_usd = raw_price / 10^(30 - token_decimals)
- Examples:
BTC (8 decimals): raw / 10^22
ETH (18 decimals): raw / 10^12
USDC (6 decimals): raw / 10^24