Skip to main content

TradeEconomics

Entry cost, carry, break-even and round-trip for ONE route of a leveraged open (and, minus the swap, of a deposit-and-borrow).

Every number a client would otherwise re-derive from the quote lives here, computed from inputs only the server has: the PROJECTED rates (the same IRM path that fills rateImpact), the day-0 fees the amortised borrow rate hides (origination, flash), gas over the whole bundle, the trade's clock (PT expiry, debt maturity, rolling term), and — with an account — the book the trade lands in.

Discipline: a figure that cannot be computed is null AND explained in notes; the block is never omitted because one input was missing. carryBasis says whether the carry is IRM-projected or a sticker fallback. Units: USD, PERCENT for rates, DAYS, BP.

notionalUsd objectrequired

The position this route creates, at the oracle. equity is the margin the user brings (0 on a pure leverage step).

equitynumber
collateralnumber
debtnumber
entryCostUsd objectrequired

Day-0 cost of getting in. slippage = swap input at the oracle − swap output at the oracle (floored at 0; slippageBp keeps the sign). gas is null when it could not be priced.

slippagenumber
feesnumber
gasnumbernullable
totalnumber
slippageBpnumbernullablerequired

Signed swap-vs-oracle, BP of the swap input. Negative = the route costs money.

entryCostBpnumbernullablerequired

entryCostUsd.total over the DEBT notional, BP.

fees object[]required
  • Array [
  • idstringrequired

    The term sheet's FeeTerm.id (origination, early-repay-penalty, …) or flash for the flash-loan fee.

    labelstringrequired
    whenstringrequired

    entry items sum to entryCostUsd.fees; exit items are in the round-trip exit cost.

    Possible values: [entry, exit]

    usdnumberrequired

    Priced on the notional the fee is charged on. Negative = a rebate.

    valuenumberrequired

    The published rate (read with unit).

    unitstringrequired

    percent | bps | …

    basisstringrequired

    principal | face-value | collateral | …

    mutableboolean

    Governance-mutable snapshot — re-verify before quoting it as a term.

  • ]
  • carryPerDayUsd objectnullablerequired

    The trade's carry per day at PROJECTED rates — what it earns after its own borrow has moved the pool. total counts incentives, base does not. With an account, the repricing of the existing book is netted out.

    totalnumber
    basenumber
    carryBasisstringrequired

    Possible values: [projected, sticker, none]

    breakEvenDays objectrequired

    entryCostUsd.total / carryPerDayUsd. Null when the carry is not positive (never pays for itself — see notes) or unknown.

    totalnumbernullable
    basenumbernullable
    roundTripDays objectrequired

    (entry + exit cost) / carry. closeQuoted says whether the exit was PRICED (a real close quote) or ASSUMED symmetric to the entry (the default today). Null on a debt that cannot be repaid early (Midnight): the round trip is at maturity, not before.

    totalnumbernullable
    basenumbernullable
    closeQuotedboolean
    exitCostUsdnumbernullable
    horizonDaysnumbernullablerequired

    Days until the trade's clock runs out. Null = perpetual.

    horizon objectrequired
    kindstring

    Possible values: [perpetual, to-expiry, to-maturity, rolling]

    endsAtinteger

    Unix seconds.

    sourcestring
    breaksEvenBeforeHorizonbooleannullablerequired
    gas objectnullablerequired
    oneOf
    unitsnumberrequired

    Gas units over the whole bundle — outstanding permissions + main transaction.

    txCountintegerrequired
    estimatedbooleanrequired

    true when every transaction was eth_estimateGas-ed from the account; false when at least one used the typical-size table (the notes say which — the main transaction usually reverts under estimation until its permissions are granted).

    gasPriceGweinumberrequired
    nativePriceUsdnumberrequired
    usdnumberrequired
    existingExposure object

    The marginal view — what this trade does to the account it lands in. The new borrow moves the pool rate, and the debt the account ALREADY holds in that market reprices with it: an ongoing cost the one-off slippage never shows. Same on the deposit side with the opposite sign.

    debtUsdSameMarketnumberrequired

    Debt already held in the DEBT market, USD.

    depositUsdSameMarketnumberrequired

    Deposits already held in the COLLATERAL market, USD.

    rateDeltaBpnumbernullable

    Projected − current borrow rate on the debt market, BP.

    depositRateDeltaBpnumbernullable

    Projected − current deposit rate on the collateral market, BP.

    repriceCostPerDayUsdnumbernullable

    Repricing of the existing book per day (debt repriced up minus deposits repriced up). Positive = a cost. Already netted out of carryPerDayUsd.

    accountAprPrenumbernullable

    Account net APR before the trade, percent, rewards included.

    accountAprPostnumbernullable

    Account net APR after the trade at PROJECTED rates, percent.

    accountNavUsdnumbernullable
    accountNavUsdPostnumbernullable
    notesstring[]required

    Every assumption and every input that was missing, in words. Read them before showing a number.

    TradeEconomics
    {
    "notionalUsd": {
    "equity": 0,
    "collateral": 0,
    "debt": 0
    },
    "entryCostUsd": {
    "slippage": 0,
    "fees": 0,
    "gas": 0,
    "total": 0
    },
    "slippageBp": 0,
    "entryCostBp": 0,
    "fees": [
    {
    "id": "string",
    "label": "string",
    "when": "entry",
    "usd": 0,
    "value": 0,
    "unit": "string",
    "basis": "string",
    "mutable": true
    }
    ],
    "carryPerDayUsd": {
    "total": 0,
    "base": 0
    },
    "carryBasis": "projected",
    "breakEvenDays": {
    "total": 0,
    "base": 0
    },
    "roundTripDays": {
    "total": 0,
    "base": 0,
    "closeQuoted": true,
    "exitCostUsd": 0
    },
    "horizonDays": 0,
    "horizon": {
    "kind": "perpetual",
    "endsAt": 0,
    "source": "string"
    },
    "breaksEvenBeforeHorizon": true,
    "gas": {
    "units": 0,
    "txCount": 0,
    "estimated": true,
    "gasPriceGwei": 0,
    "nativePriceUsd": 0,
    "usd": 0
    },
    "existingExposure": {
    "debtUsdSameMarket": 0,
    "depositUsdSameMarket": 0,
    "rateDeltaBp": 0,
    "depositRateDeltaBp": 0,
    "repriceCostPerDayUsd": 0,
    "accountAprPre": 0,
    "accountAprPost": 0,
    "accountNavUsd": 0,
    "accountNavUsdPost": 0
    },
    "notes": [
    "string"
    ]
    }