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.
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.
- yarn
- infura key account
- mnemonic seed
- gnosis-safe wallet (for the gnosis-safe example)
- Install the packages with yarn
yarn install- Copy
.env.examplevariable file and rename to.envthen put necessary variables into it.
INFURA_KEY=yourRinkebyNetworkInfuraKey
MNEMONIC=your rinkeby test seed phraseFor these example we will sell 0.1 WETH per GNO in the rinkeby network
yarn sell examples/eoa-rinkeby-market-order.jsonThe input data is fed from eoa-rinkeby-market-order.json
yarn sell examples/safe-rinkeby-market-order-1owner.jsonA 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
yarn sell examples/safe-rinkeby-market-order-2owners.jsonA 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
- Signing orders via API
- Post orders with CLI, created by @anxolin
- EthDenver Talk Why All DAOs Should Use by Anna George