import Decimal from 'decimal.js';
import { KaminoMarket, KaminoObligation, KaminoReserve } from '../classes';
import { Address, Option, Slot } from '@solana/kit';
export declare enum MaxWithdrawLtvCheck {
    MAX_LTV = 0,
    LIQUIDATION_THRESHOLD = 1
}
export declare function calcRepayAmountWithSlippage(kaminoMarket: KaminoMarket, debtReserve: KaminoReserve, currentSlot: Slot, obligation: KaminoObligation, amount: Decimal, referrer: Option<Address>): {
    repayAmount: Decimal;
    repayAmountLamports: Decimal;
    flashRepayAmountLamports: Decimal;
};
export declare const calcFlashRepayAmount: (props: {
    reserve: KaminoReserve;
    referralFeeBps: number;
    hasReferral: boolean;
    flashBorrowAmountLamports: Decimal;
}) => {
    flashRepayAmountLamports: Decimal;
};
export declare function calcMaxWithdrawCollateral(market: KaminoMarket, obligation: KaminoObligation, collReserveAddr: Address, debtReserveAddr: Address, repayAmountLamports: Decimal): {
    maxWithdrawableCollLamports: Decimal;
    canWithdrawAllColl: boolean;
    repayingAllDebt: boolean;
};
export declare function estimateDebtRepaymentWithColl(props: {
    collAmount: Decimal;
    priceDebtToColl: Decimal;
    slippagePct: Decimal;
    flashLoanFeePct: Decimal;
    kaminoMarket: KaminoMarket;
    debtReserveAddress: Address;
    obligation: KaminoObligation;
    currentSlot: Slot;
}): Decimal;
/**
 * Calculates the coll-flash sizing for repay-with-collateral:
 *   1. Flash borrow `flashBorrowInCollLamports` of collateral.
 *   2. Swap that coll → debt; produces at least `repayAmountLamports` of debt after slippage.
 *   3. Repay the obligation debt with the swapped output.
 *   4. Withdraw `collWithdrawForFlashRepayLamports` (= flashBorrowIn * (1 + flashLoanFee)) of coll.
 *   5. Flash repay coll with the withdrawn amount.
 *
 * @returns the lamport-denominated sizing values for the coll-flash repay-with-coll path.
 * @throws if `swapPriceCollToDebt` is zero.
 */
export declare function calcRepayWithCollCollFlashSwap(props: {
    repayAmountLamports: Decimal;
    swapPriceCollToDebt: Decimal;
    slippagePct: Decimal;
    collFlashLoanFee: Decimal;
    collMintFactor: Decimal;
    debtMintFactor: Decimal;
}): {
    flashBorrowInCollLamports: Decimal;
    collSwapInLamports: Decimal;
    debtMinOutLamports: Decimal;
    collWithdrawForFlashRepayLamports: Decimal;
};
export declare function validateCollFlashWithdrawCap(props: {
    collWithdrawLamports: Decimal;
    maxCollateralWithdrawLamports: Decimal;
}): void;
export declare function estimateCollNeededForDebtRepayment(props: {
    debtAmount: Decimal;
    priceDebtToColl: Decimal;
    slippagePct: Decimal;
    flashLoanFeePct: Decimal;
}): Decimal;
export declare const getMaxWithdrawLtvCheck: (obligation: KaminoObligation, repayAmountLamports: Decimal, debtReserve: KaminoReserve, collWithdrawAmount: Decimal, collReserve: KaminoReserve) => MaxWithdrawLtvCheck;
export declare function getMaxCollateralFromRepayAmount(repayAmount: Decimal, debtReserve: KaminoReserve, collReserve: KaminoReserve): Decimal;
//# sourceMappingURL=repay_with_collateral_calcs.d.ts.map