@kamino-finance/kliquidity-sdk
Version:
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
38 lines • 2.01 kB
TypeScript
import { Address, Rpc, SolanaRpcApi } from '@solana/kit';
import Decimal from 'decimal.js';
import { Whirlpool as WhirlpoolAPIResponse } from './OrcaWhirlpoolsResponse';
import { type WhirlpoolStrategy } from '../@codegen/kliquidity/accounts';
import { WhirlpoolAprApy } from './WhirlpoolAprApy';
import { GenericPoolInfo, LiquidityDistribution } from '../utils';
import { CollateralInfo } from '../@codegen/kliquidity/types';
import { KaminoPrices } from '../models';
import { Logger } from '../utils/Logger';
export declare class OrcaService {
private readonly _rpc;
private readonly _whirlpoolProgramId;
private readonly _orcaApiUrl;
private readonly _logger;
constructor(rpc: Rpc<SolanaRpcApi>, whirlpoolProgramId?: Address, logger?: Logger);
getWhirlpoolProgramId(): Address;
getOrcaWhirlpools(tokens?: Address[]): Promise<WhirlpoolAPIResponse[]>;
getOrcaWhirlpool(poolAddress: Address): Promise<WhirlpoolAPIResponse>;
private getStrategyRewardMint;
private getPoolRewardMint;
private getRewardsDecimals;
/**
* Get token prices for a strategy - for use with orca sdk
* @param strategy
* @param prices
* @param collateralInfos
* @returns {Record<string, Decimal>} - token prices by mint string
* @private
*/
private getTokenPrices;
private getPoolTokensPrices;
getStrategyWhirlpoolPoolAprApy(strategy: WhirlpoolStrategy, collateralInfos: CollateralInfo[], prices: KaminoPrices): Promise<WhirlpoolAprApy>;
getWhirlpoolLiquidityDistribution(pool: Address, keepOrder?: boolean, lowestTick?: number, highestTick?: number): Promise<LiquidityDistribution>;
getWhirlpoolPositionAprApy(poolPubkey: Address, priceLower: Decimal, priceUpper: Decimal, prices: KaminoPrices, rewardsDecimals: Map<Address, number>): Promise<WhirlpoolAprApy>;
getGenericPoolInfo(poolPubkey: Address): Promise<GenericPoolInfo>;
getPositionsCountByPool(pool: Address): Promise<number>;
}
//# sourceMappingURL=OrcaService.d.ts.map