
    <script>
        const API_URL = "https://api.manifold.markets/v0";
        let priceChart, spreadChart;
        let market1, market2;

        function gammaFunction(z) {
            if (z === 1) return 1;
            if (z === 0.5) return Math.sqrt(Math.PI);
            return (z - 1) * gammaFunction(z - 1);
        }

        function betaFunction(x, y) {
            return (gammaFunction(x) * gammaFunction(y)) / gammaFunction(x + y);
        }

        function incBetaFunction(x, a, b) {
          