We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/FajarArrizki/mcp-technical-analysis'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
/**
* Price Formatting Functions
* Format prices using original Hyperliquid format (preserves precision, no trailing zeros)
*/
/**
* Format price using original Hyperliquid format
* Uses original price string from Hyperliquid if available, otherwise formats number without trailing zeros
* This matches Hyperliquid's display format which preserves precision (e.g., "16.038" not "16.0380")
*/
export function formatPrice(price, _asset, originalPriceString) {
// CRITICAL FIX: If original price string from Hyperliquid is provided, use it directly (preserves exact format)
// This ensures price matches Hyperliquid UI exactly (same format, same precision, same trailing zeros if any)
// Do NOT remove trailing zeros - use Hyperliquid's exact format
if (originalPriceString && typeof originalPriceString === 'string' && originalPriceString !== '0') {
// Use original string directly from Hyperliquid (preserves exact format including trailing zeros if any)
return originalPriceString;
}
// If price is already a string, return it as-is but remove trailing zeros
if (typeof price === 'string') {
// Remove trailing zeros if any
return price.replace(/\.?0+$/, '');
}
// Convert number to string without trailing zeros (matches Hyperliquid format)
if (!price || isNaN(price))
return '0';
const numPrice = price;
// CRITICAL FIX: Always use toFixed(8) then remove trailing zeros to ensure consistent formatting
// This prevents floating point precision issues (e.g., 505.8300 vs 505.83)
const formatted = numPrice.toFixed(8);
// Remove trailing zeros, then remove decimal point if no digits remain
// Example: "505.83000000" -> "505.83", "506.33580000" -> "506.3358"
return formatted.replace(/0+$/, '').replace(/\.$/, '');
}
/**
* Format large numbers (volume, OI) with thousand separators
*/
export function formatLargeNumber(num) {
if (!num || isNaN(num))
return '0';
return num.toLocaleString('de-DE', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).replace(/\./g, '.');
}