Skip to main content

MarginSimulationQuoteResponse

Quote-only loop response enriched with post-trade simulation (POST only).

lenderstringrequired
quotes object[]required
  • Array [
  • deltas object
    aggregatorstring

    Aggregator source

    tradeInputnumber

    Trade input amount

    tradeOutputnumber

    Trade output amount

    deltas object

    Balance deltas

    property name*any

    Balance deltas

  • ]
  • simulation objectnullable

    Projected post-trade metrics, or null if simulation failed

    oneOf
    healthFactornumber

    Health factor before the trade

    healthFactorPostnumber

    Health factor after the trade

    borrowCapacitynumber

    Borrow capacity (USD) before the trade

    borrowCapacityPostnumber

    Borrow capacity (USD) after the trade

    balanceDataPost object

    Aggregated balance data for a sub-account.

    depositsnumber

    Total deposits in USD

    Example: 10000.5
    debtnumber

    Total debt in USD

    Example: 5000.25
    adjustedDebtnumber

    Debt adjusted for borrow factors

    Example: 5500
    collateralnumber

    Collateral value in USD

    Example: 9000
    collateralAllActivenumber

    Collateral if all assets were enabled

    Example: 10000.5
    borrowDiscountedCollateralnumber

    Collateral discounted by borrow factors

    Example: 8000
    borrowDiscountedCollateralAllActivenumber

    Discounted collateral if all enabled

    Example: 9000
    navnumber

    Net asset value (deposits - debt)

    Example: 5000.25
    deposits24hnumber

    Deposits 24h ago (for change calculation)

    Example: 9800
    debt24hnumber

    Debt 24h ago

    Example: 4900
    nav24hnumber

    NAV 24h ago

    Example: 4900
    rewards object

    Pending rewards by token

    property name*any

    Pending rewards by token

    aprDataPost object

    APR breakdown for a sub-account.

    aprnumber

    Net APR (deposit - borrow)

    Example: 2.5
    depositAprnumber

    Weighted deposit APR

    Example: 3.5
    borrowAprnumber

    Weighted borrow APR

    Example: 5.2
    rewardAprnumber

    Total reward APR

    Example: 1.2
    rewardDepositAprnumber

    Reward APR on deposits

    Example: 0.8
    rewardBorrowAprnumber

    Reward APR on borrows

    Example: 0.4
    intrinsicAprnumber

    Intrinsic yield APR (e.g., stETH staking)

    Example: 0
    intrinsicDepositAprnumber

    Intrinsic yield APR portion from deposits

    Example: 0
    intrinsicBorrowAprnumber

    Intrinsic yield APR portion from borrows

    Example: 0
    rewards object

    Reward token details

    property name*any

    Reward token details

    simulationErrorstring

    Error message if simulation failed

    MarginSimulationQuoteResponse
    {
    "lender": "string",
    "quotes": [
    {
    "deltas": {
    "aggregator": "string",
    "tradeInput": 0,
    "tradeOutput": 0,
    "deltas": {}
    }
    }
    ],
    "simulation": {
    "healthFactor": 0,
    "healthFactorPost": 0,
    "borrowCapacity": 0,
    "borrowCapacityPost": 0,
    "balanceDataPost": {
    "deposits": 10000.5,
    "debt": 5000.25,
    "adjustedDebt": 5500,
    "collateral": 9000,
    "collateralAllActive": 10000.5,
    "borrowDiscountedCollateral": 8000,
    "borrowDiscountedCollateralAllActive": 9000,
    "nav": 5000.25,
    "deposits24h": 9800,
    "debt24h": 4900,
    "nav24h": 4900,
    "rewards": {}
    },
    "aprDataPost": {
    "apr": 2.5,
    "depositApr": 3.5,
    "borrowApr": 5.2,
    "rewardApr": 1.2,
    "rewardDepositApr": 0.8,
    "rewardBorrowApr": 0.4,
    "intrinsicApr": 0,
    "intrinsicDepositApr": 0,
    "intrinsicBorrowApr": 0,
    "rewards": {}
    }
    },
    "simulationError": "string"
    }