gnosis / dex-liquidity-provision

GNU Lesser General Public License v3.0
12 stars 9 forks source link

streamline the process of deploying safes and executing strategies #27

Closed josojo closed 4 years ago

josojo commented 4 years ago

Current manual process is as outlined in the following and it should be stream lined into one js script

Task:
   @Federico could you create the same bracket liquidity strategy tomorrow (ideally before the trading challenge) for SNX - WETH. Since it also uses WETH I am afraid we need 20 new  “proxy safes”.
The reference price should simply be current SNX - ETH price but I suggest a sightly bigger spread - 3% per bracket - so in total +/-30% around the starting price.

Uniswap price at 10:36:
- Sell 1 WETH for 271.5 SNX
- Sell 1 SNX for 0.0036 WETH (275.0 SNX for 1 WETH)
Source: https://uniswap.exchange/

Token Dfusion index/address/decimals:
WETH: 1, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18
SNX: 15, 0xc011a72400e58ecd99ee497cf89e3775d4bd732f, 18
Source: https://explore.duneanalytics.com/public/dashboards/I43OkDWnojXZYm8vmdBDcLz5UsS3Tn0cx1xU8Hcg

Current commit: b35a36d2054f8a78ebffe0fc70dd6e79eaa75e50

Export personal private key from Metamask, private key has about 0.1 ETH. Add to root of repo a file called ".env" containing one line with the private key:
$  PK=privatekeygoeshere

In file truffle.conf change lines
const DEFAULT_GAS_PRICE_GWEI = 25
const DEFAULT_GAS_LIMIT = 8e6
to something more reasonable, like:
const DEFAULT_GAS_PRICE_GWEI = 3
const DEFAULT_GAS_LIMIT = 5e5

Use as master safe 0x583788f490a278DB2a8d6D7226264b4985f75678,
extracted from Ben's conversation on Slack and checked on the web interface:
https://gnosis-safe.io/safes/0x583788f490a278DB2a8d6D7226264b4985f75678/balances

Create safes:
$ npx truffle exec scripts/deploy_safes.js --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --fleetSize=20 --network mainnet

Safes created:
const slaves = [
  "0xca7b512316340b8d052c6b5aecf84338f3abbfb0",
  "0x1039EDd1d100185Eaf45141C99227D1B994CE11F",
  "0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025",
  "0xd2CF6bc70C93058F6545dF809df79f76f798aac0",
  "0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44",
  "0x906B5c2877dEad3c5565b042094d182b7575ADdE",
  "0x4A77F409187E0f5084A391faC25c3F3497db73FB",
  "0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e",
  "0x36731EC6C6c10d99f09580820b8D30607A383288",
  "0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6",
  "0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E",
  "0x519C66D04878C0BA193B2e696173A0c0e17c527e",
  "0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37",
  "0x88c470b7A4Db417Ad3578B485302D0C260668393",
  "0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D",
  "0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF",
  "0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571",
  "0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2",
  "0xFAf106837b17F8c103dd10da56935Ef0ad302dc6",
  "0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43"
]

Addresses in the list in one line:
0xca7b512316340b8d052c6b5aecf84338f3abbfb0,0x1039EDd1d100185Eaf45141C99227D1B994CE11F,0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025,0xd2CF6bc70C93058F6545dF809df79f76f798aac0,0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44,0x906B5c2877dEad3c5565b042094d182b7575ADdE,0x4A77F409187E0f5084A391faC25c3F3497db73FB,0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e,0x36731EC6C6c10d99f09580820b8D30607A383288,0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6,0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E,0x519C66D04878C0BA193B2e696173A0c0e17c527e,0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37,0x88c470b7A4Db417Ad3578B485302D0C260668393,0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D,0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF,0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571,0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2,0xFAf106837b17F8c103dd10da56935Ef0ad302dc6,0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43

Remove PK from .env

Send orders:
- no problems with decimal, both have 18
- Target price: 273
- WETH: 1
  SNX: 15
- max bracket 30%
- starts at 2pm today, at timestamp: (note that the string below uses UTC)
    $ date +%s --date='2020-02-21T15:00'
  that is at batchId:
    $ expr $(date +%s --date='2020-02-21T15:00') / 300
  5274312
    (current batch Id is 5274284, 2h30min left, it makes sense.)

Change line 300 of trading_strategy_helpers.js to:
const validFroms = [validFrom, validFrom]
This way, I can specify an absolute "valid from" and don't have to worry about the timing of the terminal command. 

$ npx truffle exec scripts/bracket_orders.js --validFrom=5274312 --priceRange=30 --targetToken=1 --stableToken=15 --targetPrice=273 --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --slaves=0xca7b512316340b8d052c6b5aecf84338f3abbfb0,0x1039EDd1d100185Eaf45141C99227D1B994CE11F,0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025,0xd2CF6bc70C93058F6545dF809df79f76f798aac0,0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44,0x906B5c2877dEad3c5565b042094d182b7575ADdE,0x4A77F409187E0f5084A391faC25c3F3497db73FB,0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e,0x36731EC6C6c10d99f09580820b8D30607A383288,0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6,0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E,0x519C66D04878C0BA193B2e696173A0c0e17c527e,0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37,0x88c470b7A4Db417Ad3578B485302D0C260668393,0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D,0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF,0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571,0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2,0xFAf106837b17F8c103dd10da56935Ef0ad302dc6,0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43 --network=mainnet

> Warning: possible unsupported (undocumented in help) command line option: --validFrom,--priceRange,--targetToken,--stableToken,--targetPrice,--masterSafe,--slaves
Using network 'mainnet'.

Preparing order transaction data
Batch Exchange 0x6F400810b62df8E13fded51bE75fF5393eaa841F
Lowest-Highest Limit 191.1-354.90000000000003
Constructing bracket trading strategy order data based on valuation 273 SNX per WETH
Safe 0 - 0xca7b512316340b8d052c6b5aecf84338f3abbfb0:
  Buy  WETH with SNX at 191.1
  Sell WETH for  SNX at 199.29
Safe 1 - 0x1039EDd1d100185Eaf45141C99227D1B994CE11F:
  Buy  WETH with SNX at 199.29
  Sell WETH for  SNX at 207.48
Safe 2 - 0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025:
  Buy  WETH with SNX at 207.48
  Sell WETH for  SNX at 215.67
Safe 3 - 0xd2CF6bc70C93058F6545dF809df79f76f798aac0:
  Buy  WETH with SNX at 215.67
  Sell WETH for  SNX at 223.86
Safe 4 - 0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44:
  Buy  WETH with SNX at 223.86
  Sell WETH for  SNX at 232.05
Safe 5 - 0x906B5c2877dEad3c5565b042094d182b7575ADdE:
  Buy  WETH with SNX at 232.05
  Sell WETH for  SNX at 240.24
Safe 6 - 0x4A77F409187E0f5084A391faC25c3F3497db73FB:
  Buy  WETH with SNX at 240.24
  Sell WETH for  SNX at 248.43
Safe 7 - 0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e:
  Buy  WETH with SNX at 248.43
  Sell WETH for  SNX at 256.62
Safe 8 - 0x36731EC6C6c10d99f09580820b8D30607A383288:
  Buy  WETH with SNX at 256.62
  Sell WETH for  SNX at 264.81
Safe 9 - 0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6:
  Buy  WETH with SNX at 264.81
  Sell WETH for  SNX at 273
Safe 10 - 0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E:
  Buy  WETH with SNX at 273
  Sell WETH for  SNX at 281.19
Safe 11 - 0x519C66D04878C0BA193B2e696173A0c0e17c527e:
  Buy  WETH with SNX at 281.19
  Sell WETH for  SNX at 289.38
Safe 12 - 0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37:
  Buy  WETH with SNX at 289.38
  Sell WETH for  SNX at 297.57
Safe 13 - 0x88c470b7A4Db417Ad3578B485302D0C260668393:
  Buy  WETH with SNX at 297.57
  Sell WETH for  SNX at 305.76
Safe 14 - 0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D:
  Buy  WETH with SNX at 305.76
  Sell WETH for  SNX at 313.95000000000005
Safe 15 - 0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF:
  Buy  WETH with SNX at 313.95000000000005
  Sell WETH for  SNX at 322.14
Safe 16 - 0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571:
  Buy  WETH with SNX at 322.14
  Sell WETH for  SNX at 330.33000000000004
Safe 17 - 0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2:
  Buy  WETH with SNX at 330.33000000000004
  Sell WETH for  SNX at 338.52
Safe 18 - 0xFAf106837b17F8c103dd10da56935Ef0ad302dc6:
  Buy  WETH with SNX at 338.52
  Sell WETH for  SNX at 346.71000000000004
Safe 19 - 0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43:
  Buy  WETH with SNX at 346.71000000000004
  Sell WETH for  SNX at 354.9
Transaction bundle size 20
Are you sure you want to send this transaction to the EVM? [yN] y
Aquiring Transaction Hash
Signing and posting multi-send transaction request from proposer account 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
Transaction awaiting execution in the interface https://gnosis-safe.io/safes/0x583788f490a278DB2a8d6D7226264b4985f75678/transactions

Sent message to Martin to sign the transaction.

Start building deposits.
Final result is in 2020-02-21_deposits-WETH-SNX.json .
Copy file 2020-02-20_deposits.json. Check that the first 10 amounts are for 10*10*18, the second 10 for 0.1*10*18. Remove all userAddresses.
Check that the last 10 orders have WETH address (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2).
Replace DAI address (0x6b175474e89094c44da98b954eedeac495271d0f) with SNX (0xc011a72400e58ecd99ee497cf89e3775d4bd732f). 10 replacements done.
Start putting in slave safes. Target price is 237.
Take Safe 0 to Safe 9 from previous command output. They would be selling WETH very cheaply, hence they must sell SNX, that is HOLD SNX.
They are:
0xca7b512316340b8d052c6b5aecf84338f3abbfb0
0x1039EDd1d100185Eaf45141C99227D1B994CE11F
0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025
0xd2CF6bc70C93058F6545dF809df79f76f798aac0
0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44
0x906B5c2877dEad3c5565b042094d182b7575ADdE
0x4A77F409187E0f5084A391faC25c3F3497db73FB
0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e
0x36731EC6C6c10d99f09580820b8D30607A383288
0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6
Put each line into the first 10 deposit entry (they hold 10**9 SNX).
Visually check they are unique. Check that last introduced entry has amount=10**19, next has 10**17.
Take Safes from 10 to 19 and do the same, checking after that the halves are distinct:
0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E
0x519C66D04878C0BA193B2e696173A0c0e17c527e
0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37
0x88c470b7A4Db417Ad3578B485302D0C260668393
0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D
0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF
0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571
0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2
0xFAf106837b17F8c103dd10da56935Ef0ad302dc6
0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43
Again copypaste one by one and test for unicity.

Copy this file to scripts/data/ and rename it to deposits.json, check that it contains SNX address (0xc011a72400e58ecd99ee497cf89e3775d4bd732f)
Copy deposit line from yesterday.

Prepare to run following line:

$ npx truffle exec scripts/transfer_approve_deposit.js --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --depositFile="./data/deposits.json" --network=mainnet

Martin did not sign previous transaction order in time. However, I was wrong in believing that "date" uses UTC, and the website https://www.timestampconvert.com gave the wrong output for the Berlin timezone. Note to self: do not use this website ever again!

Redo because of an out-of gas issue:

$ npx truffle exec scripts/bracket_orders.js --validFrom=5274312 --priceRange=30 --targetToken=1 --stableToken=15 --targetPrice=273 --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --slaves=0xca7b512316340b8d052c6b5aecf84338f3abbfb0,0x1039EDd1d100185Eaf45141C99227D1B994CE11F,0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025,0xd2CF6bc70C93058F6545dF809df79f76f798aac0,0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44,0x906B5c2877dEad3c5565b042094d182b7575ADdE,0x4A77F409187E0f5084A391faC25c3F3497db73FB,0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e,0x36731EC6C6c10d99f09580820b8D30607A383288,0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6,0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E,0x519C66D04878C0BA193B2e696173A0c0e17c527e,0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37,0x88c470b7A4Db417Ad3578B485302D0C260668393,0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D,0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF,0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571,0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2,0xFAf106837b17F8c103dd10da56935Ef0ad302dc6,0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43 --network=mainnet

Target total amount of funds:
- 2 WETH
- 500SNX
evenly distributed.

Remove file scripts/data/deposits.json .
Edit file 2020-02-21_deposits-WETH-SNX.json .

2 WETH / 10 = 0.2 WETH 
500 SNX / 10 = 50 WETH 

Search and replace:
 -     10000000000000000000
    -> 50000000000000000000
   from 10 to 50
 THEN (order is important, since the following search and replace would have also matched wrong orders.
 -     100000000000000000
    -> 200000000000000000
   from 0.1 to 0.2

Check with python that the length is right. Check that there are 10 amounts for each brackets. Check if the sell/buy price makes sense for a random safe.

Copy this file to scripts/data/ and rename it to deposits.json, check that it contains SNX address (0xc011a72400e58ecd99ee497cf89e3775d4bd732f)
Copy deposit line from yesterday.

Prepare to run following line:

$ npx truffle exec scripts/transfer_approve_deposit.js --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --depositFile="./data/deposits.json" --network=mainnet

(
[federico@localhost dex-liquidity-provision]$ npx truffle exec scripts/transfer_approve_deposit.js --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --depositFile="./data/deposits.json" --network=mainnet
> Warning: possible unsupported (undocumented in help) command line option: --masterSafe,--depositFile
Using network 'mainnet'.

Preparing transaction data...
Aquired Batch Exchange 0x6F400810b62df8E13fded51bE75fF5393eaa841F
Safe 0xca7b512316340b8d052c6b5aecf84338f3abbfb0 receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x1039EDd1d100185Eaf45141C99227D1B994CE11F receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025 receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0xd2CF6bc70C93058F6545dF809df79f76f798aac0 receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44 receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x906B5c2877dEad3c5565b042094d182b7575ADdE receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x4A77F409187E0f5084A391faC25c3F3497db73FB receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x36731EC6C6c10d99f09580820b8D30607A383288 receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6 receiving (from 0x5837...78) and depositing 50 SNX into BatchExchange
Safe 0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0x519C66D04878C0BA193B2e696173A0c0e17c527e receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37 receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0x88c470b7A4Db417Ad3578B485302D0C260668393 receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571 receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2 receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0xFAf106837b17F8c103dd10da56935Ef0ad302dc6 receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Safe 0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43 receiving (from 0x5837...78) and depositing 0.2 WETH into BatchExchange
Are you sure you want to send this transaction to the EVM? [yN] y
Aquiring Transaction Hash
Signing and posting multi-send transaction request from proposer account 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
Transaction awaiting execution in the interface https://gnosis-safe.io/safes/0x583788f490a278DB2a8d6D7226264b4985f75678/transactions
[federico@localhost dex-liquidity-provision]$ 
)

It worked!

Sum up:
 - Transactions
    - order placement (failed, not enough gas because of low gas limit)
    https://etherscan.io/tx/0x4982f4bcddc671a1b623bcb470bdff4288e03e4e5cf21c9db1225caa4141e066
    - order placement (successful)
    https://etherscan.io/tx/0x78fc87bfc99c6c0c0d1387ebdd0602b42fd66cbf40bbb5815db852b01c54c2c4
    - deposits (successful)
    https://etherscan.io/tx/0x7fe57b1dafa29b78cb8e7cd4404ecec15b292f31bc8cfc5101397b78b323cd19

Total amount spent by me = 0.000730905×21 = 0.015349005 ETH, one wallet too much was created.
This wallet (0x5AE84974FF12998Cfae93fc63f8e2DcaDbEDCC66) can be reused in the future.

----------------------------------------------------------------------------------

2020-02-21, 17:40

Task: add funding to the previously created brakets.

Same commit and changes from before.

Copy command from before.
Remove scripts/data/deposits.json
Copy file 2020-02-21_deposits-WETH-SNX.json to 2020-02-21_deposits-WETH-SNX-large.json
In the new file, replace "50000000000000000000" with "500000000000000000000" and
                           "200000000000000000" with   "2000000000000000000"
Copy file to scripts/data and rename it to deposit.json
Double check it's the right file.

Run:

$ npx truffle exec scripts/transfer_approve_deposit.js --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --depositFile="./data/deposits.json" --network=mainnet

Result:
[federico@localhost dex-liquidity-provision]$ npx truffle exec scripts/transfer_approve_deposit.js --masterSafe=0x583788f490a278DB2a8d6D7226264b4985f75678 --depositFile="./data/deposits.json" --network=mainnet
> Warning: possible unsupported (undocumented in help) command line option: --masterSafe,--depositFile
Using network 'mainnet'.

Preparing transaction data...
Aquired Batch Exchange 0x6F400810b62df8E13fded51bE75fF5393eaa841F
Safe 0xca7b512316340b8d052c6b5aecf84338f3abbfb0 receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x1039EDd1d100185Eaf45141C99227D1B994CE11F receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x00F0FBDEEa1cDEc029Ba6025ca726Fdcf43E9025 receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0xd2CF6bc70C93058F6545dF809df79f76f798aac0 receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x3a58a6E39B62Fe2FF81e06B0777BB3a476e90f44 receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x906B5c2877dEad3c5565b042094d182b7575ADdE receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x4A77F409187E0f5084A391faC25c3F3497db73FB receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x7bCe8f1485C74B5eA536C12eA5713E38fF353d2e receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x36731EC6C6c10d99f09580820b8D30607A383288 receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x19601E6825D2715CBD22B6AEC9B2528eDEe974A6 receiving (from 0x5837...78) and depositing 500 SNX into BatchExchange
Safe 0x3e6C2b2c3a842b6492F9F43349D77A40568e3d7E receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0x519C66D04878C0BA193B2e696173A0c0e17c527e receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0x95D806485731E2033A0FDb3DcFfc0E6bF9FA3b37 receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0x88c470b7A4Db417Ad3578B485302D0C260668393 receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0x7127Bf85fFF72cDDf72a28a1569fc6Ce5810bB4D receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0x0F27680805e50Fa0ab0dDAEa026ec3Da292a24DF receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0xD17e111CB0c2209Be83E6e37Ee8D8CFDD42B7571 receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0xDcBB69104d58d4393B19f990FD4c1971D6F4B1E2 receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0xFAf106837b17F8c103dd10da56935Ef0ad302dc6 receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Safe 0x5F7DdAFa0D926bFBC78A20474A8f86044D5a4c43 receiving (from 0x5837...78) and depositing 2 WETH into BatchExchange
Are you sure you want to send this transaction to the EVM? [yN] y
Aquiring Transaction Hash
Signing and posting multi-send transaction request from proposer account 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
Transaction awaiting execution in the interface https://gnosis-safe.io/safes/0x583788f490a278DB2a8d6D7226264b4985f75678/transactions

Balances before:
[federico@localhost dex-liquidity-provision]$ npx truffle exec check_balances.js --network=mainnet
Using network 'mainnet'.

Safe 1
WETH: 0
SNX:  50
Safe 2
WETH: 0
SNX:  50
Safe 3
WETH: 0
SNX:  50
Safe 4
WETH: 0
SNX:  50
Safe 5
WETH: 0
SNX:  50
Safe 6
WETH: 0
SNX:  50
Safe 7
WETH: 0
SNX:  50
Safe 8
WETH: 0
SNX:  50
Safe 9
WETH: 0
SNX:  50
Safe 10
WETH: 0
SNX:  50
Safe 11
WETH: 0.000000038365980876
SNX:  56.684579467741758723
Safe 12
WETH: 0.000000038365656616
SNX:  58.130106511198743421
Safe 13
WETH: 0.000000059923463443
SNX:  59.6684771811778557
Safe 14
WETH: 0.2
SNX:  0
Safe 15
WETH: 0.2
SNX:  0
Safe 16
WETH: 0.2
SNX:  0
Safe 17
WETH: 0.2
SNX:  0
Safe 18
WETH: 0.2
SNX:  0
Safe 19
WETH: 0.2
SNX:  0
Safe 20
WETH: 0.2
SNX:  0

Balances after:
[federico@localhost dex-liquidity-provision]$ npx truffle exec check_balances.js --network=mainnetUsing network 'mainnet'.

Safe 1
WETH: 0
SNX:  550
Safe 2
WETH: 0
SNX:  550
Safe 3
WETH: 0
SNX:  550
Safe 4
WETH: 0
SNX:  550
Safe 5
WETH: 0
SNX:  550
Safe 6
WETH: 0
SNX:  550
Safe 7
WETH: 0
SNX:  550
Safe 8
WETH: 0
SNX:  550
Safe 9
WETH: 0
SNX:  550
Safe 10
WETH: 0
SNX:  550
Safe 11
WETH: 2.000000038365980876
SNX:  56.684579467741758723
Safe 12
WETH: 2.000000038365656616
SNX:  58.130106511198743421
Safe 13
WETH: 2.000000059923463443
SNX:  59.6684771811778557
Safe 14
WETH: 2.2
SNX:  0
Safe 15
WETH: 2.2
SNX:  0
Safe 16
WETH: 2.2
SNX:  0
Safe 17
WETH: 2.2
SNX:  0
Safe 18
WETH: 2.2
SNX:  0
Safe 19
WETH: 2.2
SNX:  0
Safe 20
WETH: 2.2
SNX:  0

Successful transaction:
https://etherscan.io/tx/0xca0207eeee10c9f4210e2c475649947f6c3d485373ed48a44ad6cfb5fb33081b
bh2smith commented 4 years ago

stream lined into one js script

While I agree that there are several inconvenient aspects pointed out here (such as the safe addresses logged differently than used later. cf. #34) I'm not sure it is a good idea to have a single script for this entire process. Or at least, we should keep the possibility to run each of the scripts separately

I completely agree that the depositListfile format is bad and not very easy to use. Please refer to issue #30. On that note, I would propose that this issue be split up into isolated tasks to that we can all work together to streamline this process, rather than having one large construction site that blocks everyone else.

josojo commented 4 years ago

I'm not sure it is a good idea to have a single script for this entire process. Or at least, we should keep the possibility to run each of the scripts separately

Yes, we will definitively keep it modular, this is important. But offering others a 1-click experience with build-in sanity checks is a must for external customers.

But I also agree that this is not the highest priority, I will focus for now on smoothing the individual steps