UNPKG

@ox-fun/drift-sdk

Version:

SDK for Drift Protocol

23 lines (19 loc) 524 B
import { BN } from '@coral-xyz/anchor'; import { PublicKey } from '@solana/web3.js'; import { OracleSource } from '../types'; export type OraclePriceData = { price: BN; slot: BN; confidence: BN; hasSufficientNumberOfDataPoints: boolean; twap?: BN; twapConfidence?: BN; }; export type OracleInfo = { publicKey: PublicKey; source: OracleSource; }; export interface OracleClient { getOraclePriceDataFromBuffer(buffer: Buffer): OraclePriceData; getOraclePriceData(publicKey: PublicKey): Promise<OraclePriceData>; }