Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article covers ERC6123, a proposal for automatically executing financial derivatives transactions, from collateral management through settlement, to ensure they are completed securely and reliably.
This article translates, summarizes, and supplements the following proposal.
Overview
A Smart Derivative Contract (SDC) is a mechanism for fully automating and securely executing the lifecycle of financial instruments, such as derivatives and bonds, from trade inception to final settlement. In conventional financial transactions, there is always a risk that the counterparty cannot make the payments stipulated by the contract. This is known as counterparty risk. A key feature of an SDC is its use of smart contracts to almost eliminate this risk.
An SDC uses a price determination mechanism agreed upon in advance (a valuation oracle and model), so the settlement amount is unambiguous and the value is calculated objectively and transparently. It also provides procedures and callbacks for automatically executing settlements, facilitating token-based payments. Using ERC20 tokens enables immediate and secure transfers on the blockchain.
In 2021 and 2022, legally binding digital interest rate swaps (financial contracts) using SDCs were demonstrated in practice, confirming the technology's practical viability.
Motivation
Rethinking financial derivatives
Financial contracts known as over-the-counter derivatives (OTC derivatives) are agreements between two parties to exchange multiple cash flows over an extended period. As market conditions change, the value of the contract fluctuates, creating an ongoing risk that a counterparty cannot make a payment.
An SDC fundamentally rethinks this traditional arrangement, redesigning the financial contract with the following goals.
- Eliminate counterparty risk
- Substantially simplify post-trade processing
The Smart Derivative Contract concept
An SDC is a settlement protocol that reproduces the economic behavior of a financial contract while executing all processing on a blockchain according to predefined rules. Its deterministic design defines what happens in each state, eliminating uncertainty in the process from trade inception to termination.
Settlement can use ERC20 tokens, and a dedicated Settlement Token specification is also available. This enables fully autonomous contract processing among multiple parties without a third-party intermediary.
The protocol logic can be implemented in Solidity as a finite state machine, allowing strict management of each state.
A finite state machine (FSM) has a predefined set of states and operates by transitioning between them according to rules.
For example, it can enforce a sequence such as "Preparing → Processing → Completed" using the following predefined states.
- "Preparing"
- "Processing"
- "Completed"
An FSM is a fundamental design technique for strictly managing states and transitions in this way.
Applications
SDC functionality can be used for various financial contracts.
Settled-to-market OTC derivatives
The basic idea is as follows.
- At regular intervals (for example, daily), calculate the contract's Net Present Value and exchange that value between the parties.
- After the exchange, the contract's value returns to zero and the next cycle begins.
- At the start of each cycle, lock margin (collateral) to ensure settlement.
- If a party fails to provide sufficient collateral or comply with the rules, the SDC automatically terminates the contract, and a guaranteed termination fee is paid by the party in breach to the counterparty.
By resolving exposure to price movements daily, this mechanism can eliminate the large credit risk associated with traditional arrangements.
Collateralized OTC derivatives
A collateralized derivative contract can also be constructed as a variation.
- The contract manages multiple tokens, for collateral and payments.
- The design prevents undercollateralization, removing the need for a large initial margin.
Conventional financial markets require substantial collateral to mitigate the risk of insufficient collateral, whereas SDC logic can manage it automatically.
Defaultable OTC derivatives
This type does not have a collateral process. The cash flows specified in the contract are settled directly, but if a required settlement cannot be made, the contract enters a Failure to Pay condition.
Smart bonds (Smart Bond)
The lifecycle functionality of an SDC can also be applied to bonds.
- Issuers can automate bond allocation (issuance), redemption, and interest payments.
- Holders can also transfer bonds between themselves through secondary-market transactions.
All these operations are processed securely on-chain according to predefined settlement phases.
Specification
Roles of ISDCTrade and ISDCSettlement
A Smart Derivative Contract (SDC) automates financial derivatives transactions with smart contracts, from inception to termination. ISDCTrade and ISDCSettlement handle different processes, clearly separating the overall trade workflow.
Role of ISDCTrade
This interface manages the lifecycle of a trade from inception to termination. It primarily handles the following processes.
- Trade inception (inceptTrade)
- Confirmation and formation of the trade by the counterparty (confirmTrade)
- Cancellation when necessary (cancelTrade)
- Proposal and agreement to terminate an existing trade (requestTradeTermination / confirmTradeTermination)
Each operation is recorded by its corresponding event.
Role of ISDCSettlement
This interface manages settlement after a trade has been confirmed. It handles the following phases.
- Initiating the settlement phase (initiateSettlement)
- Calculating the settlement amount through an oracle (performSettlement)
- Determining settlement success or failure
- Preparing for the next settlement (afterSettlement)
Settlement-related activity is also recorded through events, making it easy to monitor externally.
Trade inception workflow
1. Proposing a trade (inceptTrade)
Party A calls inceptTrade and submits a proposal containing the following information.
- Counterparty address
- Trade specification (tradeData)
- Position
- Initial payment amount
- Initial settlement data
When the proposal is submitted, the TradeIncepted event is emitted.
2. Confirming a trade (confirmTrade)
Party B reviews the proposal and calls confirmTrade to establish the trade.
The TradeConfirmed event is emitted upon confirmation.
3. Canceling a trade proposal (cancelTrade)
If B does not confirm, A can call cancelTrade to withdraw the trade proposal.
This operation emits the TradeCanceled event.
4. Terminating a confirmed trade
Even after confirmation, the parties can terminate a trade by mutual agreement.
The process is as follows.
- One party calls
requestTradeTermination. - The counterparty reviews the request and calls
confirmTradeTerminationto agree. - The request can also be withdrawn with
cancelTradeTerminationif necessary.
Termination-related activity can be traced through the corresponding events.
Settlement workflow
1. Initiating the settlement phase (initiateSettlement)
When someone calls initiateSettlement, the settlement process begins.
The SettlementRequested event is emitted at this point.
2. Calculating the settlement amount (performSettlement)
An external oracle calculates the amount and calls performSettlement.
The result is announced through the SettlementDetermined event.
3. Executing settlement
The actual transfer for settlement takes place.
- Success → SettlementTransferred event
- Failure → SettlementFailed event
4. Preparing for the next settlement cycle (afterSettlement)
Finally, afterSettlement is called to determine the following.
- Whether settlement was successful
- Adjustments to collateral and values for the next cycle
- Whether the next settlement phase can begin
A serious failure may lead to trade termination.
Benefits of this design
The separation between ISDCTrade, which manages the overall trade state, and ISDCSettlement, which manages settlement progression, is central to the transparency and automation of an SDC.
This design provides the following benefits.
- Prevention of discrepancies in trade terms
- Elimination of errors by reducing manual work
- Automatic settlement based on external market data
- Prevention of unauthorized operations
- An on-chain record of the entire history
These two interfaces play a particularly important role in the core SDC design principle of defining and strictly managing states without ambiguity.
ISDCTrade
Events
TradeIncepted
event TradeIncepted(address initiator, string tradeId, string tradeData);Emitted when a trade is proposed.
It is emitted when the initiator calls inceptTrade.
It announces the trade identifier tradeId and the terms of the trade in tradeData.
Parameters
initiator- Address that proposed the trade.
tradeId- Automatically generated unique trade ID.
tradeData- String describing the trade specification.
TradeConfirmed
event TradeConfirmed(address confirmer, string tradeId);Emitted when the counterparty confirms a trade.
The event is emitted when the counterparty calls confirmTrade, indicating that the trade has been agreed upon.
The trade can then progress toward the active state.
Parameters
confirmer- Address that confirmed the trade.
tradeId- ID of the trade being confirmed.
TradeCanceled
event TradeCanceled(address initiator, string tradeId);Emitted when a trade is canceled.
The event is emitted when the initiator calls cancelTrade to withdraw the trade.
It is primarily used when confirmation remains pending.
Parameters
initiator- Address of the party that canceled the trade.
tradeId- ID of the canceled trade.
TradeActivated
event TradeActivated(string tradeId);Emitted when a trade becomes active. It indicates that the trade is finalized and settlement processing can begin.
Parameters
tradeId- ID of the activated trade.
TradeTerminationRequest
event TradeTerminationRequest(address initiator, string tradeId, int256 terminationPayment, string terminationTerms);Emitted when a trade termination request is submitted.
It notifies listeners when one party uses requestTradeTermination to propose termination terms and a payment amount.
Parameters
initiator- Address that proposed termination.
tradeId- ID of the relevant trade.
terminationPayment- Amount payable upon termination.
terminationTerms- Termination terms (for example, XML).
TradeTerminationConfirmed
event TradeTerminationConfirmed(address confirmer, string tradeId, int256 terminationPayment, string terminationTerms);Emitted when the counterparty confirms a termination request.
It is announced when confirmTradeTermination is called, and the trade proceeds toward termination.
Parameters
confirmer- Address that confirmed termination.
tradeId- ID of the relevant trade.
terminationPayment- Agreed payment amount upon termination.
terminationTerms- Termination terms.
TradeTerminationCanceled
event TradeTerminationCanceled(address initiator, string tradeId, string terminationTerms);Emitted when a termination request is withdrawn.
The event is emitted when the party that proposed termination calls cancelTradeTermination.
Parameters
initiator- Address that withdrew the request.
tradeId- ID of the relevant trade.
terminationTerms- Previously proposed termination terms.
TradeTerminated
event TradeTerminated(string cause);Emitted when a trade enters the terminated state. It indicates the cause of termination, such as termination by agreement or forced termination following a failed settlement.
Parameters
cause- String explaining the reason for termination.
Functions
inceptTrade
function inceptTrade(address withParty, string memory tradeData, int position, int256 paymentAmount, string memory initialSettlementData)
external
returns (string memory);Proposes a trade.
The caller submits a trade proposal by providing the counterparty address, trade specification, position, initial payment amount, and initial settlement data.
When called, the function generates a new tradeId and announces it externally through an event.
Parameters
withParty- Address of the counterparty.
tradeData- Proposed trade specification.
position- Position from the perspective of the proposer (initiator).
paymentAmount- Amount paid by the proposer.
initialSettlementData- Data required for the initial settlement.
Return value
tradeId- Automatically generated trade ID.
confirmTrade
function confirmTrade(address withParty, string memory tradeData, int position, int256 paymentAmount, string memory initialSettlementData)
external;Confirms a trade proposal. The function checks whether the proposal details are consistent and establishes the trade if they are.
Parameters
withParty- Counterparty to the trade.
tradeData- Trade specification submitted by the confirming party.
position- Position from the confirmer's perspective (with the opposite sign to the initiator's position).
paymentAmount- Payment amount from the confirmer's perspective.
initialSettlementData- Initial settlement data.
cancelTrade
function cancelTrade(address withParty, string memory tradeData, int position, int256 paymentAmount, string memory initialSettlementData)
external;Withdraws a trade proposal. It can be used, for example, when some time has elapsed without confirmation by the counterparty.
Parameters
withParty- Counterparty address.
tradeData- Trade data submitted with the proposal.
position- Proposer's position.
paymentAmount- Payment amount.
initialSettlementData- Initial settlement data.
requestTradeTermination
function requestTradeTermination(string memory tradeId, int256 terminationPayment, string memory terminationTerms)
external;Proposes termination of an existing confirmed trade. The caller presents termination terms and a payment amount and seeks the counterparty's agreement.
Parameters
tradeId- ID of the relevant trade.
terminationPayment- Amount payable upon termination.
terminationTerms- Termination terms (for example, XML).
confirmTradeTermination
function confirmTradeTermination(string memory tradeId, int256 terminationPayment, string memory terminationTerms)
external;Confirms a termination proposal. The trade proceeds to termination by agreement.
Parameters
tradeId- ID of the relevant trade.
terminationPayment- Agreed payment amount upon termination.
terminationTerms- Termination terms.
cancelTradeTermination
function cancelTradeTermination(string memory tradeId, int256 terminationPayment, string memory terminationTerms)
external;Withdraws a termination proposal. The proposer can withdraw it if, for example, the counterparty does not confirm.
Parameters
tradeId- Trade ID.
terminationPayment- Payment amount.
terminationTerms- Termination terms.
ISDCSettlement
Events
SettlementRequested
event SettlementRequested(address initiator, string tradeData, string lastSettlementData);Emitted when settlement begins.
The event is emitted when initiateSettlement is called and provides data from the previous settlement for use in the next calculation.
Parameters
initiator- Address that initiated settlement.
tradeData- Trade specification.
lastSettlementData- Data from the previous settlement.
SettlementDetermined
event SettlementDetermined(address initiator, int256 settlementAmount, string settlementData);Emitted when the settlement amount is determined. It announces the amount and related data supplied by an oracle or similar source.
Parameters
initiator- Address that provided the settlement amount (normally the oracle).
settlementAmount- Determined settlement amount.
settlementData- Data to be used for the next settlement.
SettlementTransferred
event SettlementTransferred(string transactionData);Emitted when settlement is executed successfully. It signals successful settlement, regardless of whether settlement is synchronous or asynchronous.
Parameters
transactionData- Additional information about the settlement.
SettlementFailed
event SettlementFailed(string transactionData);Emitted when settlement fails. It indicates why settlement could not be completed, such as insufficient collateral or a failed external transfer.
Parameters
transactionData- Details of the failure.
Functions
initiateSettlement
function initiateSettlement() external;Initiates the settlement phase. A trade party or a delegated address uses this function to start the next settlement cycle.
performSettlement
function performSettlement(int256 settlementAmount, string memory settlementData)
external;Receives the settlement amount calculated by an oracle or similar source and performs settlement. After verifying the amount, it emits either a success or a failure event.
Parameters
settlementAmount- Settlement amount.
settlementData- Settlement rules or data for the next cycle.
afterSettlement
function afterSettlement() external;Prepares for the next settlement cycle. It verifies the previous settlement result and performs collateral checks or other checks if needed.
IAsyncTransferCallback
Functions
afterTransfer
function afterTransfer(bool success, uint256 transactionID, string memory transactionData) external;A callback invoked after an external settlement system completes its transfer. It receives the transfer result and proceeds with settlement success or failure handling as appropriate.
Parameters
successtrueif the transfer succeeds, orfalseif it fails.
transactionID- Transaction ID in the settlement system.
transactionData- Additional information about the transfer.
IAsyncTransfer
Events
AsyncTransferInitiated
event AsyncTransferInitiated(address from, address to, uint256 amount, uint256 transactionID);Emitted when an asynchronous transfer to an external system is initiated.
Parameters
from- Sender address.
to- Recipient address.
amount- Transfer amount.
transactionID- External transfer ID.
AsyncTransferCompleted
event AsyncTransferCompleted(uint256 transactionID, bool success, string transactionData);Emitted when the external settlement system completes the transfer.
Parameters
transactionID- Transaction ID.
success- Whether the transfer succeeded.
transactionData- Additional information.
Functions
initiateAsyncTransfer
function initiateAsyncTransfer(address to, uint256 amount) external returns (uint256);Initiates a transfer through an external settlement system.
It returns a transaction ID, and afterTransfer is called upon completion of the transfer.
Parameters
to- Recipient address.
amount- Transfer amount.
Return value
transactionID- External transfer ID.
Additional notes
Core protocol design principles
The SDC interface design and reference implementation are based on the following principles.
Allow counterparties to conduct financial transactions deterministically
The central feature of an SDC is that it eliminates ambiguity and human error inherent in financial transactions, providing a deterministic process in which what happens and when is fully defined.
Trade and settlement states are clearly defined, preventing external actors from performing unauthorized operations at arbitrary times.
The contract thereby controls the following issues.
- Settlement errors
- Timing discrepancies
- Risk of counterparty nonperformance (counterparty risk)
Cover the entire trade lifecycle with the interfaces
An SDC handles all the following stages on-chain.
- Trade inception (Incept)
- Trade confirmation (Confirm)
- Settlement cycles (Settlement)
- Maintenance (Valuation and precondition checks)
- Termination requests and agreements
- Forced termination (when settlement fails)
Although the specification separates ISDCTrade and ISDCSettlement, the two interfaces together can describe every stage of a financial transaction.
Support multiple trades through a general-purpose design
The specification is designed to support both single and multiple trades.
In particular, it anticipates mechanisms for netting multiple trades, making it applicable to companies and financial institutions that handle large volumes of OTC transactions.
Rely on an external oracle for valuation
Calculating the market value of derivatives is complex, and performing those calculations on-chain is impractical.
The SDC therefore assumes that an external oracle calculates the price and supplies market data.
The oracle is integrated as follows.
initiateSettlemententers the settlement phase.- The oracle calculates the price using market data.
performSettlementpasses the price to the contract.- The contract executes settlement based on that value.
In this way, the protocol implements a pull-based oracle pattern with a callback.
Structure the protocol around the finite state machine in SDCSingleTrade.sol
The reference implementation SDCSingleTrade.sol uses a state machine to define the following.
- Which functions can be called in each state
- How states transition
- How states transition when settlement succeeds or fails
In the implementation, modifier guards prevent execution in invalid states.
Provide interfaces that can be extended to net settlement
Although the interfaces assume implementation on a per-trade basis, they are designed to be extensible to the net settlement of multiple trades.
This allows the design to accommodate large-scale enterprise derivatives settlement.
Trade states and process states
The overall SDC workflow is illustrated in the following diagram.
Trade and settlement state transition diagram

This diagram shows the state transitions of SDCSingleTrade.sol, with clearly controlled progression through Inactive → Incepted → Confirmed → InTransfer → Valuation → Settled → (loop) or Terminated.
The key states and operations are as follows.
- Incept (proposal)
- Confirm (confirmation)
- InTransfer (transfer processing)
- Valuation (valuation phase)
- Settled (settlement completed)
- Terminated (termination)
If settlement fails, the workflow clearly transitions to InTermination, followed by Terminated.
Sequence for asynchronous settlement (using IAsyncTransfer)
The following is the detailed sequence of an implementation variant using SettlementToken.

Trade initialization (Initialize Trade)
To start operating an SDC (Smart Derivative Contract), the parties first prepare the funds required for the trade and deploy the contract. CP1 and CP2 ensure they have sufficient balances for collateral and fees, then deploy the contract with information such as the SettlementToken address. These steps prepare the parties for the trade.
Trade inception (Incept)
The first action to start the trade is a call to inceptTrade by CP1.
When CP1 submits a proposal to the SDC stating the terms under which it wishes to trade, the contract records the details, emits the TradeIncepted event, and moves to Incepted.
At this point, the trade has not yet been formally established; only the proposal has been recorded.
Trade confirmation (Confirm)
If CP2 reviews the proposal and agrees to the terms, it calls confirmTrade to formally establish the trade.
The SDC emits the TradeConfirmed event and transitions to Confirmed.
The workflow then proceeds to initial transfers so that the trade can be managed correctly.
Initial transfers (Margin Buffer, fees, etc.)
Once the trade becomes Confirmed, the SDC requests SettlementToken (which supports IAsyncTransfer) to collect collateral and fees in a batch.
This is performed using transferBatchAndCallback, which processes transfers such as the following together.
- Collateral (Margin Buffer) from CP1 and CP2 to the SDC
- Required fees
- Upfront fees, where applicable
While the transfers are in progress, the state changes to InTransfer. When SettlementToken completes processing, it uses afterTransfer to return the result to the SDC.
If all transfers succeed, the TradeActivated event is emitted, followed by SettlementAwaitingInitiation.
The state changes to Settled, and the settlement cycle can now begin.
Settlement cycle (Settlement Loop)
Settlement takes place repeatedly at the scheduled times throughout the life of the trade.
When the SDC is in Settled, initiateSettlement is the action used to start the next settlement.
Initiating settlement (initiateSettlement)
When either party or a delegated operator calls initiateSettlement, the SDC accepts the settlement request and emits SettlementRequested.
At the same time, it moves to Valuation, the phase in which the current settlement amount is calculated.
Off-chain valuation (Valuation)
During Valuation, an off-chain valuation oracle refers to market data and calculates the derivative's present value.
Once the calculation is complete, the oracle calls performSettlement and supplies the settlement amount to the SDC.
The SDC then emits SettlementDetermined and transitions to InTransfer.
Settlement transfer (transferAndCallback)
Once the settlement amount is known, the SDC asks SettlementToken to transfer funds from the paying party to the receiving party.
This operation uses transferAndCallback, and the state is again InTransfer while the transfer is underway.
Once transfer processing is complete, SettlementToken returns the result to the SDC through afterTransfer.
Handling settlement success and failure
On success
If the transfer succeeds, the SDC emits events such as TransferSucceeded and SettlementSucceeded to signal completion.
It returns to Settled and waits for the next settlement date.
On failure
If the transfer fails, the SDC proceeds to termination processing to end the trade securely. The process is as follows.
- Emit
TransferFailedto signal the failure. - Pay the required settlement amount to the receiving party from the collateral held by the SDC.
- Transfer the
TerminationFeeat the same time. - Return the remaining balances to CP1 and CP2.
- Emit
TradeTerminatedand set the final state toTerminated.
This allows the trade to end securely without leaving unresolved risks or inconsistencies from the failed settlement.
Precondition checks for the next settlement (optional)
The afterSettlement call at the bottom of the diagram is a checkpoint that can be invoked as needed before the next settlement.
This hook can check whether sufficient collateral is available, transfers are ready, or the preceding operation has completed correctly.
If no problems are found, SettlementAwaitingInitiation is emitted, and the next initiateSettlement call can be made.
If an issue is detected, the trade transitions immediately to Terminated.
Summary of the overall workflow
The SDC workflow proceeds as follows.
- Deploy the contract.
- CP1 proposes a trade (
Incept). - CP2 confirms the trade (
Confirm). - Transfer the initial collateral (
InTransfer→Settled). - Call
initiateSettlementon the settlement date. - Perform off-chain valuation and receive the result through
performSettlement. - Execute the settlement transfer (
InTransfer). - Return to
Settledon success. - Proceed to
Terminatedon failure. - Perform precondition checks for the next settlement as needed.
This workflow strictly manages the trade state from inception to termination, executes all transfers asynchronously and securely, and facilitates integration with off-chain systems.
Sequence with separate collateral accounts
The following diagram shows the sequence for the variant that separates cash and collateral tokens.

Initiating the settlement cycle (Settled → Valuation)
When the trade is in Settled, call initiateSettlement() to start the next settlement cycle.
Either party or a delegated address can execute this operation.
Upon receiving the call, the SDC emits SettlementRequested, representing the settlement request, and advances to Valuation.
In Valuation, the off-chain valuation oracle calculates the trade's present value based on market information.
The result is returned to the SDC through performSettlement(). The SDC emits SettlementDetermined and transitions to InTransfer.
The actual transfer phase begins here.
Two settlement workflow patterns
The processing after entering InTransfer depends on the type of transaction.
Collateral adjustment (Adjust Collateral)
This workflow is used when changes in the value of the trade require an adjustment to the amount of collateral. It proceeds as follows.
- The SDC requests a collateral transfer from CollateralToken using
transferAndCallback(). - The token attempts the transfer and calls
afterTransferwith the result. - On success, the
TransferSucceededevent is emitted and the state returns toSettled. - On failure, the
TransferFailedevent is emitted and the trade proceeds directly to forced termination (Terminated).
Collateral adjustment simply increases or decreases the collateral. There are consequently few branches, with clear success and failure paths.
Coupon payment (Coupon Payment)
When periodic interest payments or cash settlements are required, collateral and cash must be moved in a safe order. To mitigate risk, the process has three steps: lock collateral, transfer cash, and finally transfer the collateral.
The workflow is as follows.
- Lock collateral
The SDC requests a lock operation from CollateralToken. If successful, the process advances to the cash transfer.
If the lock fails, the trade immediately transitions to
Terminated. - Transfer cash Request a cash transfer from CashToken. On success, proceed to collateral release. On failure, restore the locked collateral and begin termination processing.
- Release (pass) collateral
Finally, transfer the collateral to the receiving party.
On success, return to
Settledand wait for the next cycle. On failure, proceed to forced termination.
All three steps are performed asynchronously, and each result is reported to the contract through afterTransfer.
Precondition checks before the next settlement (afterSettlement)
If necessary, the SDC calls afterSettlement to perform precondition checks before the next settlement.
This step confirms that the system is ready to execute the next settlement safely.
The checks vary by implementation, such as whether advance payments are ready, whether there is a collateral shortfall, and whether the preceding operation completed successfully.
If the results are satisfactory, SettlementAwaitingInitiation is emitted and the next settlement cycle is ready to begin.
If an issue is identified, termination processing starts immediately and the state becomes Terminated.
Termination processing after a failed settlement
If a transfer fails in either workflow, the SDC performs termination processing to close out the trade securely.
During termination, any remaining payments required by the trade are transferred, and unprocessed balances are returned to each party.
TradeTerminated is then emitted, and the final state is set to Terminated.
Key points of the overall workflow
The settlement cycle proceeds in the following order.
- Initiate settlement (
initiateSettlement). - Perform off-chain valuation (
performSettlement). - Transition to
InTransferand enter the transfer phase. - Execute either collateral adjustment or a coupon payment (each has a success path and a failure path).
- Return to
Settledon success or enterTerminatedon failure. - Perform precondition checks for the next settlement (
afterSettlement) if necessary. - Continue the loop if no problems are found, or terminate if there is an issue.
In this way, an SDC implements the collateral management, consistency, and settlement workflow security required for financial operations on-chain.
Test cases
https://eips.ethereum.org/assets/eip-6123/test/SDCTests.js
References
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: https://eips.ethereum.org/EIPS/eip-6123.
Conclusion
This article covered ERC6123, a proposal for automatically executing financial derivatives transactions, from collateral management through settlement, to ensure they are completed securely and reliably. I hope it was useful.

