A deterministic protocol for frictionless post-trade processing of OTC financial contracts
|Authors||Christian Fries (@cfries), Peter Kohl-Landgraf (@pekola), Alexandros Korpis (@kourouta)|
Table of Contents
- Test Cases
- Reference Implementation
- Security Considerations
The Smart Derivative Contract is a deterministic protocol to trade and process financial derivative contracts frictionless and scalable in a completely automated way. Counterparty credit risk ís removed. Known operational risks and complexities in post-trade processing are removed by construction as all process states are fully specified and are known to the counterparties.
By their very nature, so-called “over-the-counter (OTC)” financial contracts are bilateral contractual agreements on the exchange of long-dated cash flow schedules. Since these contracts change their intrinsic market value due to changing market environments, they are subject to counterparty credit risk when one counterparty is subject to default. The initial white paper describes the concept of a Smart Derivative Contract with the central aim to detach bilateral financial transactions from counterparty credit risk and to remove complexities in bilateral post-trade processing by a complete redesign.
A Smart Derivative Contract is a deterministic settlement protocol which has the same economic behaviour as a collateralized OTC Derivative. Every process state is specified; therefore, the entire post-trade process is known in advance. A Smart Derivative Contract (SDC) settles outstanding net present value of the underlying financial contract on a frequent basis. With each settlement cycle net present value of the underlying contract is exchanged, and the value of the contract is reset to zero. Pre-Agreed margin buffers are locked at the beginning of each settlement cycle such that settlement will be guaranteed up to a certain amount. If a counterparty fails to obey contract rules, e.g. not provide sufficient prefunding, SDC will terminate automatically with the guaranteed transfer of a termination fee by the causing party. These features enable two counterparties to process their financial contract fully decentralized without relying on a third central intermediary agent. The process logic of SDC can be implemented as a finite state machine on solidity. An EIP-20 token can be used for frictionless decentralized settlement, see reference implementation. Combined with an appropriate external market data and valuation oracle which calculates net present values, each known OTC derivative contract is able to be processed using this standard protocol.
The following methods specify inception and post-trade live cycle of a Smart Derivative Contract. For futher information also please look at the interface documentation ISDC.sol.
A counterparty can initiate a trade by providing trade data as string and calling inceptTrade and initial settlement data. Only registered counteparties are allowed to use that function.
function inceptTrade(string memory _tradeData, string memory _initialSettlementData) external;
A counterparty can confirm a trade by providing the identical trade data and initial settlement information, which are already stored from inceptTrade call.
function confirmTrade(string memory _tradeData, string memory _initialSettlementData) external;
This method checks whether contractual prefunding is provided by both counterparties as agreed in the contract terms. Triggers a contract termination if not.
function initiatePrefunding() external;
Allows eligible participants (such as counterparties or a delegated agent) to initiate a settlement.
function initiateSettlement() external;
Valuation may be provided off-chain via an external oracle service that calculates net present value and uses external market data. Method serves as callback called from an external oracle providing settlement amount and used settlement data which also get stored. Settlement amount will be checked according to contract terms resulting in either a reqular settlement or a termination of the trade.
function performSettlement(int256 settlementAmount, string memory settlementData) external;
Allows an eligible party to request a mutual termination
function requestTradeTermination(string memory tradeId) external;
Allows eligible parties to confirm a formerly-requested mutual trade termination.
function confirmTradeTermination(string memory tradeId) external;
The following events are emitted during an SDC trade livecycle.
Emitted on trade inception - method ‘inceptTrade’
event TradeIncepted(address initiator, string tradeId, string tradeData);
Emitted on trade confirmation - method ‘confirmTrade’
event TradeConfirmed(address confirmer, string tradeId);
Emitted when trade is activated
event TradeActivated(string tradeId);
Emitted when termination request is initiated by a counterparty
event TradeTerminationRequest(address cpAddress, string tradeId);
Emitted when termination request is confirmed by a counterparty
event TradeTerminationConfirmed(address cpAddress, string tradeId);
Emitted when trade is terminated
event TradeTerminated(string cause);
The following events are emitted during SDC’s process livecycle.
Emitted when funding phase is initiated
Emitted when funding has completed successfully - method ‘initiatePrefunding’
Emitted when a settlement is initiated - method ‘initiateSettlement’
event ProcessSettlementRequest(string tradeData, string lastSettlementData);
Emitted when settlement was processed successfully - method ‘performSettlement’
The interface design and reference implementation are based on the following considerations:
- A SDC protocol is supposed to be used by two counterparties and enables them to initiate and process a derivative transaction in a bilateral and digital manner.
- The provided interface specification is supposed to completely reflect the entire trade livecycle.
- The interface specification is generic enough to handle the case that two counterparties process one or even multiple derivative transactions (on a netted base)
- Usually, the valuation of an OTC trade will require advanced valuation methodology. This is why the concept will in most cases rely on external market data and valuation algorithms
- A pull-based valuation based oracle pattern is specified by a simple callback pattern (methods: initiateSettlement, performSettlement)
- The reference implementation
SDC.solis based on a state-machine pattern where the states also serve as guards (via modifiers) to check which method is allowed to be called at a particular given process and trade state
- Java based state machine and contract implementations are also available. See the github repo link below.
A reference implementation SDC.sol is provided and is based on the EIP-20 token standard. See folder /assets/contracts, more explanation on the implementation is provided inline.
Please take a look at the provided xml file as a suggestion on how trade parameters could be stored.
No known security issues up to now.
Copyright and related rights waived via CC0.
Please cite this document as:
Christian Fries (@cfries), Peter Kohl-Landgraf (@pekola), Alexandros Korpis (@kourouta), "EIP-6123: Smart Derivative Contract [DRAFT]," Ethereum Improvement Proposals, no. 6123, December 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-6123.