Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workshop to trade in cowswap using gnosis-safe through SDK

The purpose of this workshop is to present how to easily create a market order using Meta DEX cowswap through its SDK. With a simple transaction it encapsulates the steps of pre-signing, approval, even wrapping.

The slides presented at the EthLatam Buenos Aires workshop are available here.

This workshop is inspired by a CLI working in progress repository from a member of the CoW protocol core team.

Overview

Right now there is a large group of DAO's managing their treasury with a secure multi-signature wallet. Multi-signature orders can suffer from several drawbacks:

  • Waste of gas cost when tx fails, (due to lack of signature and expiration).
  • Bots eat all the slippage (due to lax slippage trying to cover volatility).

This is solved with the professional CoW Protocol settlement layer, that is why we present how to package a series of actions in a simple transaction using gnosis-safe, this unlock a range of possibilities that we encourage you to try.

📝 Requirements

🚀 Setting up

  1. Install the packages with yarn
    yarn install
  1. Copy .env.example variable file and rename to .env then put necessary variables into it.
    INFURA_KEY=yourRinkebyNetworkInfuraKey
    MNEMONIC=your rinkeby test seed phrase

🧑‍💻 Let's get to work

For these example we will sell 0.1 WETH per GNO in the rinkeby network

1. Create a market order with a external owned account (EOA)

yarn sell examples/eoa-rinkeby-market-order.json

The input data is fed from eoa-rinkeby-market-order.json

2. Create a market order using a gnosis-safe wallet

yarn sell examples/safe-rinkeby-market-order-1owner.json

A single signatory account of gnosis-safe is now used

...
"account": {
    "accountType": "SAFE_WITH_EOA_PROPOSER",
    "safeAddress": "yourSingleSignatoreAddress"
  },
...

The data is fed from safe-rinkeby-market-order-1owner.json

3. Create a market order using a multisignature safe wallet

yarn sell examples/safe-rinkeby-market-order-2owners.json

A multi-signature account is now used

...
"account": {
    "accountType": "SAFE_WITH_EOA_PROPOSER",
    "safeAddress": "yourMultiSignatureAccount"
  },
...

The data is fed from safe-rinkeby-market-order-2owners.json

😎 That's it for now


📔 References

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages