// SPDX-License-Identifier: CC0-1.0 pragma solidity >=0.7.0; import "./ISDCTrade.sol"; import "./ISDCSettlement.sol"; import "./IAsyncTransferCallback.sol"; /*------------------------------------------- DESCRIPTION ---------------------------------------------------------------------------------------*/ /** * @title ERC6123 Smart Derivative Contract * @dev Interface specification for a Smart Derivative Contract, which specifies the post-trade live cycle of an OTC financial derivative in a completely deterministic way. * * A Smart Derivative Contract (SDC) is a deterministic settlement protocol which aims is to remove many inefficiencies in (collateralized) financial transactions. * Settlement (Delivery versus payment) and Counterparty Credit Risk are removed by construction. * * Special Case OTC-Derivatives: In case of a collateralized OTC derivative the SDC nets contract-based and collateral flows . As result, the SDC generates a stream of * reflecting the settlement of a referenced underlying. The settlement cash flows may be daily (which is the standard frequency in traditional markets) * or at higher frequencies. * With each settlement flow the change is the (discounting adjusted) net present value of the underlying contract is exchanged and the value of the contract is reset to zero. * * To automatically process settlement, parties need to provide sufficient initial funding and termination fees at the * beginning of each settlement cycle. Through a settlement cycle the margin amounts are locked. Simplified, the contract reverts the classical scheme of * 1) underlying valuation, then 2) funding of a margin call to * 1) pre-funding of a margin buffer (a token), then 2) settlement. * * A SDC may automatically terminates the financial contract if there is insufficient pre-funding or if the settlement amount exceeds a * prefunded margin balance. Beyond mutual termination is also intended by the function specification. * * Events and Functionality specify the entire live cycle: TradeInception, TradeConfirmation, TradeTermination, Margin-Account-Mechanics, Valuation and Settlement. * * The process can be described by time points and time-intervals which are associated with well defined states: *