/** * @name perps/adrena/adrena-pda * @description PDA derivation helpers for the Adrena protocol on Solana. * * All PDAs are derived from the official Adrena release/39 ABI layout using * `@solana/web3.js` `PublicKey.findProgramAddressSync`. * * @module perps/adrena/adrena-pda */ import { PublicKey } from '@solana/web3.js'; /** * Derive the Cortex PDA: [Buffer.from("cortex")]. * @returns Cortex public key. */ export declare function deriveCortexPda(): PublicKey; /** * Derive a Pool PDA from a pool address: [Buffer.from("pool"), poolAddress]. * Note: Adrena pools are existing accounts, not PDAs in most instructions. * The Pool PDA is used for named pools where the seed is the pool name. * @param poolName — Pool name bytes (e.g. "main-pool"). * @returns Pool PDA public key. */ export declare function derivePoolPdaFromName(poolName: string): PublicKey; /** * Derive a Custody PDA: [Buffer.from("custody"), pool, seed]. * @param pool — Pool public key. * @param seed — Custody seed (u32 little-endian, 4 bytes). * @returns Custody PDA public key. */ export declare function deriveCustodyPda(pool: PublicKey, seed: Buffer): PublicKey; /** * Derive a custody token account PDA: [Buffer.from("custody_token_account"), custody]. * @param custody — Custody public key. * @returns Custody token account public key. */ export declare function deriveCustodyTokenAccountPda(custody: PublicKey): PublicKey; /** * Derive the Oracle PDA: [Buffer.from("oracle")]. * @returns Oracle public key. */ export declare function deriveOraclePda(): PublicKey; /** * Derive the transfer authority PDA: [Buffer.from("transfer_authority")]. * @returns Transfer authority public key. */ export declare function deriveTransferAuthorityPda(): PublicKey; /** * Derive a user profile PDA: [Buffer.from("user_profile"), owner]. * @param owner — Owner wallet public key. * @returns User profile PDA public key. */ export declare function deriveUserProfilePda(owner: PublicKey): PublicKey; /** * Derive a Position PDA: [Buffer.from("position"), owner, pool, custody, side_byte]. * Side enum: Long = 1, Short = 2 (NOT 0/1 — see Adrena types.rs Side enum). * @param owner — Owner wallet public key. * @param pool — Pool public key. * @param custody — Custody (principal) public key. * @param side — Position side: 'long' | 'short'. * @returns Position PDA public key. */ export declare function derivePositionPda(owner: PublicKey, pool: PublicKey, custody: PublicKey, side: 'long' | 'short'): PublicKey; /** * Derive a limit order book PDA: [Buffer.from("limit_order_book"), owner, pool]. * @param owner — Owner wallet public key. * @param pool — Pool public key. * @returns Limit order book PDA public key. */ export declare function deriveLimitOrderBookPda(owner: PublicKey, pool: PublicKey): PublicKey; /** * Derive a collateral escrow PDA: [Buffer.from("escrow_account"), owner, pool, collateralCustody]. * @param owner — Owner wallet public key. * @param pool — Pool public key. * @param collateralCustody — Collateral custody public key. * @returns Collateral escrow PDA public key. */ export declare function deriveCollateralEscrowPda(owner: PublicKey, pool: PublicKey, collateralCustody: PublicKey): PublicKey; /** * Derive LP token mint PDA: [Buffer.from("lp_token_mint"), pool]. * @param pool — Pool public key. * @returns LP token mint PDA public key. */ export declare function deriveLpTokenMintPda(pool: PublicKey): PublicKey; /** * Derive staking PDA: [Buffer.from("staking"), stakingSeed]. * The staking seed is the LP token mint for LP staking, or the governance token mint for ADX staking. * @param stakingSeed — Staking seed public key (e.g. LP token mint). * @returns Staking PDA public key. */ export declare function deriveStakingPda(stakingSeed: PublicKey): PublicKey; /** * Derive user staking PDA: [Buffer.from("user_staking"), owner, staking]. * @param owner — Owner wallet public key. * @param staking — Staking PDA public key. * @returns User staking PDA public key. */ export declare function deriveUserStakingPda(owner: PublicKey, staking: PublicKey): PublicKey; /** * Derive genesis lock PDA: [Buffer.from("genesis_lock"), pool]. * @param pool — Pool public key. * @returns Genesis lock PDA public key. */ export declare function deriveGenesisLockPda(pool: PublicKey): PublicKey; /** * Derive LM token treasury PDA: [Buffer.from("lm_token_treasury"), cortex]. * @param cortex — Cortex PDA public key. * @returns LM token treasury PDA public key. */ export declare function deriveLmTokenTreasuryPda(cortex: PublicKey): PublicKey; /** * Derive LM token mint PDA: [Buffer.from("lm_token_mint")]. * @returns LM token mint PDA public key. */ export declare function deriveLmTokenMintPda(): PublicKey; /** * Derive governance token mint PDA: [Buffer.from("governance_token_mint")]. * @returns Governance token mint PDA public key. */ export declare function deriveGovernanceTokenMintPda(): PublicKey; /** * Derive staking staked token vault PDA: [Buffer.from("staking_staked_token_vault"), staking]. * @param staking — Staking PDA public key. * @returns Staking staked token vault PDA public key. */ export declare function deriveStakingStakedTokenVaultPda(staking: PublicKey): PublicKey; /** * Derive staking reward token vault PDA: [Buffer.from("staking_reward_token_vault"), staking]. * @param staking — Staking PDA public key. * @returns Staking reward token vault PDA public key. */ export declare function deriveStakingRewardTokenVaultPda(staking: PublicKey): PublicKey; /** * Derive staking LM reward token vault PDA: [Buffer.from("staking_lm_reward_token_vault"), staking]. * @param staking — Staking PDA public key. * @returns Staking LM reward token vault PDA public key. */ export declare function deriveStakingLmRewardTokenVaultPda(staking: PublicKey): PublicKey; /** * Derive the associated token account address for a wallet and mint. * Re-exported from the shared `solana/ata-utils` module for backward compat. * New code should import from `solana/ata-utils.ts` directly. * @param owner — Wallet public key. * @param mint — Token mint public key. * @returns ATA public key. */ export { deriveAtaAddress as deriveAta } from '../../../solana/src/ata-utils.js'; //# sourceMappingURL=adrena-pda.d.ts.map