import { Address, GetAccountInfoApi, GetMultipleAccountsApi, Rpc } from "@solana/kit";
import BN from "bn.js";
import * as types from "../types";
export interface LendingMarketFields {
    /** Version of lending market */
    version: BN;
    /** Bump seed for derived authority address */
    bumpSeed: BN;
    /** Owner authority which can add new reserves */
    lendingMarketOwner: Address;
    /** Temporary cache of the lending market owner, used in update_lending_market_owner */
    lendingMarketOwnerCached: Address;
    /**
     * Currency market prices are quoted in
     * e.g. "USD" null padded (`*b"USD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"`) or a SPL token mint pubkey
     */
    quoteCurrency: Array<number>;
    /** Referral fee for the lending market, as bps out of the total protocol fee */
    referralFeeBps: number;
    emergencyMode: number;
    /**
     * Whether the obligations on this market should be subject to auto-deleveraging after deposit
     * or borrow limit is crossed.
     * Besides this flag, the particular reserve's flag also needs to be enabled (logical `AND`).
     * **NOTE:** this also affects the individual "target LTV" deleveraging.
     */
    autodeleverageEnabled: number;
    borrowDisabled: number;
    /**
     * Refresh price from oracle only if it's older than this percentage of the price max age.
     * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.
     * Price is always refreshed if this set to 0.
     */
    priceRefreshTriggerToMaxAgePct: number;
    /** Percentage of the total borrowed value in an obligation available for liquidation */
    liquidationMaxDebtCloseFactorPct: number;
    /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */
    insolvencyRiskUnhealthyLtvPct: number;
    /** Minimum liquidation value threshold triggering full liquidation for an obligation */
    minFullLiquidationValueThreshold: BN;
    /** Max allowed liquidation value in one ix call */
    maxLiquidatableDebtMarketValueAtOnce: BN;
    /** [DEPRECATED] Global maximum unhealthy borrow value allowed for any obligation */
    reserved0: Array<number>;
    /** Global maximum allowed borrow value allowed for any obligation */
    globalAllowedBorrowValue: BN;
    /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */
    riskCouncil: Address;
    /** [DEPRECATED] Reward points multiplier per obligation type */
    reserved1: Array<number>;
    /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */
    elevationGroups: Array<types.ElevationGroupFields>;
    elevationGroupPadding: Array<BN>;
    /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */
    minNetValueInObligationSf: BN;
    /** Minimum value to enforce smallest ltv priority checks on the collateral reserves on liquidation */
    minValueSkipLiquidationLtvChecks: BN;
    /** Market name, zero-padded. */
    name: Array<number>;
    /** Minimum value to enforce highest borrow factor priority checks on the debt reserves on liquidation */
    minValueSkipLiquidationBfChecks: BN;
    /**
     * Time (in seconds) that must pass before liquidation is allowed on an obligation that has
     * been individually marked for auto-deleveraging (by the risk council).
     */
    individualAutodeleverageMarginCallPeriodSecs: BN;
    /**
     * Minimum amount of deposit at creation of a reserve to prevent artificial inflation
     * Note: this amount cannot be recovered, the ctoken associated are never minted
     */
    minInitialDepositAmount: BN;
    /** Whether the obligation orders should be evaluated during liquidations. */
    obligationOrderExecutionEnabled: number;
    /** Whether the lending market is set as immutable. */
    immutable: number;
    /**
     * Whether new obligation orders can be created.
     * Note: updating or cancelling existing orders is *not* affected by this flag.
     */
    obligationOrderCreationEnabled: number;
    /**
     * Whether the liquidation operations that are triggered by price changes should be disabled.
     * This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some
     * obligation orders' execution.
     *
     * *Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other
     * liquidation-driving flags (see e.g. [Self::autodeleverage_enabled]).
     */
    priceTriggeredLiquidationDisabled: number;
    padding2: Array<number>;
    /** Authority that can propose creating of new reserves but cannot enable them. */
    proposerAuthority: Address;
    padding1: Array<BN>;
}
export interface LendingMarketJSON {
    /** Version of lending market */
    version: string;
    /** Bump seed for derived authority address */
    bumpSeed: string;
    /** Owner authority which can add new reserves */
    lendingMarketOwner: string;
    /** Temporary cache of the lending market owner, used in update_lending_market_owner */
    lendingMarketOwnerCached: string;
    /**
     * Currency market prices are quoted in
     * e.g. "USD" null padded (`*b"USD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"`) or a SPL token mint pubkey
     */
    quoteCurrency: Array<number>;
    /** Referral fee for the lending market, as bps out of the total protocol fee */
    referralFeeBps: number;
    emergencyMode: number;
    /**
     * Whether the obligations on this market should be subject to auto-deleveraging after deposit
     * or borrow limit is crossed.
     * Besides this flag, the particular reserve's flag also needs to be enabled (logical `AND`).
     * **NOTE:** this also affects the individual "target LTV" deleveraging.
     */
    autodeleverageEnabled: number;
    borrowDisabled: number;
    /**
     * Refresh price from oracle only if it's older than this percentage of the price max age.
     * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.
     * Price is always refreshed if this set to 0.
     */
    priceRefreshTriggerToMaxAgePct: number;
    /** Percentage of the total borrowed value in an obligation available for liquidation */
    liquidationMaxDebtCloseFactorPct: number;
    /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */
    insolvencyRiskUnhealthyLtvPct: number;
    /** Minimum liquidation value threshold triggering full liquidation for an obligation */
    minFullLiquidationValueThreshold: string;
    /** Max allowed liquidation value in one ix call */
    maxLiquidatableDebtMarketValueAtOnce: string;
    /** [DEPRECATED] Global maximum unhealthy borrow value allowed for any obligation */
    reserved0: Array<number>;
    /** Global maximum allowed borrow value allowed for any obligation */
    globalAllowedBorrowValue: string;
    /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */
    riskCouncil: string;
    /** [DEPRECATED] Reward points multiplier per obligation type */
    reserved1: Array<number>;
    /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */
    elevationGroups: Array<types.ElevationGroupJSON>;
    elevationGroupPadding: Array<string>;
    /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */
    minNetValueInObligationSf: string;
    /** Minimum value to enforce smallest ltv priority checks on the collateral reserves on liquidation */
    minValueSkipLiquidationLtvChecks: string;
    /** Market name, zero-padded. */
    name: Array<number>;
    /** Minimum value to enforce highest borrow factor priority checks on the debt reserves on liquidation */
    minValueSkipLiquidationBfChecks: string;
    /**
     * Time (in seconds) that must pass before liquidation is allowed on an obligation that has
     * been individually marked for auto-deleveraging (by the risk council).
     */
    individualAutodeleverageMarginCallPeriodSecs: string;
    /**
     * Minimum amount of deposit at creation of a reserve to prevent artificial inflation
     * Note: this amount cannot be recovered, the ctoken associated are never minted
     */
    minInitialDepositAmount: string;
    /** Whether the obligation orders should be evaluated during liquidations. */
    obligationOrderExecutionEnabled: number;
    /** Whether the lending market is set as immutable. */
    immutable: number;
    /**
     * Whether new obligation orders can be created.
     * Note: updating or cancelling existing orders is *not* affected by this flag.
     */
    obligationOrderCreationEnabled: number;
    /**
     * Whether the liquidation operations that are triggered by price changes should be disabled.
     * This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some
     * obligation orders' execution.
     *
     * *Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other
     * liquidation-driving flags (see e.g. [Self::autodeleverage_enabled]).
     */
    priceTriggeredLiquidationDisabled: number;
    padding2: Array<number>;
    /** Authority that can propose creating of new reserves but cannot enable them. */
    proposerAuthority: string;
    padding1: Array<string>;
}
export declare class LendingMarket {
    /** Version of lending market */
    readonly version: BN;
    /** Bump seed for derived authority address */
    readonly bumpSeed: BN;
    /** Owner authority which can add new reserves */
    readonly lendingMarketOwner: Address;
    /** Temporary cache of the lending market owner, used in update_lending_market_owner */
    readonly lendingMarketOwnerCached: Address;
    /**
     * Currency market prices are quoted in
     * e.g. "USD" null padded (`*b"USD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"`) or a SPL token mint pubkey
     */
    readonly quoteCurrency: Array<number>;
    /** Referral fee for the lending market, as bps out of the total protocol fee */
    readonly referralFeeBps: number;
    readonly emergencyMode: number;
    /**
     * Whether the obligations on this market should be subject to auto-deleveraging after deposit
     * or borrow limit is crossed.
     * Besides this flag, the particular reserve's flag also needs to be enabled (logical `AND`).
     * **NOTE:** this also affects the individual "target LTV" deleveraging.
     */
    readonly autodeleverageEnabled: number;
    readonly borrowDisabled: number;
    /**
     * Refresh price from oracle only if it's older than this percentage of the price max age.
     * e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.
     * Price is always refreshed if this set to 0.
     */
    readonly priceRefreshTriggerToMaxAgePct: number;
    /** Percentage of the total borrowed value in an obligation available for liquidation */
    readonly liquidationMaxDebtCloseFactorPct: number;
    /** Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100% */
    readonly insolvencyRiskUnhealthyLtvPct: number;
    /** Minimum liquidation value threshold triggering full liquidation for an obligation */
    readonly minFullLiquidationValueThreshold: BN;
    /** Max allowed liquidation value in one ix call */
    readonly maxLiquidatableDebtMarketValueAtOnce: BN;
    /** [DEPRECATED] Global maximum unhealthy borrow value allowed for any obligation */
    readonly reserved0: Array<number>;
    /** Global maximum allowed borrow value allowed for any obligation */
    readonly globalAllowedBorrowValue: BN;
    /** The address of the risk council, in charge of making parameter and risk decisions on behalf of the protocol */
    readonly riskCouncil: Address;
    /** [DEPRECATED] Reward points multiplier per obligation type */
    readonly reserved1: Array<number>;
    /** Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold */
    readonly elevationGroups: Array<types.ElevationGroup>;
    readonly elevationGroupPadding: Array<BN>;
    /** Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals) */
    readonly minNetValueInObligationSf: BN;
    /** Minimum value to enforce smallest ltv priority checks on the collateral reserves on liquidation */
    readonly minValueSkipLiquidationLtvChecks: BN;
    /** Market name, zero-padded. */
    readonly name: Array<number>;
    /** Minimum value to enforce highest borrow factor priority checks on the debt reserves on liquidation */
    readonly minValueSkipLiquidationBfChecks: BN;
    /**
     * Time (in seconds) that must pass before liquidation is allowed on an obligation that has
     * been individually marked for auto-deleveraging (by the risk council).
     */
    readonly individualAutodeleverageMarginCallPeriodSecs: BN;
    /**
     * Minimum amount of deposit at creation of a reserve to prevent artificial inflation
     * Note: this amount cannot be recovered, the ctoken associated are never minted
     */
    readonly minInitialDepositAmount: BN;
    /** Whether the obligation orders should be evaluated during liquidations. */
    readonly obligationOrderExecutionEnabled: number;
    /** Whether the lending market is set as immutable. */
    readonly immutable: number;
    /**
     * Whether new obligation orders can be created.
     * Note: updating or cancelling existing orders is *not* affected by this flag.
     */
    readonly obligationOrderCreationEnabled: number;
    /**
     * Whether the liquidation operations that are triggered by price changes should be disabled.
     * This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some
     * obligation orders' execution.
     *
     * *Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other
     * liquidation-driving flags (see e.g. [Self::autodeleverage_enabled]).
     */
    readonly priceTriggeredLiquidationDisabled: number;
    readonly padding2: Array<number>;
    /** Authority that can propose creating of new reserves but cannot enable them. */
    readonly proposerAuthority: Address;
    readonly padding1: Array<BN>;
    static readonly discriminator: Buffer<ArrayBuffer>;
    static readonly layout: import("buffer-layout").Layout<LendingMarket>;
    constructor(fields: LendingMarketFields);
    static fetch(rpc: Rpc<GetAccountInfoApi>, address: Address, programId?: Address): Promise<LendingMarket | null>;
    static fetchMultiple(rpc: Rpc<GetMultipleAccountsApi>, addresses: Address[], programId?: Address): Promise<Array<LendingMarket | null>>;
    static decode(data: Buffer): LendingMarket;
    toJSON(): LendingMarketJSON;
    static fromJSON(obj: LendingMarketJSON): LendingMarket;
}
//# sourceMappingURL=LendingMarket.d.ts.map