UNPKG

@marinade.finance/kamino-sdk

Version:
16 lines 678 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.priceToTickIndexWithRounding = void 0; const decimal_js_1 = __importDefault(require("decimal.js")); function priceToTickIndexWithRounding(price) { let tickIndex = new decimal_js_1.default(Math.log(Math.sqrt(price))) .div(new decimal_js_1.default(Math.log(Math.sqrt(1.0001)))) .round() .toNumber(); return tickIndex; } exports.priceToTickIndexWithRounding = priceToTickIndexWithRounding; //# sourceMappingURL=raydium.js.map