UNPKG

@drift-labs/sdk

Version:
22 lines (20 loc) 547 B
import type { PublicKey, TransactionInstruction } from '@solana/web3.js'; import type { DriftProgram } from '../../config'; export async function buildUpdateFundingRateInstruction(args: { program: DriftProgram; perpMarketIndex: number; state: PublicKey; perpMarket: PublicKey; oracle: PublicKey; }): Promise<TransactionInstruction> { return await (args.program.instruction as any).updateFundingRate( args.perpMarketIndex, { accounts: { state: args.state, perpMarket: args.perpMarket, oracle: args.oracle, }, } ); }