SIP-267: Direct Integration

Author
StatusDraft
TypeGovernance
NetworkEthereum & Optimism
ImplementorTBD
ReleaseTBD
Created2022-07-28

Simple Summary

This SIP proposes to implement a direct integration contract that allows integrators to tap into Synthetix's exchange functionalities with a customized set parameters.

Abstract

The direct integration contract allows the Synthetix protocol to create a unique enviroment for integrators, allowing access to Synthetix's exchange functionalities with custom parameters that fit individual use cases. Although this sip is built on top of v2x, it fits in the spirit of what we should expect with Synthetix v3, where different markets can be created and tailored for specific offerings and use cases.

Motivation

There are a number of benefits to the Synthetix protocol from having a direct integration path with partners:

  • Lyra's uses Synthetix's exchange functionalities in to offer it's users options trading venue with an integrated amm model which embeds slippage.
  • Curve also provides Synthetix with pools that allow for cross-asset swaps with built-in slippage.

Both these protocols have a significantly reduced chance of latency attacks, due to their protocol's incorporation of slippage constraining toxic flow to a certain extent. Providing these special DirectIntegration routes into Synthetix's exchange functionalities isolates the trade flow to a certain extent and allows us to offer more competitive offerings via lower fees.

Specification

Technical Specification

The DirectIntegration contract allows the Spartan Council to approve an external contract, not owned or managed by the Synthetix protocol, to interact with the Synthetix's core exchange functionalities at specified parameters. If no parameter overrides were specified, the prevailing parameter configuration would be automatically used. Below are the functionalities configurable within the DirectIntegration contract:

Add / Remove Integration

addIntegration and removeIntegration functions, which take in 2 arguments :

  • The address of the external integrators' contract
  • An identifier of the exchange functionality that could be tapped by the external contract (example exchangeAtomically).

By calling addIntegration the external contract can interact with the synthetix exchange functionality at the default parameters that are currently on-chain. While calling removeIntegration on the other hand, removes the external contract address as well as all pre-configured overridden parameters related to that external contract from memory.

Add Override on Parameters

addOverride is a function that takes in the following arguments:

  • The address of the external contract
  • An identifier of the parameter to be overridden (example setAtomicExchangeFeeRate)
  • A list that make -- The address of the external contract

up the override values. An example of this would be ['sETH',10 bp] which sets fees on atomic exchanges on sETH to 10 bp.

Hence addOverride can be used to lower the exchangeFee on exchanges with certain synths for integrators. In case an override value needs to be edited, removeOverride can be done followed by addOverride.

Remove Override on Parameters

removeOverride is a function that takes in the following arguments:

  • The address of the external contract
  • An identifier of a parameter (i.e. setAtomicExchangeFeeRate)

Once a remove override is set, the default parameters prevailing within the current Synthetix core contracts is used.

Get Integration Parameters

The getIntegrationParameter function takes in the following arguments:

  • The address of the external contract
  • An identifier of a parameter (i.e. setAtomicExchangeFeeRate)

This is a getter function that can be used to read the configured parameters on a external contract.

Resume / Pause Integration

The SystemStatus would include resumeIntegration and pauseIntegration functions, that take in the external contract address and allows pdao to suspend and resume interaction with external contracts.

Parameters Involved

Below is a list of parameters that can be configured via the DirectIntegration contract:

  • setDexPriceAggregator
  • setAtomicExchangeFeeRate
  • setAtomicMaxVolumePerBlock
  • setAtomicVolatilityTwapSeconds SIP-265
  • setAtomicMaxTwapDelta SIP-265
  • setAtomicSlippageScalingFactor SIP-266 (yet to be published)
  • setExchangeFeeRateForSynths
  • setExchangeDynamicFeeWeightDecay
  • setExchangeDynamicFeeThreshold
  • setExchangeDynamicFeeRounds
  • setExchangeMaxDynamicFee

Test Cases

Configurable Values (Via SCCP)

Below is a list of values configurable via SIP or SCCP:

  • addIntegration, addOverride: These will require a SIP and a presentation, given the importance of clearly presenting external interactions with Synthetix contracts and the parameters overrides that would be implemented.
  • removeOverride , resumeIntegration , removeIntegration: These interactions can be configured via SCCP.
  • pauseIntegration can be called by pDAO should it be needed in cases of emergencies.

Copyright and related rights waived via CC0.