Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

indent-contracts

The on-chain surface of the clearing layer. Interfaces, events and errors, published before deployment.

checks solidity chain license


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.


What is here

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

The whole venue-facing surface

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.


The waterfall order is part of the interface

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.


What the interfaces refuse to allow

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.


Related

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

Status

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.

About

On-chain surface of the clearing layer: submission, novation, collateral and settlement.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages