import Decimal from 'decimal.js';
import { KaminoReserve } from '../classes';
/**
 * Expected output details when swapping source collateral into target collateral.
 */
export interface SwapCollExpectedOutput {
    /**
     * Target collateral amount that will be deposited into the obligation, in token units (not lamports).
     */
    expectedTargetCollAmount: Decimal;
    /**
     * Flash-loan fee amount in units of the flash-borrowed token.
     */
    flashLoanFeeAmount: Decimal;
    /**
     * For the 'debt' flash-borrow flow, the net increase in the obligation's debt position vs. the starting
     * outstanding amount, in debt-token units. Includes both the flash-loan fee AND the target debt reserve's
     * origination/borrow fee on the re-borrow (matches `getDebtWithFeesForBorrowAmount` semantics used on-chain).
     * 0 for the coll-side flash-borrow flows.
     */
    additionalDebtFromFee: Decimal;
}
/**
 * Inputs shared by every flow.
 */
interface BaseCalculateSwapCollExpectedOutputInputs {
    sourceCollAmount: Decimal;
    sourceCollReserve: KaminoReserve;
    targetCollReserve: KaminoReserve;
    /**
     * Price of 1 source coll denominated in target coll (e.g. 20 USDC = 1 MSOL → price = 1/20 = 0.05 when source=USDC,
     * target=MSOL).
     */
    priceSourceCollToTargetColl: Decimal;
    slippagePct: Decimal;
}
/**
 * Inputs for the coll-side flash-borrow flows ('targetColl' default, or 'sourceColl').
 */
export interface CalculateSwapCollExpectedOutputInputsCollFlow extends BaseCalculateSwapCollExpectedOutputInputs {
    flashBorrowToken?: 'sourceColl' | 'targetColl';
}
/**
 * Inputs for the 'debt' flash-borrow flow; both `debtReserve` and `outstandingDebtAmount` are required so that the
 * resulting flash-loan fee (paid as additional debt) can be computed.
 */
export interface CalculateSwapCollExpectedOutputInputsDebtFlow extends BaseCalculateSwapCollExpectedOutputInputs {
    flashBorrowToken: 'debt';
    debtReserve: KaminoReserve;
    /**
     * Outstanding debt amount (token units) of the user in the debt reserve. Used to estimate the flash-borrow size
     * (and thus the resulting fee).
     */
    outstandingDebtAmount: Decimal;
}
export type CalculateSwapCollExpectedOutputInputs = CalculateSwapCollExpectedOutputInputsCollFlow | CalculateSwapCollExpectedOutputInputsDebtFlow;
/**
 * Calculates the expected amount of target collateral that will end up in the obligation after a swap, taking into
 * account the flash-loan fee and slippage. For the 'debt' flash-borrow flow, also reports the (small) additional debt
 * the user will incur as a consequence of the flash-loan fee.
 *
 * Note: this is an estimate only; the actual on-chain result is subject to real DEX slippage.
 */
export declare function calculateSwapCollExpectedOutput(inputs: CalculateSwapCollExpectedOutputInputs): SwapCollExpectedOutput;
/**
 * Expected output details when swapping source debt into target debt.
 */
export interface SwapDebtExpectedOutput {
    /**
     * Target debt amount the obligation will owe after the swap settles, in target-debt token units. Includes the
     * target reserve's borrow/origination fee on top of the receive amount (matching how the on-chain obligation
     * actually grows), so this value mirrors `getDebtWithFeesForBorrowAmount` used by the LTV checks. UIs should
     * surface this number rather than the pre-fee receive amount.
     */
    expectedTargetDebtAmount: Decimal;
    /**
     * Flash-loan fee amount in units of the flash-borrowed token.
     */
    flashLoanFeeAmount: Decimal;
    /**
     * Origination fee applied by the target debt reserve on top of the borrow receive amount, in target-debt token
     * units. Zero for reserves with `originationFeeSf === 0`. Included inside `expectedTargetDebtAmount`.
     */
    borrowOriginationFeeAmount: Decimal;
}
export interface CalculateSwapDebtExpectedOutputInputs {
    sourceDebtSwapAmount: Decimal;
    sourceDebtReserve: KaminoReserve;
    targetDebtReserve: KaminoReserve;
    flashBorrowToken: 'sourceDebt' | 'targetDebt';
    /**
     * Price of 1 source debt denominated in target debt.
     */
    priceSourceDebtToTargetDebt: Decimal;
    slippagePct: Decimal;
}
/**
 * Calculates the expected amount of target debt that the obligation will owe after a debt swap, taking into account
 * the flash-loan fee and slippage.
 */
export declare function calculateSwapDebtExpectedOutput(inputs: CalculateSwapDebtExpectedOutputInputs): SwapDebtExpectedOutput;
export {};
//# sourceMappingURL=swap_calcs.d.ts.map