import { MorphoQueryMeta, MorphoMarketOverride, FetcherResult, OraclePriceEntry, ParseContext } from '../types';
/**
 * Check if the Morpho GraphQL API is available for a given chain.
 * Some chains are not indexed by the Morpho API.
 *
 * Callers use this to classify chains into two strict modes:
 *   - available → API only (ignore overrides)
 *   - unavailable → on-chain from overrides only (skip API)
 */
export declare function morphoApiAvailable(chainId: string): boolean;
export declare function morphoApiIncomplete(chainId: string): boolean;
/**
 * Market overrides for extending Morpho markets beyond JSON data
 */
export type MorphoMarketOverrides = {
    [chainId: string]: MorphoMarketOverride[];
};
/**
 * Grouped metadata for deduplicated oracle calls
 * Multiple markets can share the same oracle — one call, many markets
 */
interface MorphoGroupedMeta {
    markets: MorphoQueryMeta[];
}
/**
 * Context for Morpho fetcher with optional market overrides
 */
export interface MorphoFetcherContext {
    marketOverrides?: MorphoMarketOverrides;
}
/**
 * Get multicall calls for Morpho oracles
 * Groups markets by oracle address to deduplicate price() calls.
 * Each entry in the result still maps back to individual markets via targetLender.
 *
 * @param chainId - Chain ID to get calls for
 * @param context - Optional context with market overrides
 */
export declare function getMorphoCalls(chainId: string, context?: MorphoFetcherContext): FetcherResult<MorphoGroupedMeta>[];
/**
 * Parse Morpho oracle results into structured price entries
 *
 * Processes all markets sharing the same oracle with a single price() result.
 * Each entry gets a targetLender so it routes to the correct per-market lender key.
 *
 * Morpho oracles return price of collateral in terms of loan asset (debt).
 * To get USD price:
 * - If we know loan asset USD price: collateralUSD = priceDebtToCollateral * loanAssetUSD
 * - If we know collateral USD price: loanAssetUSD = collateralUSD / priceDebtToCollateral
 */
export declare function parseMorphoResults(data: any[], meta: MorphoGroupedMeta, context: ParseContext): OraclePriceEntry[];
/**
 * Get ABI for Morpho oracle calls
 */
export declare function getMorphoAbi(): readonly [{
    readonly inputs: readonly [];
    readonly name: "price";
    readonly outputs: readonly [{
        readonly internalType: "uint256";
        readonly name: "";
        readonly type: "uint256";
    }];
    readonly stateMutability: "view";
    readonly type: "function";
}, {
    readonly inputs: readonly [{
        readonly internalType: "address";
        readonly name: "asset";
        readonly type: "address";
    }];
    readonly name: "peek";
    readonly outputs: readonly [{
        readonly internalType: "uint256";
        readonly name: "";
        readonly type: "uint256";
    }];
    readonly stateMutability: "view";
    readonly type: "function";
}];
export interface MorphoGqlMarket {
    uniqueKey: string;
    oracleAddress: string;
    loanAsset: {
        address: string;
        decimals: number;
        priceUsd: number | null;
    };
    collateralAsset: {
        address: string;
        decimals: number;
        priceUsd: number | null;
    } | null;
    state: {
        price: string | null;
    } | null;
}
/**
 * Fetch Morpho oracle prices from the GraphQL API instead of on-chain calls.
 * Returns OraclePriceEntry[] directly, or null if the API is unavailable.
 *
 * This avoids hundreds of on-chain price() calls on chains where the API is available.
 */
export declare function fetchMorphoGraphQLPrices(chainId: string): Promise<OraclePriceEntry[] | null>;
/**
 * Convert MorphoGqlMarket[] to OraclePriceEntry[].
 * Shared by the Morpho GraphQL and Mystic paths.
 */
export declare function processMarketsToEntries(chainId: string, allMarkets: MorphoGqlMarket[], source: string): OraclePriceEntry[] | null;
/**
 * Morpho Oracle Fetcher module
 */
export declare const morphoFetcher: {
    getCalls: typeof getMorphoCalls;
    parse: typeof parseMorphoResults;
    getAbi: typeof getMorphoAbi;
};
export {};
//# sourceMappingURL=morpho.d.ts.map