 calculatedHedgeRatio.toFixed(4);

            // Update share calculations
            updateShareCalculations();
        }

        function updateShareCalculations() {
            const betAmount = parseFloat(document.getElementById('betAmount').value);
            const hedgeRatio = parseFloat(document.getElementById('hedgeRatio').value);
            const p1 = market1.probability;
            const p2 = market2.probability;
            const spread = p1 - p2;
            const adjustedSpread = p1 - Mat