import { Account, Address, Base64EncodedDataResponse, GetMultipleAccountsApi, Rpc } from '@solana/kit'; import Decimal from 'decimal.js'; import { Scope } from '@kamino-finance/scope-sdk'; import { OraclePrices } from '@kamino-finance/scope-sdk/dist/@codegen/scope/accounts/OraclePrices'; import { ReserveWithAddress } from '../classes'; import { Reserve } from '../lib'; import { Configuration } from '@kamino-finance/scope-sdk/dist/@codegen/scope/accounts/Configuration'; export declare const MAX_CONFIDENCE_PERCENTAGE: Decimal; export declare const CONFIDENCE_FACTOR: Decimal; export type TokenOracleData = { mintAddress: Address; decimals: Decimal; price: Decimal; timestamp: bigint; valid: boolean; }; export type CandidatePrice = { price: Decimal; timestamp: bigint; valid: boolean; }; export type ScopePriceRefreshConfig = { scope: Scope; scopeConfigurations: [Address, Configuration][]; }; export declare function hasOracleConfigured(reserve: Reserve): boolean; export declare function getUnconfiguredOracleReserveMessage(reserveAddress: Address, reserve: Reserve): string; export declare function getTokenOracleDataSync(allOracleAccounts: AllOracleAccounts, reserves: ReserveWithAddress[]): Array<[ReserveWithAddress, TokenOracleData | undefined]>; export declare function getTokenOracleData(rpc: Rpc, reserves: ReserveWithAddress[], oracleAccounts?: AllOracleAccounts): Promise>; export type AllOracleAccounts = Map>; export declare function getAllOracleAccounts(rpc: Rpc, reserves: Reserve[]): Promise; export type PythPrices = { spot?: CandidatePrice; twap?: CandidatePrice; }; /** * Get pyth price from cache or fetch if not available * @param oracle oracle address * @param cache pyth cache * @param oracleAccounts all oracle accounts */ export declare function cacheOrGetPythPrices(oracle: Address, cache: Map, oracleAccounts: AllOracleAccounts): PythPrices | null; /** * Get switchboard price from cache or fetch if not available * @param oracle oracle address * @param switchboardCache cache for oracle prices * @param oracleAccounts all oracle accounts */ export declare function cacheOrGetSwitchboardPrice(oracle: Address, switchboardCache: Map, oracleAccounts: AllOracleAccounts): CandidatePrice | null; /** * Get scope price from cache or fetch if not available * @param oracle oracle address * @param scopeCache cache for oracle prices * @param allOracleAccounts all oracle accounts * @param chain scope chain */ export declare function cacheOrGetScopePrice(oracle: Address, scopeCache: Map, allOracleAccounts: AllOracleAccounts, chain: number[]): CandidatePrice | null; //# sourceMappingURL=oracle.d.ts.map