UNPKG

@kamino-finance/kliquidity-sdk

Version:

Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol

15 lines 633 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 = priceToTickIndexWithRounding; const decimal_js_1 = __importDefault(require("decimal.js")); function priceToTickIndexWithRounding(price) { const 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; } //# sourceMappingURL=raydium.js.map