import type { MidnightMarketConfig } from '@1delta/data-sdk';
/** One aggregated price level of a Midnight book side (raw bigints, loan-token units). */
export interface MidnightBookLevel {
    /** Midnight tick (price point). */
    tick: bigint;
    /** Total credit/debt units available at this level. */
    units: bigint;
    /** Total loan-token assets implied at this level. */
    assets: bigint;
}
/**
 * Top-of-book snapshot for a single Midnight market, already reduced to the
 * best executable rate per side plus the aggregate depth.
 *
 * Side semantics (Midnight): `bids` are maker BUY offers (makers lending) — a
 * taker consumes them to BORROW. `asks` are maker SELL offers (makers
 * borrowing) — a taker consumes them to LEND. So:
 *   - best BORROW rate  = min period-rate over bids (cheapest to borrow)
 *   - best SUPPLY yield  = max period-rate over asks (highest to lend)
 * Selection is order-agnostic (we scan every level), so it does not depend on
 * the API returning levels best-first.
 */
export interface MidnightBookTop {
    /** Tick of the best (lowest-rate) borrow offer, or undefined if the bid side is empty. */
    bestBorrowTick?: bigint;
    /** Tick of the best (highest-yield) supply offer, or undefined if the ask side is empty. */
    bestSupplyTick?: bigint;
    /** Aggregate borrowable units/assets (bid side). */
    borrowDepthUnits: bigint;
    borrowDepthAssets: bigint;
    /** Aggregate lendable units/assets (ask side). */
    supplyDepthUnits: bigint;
    supplyDepthAssets: bigint;
}
/** Pluggable Midnight order-book source — hosted API today, self-indexed mempool later. */
export interface MidnightBookSource {
    /** Best-rate + depth snapshot for a market, or null when unavailable. */
    getBookTop(marketId: string): Promise<MidnightBookTop | null>;
}
/** A Midnight market paired with its current top-of-book (null when the book fetch failed). */
export interface MidnightMarketRaw {
    config: MidnightMarketConfig;
    top: MidnightBookTop | null;
}
//# sourceMappingURL=types.d.ts.map