The finance developer workbenchSearch the reference Development · 0.1.4 · unpublished

Public API / @insiderfinance/totalfinance

@insiderfinance/totalfinance/crypto/inverse

import from '@insiderfinance/totalfinance/crypto/inverse'

Every public export in this entry point, including type-only declarations. Search by name or concept.

Jump to an export (7)

InverseFuture · InverseFutureInput · InverseHedge · InverseHedgeInput · InverseSide · inverseFuture · inverseHedge

interface

InverseFuture

The coin economics of an inverse-margined futures/perp position.

/** The coin economics of an inverse-margined futures/perp position. */
export interface InverseFuture {
    /** Coin PnL since entry: `s · notionalUsd · (1/entry − 1/mark)`. */
    coinPnl: number;
    /** USD value of that coin PnL at the mark (`coinPnl · markPrice`). */
    usdPnl: number;
    /** `∂coinPnl/∂mark = s · notionalUsd / mark²` — coin per $1 move; NOT constant (inverse convexity). */
    coinDelta: number;
    /** `∂²coinPnl/∂mark² = s · (−2·notionalUsd / mark³)` — a LONG inverse future is SHORT gamma in coin. */
    coinGamma: number;
    /** Coin-equivalent size at the mark (`s · notionalUsd / mark`) — how many coins the position is long. */
    coinExposure: number;
}
Fields, parameters & returned members (5)
Name / typeMeaning & unitOptional / default
coinDelta
number
`∂coinPnl/∂mark = s · notionalUsd / mark²` — coin per $1 move; NOT constant (inverse convexity).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
coinExposure
number
Coin-equivalent size at the mark (`s · notionalUsd / mark`) — how many coins the position is long.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
coinGamma
number
`∂²coinPnl/∂mark² = s · (−2·notionalUsd / mark³)` — a LONG inverse future is SHORT gamma in coin.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
coinPnl
number
Coin PnL since entry: `s · notionalUsd · (1/entry − 1/mark)`.
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
usdPnl
number
USD value of that coin PnL at the mark (`coinPnl · markPrice`).
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

interface

InverseFutureInput

Input for {@link inverseFuture}.

// ── inverseFuture ───────────────────────────────────────────────────────────────
/** Input for {@link inverseFuture}. */
export interface InverseFutureInput {
    /** USD notional (= contracts × contract multiplier, e.g. $10/contract on Deribit). */
    notionalUsd: number;
    /** Entry price (USD per coin). */
    entryPrice: number;
    /** Current mark price (USD per coin). */
    markPrice: number;
    /** Position side. Default 'long'. */
    side?: InverseSide;
}
Fields, parameters & returned members (4)
Name / typeMeaning & unitOptional / default
entryPrice
number
Entry price (USD per coin).
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
markPrice
number
Current mark price (USD per coin).
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
notionalUsd
number
USD notional (= contracts × contract multiplier, e.g. $10/contract on Deribit).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
side
'long' | 'short'
Position side. Default 'long'.
unitless by name
Optional
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

interface

InverseHedge

The inverse future/perp trade that neutralizes a coin delta.

/** The inverse future/perp trade that neutralizes a coin delta. */
export interface InverseHedge {
    /** USD notional of the inverse future to trade. */
    notionalUsd: number;
    /** Which way to trade it. */
    side: InverseSide;
    /** The hedge future's coin delta — equal and opposite to the input `coinDelta` (combined ⇒ 0). */
    hedgeCoinDelta: number;
    /** Residual coin gamma after the delta hedge (`positionGamma + hedgeFutureGamma`) — iff `coinGamma` given. */
    residualCoinGamma?: number;
}
Fields, parameters & returned members (4)
Name / typeMeaning & unitOptional / default
hedgeCoinDelta
number
The hedge future's coin delta — equal and opposite to the input `coinDelta` (combined ⇒ 0).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
notionalUsd
number
USD notional of the inverse future to trade.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
residualCoinGamma
number
Residual coin gamma after the delta hedge (`positionGamma + hedgeFutureGamma`) — iff `coinGamma` given.
unitless by name
Optional
No @default declared; consult the signature and description.
side
'long' | 'short'
Which way to trade it.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

interface

InverseHedgeInput

Input for {@link inverseHedge}.

// ── inverseHedge ────────────────────────────────────────────────────────────────
/** Input for {@link inverseHedge}. */
export interface InverseHedgeInput {
    /** The coin delta to neutralize (e.g. `inverseOption.greeks(…).value.coin.delta`). */
    coinDelta: number;
    /** Mark price of the inverse future/perp used to hedge (USD per coin; a perp ≈ spot). */
    markPrice: number;
    /** Coin gamma of the position being hedged — supply to get the residual gamma after the delta hedge. */
    coinGamma?: number;
}
Fields, parameters & returned members (3)
Name / typeMeaning & unitOptional / default
coinDelta
number
The coin delta to neutralize (e.g. `inverseOption.greeks(…).value.coin.delta`).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
coinGamma
number
Coin gamma of the position being hedged — supply to get the residual gamma after the delta hedge.
unitless by name
Optional
No @default declared; consult the signature and description.
markPrice
number
Mark price of the inverse future/perp used to hedge (USD per coin; a perp ≈ spot).
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

type

InverseSide

Position side of an inverse contract.

/** Position side of an inverse contract. */
export type InverseSide = (typeof SIDES)[number];
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

function

inverseFuture

Public declaration. Read the signature and parameter/member contracts below; no additional behavior is inferred.

export declare function inverseFuture(input: InverseFutureInput): Computed<InverseFuture>;
Fields, parameters & returned members (9)
Name / typeMeaning & unitOptional / default
(input)
InverseFutureInput

unitless by name
Required / declared member
No @default declared; consult the signature and description.
(input).entryPrice
number
Entry price (USD per coin).
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
(input).markPrice
number
Current mark price (USD per coin).
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
(input).notionalUsd
number
USD notional (= contracts × contract multiplier, e.g. $10/contract on Deribit).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
(input).side
'long' | 'short'
Position side. Default 'long'.
unitless by name
Optional
No @default declared; consult the signature and description.
return.assumptions
Assumptions<Record<never, never>>
Every applied convention, echoed back.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.diagnostics
Diagnostics
How the value was computed, plus any warnings.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.provenance
import('@insiderfinance/totalfinance/core').Provenance
Optional data lineage when the inputs came from a provider.
unitless by name
Optional
No @default declared; consult the signature and description.
return.value
InverseFuture
The computed value. Never `NaN` or `±Infinity`: a value the model cannot produce is `null` beside a diagnostic that says why (Law 7 — a warning never licenses a non-finite number).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.

function

inverseHedge

Public declaration. Read the signature and parameter/member contracts below; no additional behavior is inferred.

export declare function inverseHedge(input: InverseHedgeInput): Computed<InverseHedge>;
Fields, parameters & returned members (8)
Name / typeMeaning & unitOptional / default
(input)
InverseHedgeInput

unitless by name
Required / declared member
No @default declared; consult the signature and description.
(input).coinDelta
number
The coin delta to neutralize (e.g. `inverseOption.greeks(…).value.coin.delta`).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
(input).coinGamma
number
Coin gamma of the position being hedged — supply to get the residual gamma after the delta hedge.
unitless by name
Optional
No @default declared; consult the signature and description.
(input).markPrice
number
Mark price of the inverse future/perp used to hedge (USD per coin; a perp ≈ spot).
currency amount (the field or record currency)
Required / declared member
No @default declared; consult the signature and description.
return.assumptions
Assumptions<Record<never, never>>
Every applied convention, echoed back.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.diagnostics
Diagnostics
How the value was computed, plus any warnings.
unitless by name
Required / declared member
No @default declared; consult the signature and description.
return.provenance
import('@insiderfinance/totalfinance/core').Provenance
Optional data lineage when the inputs came from a provider.
unitless by name
Optional
No @default declared; consult the signature and description.
return.value
InverseHedge
The computed value. Never `NaN` or `±Infinity`: a value the model cannot produce is `null` beside a diagnostic that says why (Law 7 — a warning never licenses a non-finite number).
unitless by name
Required / declared member
No @default declared; consult the signature and description.
Stability, warnings & conventions
stable-by-law (pre-1.0; not a 1.0 stability guarantee)

Declared field units are shown above. “Unitless by name” means the name alone does not establish a unit, not that a financial quantity has none. Check source descriptions, conventions, and the returned diagnostics. Errors and warnings are part of the result contract.