The on-chain surface of the clearing layer. Interfaces, events and errors, published before deployment.
Nothing here is deployed. These are the interfaces the contracts will implement, published first so they can be read, argued with and corrected while changing them is still cheap.
An interface is a promise about what the code will be allowed to do. Putting that promise in public before the implementation exists is the point: once an address holds collateral, the argument about shape is over.
| Interface | Governs |
|---|---|
IClearing |
Submission, novation, netting, settlement finality |
ICollateral |
Posting, haircuts, position limits |
IDefaultWaterfall |
Loss absorption in fixed layer order |
ISolvencyProof |
Coverage published without revealing positions |
function submit(
Obligation calldata obligation,
bytes calldata buyerSignature,
bytes calldata sellerSignature
) external returns (bytes32 id);One struct, one call. Submission is atomic: the obligation is admitted and novated in the same transaction, or the call reverts.
That matters more than it looks. There is no pending state in which a venue believes a trade is cleared while the protocol does not, so a venue never has to reconcile its own view against ours.
Limit breaches, expiry, unknown members and bad signatures are all errors, not events. A trade that cannot clear is rejected at submission rather than unwound afterwards.
enum Layer {
DefaulterMargin, // 1
DefaulterFundContribution, // 2
ProtocolInsurance, // 3
MutualisedFund, // 4
Auction // 5
}Layer three sits ahead of layer four deliberately. The protocol's own capital
is consumed before any surviving member's, and absorb returns
survivorsTouched so the property is observable rather than asserted in a
document.
CI fails if that order is ever reordered, because the order is the guarantee.
The protocol token is not accepted as collateral against a position. A fall in the token would cut the collateral backing exactly when the default fund is most likely to be needed, and that reflexive loop has broken collateralised systems before. It is designed out at the interface rather than left as a parameter someone can widen later.
| indent-core | The maths these contracts will enforce, with tests |
| indent-sdk | Venue-side obligation building and lifecycle |
| indentlayer.xyz/docs | The model behind all of it |
| Interfaces | published |
| Implementation | in progress |
| Testnet | not open |
| Mainnet | not live |
Network: Robinhood Chain, chain ID 4663.
Corrections to the surface are more welcome than additions to it. If a guarantee is missing or an error is unreachable, open an issue.
MIT licensed.