Indent LayerINDENT LAYERDOCS

Integration

A venue integrates at one point in its flow: the moment a trade is matched.

What you send

A signed fill: the two participants, the asset, size, price and the venue's own identifier. The signature is what lets us attribute the fill and reject replays.

What you get back

A signed obligation: the novated claim, the settlement window it belongs to, and the current net for that participant in that asset.

Sketch

import { Clearing } from '@indentlayer/sdk';

const clearing = new Clearing({
  venue: process.env['INDENT_VENUE_ID'],
  signer: process.env['INDENT_SIGNING_KEY'],
  chainId: 4663,
});

async function main() {
  const obligation = await clearing.obligations.fromFill({
    fill: matchedFill,
    window: 'current',
  });

  console.log(obligation.net);
}

main();

The package name above is the intended one. It is not published yet, and this repository does not ship an implementation.

Lifecycle states

matched → novated → netted → settled

defaulted is reachable from novated and netted, and routes into the default waterfall.

What a venue has to decide

  1. Which assets to clear. Clearing is per asset, not per venue.
  2. Whether to clear every fill or only fills above a size threshold.
  3. Who posts collateral: the venue on behalf of its users, or the users directly.