SIP 109: Add Synth Exchange Suspension Support Source

AuthorJustin J Moses
Discussions-Tohttps://research.synthetix.io/t/tbc
StatusImplemented
Created2021-02-02

Simple Summary

Add support for the restriction of specific synth exchanges during market closures without impacting their transfer.

Abstract

The current SystemStatus contract (introduced in SIP-44) should be amended to support a new type of suspension - synth exchanges. These must be less restrictive than the synth suspensions that currently exist and only prevent exchanging to and from the specified synth, but still allow their transfer.

Motivation

The SystemStatus contract supports the synthSuspension(bytes32) method allowing the protocolDAO to suspend a synth, thereby preventing its exchange, settlement or transfer. This has been used as a fairly blunt instrument to implement daily market closures of the equity synths sFTSE and sNIKKEI. However, given the need to support forex and commodity market closures as well over the weekend, and the fact that some of these synths, including sEUR are part of distributed pools such as the Curve sEUR pool, prohibiting transfers is too restrictive. Thus a new mechanism to merely prevent the exchange of these synths during market closures is required.

Specification

Overview

Add a new suspension type: SynthExchange to SystemStatus, and support the suspension and resumption of these, along with the current Synth suspension, in groups, thereby reducing the number of transactions required to suspend a class of synths simulatenously (say all forex or commodity synths).

Rationale

The SystemStatus contract is where all suspension is currently managed and is already integrated with exchanging, using it to create another check is the most logical and non-intrusive spot.

Technical Specification

Add the following functions to SystemStatus:

    bytes32 public constant SECTION_SYNTH_EXCHANGE = "SynthExchange";

    function suspendSynthExchange(bytes32 currencyKey, uint256 reason) external;

    function resumeSynthExchange(bytes32 currencyKey) external;

    event SynthExchangeSuspended(bytes32 currencyKey, uint256 reason);

    event SynthExchangeResumed(bytes32 currencyKey, uint256 reason);

In addition, add the following helper functions to prevent the number of individual transactions required when working with a collection of synths:

    function suspendSynthsExchange(bytes32[] calldata currencyKey, uint256 reason) external;

    function resumeSynthsExchange(bytes32[] calldata currencyKey) external;

    // helper function for existing suspendSynth() function
    function suspendSynths(bytes32[] calldata currencyKeys, uint256 reason) external;

    // helper function for existing resumeSynth() function
    function resumeSynths(bytes32[] calldata currencyKeys) external;

During exchanges, on top of the existing checks, if either synth is suspended for exchanging, then the exchange will revert.

Test Cases

  • Given a user has some synth A and wants to exchange into synth B
    • Given the protocolDAO has suspended the exchanging of synth B
      • When the user attempts to exchange A into B
        • ❌ Then the transaction reverts due to synth suspension
      • When the user attempts transfer their synth B
        • ✅ Then it succeeds as transfers are not impacted by synth exchange suspension
      • When the user attempts to settle their exchanges into synth B
        • ✅ Then it succeeds as settlement is not impacted by synth exchange suspension
    • Given the protocolDAO has suspended the exchanging of synth A
      • When the user attempts to exchange A into B
        • ❌ Then the transaction reverts due to synth suspension

Configurable Values (Via SCCP)

N/A

Copyright and related rights waived via CC0.