Assumptions:

  1. For each leg, we can extract a base asset
  2. For each base asset, we can calculate or get volatility

Calculations

  1. Group legs based on base asset used.
  2. Calculate the required collateral as follows:

$$ requiredCollateral=\sum_{{1\le i\le groupAmount}}grpMaxLoss_i*(1+overallRiskFactor)

$$

$$ grpMaxLoss=\min_{\substack{scenario \in groupScenarios}} groupRisk(scenario)

$$

$$ groupRisk(scenario)=\sum_{{1\le i\le legAmount}} legPnl_i(scenario)

$$

$$ legPnl_i(scenario) = legUnitPnl_i(scenario)legAmount_ilegStructureMultiplier

$$

$$ legUnitPnl_i(scenario) = unitPnl_i(scenario)-|unitValue_i|*(1+sf)\\sf -safety\ price\ shift\ factor

$$

$$ unitPnl_i(scenario) = (shockedValue_i(scenario)-unitValue_i)*\begin{cases} 1&\text{if } leg_i~is~buy \\ -1&\text{if } leg_i~is~sell \end{cases}

$$

  1. Unit value and shocked value are calculated depending on the type of instrument:

    1. Spot:

      $$ unitValue=baseAssetPrice\\shockedValue(scn)=baseAssetPrice*(1+scn.priceChange)

      $$

    2. Option:

    $$ unitValue=BSch(baseAssetPrice, volatility)\\shockedValue(scn)=BSch(shockedPrice, shockedVolatility)\\shockedPrice=baseAssetPrice*(1+scn.priceChange)\\shockedVolatility(scn)=volatility*(1+scn.volatilityChange)\\BSch-Black\ Scholes\ formula

    $$

    1. Term or Perp future

    $$ unitValue=baseAssetPriceunderlyingPerContract\\shockedValue(scn)=baseAssetPrice(1+scn.priceChange)*underlyingPerContract

    $$

Questions

  1. What would happen if required collateral for an rfq would grow\shrink over the rfq lifetime? Could there be a case when the taker or maker would lock or unlock collateral during rfq lifetime due to price or volatility shift? — When the taker confirms a response, he specifies the accepted leg multiplier. With this updated leg multiplier we are recalculating the required collateral for the maker. What would happen if recalculated required collateral would be bigger than the one already locked? — We recalculate collateral for a maker, unlock it if it’s lower, and do nothing if it’s higher
  2. Do the European and American options have the same price estimation function? - There are differences, but to simplify we’d use the same logic
  3. What collateral should be required on a variable-size rfq creation? - for now, value placeholder, later in the development plan decide the final logic
  4. A set of scenarios is selected on a per-rfq level or a per-group level? - on a per-group level
  5. Does each scenario consist of the base price shift and volatility shift? - yes

Examples