UNPKG

@symmetry-hq/baskets-v2-sdk

Version:

Symmetry Baskets V2 SDK

23 lines (22 loc) 1.03 kB
import { AccountInfo, PublicKey } from "@solana/web3.js"; import { BasketsProgram } from "../idl/types"; import { Program } from "@coral-xyz/anchor"; export declare enum OracleType { Pyth = 0, RaydiumCpmm = 1, RaydiumLiquidityPoolV4 = 2, Unknown = 3 } export declare class OracleTypeUtils { static toU8(type: OracleType): number; static fromU8(value: number): OracleType; } export declare function validateOracle(program: Program<BasketsProgram>, tokenMint: PublicKey, tokenMintAccountInfo: AccountInfo<Buffer>, oracleAccountInfo: AccountInfo<Buffer>, oracleType: number, oracle1: PublicKey, oracle2: PublicKey): string; export interface OraclePrice { sellPrice: number; avgPrice: number; buyPrice: number; age: number; sellValue: number; } export declare function loadOraclePrice(tokenDecimals: number, oracleType: number, oracleAccount1: AccountInfo<Buffer> | null, oracleAccount2: AccountInfo<Buffer> | null, solPrice: number, usdcPrice: number, tokenAmount: number): OraclePrice;