@kamino-finance/kliquidity-sdk
Version:
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
41 lines • 2.71 kB
TypeScript
import { Address, IInstruction, TransactionSigner, Rpc, GetAccountInfoApi, Account } from '@solana/kit';
import { WhirlpoolStrategy } from '../@codegen/kliquidity/accounts';
import Decimal from 'decimal.js';
import { CollateralInfo } from '../@codegen/kliquidity/types';
import { Token } from '@solana-program/token-2022';
export declare const SOL_MINTS: (Address<"So11111111111111111111111111111111111111111"> | Address<"So11111111111111111111111111111111111111112">)[];
export declare const DECIMALS_SOL = 9;
export declare function getAssociatedTokenAddressAndAccount(connection: Rpc<GetAccountInfoApi>, mint: Address, owner: Address, programId?: Address): Promise<[Address, Account<Token> | null]>;
export declare function getAssociatedTokenAddress(mint: Address, owner: Address, programId?: Address, associatedTokenProgramId?: Address): Promise<Address>;
export declare function createAssociatedTokenAccountInstruction(payer: TransactionSigner, associatedToken: Address, owner: Address, mint: Address, programId?: Address, associatedTokenProgramId?: Address): IInstruction;
export declare function createComputeUnitLimitIx(units?: number): IInstruction;
export declare function getStrategyPriceRangeOrca(tickLowerIndex: number, tickUpperIndex: number, strategy: WhirlpoolStrategy, poolPrice: Decimal): {
priceLower: Decimal;
poolPrice: Decimal;
priceUpper: Decimal;
strategyOutOfRange: boolean;
};
export declare function getStrategyPriceRangeRaydium(tickLowerIndex: number, tickUpperIndex: number, tickCurrent: number, tokenADecimals: number, tokenBDecimals: number): {
priceLower: Decimal;
poolPrice: Decimal;
priceUpper: Decimal;
strategyOutOfRange: boolean;
};
export declare function getStrategyPriceRangeMeteora(priceLower: Decimal, priceUpper: Decimal, activeBinId: number, binStep: number, decimalsA: number, decimalsB: number): {
priceLower: Decimal;
poolPrice: Decimal;
priceUpper: Decimal;
strategyOutOfRange: boolean;
};
export declare function getMeteoraPriceLowerUpper(tickLowerIndex: number, tickUpperIndex: number, tokenAMintDecimals: number, tokenBMintDecimals: number, binStep: number): {
priceLower: Decimal;
priceUpper: Decimal;
};
export declare function getPriceLowerUpper(tickLowerIndex: number, tickUpperIndex: number, tokenAMintDecimals: number, tokenBMintDecimals: number): {
priceLower: Decimal;
priceUpper: Decimal;
};
export declare function getTokenNameFromCollateralInfo(collateralInfo: CollateralInfo): string;
export declare const isSOLMint: (mint: Address) => boolean;
export declare function getMintDecimals(rpc: Rpc<GetAccountInfoApi>, mint: Address): Promise<number>;
//# sourceMappingURL=tokenUtils.d.ts.map