import { FetcherResult, OraclePriceEntry, ParseContext } from '../types';
/**
 * Morpho Midnight oracle price fetcher.
 *
 * Midnight is a fixed-rate, fixed-maturity order-book protocol (NOT a Blue
 * fork), but each collateral leg of a market carries a Morpho-style oracle
 * that implements `price()` with identical scaling — verified on-chain: the
 * raw uint256 is `ratio * 10^(36 + loanDecimals - collateralDecimals)`, the
 * price of the collateral quoted in the loan asset. So the pricing math is
 * the same as `morpho.ts`; only the shape (one loan asset, N collateral legs
 * per market) and the lender key (`MORPHO_MIDNIGHT_<id>`) differ.
 *
 * Entries land under `midnightLenderKey(marketId)` so their marketUids join the
 * Midnight lending data emitted by `convertMidnightMarketsToResponse`.
 *
 * Like Morpho, Midnight prices are DERIVED: the collateral USD price needs the
 * loan asset's USD price from an earlier (Pass 1) parser. Parsed with
 * `updatePrices=false` so derived values don't overwrite direct oracle reads.
 */
/** One collateral leg of a Midnight market — one `price()` call. */
interface MidnightLeg {
    collateralAsset: string;
    collateralDecimals: number;
    oracle: string;
}
/** Grouped metadata: one Midnight market (loan asset + ordered collateral legs). */
interface MidnightMarketMeta {
    marketId: string;
    loanAsset: string;
    loanDecimals: number;
    /** Ordered to match the emitted `price()` calls (index = call slot). */
    legs: MidnightLeg[];
}
/**
 * Build multicall calls for Midnight oracles.
 *
 * One `FetcherResult` per market; its `calls` are the per-leg `price()` reads
 * in collateral-leg order, so the parser can zip results back to legs by index.
 * Legs without a configured oracle are dropped (they can't be priced).
 */
export declare function getMidnightCalls(chainId: string): FetcherResult<MidnightMarketMeta>[];
/**
 * Parse Midnight oracle results into structured price entries.
 *
 * Mirrors `parseMorphoResults`: each leg's oracle returns the collateral price
 * in loan-asset terms. USD conversion multiplies that ratio by the loan asset's
 * known USD price. Emits one loan-asset entry per market (price = 1, the
 * oracle's own unit of account) plus one entry per priced collateral leg.
 */
export declare function parseMidnightResults(data: any[], meta: MidnightMarketMeta, context: ParseContext): OraclePriceEntry[];
/** ABI for Midnight oracle calls (same `price()` interface as Morpho). */
export declare function getMidnightAbi(): 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";
}];
/**
 * Morpho Midnight Oracle Fetcher module
 */
export declare const midnightFetcher: {
    getCalls: typeof getMidnightCalls;
    parse: typeof parseMidnightResults;
    getAbi: typeof getMidnightAbi;
};
export {};
//# sourceMappingURL=midnight.d.ts.map