import { PublicKey, TransactionInstruction, Transaction, AccountMeta } from "@solana/web3.js"; import * as anchor from "@zetamarkets/anchor"; import * as types from "./types"; import { Asset } from "./constants"; import * as constants from "./constants"; export declare function initializeCombinedInsuranceVaultIx(): TransactionInstruction; export declare function initializeCombinedVaultIx(): TransactionInstruction; export declare function initializeCombinedSocializedLossAccountIx(): TransactionInstruction; export declare function migrateToCrossMarginAccountIx(marginAccounts: PublicKey[], crossMarginAccount: PublicKey, userKey: PublicKey): TransactionInstruction; export declare function initializeCrossMarginAccountManagerV2Ix(crossMarginAccountManager: PublicKey, user: PublicKey, referrer?: PublicKey): TransactionInstruction; export declare function closeCrossMarginAccountManagerIx(userKey: PublicKey, crossMarginAccountManager: PublicKey): TransactionInstruction; export declare function initializeCrossMarginAccountIx(crossMarginAccount: PublicKey, crossMarginAccountManager: PublicKey, user: PublicKey): TransactionInstruction; export declare function closeCrossMarginAccountIx(userKey: PublicKey, crossMarginAccount: PublicKey, crossMarginAccountManager: PublicKey): TransactionInstruction; export declare function closeMarginAccountIx(asset: Asset, userKey: PublicKey, marginAccount: PublicKey): TransactionInstruction; export declare function initializeInsuranceDepositAccountIx(payer: PublicKey, userKey: PublicKey, userWhitelistInsuranceKey: PublicKey): TransactionInstruction; /** * @param amount the native amount to deposit (6dp) */ export declare function depositV2Ix(amount: number, marginAccount: PublicKey, usdcAccount: PublicKey, userKey: PublicKey, whitelistDepositAccount: PublicKey | undefined): TransactionInstruction; /** * @param amount the native amount to deposit (6dp) * @param user to deposit to */ export declare function depositPermissionlessIx(amount: number, userToDeposit: PublicKey, payer: PublicKey, whitelistDepositAccount: PublicKey | undefined): TransactionInstruction; /** * @param amount * @param insuranceDepositAccount * @param usdcAccount * @param userKey */ export declare function depositInsuranceVaultV2Ix(amount: number, insuranceDepositAccount: PublicKey, usdcAccount: PublicKey, userKey: PublicKey): TransactionInstruction; export declare function withdrawInsuranceVaultV2Ix(percentageAmount: number, insuranceDepositAccount: PublicKey, usdcAccount: PublicKey, userKey: PublicKey): TransactionInstruction; /** * @param amount the native amount to withdraw (6dp) */ export declare function withdrawV2Ix(amount: number, marginAccount: PublicKey, usdcAccount: PublicKey, userKey: PublicKey): TransactionInstruction; export declare function initializeOpenOrdersV2Ix(market: PublicKey, userKey: PublicKey, authority: PublicKey, marginAccount: PublicKey): [TransactionInstruction, PublicKey]; export declare function initializeOpenOrdersV3Ix(asset: Asset, market: PublicKey, authority: PublicKey, crossMarginAccount: PublicKey): [TransactionInstruction, PublicKey]; export declare function closeOpenOrdersV4Ix(asset: Asset, userKey: PublicKey, crossMarginAccount: PublicKey, openOrders: PublicKey): TransactionInstruction; export declare function closeOpenOrdersV2Ix(market: PublicKey, userKey: PublicKey, marginAccount: PublicKey, openOrders: PublicKey): TransactionInstruction; export declare function placePerpOrderV5Ix(asset: Asset, price: number, size: number, side: types.Side, orderType: types.OrderType, reduceOnly: boolean, clientOrderId: number, tag: String, tifOffset: number, marginAccount: PublicKey, authority: PublicKey, openOrders: PublicKey, whitelistTradingFeesAccount: PublicKey | undefined, selfTradeBehavior?: types.SelfTradeBehavior): TransactionInstruction; export declare function placeMultiOrdersIx(asset: Asset, bidOrders: OrderArgs[], askOrders: OrderArgs[], orderType: types.OrderType, marginAccount: PublicKey, authority: PublicKey, openOrders: PublicKey): TransactionInstruction; export declare function placeTriggerOrderIx(asset: Asset, orderPrice: number, triggerPrice: number, triggerDirection: types.TriggerDirection, triggerTimestamp: anchor.BN, triggerOrderBit: number, size: number, side: types.Side, orderType: types.OrderType, reduceOnly: boolean, tag: String, marginAccount: PublicKey, authority: PublicKey, openOrders: PublicKey): TransactionInstruction; export declare function executeTriggerOrderV2Ix(asset: Asset, side: types.Side, triggerOrderBit: number, triggerOrder: PublicKey, marginAccount: PublicKey, openOrders: PublicKey, payer: PublicKey): TransactionInstruction; export declare function takeTriggerOrderIx(asset: Asset, triggerOrder: PublicKey, triggerOrderBit: number, orderMarginAccount: PublicKey, takerMarginAccount: PublicKey, taker: PublicKey): TransactionInstruction; export declare function cancelTriggerOrderV2Ix(triggerOrderBit: number, authority: PublicKey, triggerOrder: PublicKey, marginAccount: PublicKey): TransactionInstruction; export declare function forceCancelTriggerOrderIx(triggerOrderBit: number, authority: PublicKey, triggerOrder: PublicKey, marginAccount: PublicKey, enforceTpslConditions?: boolean): TransactionInstruction; export declare function editTriggerOrderIx(newOrderPrice: number, newTriggerPrice: number, newTriggerDirection: types.TriggerDirection, newTriggerTimestamp: anchor.BN, newSize: number, newSide: types.Side, newOrderType: types.OrderType, newReduceOnly: boolean, owner: PublicKey, triggerOrder: PublicKey, crossMarginAccount: PublicKey): TransactionInstruction; export declare function cancelOrderIx(asset: Asset, userKey: PublicKey, marginAccount: PublicKey, openOrders: PublicKey, orderId: anchor.BN, side: types.Side): TransactionInstruction; export declare function cancelOrderNoErrorIx(asset: Asset, userKey: PublicKey, marginAccount: PublicKey, openOrders: PublicKey, orderId: anchor.BN, side: types.Side): TransactionInstruction; export declare function pruneExpiredTIFOrdersIxV2(asset: Asset, limit: number): TransactionInstruction; export declare function pruneExpiredTIFOrdersIx(asset: Asset): TransactionInstruction; export declare function cancelAllMarketOrdersIx(asset: Asset, userKey: PublicKey, marginAccount: PublicKey, openOrders: PublicKey): TransactionInstruction; export declare function cancelOrderByClientOrderIdIx(asset: Asset, userKey: PublicKey, marginAccount: PublicKey, openOrders: PublicKey, clientOrderId: anchor.BN): TransactionInstruction; export declare function cancelOrderByClientOrderIdNoErrorIx(asset: Asset, userKey: PublicKey, marginAccount: PublicKey, openOrders: PublicKey, clientOrderId: anchor.BN): TransactionInstruction; export declare function forceCancelOrderByOrderIdV2Ix(asset: Asset, marginAccount: PublicKey, openOrders: PublicKey, orderId: anchor.BN, side: types.Side): TransactionInstruction; export declare function forceCancelOrdersV2Ix(asset: Asset, marginAccount: PublicKey, openOrders: PublicKey): TransactionInstruction; export declare function initializeZetaMarketTIFEpochCyclesIx(asset: Asset, cycleLength: number): TransactionInstruction; export declare function initializeZetaMarketTxs(asset: Asset, seedIndex: number, requestQueue: PublicKey, eventQueue: PublicKey, bids: PublicKey, asks: PublicKey, marketIndexes: PublicKey, zetaGroupAddress: PublicKey): Promise<[Transaction, Transaction]>; export declare function initializeUnderlyingIx(underlyingMint: PublicKey, flexUnderlying: boolean): TransactionInstruction; export declare function initializePerpSyncQueueIx(asset: Asset): TransactionInstruction; export declare function collectTreasuryFundsIx(collectionTokenAccount: PublicKey, amount: anchor.BN, admin: PublicKey): TransactionInstruction; export declare function treasuryMovementIx(treasuryMovementType: types.TreasuryMovementType, amount: anchor.BN): TransactionInstruction; export declare function rebalanceInsuranceVaultIx(remainingAccounts: any[]): TransactionInstruction; export declare function liquidateV2Ix(asset: Asset, liquidator: PublicKey, liquidatorAccount: PublicKey, market: PublicKey, liquidatedAccount: PublicKey, size: number): TransactionInstruction; export declare function crankMarketIx(asset: Asset, market: PublicKey, eventQueue: PublicKey, dexProgram: PublicKey, remainingAccounts: any[]): TransactionInstruction; export declare function updatePricingV2Ix(asset: Asset): TransactionInstruction; export declare function updatePricingV3Ix(asset: Asset, price: anchor.BN, timestamp: anchor.BN): TransactionInstruction; export declare function applyPerpFundingIx(asset: Asset, remainingAccounts: any[]): TransactionInstruction; export declare function updateTreasurySplitTokenAccountIx(treasurySplitTokenAccount: PublicKey, treasurySplitPercentage: number, admin: PublicKey): TransactionInstruction; export declare function updateMarginParametersIx(asset: Asset, args: UpdateMarginParametersArgs, admin: PublicKey): TransactionInstruction; export declare function updatePerpParametersIx(asset: Asset, args: UpdatePerpParametersArgs, admin: PublicKey): TransactionInstruction; export declare function initializeZetaPricingIx(perpArgs: UpdatePerpParametersArgs, marginArgs: UpdateMarginParametersArgs): TransactionInstruction; export declare function updateZetaPricingPubkeysIx(args: UpdateZetaPricingPubkeysArgs): TransactionInstruction; export declare function initializeZetaStateIx(stateAddress: PublicKey, stateNonce: number, serumAuthority: PublicKey, treasuryWallet: PublicKey, referralsAdmin: PublicKey, referralsRewardsWallet: PublicKey, serumNonce: number, mintAuthority: PublicKey, mintAuthorityNonce: number, params: StateParams, secondaryAdmin: PublicKey): TransactionInstruction; export declare function initializeZetaTreasuryWalletIx(): TransactionInstruction; export declare function initializeZetaReferralsRewardsWalletIx(): TransactionInstruction; export declare function updateZetaStateIx(params: StateParams, admin: PublicKey): TransactionInstruction; export declare function addPerpMarketIndexIx(asset: Asset, marketIndexes: PublicKey): TransactionInstruction; export declare function initializeMarketIndexesIx(asset: Asset, marketIndexes: PublicKey, nonce: number): TransactionInstruction; export declare function addMarketIndexesIx(asset: Asset, marketIndexes: PublicKey): TransactionInstruction; export declare function initializeWhitelistDepositAccountIx(asset: Asset, user: PublicKey, admin: PublicKey): TransactionInstruction; export declare function initializeWhitelistInsuranceAccountIx(user: PublicKey, admin: PublicKey): TransactionInstruction; export declare function initializeWhitelistTradingFeesAccountIx(user: PublicKey, admin: PublicKey): TransactionInstruction; export declare function settlePositionsHaltedTxs(asset: Asset, marginAccounts: AccountMeta[], admin: PublicKey): Transaction[]; export declare function settlePositionsHaltedIx(asset: Asset, marginAccounts: AccountMeta[], admin: PublicKey): TransactionInstruction; export declare function cleanZetaMarketsIx(asset: Asset, marketAccounts: any[]): TransactionInstruction; export declare function cleanZetaMarketHaltedIx(asset: Asset): TransactionInstruction; export declare function cancelOrderHaltedIx(asset: Asset, account: PublicKey, openOrders: PublicKey, orderId: anchor.BN, side: types.Side): TransactionInstruction; export declare function haltIx(asset: Asset, admin: PublicKey): TransactionInstruction; export declare function unhaltIx(asset: Asset, admin: PublicKey): TransactionInstruction; export declare function updateHaltStateIx(args: UpdateHaltStateArgs, admin: PublicKey): TransactionInstruction; export declare function updateAdminIx(secondary: boolean, admin: PublicKey, newAdmin: PublicKey): TransactionInstruction; export declare function updatePricingAdminIx(secondary: boolean, admin: PublicKey, newAdmin: PublicKey): TransactionInstruction; export declare function initializeReferrerAccountsIx(id: string, user: PublicKey, referrerIdAccount: PublicKey, referrerPubkeyAccount: PublicKey): TransactionInstruction; export declare function closeReferrerAccountsIx(user: PublicKey, referrerIdAccount: PublicKey, referrerPubkeyAccount: PublicKey): TransactionInstruction; export declare function updateReferralsAdminIx(admin: PublicKey, newReferralsAdmin: PublicKey): TransactionInstruction; export declare function settleDexFundsTxs(asset: Asset, vaultOwner: PublicKey, remainingAccounts: any[]): Transaction[]; export declare function settleDexFundsIx(asset: Asset, vaultOwner: PublicKey, openOrders: PublicKey): TransactionInstruction; export declare function burnVaultTokenTx(asset: Asset): Transaction; export declare function toggleMarketMakerIx(isMarketMaker: boolean, account: PublicKey): TransactionInstruction; export declare function chooseAirdropCommunityIx(community: number, accountManager: PublicKey, authority: PublicKey): TransactionInstruction; export declare function editDelegatedPubkeyIx(delegatedPubkey: PublicKey, account: PublicKey, authority: PublicKey): TransactionInstruction; export declare function updateTakeTriggerOrderFeePercentageIx(newTakeTriggerOrderFeePercentage: anchor.BN, admin: PublicKey): TransactionInstruction; export declare function updateMakerRebatePercentageIx(newNativeMakerRebatePercetange: anchor.BN, admin: PublicKey): TransactionInstruction; export declare function editMaType(maType: constants.MarginAccountType, marginAccount: PublicKey, admin: PublicKey): TransactionInstruction; export declare function updateMinLotIx(asset: Asset, newMinLotSize: number, admin: PublicKey): TransactionInstruction; export declare function updateTickSizeIx(asset: Asset, newTickSize: number, admin: PublicKey): TransactionInstruction; export declare function initializeMinLotsAndTickSizes(admin: PublicKey): TransactionInstruction; export interface ExpireSeriesOverrideArgs { settlementNonce: number; settlementPrice: anchor.BN; } export interface UpdateHaltStateArgs { asset: any; spotPrice: anchor.BN; timestamp: anchor.BN; } export interface UpdateVolatilityArgs { expiryIndex: number; volatility: Array; } export interface UpdateInterestRateArgs { expiryIndex: number; interestRate: anchor.BN; } export interface StateParams { strikeInitializationThresholdSeconds: number; pricingFrequencySeconds: number; liquidatorLiquidationPercentage: number; insuranceVaultLiquidationPercentage: number; nativeDepositLimit: anchor.BN; expirationThresholdSeconds: number; positionMovementFeeBps: number; marginConcessionPercentage: number; maxPerpDeltaAgeSeconds: number; nativeWithdrawLimit: anchor.BN; withdrawLimitEpochSeconds: number; nativeOpenInterestLimit: anchor.BN; } export interface InitializeZetaGroupPricingArgs { interestRate: anchor.BN; volatility: Array; optionTradeNormalizer: anchor.BN; futureTradeNormalizer: anchor.BN; maxVolatilityRetreat: anchor.BN; maxInterestRetreat: anchor.BN; minDelta: anchor.BN; maxDelta: anchor.BN; minInterestRate: anchor.BN; maxInterestRate: anchor.BN; minVolatility: anchor.BN; maxVolatility: anchor.BN; } export interface UpdateMarginParametersArgs { futureMarginInitial: anchor.BN; futureMarginMaintenance: anchor.BN; } export interface UpdatePerpParametersArgs { minFundingRatePercent: anchor.BN; maxFundingRatePercent: anchor.BN; perpImpactCashDelta: anchor.BN; } export interface UpdateZetaGroupExpiryArgs { expiryIntervalSeconds: number; newExpiryThresholdSeconds: number; } export interface PositionMovementArg { index: number; size: anchor.BN; } export interface OverrideExpiryArgs { expiryIndex: number; activeTs: anchor.BN; expiryTs: anchor.BN; } export interface SetReferralsRewardsArgs { referralsAccountKey: PublicKey; pendingRewards: anchor.BN; overwrite: boolean; } export interface UpdateZetaPricingPubkeysArgs { asset: any; oracle: PublicKey; market: PublicKey; perpSyncQueue: PublicKey; zetaGroupKey: PublicKey; resetOracle: boolean; } export interface OrderArgs { price: anchor.BN; size: anchor.BN; clientOrderId: anchor.BN | null; tifOffset: number | null; }