SIP-14: Allow delegation of Synthetix Exchange function to another address

Author
Discussions-Tohttps://discord.gg/DQ8ehX4
StatusImplemented
Created2019-08-01

Simple Summary

This SIP proposes to allow a wallet to delegate permission for another wallet / address to make exchanges on their behalf. This would be restricted to only doing exchange transactions.

Allows a non-custodial wallet to make trades on behalf of the owner wallet.

Abstract

Currently only the wallet that also owns the synths can sign synthetix exchange transactions and restricts different trading platforms /automated trading that employ trading strategies from being used on the exchange without exposing the private keys of the wallet that also have ownership of the synths.

Also allows hardware wallets to utilise an automated service to trade on synthetix exchange as they can delegate a temporary wallet to trade on behalf.

Motivation

Currently only the wallet that also owns the synths can sign synthetix exchange transactions and restricts different trading platforms / automated trading that employ trading strategies from being used on the exchange without exposing the private keys of the wallet that also have ownership of the synths.

Also allows hardware wallets to utilise an automated service to trade on synthetix exchange as they can delegate a temporary wallet to trade on behalf.

Specification

function approveExchangeOnBehalf: Approve delegate address to trade on another wallet. function exchangeOnBehalf: Only ability to call synthetix.exchange() for an approved wallet. function removeExchangeOnBehalf: Remove any delegated address from approval list.

Rationale

  • Improve the trading experience of Synthetix.exchange for professional and retail traders.
  • Allow automated trading using a separate private key to sign exchange transactions.
  • Allow hardware wallets to still trade with automated services.

Test Cases

https://github.com/Synthetixio/synthetix/blob/v2.21.6/test/contracts/Exchanger.js#L1230

Implementation

https://github.com/Synthetixio/synthetix/blob/v2.21.6/contracts/Exchanger.sol#L164

Copyright and related rights waived via CC0.