import { BN } from '@coral-xyz/anchor';
import { PublicKey } from '@solana/web3.js';
import { I80F48, I80F48Dto } from '../numbers/I80F48';
import { As } from '../utils';
import { OracleProvider } from './oracle';
export type TokenIndex = number & As<'token-index'>;
export type OracleConfigDto = {
    confFilter: I80F48Dto;
    maxStalenessSlots: BN;
};
export type OracleConfig = {
    confFilter: I80F48;
    maxStalenessSlots: BN;
};
export type StablePriceModel = {
    stablePrice: number;
    lastUpdateTimestamp: BN;
    delayPrices: number[];
    delayAccumulatorPrice: number;
    delayAccumulatorTime: number;
    delayIntervalSeconds: number;
    delayGrowthLimit: number;
    stableGrowthLimit: number;
    lastDelayIntervalIndex: number;
};
export interface BankForHealth {
    tokenIndex: TokenIndex;
    maintAssetWeight: I80F48;
    initAssetWeight: I80F48;
    maintLiabWeight: I80F48;
    initLiabWeight: I80F48;
    price: I80F48;
    stablePriceModel: StablePriceModel;
    scaledInitAssetWeight(price: I80F48): I80F48;
    scaledInitLiabWeight(price: I80F48): I80F48;
    nativeDeposits(): I80F48;
    nativeBorrows(): I80F48;
    maintWeights(): [I80F48, I80F48];
    depositWeightScaleStartQuote: number;
    borrowWeightScaleStartQuote: number;
}
export declare class Bank implements BankForHealth {
    publicKey: PublicKey;
    group: PublicKey;
    mint: PublicKey;
    vault: PublicKey;
    oracle: PublicKey;
    stablePriceModel: StablePriceModel;
    indexLastUpdated: BN;
    bankRateLastUpdated: BN;
    flashLoanTokenAccountInitial: BN;
    flashLoanApprovedAmount: BN;
    tokenIndex: TokenIndex;
    mintDecimals: number;
    bankNum: number;
    minVaultToDepositsRatio: number;
    netBorrowLimitWindowSizeTs: BN;
    lastNetBorrowsWindowStartTs: BN;
    netBorrowLimitPerWindowQuote: BN;
    netBorrowsInWindow: BN;
    borrowWeightScaleStartQuote: number;
    depositWeightScaleStartQuote: number;
    reduceOnly: number;
    forceClose: boolean;
    feesWithdrawn: BN;
    tokenConditionalSwapTakerFeeRate: number;
    tokenConditionalSwapMakerFeeRate: number;
    flashLoanSwapFeeRate: number;
    interestTargetUtilization: number;
    interestCurveScaling: number;
    potentialSerumTokens: BN;
    maintWeightShiftStart: BN;
    maintWeightShiftEnd: BN;
    fallbackOracle: PublicKey;
    depositLimit: BN;
    allowAssetLiquidation: boolean;
    collateralFeePerDay: number;
    forceWithdraw: boolean;
    name: string;
    oracleConfig: OracleConfig;
    depositIndex: I80F48;
    borrowIndex: I80F48;
    indexedDeposits: I80F48;
    indexedBorrows: I80F48;
    avgUtilization: I80F48;
    adjustmentFactor: I80F48;
    maxRate: I80F48;
    rate0: I80F48;
    rate1: I80F48;
    util0: I80F48;
    util1: I80F48;
    _price: I80F48 | undefined;
    _uiPrice: number | undefined;
    _oracleLastUpdatedSlot: number | undefined;
    _oracleLastKnownDeviation: I80F48 | undefined;
    _oracleProvider: OracleProvider | undefined;
    collectedFeesNative: I80F48;
    loanFeeRate: I80F48;
    loanOriginationFeeRate: I80F48;
    initAssetWeight: I80F48;
    maintAssetWeight: I80F48;
    initLiabWeight: I80F48;
    maintLiabWeight: I80F48;
    liquidationFee: I80F48;
    dust: I80F48;
    maintWeightShiftDurationInv: I80F48;
    maintWeightShiftAssetTarget: I80F48;
    maintWeightShiftLiabTarget: I80F48;
    zeroUtilRate: I80F48;
    platformLiquidationFee: I80F48;
    collectedLiquidationFees: I80F48;
    collectedCollateralFees: I80F48;
    static from(publicKey: PublicKey, obj: {
        group: PublicKey;
        name: number[];
        mint: PublicKey;
        vault: PublicKey;
        oracle: PublicKey;
        oracleConfig: OracleConfigDto;
        stablePriceModel: StablePriceModel;
        depositIndex: I80F48Dto;
        borrowIndex: I80F48Dto;
        indexedDeposits: I80F48Dto;
        indexedBorrows: I80F48Dto;
        indexLastUpdated: BN;
        bankRateLastUpdated: BN;
        avgUtilization: I80F48Dto;
        adjustmentFactor: I80F48Dto;
        util0: I80F48Dto;
        rate0: I80F48Dto;
        util1: I80F48Dto;
        rate1: I80F48Dto;
        maxRate: I80F48Dto;
        collectedFeesNative: I80F48Dto;
        loanOriginationFeeRate: I80F48Dto;
        loanFeeRate: I80F48Dto;
        maintAssetWeight: I80F48Dto;
        initAssetWeight: I80F48Dto;
        maintLiabWeight: I80F48Dto;
        initLiabWeight: I80F48Dto;
        liquidationFee: I80F48Dto;
        dust: I80F48Dto;
        flashLoanTokenAccountInitial: BN;
        flashLoanApprovedAmount: BN;
        tokenIndex: number;
        mintDecimals: number;
        bankNum: number;
        minVaultToDepositsRatio: number;
        netBorrowLimitWindowSizeTs: BN;
        lastNetBorrowsWindowStartTs: BN;
        netBorrowLimitPerWindowQuote: BN;
        netBorrowsInWindow: BN;
        borrowWeightScaleStartQuote: number;
        depositWeightScaleStartQuote: number;
        reduceOnly: number;
        forceClose: number;
        disableAssetLiquidation: number;
        forceWithdraw: number;
        feesWithdrawn: BN;
        tokenConditionalSwapTakerFeeRate: number;
        tokenConditionalSwapMakerFeeRate: number;
        flashLoanSwapFeeRate: number;
        interestTargetUtilization: number;
        interestCurveScaling: number;
        potentialSerumTokens: BN;
        maintWeightShiftStart: BN;
        maintWeightShiftEnd: BN;
        maintWeightShiftDurationInv: I80F48Dto;
        maintWeightShiftAssetTarget: I80F48Dto;
        maintWeightShiftLiabTarget: I80F48Dto;
        fallbackOracle: PublicKey;
        depositLimit: BN;
        zeroUtilRate: I80F48Dto;
        platformLiquidationFee: I80F48Dto;
        collectedLiquidationFees: I80F48Dto;
        collectedCollateralFees: I80F48Dto;
        collateralFeePerDay: number;
    }): Bank;
    constructor(publicKey: PublicKey, group: PublicKey, name: number[], mint: PublicKey, vault: PublicKey, oracle: PublicKey, oracleConfig: OracleConfigDto, stablePriceModel: StablePriceModel, depositIndex: I80F48Dto, borrowIndex: I80F48Dto, indexedDeposits: I80F48Dto, indexedBorrows: I80F48Dto, indexLastUpdated: BN, bankRateLastUpdated: BN, avgUtilization: I80F48Dto, adjustmentFactor: I80F48Dto, util0: I80F48Dto, rate0: I80F48Dto, util1: I80F48Dto, rate1: I80F48Dto, maxRate: I80F48Dto, collectedFeesNative: I80F48Dto, loanOriginationFeeRate: I80F48Dto, loanFeeRate: I80F48Dto, maintAssetWeight: I80F48Dto, initAssetWeight: I80F48Dto, maintLiabWeight: I80F48Dto, initLiabWeight: I80F48Dto, liquidationFee: I80F48Dto, dust: I80F48Dto, flashLoanTokenAccountInitial: BN, flashLoanApprovedAmount: BN, tokenIndex: TokenIndex, mintDecimals: number, bankNum: number, minVaultToDepositsRatio: number, netBorrowLimitWindowSizeTs: BN, lastNetBorrowsWindowStartTs: BN, netBorrowLimitPerWindowQuote: BN, netBorrowsInWindow: BN, borrowWeightScaleStartQuote: number, depositWeightScaleStartQuote: number, reduceOnly: number, forceClose: boolean, feesWithdrawn: BN, tokenConditionalSwapTakerFeeRate: number, tokenConditionalSwapMakerFeeRate: number, flashLoanSwapFeeRate: number, interestTargetUtilization: number, interestCurveScaling: number, potentialSerumTokens: BN, maintWeightShiftStart: BN, maintWeightShiftEnd: BN, maintWeightShiftDurationInv: I80F48Dto, maintWeightShiftAssetTarget: I80F48Dto, maintWeightShiftLiabTarget: I80F48Dto, fallbackOracle: PublicKey, depositLimit: BN, zeroUtilRate: I80F48Dto, platformLiquidationFee: I80F48Dto, collectedLiquidationFees: I80F48Dto, allowAssetLiquidation: boolean, collectedCollateralFees: I80F48Dto, collateralFeePerDay: number, forceWithdraw: boolean);
    toString(): string;
    isOracleStaleOrUnconfident(nowSlot: number): boolean;
    areDepositsReduceOnly(): boolean;
    areBorrowsReduceOnly(): boolean;
    scaledInitAssetWeight(price: I80F48): I80F48;
    scaledInitLiabWeight(price: I80F48): I80F48;
    maintWeights(): [I80F48, I80F48];
    getAssetPrice(): I80F48;
    getLiabPrice(): I80F48;
    get price(): I80F48;
    get uiPrice(): number;
    get oracleLastUpdatedSlot(): number;
    get oracleProvider(): OracleProvider;
    nativeDeposits(): I80F48;
    nativeBorrows(): I80F48;
    uiDeposits(): number;
    uiBorrows(): number;
    /**
     *
     * @returns borrow rate, 0 is 0% where 1 is 100%; not including loan upkeep rate
     */
    getBorrowRateWithoutUpkeepRate(): I80F48;
    /**
     *
     * @returns total borrow rate, 0 is 0% where 1 is 100% (including loan upkeep rate)
     */
    getBorrowRate(): I80F48;
    /**
     *
     * @returns total borrow rate percentage (including loan upkeep rate)
     */
    getBorrowRateUi(): number;
    /**
     *
     * @returns deposit rate, 0 is 0% where 1 is 100%
     */
    getDepositRate(): I80F48;
    /**
     *
     * @returns deposit rate percentage
     */
    getDepositRateUi(): number;
    getNetBorrowLimitPerWindow(): I80F48;
    getBorrowLimitLeftInWindow(): I80F48;
    getNetBorrowLimitPerWindowUi(): number;
    getMaxWithdraw(vaultBalance: BN, userDeposits?: I80F48): I80F48;
    getTimeToNextBorrowLimitWindowStartsTs(): number;
    /**
     *
     * @param mintPk
     * @returns remaining deposit limit for mint, returns null if there is no limit for bank
     */
    getRemainingDepositLimit(): BN | null;
}
export declare class MintInfo {
    publicKey: PublicKey;
    group: PublicKey;
    tokenIndex: TokenIndex;
    mint: PublicKey;
    banks: PublicKey[];
    vaults: PublicKey[];
    oracle: PublicKey;
    registrationTime: BN;
    fallbackOracle: PublicKey;
    groupInsuranceFund: boolean;
    static from(publicKey: PublicKey, obj: {
        group: PublicKey;
        tokenIndex: number;
        mint: PublicKey;
        banks: PublicKey[];
        vaults: PublicKey[];
        oracle: PublicKey;
        registrationTime: BN;
        fallbackOracle: PublicKey;
        groupInsuranceFund: number;
    }): MintInfo;
    constructor(publicKey: PublicKey, group: PublicKey, tokenIndex: TokenIndex, mint: PublicKey, banks: PublicKey[], vaults: PublicKey[], oracle: PublicKey, registrationTime: BN, fallbackOracle: PublicKey, groupInsuranceFund: boolean);
    firstBank(): PublicKey;
    firstVault(): PublicKey;
    toString(): string;
}
