Alert Source Discuss
šŸš§ Stagnant Standards Track: ERC

ERC-6123: Smart Derivative Contract

A deterministic protocol for frictionless post-trade processing of OTC financial contracts

Authors Christian Fries (@cfries), Peter Kohl-Landgraf (@pekola), Alexandros Korpis (@kourouta)
Created 2022-12-13
Discussion Link


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.


Rethinking Financial Derivatives

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.

Concept of a Smart Derivative Contract

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;

Trade Events

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);

Process Events

The following events are emitted during SDCā€™s process livecycle.


Emitted when funding phase is initiated

event ProcessAwaitingFunding();


Emitted when funding has completed successfully - method ā€˜initiatePrefundingā€™

event ProcessFunded();


Emitted when a settlement is initiated - method ā€˜initiateSettlementā€™

event ProcessSettlementRequest(string tradeData, string lastSettlementData);


Emitted when settlement was processed successfully - method ā€˜performSettlementā€™

event ProcessSettled();


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.sol is 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.

State diagram of trade and process states

image info

Sequence diagram of trade initiation and settlement livecycle

image info

Test Cases

Live-cycle unit tests based on the sample implementation and usage of EIP-20 token is provided. See file test/SDC.js ).

Reference Implementation

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.

Trade Data Specification (suggestion)

Please take a look at the provided xml file as a suggestion on how trade parameters could be stored.

Security Considerations

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), "ERC-6123: Smart Derivative Contract [DRAFT]," Ethereum Improvement Proposals, no. 6123, December 2022. [Online serial]. Available: