Socket
Socket
Sign inDemoInstall

@orca-so/whirlpool-sdk

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orca-so/whirlpool-sdk - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

dist/tsconfig.tsbuildinfo

2

dist/utils/public/apr.js

@@ -23,3 +23,3 @@ "use strict";

const tokenPriceB = tokenPrices[tokenMintB.toBase58()];
if (!tokenPriceA || !tokenPriceB || tickLowerIndex >= tickUpperIndex) {
if (!fees24h || !tokenPriceA || !tokenPriceB || tickLowerIndex >= tickUpperIndex) {
return exports.ZERO_APR;

@@ -26,0 +26,0 @@ }

@@ -12,1 +12,10 @@ /// <reference types="bn.js" />

export declare function priceToTickIndex(price: Decimal, decimalsA: number, decimalsB: number): number;
/**
* Get the startIndex of the tick array containing tickIndex.
*
* @param tickIndex
* @param tickSpacing
* @param offset can be used to get neighboring tick array startIndex.
* @returns
*/
export declare function getStartTickIndex(tickIndex: number, tickSpacing: number, offset?: number): number;

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.priceToTickIndex = exports.tickIndexToPrice = exports.priceToSqrtX64 = exports.sqrtPriceX64ToPrice = exports.getPrevValidTickIndex = exports.getNextValidTickIndex = exports.getNearestValidTickIndex = exports.getNearestValidTickIndexFromTickIndex = void 0;
exports.getStartTickIndex = exports.priceToTickIndex = exports.tickIndexToPrice = exports.priceToSqrtX64 = exports.sqrtPriceX64ToPrice = exports.getPrevValidTickIndex = exports.getNextValidTickIndex = exports.getNearestValidTickIndex = exports.getNearestValidTickIndexFromTickIndex = void 0;
const whirlpool_client_sdk_1 = require("@orca-so/whirlpool-client-sdk");

@@ -45,1 +45,15 @@ const decimal_js_1 = __importDefault(require("decimal.js"));

exports.priceToTickIndex = priceToTickIndex;
/**
* Get the startIndex of the tick array containing tickIndex.
*
* @param tickIndex
* @param tickSpacing
* @param offset can be used to get neighboring tick array startIndex.
* @returns
*/
function getStartTickIndex(tickIndex, tickSpacing, offset = 0) {
const realIndex = Math.floor(tickIndex / tickSpacing / whirlpool_client_sdk_1.TICK_ARRAY_SIZE);
const startTickIndex = (realIndex + offset) * tickSpacing * whirlpool_client_sdk_1.TICK_ARRAY_SIZE;
return startTickIndex;
}
exports.getStartTickIndex = getStartTickIndex;
{
"name": "@orca-so/whirlpool-sdk",
"version": "0.1.0",
"version": "0.1.1",
"description": "Whirlpool SDK for the Orca protocol.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc