import { BN } from "@coral-xyz/anchor"; import { PublicKey } from "@solana/web3.js"; import { Decodable } from "./base"; export declare const STRATEGY_DURATION_COUNT = 5; interface ExternalYieldAccounts { externalYieldAccount: PublicKey; externalYieldVault: PublicKey; } interface CapMonitor { startTime1hr: BN; startTime24hr: BN; principal1hr: BN; principal24hr: BN; } export declare const LOOPSCALE_STRATEGY_ACCOUNT_DISCRIMINATOR: Buffer; export declare const LOOPSCALE_VAULT_DISCRIMINATOR: Buffer; export declare const LOOPSCALE_VAULT_STAKE_DISCRIMINATOR: Buffer; export declare function hasLoopscaleStrategyDiscriminator(data: Buffer): boolean; export declare class LoopscaleStrategy extends Decodable { discriminator: number[]; version: number; nonce: PublicKey; bump: number; principalMint: PublicKey; lender: PublicKey; originationsEnabled: number; externalYieldSource: number; interestPerSecond: number[]; lastAccruedTimestamp: BN; liquidityBuffer: BN; tokenBalance: BN; interestFee: BN; principalFee: BN; originationFee: BN; originationCap: BN; externalYieldAmount: BN; currentDeployedAmount: BN; outstandingInterestAmount: BN; feeClaimable: BN; cumulativePrincipalOriginated: BN; cumulativeInterestAccrued: BN; cumulativeLoanCount: BN; activeLoanCount: BN; marketInformation: PublicKey; collateralMap: BN[][]; externalYieldAccounts: ExternalYieldAccounts; supplyMonitor: CapMonitor; withdrawMonitor: CapMonitor; borrowMonitor: CapMonitor; static _layout: any; /** * Returns the duration index whose collateral term for the given asset * matches `expectedApy`, or null if no populated slot matches. */ durationIndexForApy(collateralAssetIndex: number, expectedApy: BN): number | null; /** Duration indexes that have a populated collateral term for the asset. */ populatedDurationIndexes(collateralAssetIndex: number): number[]; } export declare class LoopscaleVault extends Decodable { discriminator: number[]; manager: PublicKey; nonce: PublicKey; bump: number; lpSupply: BN; lpMint: PublicKey; principalMint: PublicKey; cumulativePrincipalDeposited: BN; depositsEnabled: number; maxEarlyUnstakeFee: BN; static _layout: any; } export declare function hasLoopscaleVaultDiscriminator(data: Buffer): boolean; export declare function hasLoopscaleVaultStakeDiscriminator(data: Buffer): boolean; export declare const LOOPSCALE_LOAN_LEDGER_COUNT = 5; export declare const LOOPSCALE_LOAN_COLLATERAL_COUNT = 5; export declare const LOOPSCALE_LOAN_DISCRIMINATOR: Buffer; export declare function hasLoopscaleLoanDiscriminator(data: Buffer): boolean; export interface LoopscaleLoanDuration { duration: number; durationType: number; } export interface LoopscaleLedger { status: number; strategy: PublicKey; principalMint: PublicKey; marketInformation: PublicKey; principalDue: BN; principalRepaid: BN; interestOutstanding: BN; lastInterestUpdatedTime: BN; duration: LoopscaleLoanDuration; interestPerSecond: number[]; startTime: BN; endTime: BN; apy: BN; } export interface LoopscaleCollateral { assetMint: PublicKey; amount: BN; assetType: number; assetIdentifier: PublicKey; } export declare class LoopscaleLoan extends Decodable { discriminator: number[]; version: number; bump: number; status: number; borrower: PublicKey; nonce: BN; startTime: BN; ledgers: LoopscaleLedger[]; collateral: LoopscaleCollateral[]; weightMatrix: number[][]; ltvMatrix: number[][]; lqtMatrix: number[][]; static _layout: any; /** Ledgers that are not in the empty/unused (status 0) state. */ get activeLedgers(): LoopscaleLedger[]; /** Collateral entries that hold a non-zero amount or a set identifier. */ get activeCollateral(): LoopscaleCollateral[]; } interface CollateralCaps { maxAllocationPct: BN; currentAllocationAmount: BN; } export interface LoopscaleAssetData { assetIdentifier: PublicKey; quoteMint: PublicKey; oracleAccount: PublicKey; oracleType: number; maxUncertainty: BN; maxAge: BN; decimals: number; ltv: BN; liquidationThreshold: BN; collateralCaps: CollateralCaps; } interface PrincipalCaps { max1hr: BN; max24hr: BN; maxOutstanding: BN; } export declare class LoopscaleMarketInformation extends Decodable { discriminator: number[]; authority: PublicKey; delegate: PublicKey; principalMint: PublicKey; assetData: LoopscaleAssetData[]; borrowCaps: PrincipalCaps; withdrawCaps: PrincipalCaps; supplyCaps: PrincipalCaps; version: number; static _layout: any; /** Index of `assetIdentifier` in the asset data table, or null if absent. */ findAssetIndex(assetIdentifier: PublicKey): number | null; } export {};