From 946f34f480413a87cc8dcef6ba1c1eaef17768f6 Mon Sep 17 00:00:00 2001 From: Julian Traversa Date: Sun, 30 Jan 2022 17:58:25 -0500 Subject: [PATCH] mainnet update --- .gitignore | 1 + constants/__init__.py | 18 ++-- helpers/http.py | 31 ++++--- orders/orders.json | 188 ++++++++++++++++++++++----------------- swuniswap-v3-zcTokens.py | 15 ++-- swuniswap-v3.py | 29 +++--- 6 files changed, 155 insertions(+), 127 deletions(-) diff --git a/.gitignore b/.gitignore index b303801..e5b02d6 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,4 @@ dmypy.json # vim files .swo .swp +orders/orders.json diff --git a/constants/__init__.py b/constants/__init__.py index e046364..bf69383 100644 --- a/constants/__init__.py +++ b/constants/__init__.py @@ -1,15 +1,15 @@ # Market -UNDERLYING = "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa" # The underlying token address -MATURITY = float(1669957199) # The Swivel market maturity in unix -DECIMALS = float(18) # The decimals of the underlying token -NETWORK_STRING = "rinkeby" +UNDERLYING = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" # The underlying token address +MATURITY = float(1656039600) # The Swivel market maturity in unix +DECIMALS = float(6) # The decimals of the underlying token +NETWORK_STRING = "mainnet" # Position -AMOUNT = float(10000) # The amount of n/zcTokens to use market-making -UPPER_RATE = float(13) # The highest rate at which to quote -LOWER_RATE = float(9.5) # The lowest rate at which to quote +AMOUNT = float(50000) # The amount of n/zcTokens to use market-making +UPPER_RATE = float(5.5) # The highest rate at which to quote +LOWER_RATE = float(2.75) # The lowest rate at which to quote NUM_TICKS = int(3) # The number of liquidity ticks to split your amount into (Per side + 1 at market price) COMPOUND_RATE_LEAN = float(1) # How much your quote should change when Compound’s rate varies (e.g. 1 = 1:1 change in price) -EXPIRY_LENGTH = float(100) # How often orders should be refreshed (in seconds) +EXPIRY_LENGTH = float(600) # How often orders should be refreshed (in seconds) -PUBLIC_KEY = "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C" \ No newline at end of file +PUBLIC_KEY = "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5" \ No newline at end of file diff --git a/helpers/http.py b/helpers/http.py index f93573b..b181bbf 100644 --- a/helpers/http.py +++ b/helpers/http.py @@ -3,7 +3,7 @@ # the current api-dev exposed for swivel api with a format placeholder swivel_api_route = 'https://api-dev.swivel.exchange/v2/{}' -kovan_api_route = 'https://api-main.swivel.exchange/v2/{}' +mainnet_api_route = 'https://api-main.swivel.exchange/v2/{}' # update as needed... param_keys = ('underlying', 'maturity', 'depth', 'status') @@ -54,9 +54,8 @@ def invalidate_order(u, m, n): params = new_params(underlying=u, maturity=m) resp = requests.delete(route, params=params, auth=('<____>','<____>')) return resp.status_code, resp.reason - if n == 42: - - route = kovan_api_route.format('orders/{}') + if n == 1: + route = mainnet_api_route.format('orders/{}') params = new_params(underlying=u, maturity=m) resp = requests.delete(route, params=params) return resp.status_code, resp.reason @@ -67,9 +66,9 @@ def orderbook(u, m, d, n): params = new_params(underlying=u, maturity=m, depth=d) resp = requests.get(swivel_api_route.format('orderbook'), params=params) return resp.json() - if n == 42: + if n == 1: params = new_params(underlying=u, maturity=m, depth=d) - resp = requests.get(kovan_api_route.format('orderbook'), params=params) + resp = requests.get(mainnet_api_route.format('orderbook'), params=params) return resp.json() @@ -83,12 +82,12 @@ def markets(n, status=None): resp = requests.get(swivel_api_route.format('markets'), params=params) return resp.json() - if n == 42: + if n == 1: params = None if status != None: params = new_params(status=status) - resp = requests.get(kovan_api_route.format('markets'), params=params) + resp = requests.get(mainnet_api_route.format('markets'), params=params) return resp.json() def last_trade(u, m, n): @@ -97,9 +96,9 @@ def last_trade(u, m, n): params = new_params(underlying=u, maturity=m, depth=1) resp = requests.get(swivel_api_route.format('fills'), params=params) return resp.json()[0] - if n == 42: + if n == 1: params = new_params(underlying=u, maturity=m, depth=1) - resp = requests.get(kovan_api_route.format('fills'), params=params) + resp = requests.get(mainnet_api_route.format('fills'), params=params) return resp.json()[0] def orders(u, m, a, n, status=None): @@ -127,8 +126,8 @@ def orders(u, m, a, n, status=None): resp = requests.get(route, params) return resp.json() - if n == 42: - route = kovan_api_route.format('users/{}/orders'.format(a)) + if n == 1: + route = mainnet_api_route.format('users/{}/orders'.format(a)) params = new_params(underlying=u, maturity=m) if status !=None: @@ -143,8 +142,8 @@ def order(k, n): route = swivel_api_route.format('orders/{}'.format(k)) resp= requests.get(route) return resp.json() - if n == 42: - route = kovan_api_route.format('orders/{}'.format(k)) + if n == 1: + route = mainnet_api_route.format('orders/{}'.format(k)) resp= requests.get(route) return resp.json() @@ -157,7 +156,7 @@ def limit_order(o, s, n): if n == 4: resp = requests.post(swivel_api_route.format('orders'), json={'order': o, 'signature': s}) return resp.status_code, resp.reason - if n == 42: - resp = requests.post(kovan_api_route.format('orders'), json={'order': o, 'signature': s}) + if n == 1: + resp = requests.post(mainnet_api_route.format('orders'), json={'order': o, 'signature': s}) return resp.status_code, resp.reason diff --git a/orders/orders.json b/orders/orders.json index 60f7861..cc14631 100644 --- a/orders/orders.json +++ b/orders/orders.json @@ -1,142 +1,162 @@ [ { "order": { - "key": "0x6696c206ebdcbe0d2967e6e97a283b1f4e088d9b4f8916ca72c70382155618a3", - "maker": "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C", - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "key": "0x6d637575369809075678b4d6814fad8d01a11b00d54099c6e44702bfb351fc9f", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "vault": true, "exit": true, - "principal": "1248750000000000065536", - "premium": "128825730576725393408", - "maturity": "1669957199", - "expiry": "1642463976" + "principal": "6660000000", + "premium": "101500322", + "maturity": "1656039600", + "expiry": "1643359254" }, "meta": { - "price": "0.1031637482095899", - "signature": "0x88ee5557612a3ba758ed129afe031ed546799a29f38b8d7990c4eafd59d99197359632514882936ec9efcb47edb557e599ad8faa8f6953bc31b946b603dfea641b", - "premiumAvailable": "128825730576725393408", - "principalAvailable": "1248750000000000065536", - "sequence": 170880 + "price": "0.015240288588588589", + "signature": "0x9b861db160d0a4a5e2938bcade4022e8bc4eb81b3420b6decf2dcb0bed81b389281e03fed59aa7a89cd4e2be3b3bef4302d1b66d50354abe358c2de7c554ed921c", + "premiumAvailable": "101500322", + "principalAvailable": "6660000000", + "sequence": 30341 } }, { "order": { - "key": "0x436b55368b2d444a51e55e2923dff5567540a60be9c308823ebc0d2fc518b6ff", - "maker": "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C", - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "key": "0x05060075b65e0080685862195167797d2184ae62671449b6eea5e1a32960c3eb", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "vault": true, "exit": true, - "principal": "2497500000000000131072", - "premium": "270352589520170156032", - "maturity": "1669957199", - "expiry": "1642463976" + "principal": "13319950850", + "premium": "223300238", + "maturity": "1656039600", + "expiry": "1643359254" }, "meta": { - "price": "0.10824928509316122", - "signature": "0x3ff3e0f7f8e6621d6875c10635be1ea1d698cc2d05b2054fa042c878c2472b7232a5403428281a4f7ee2d422f3aa7379e7e401bb404a363d29a0af5977872a6d1c", - "premiumAvailable": "270352589520170156032", - "principalAvailable": "2497500000000000131072", - "sequence": 170881 + "price": "0.016764343991554593", + "signature": "0xc54078e54bdea1d8451229eb945f6054a4b247da64e3bd983baf91e125cc7b612a9388ff99362ee1025fe78c943887f2cf922def218d34e5a23f7a9d847efbe31b", + "premiumAvailable": "223300238", + "principalAvailable": "13319950850", + "sequence": 30342 } }, { "order": { - "key": "0xd2e2890a6d7b4a8830c924577d94a953744f07f985322c3af39a29e4eccddfcc", - "maker": "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C", - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "key": "0xfe6c1fd065bb3c5620d8e1ab5940f5131199756dc10a8d606ddbe57947d3b7a1", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "vault": true, "exit": true, - "principal": "4995000000000000262144", - "premium": "566107435773779181568", - "maturity": "1669957199", - "expiry": "1642463976" + "principal": "26640000000", + "premium": "487202618", + "maturity": "1656039600", + "expiry": "1643359254" }, "meta": { - "price": "0.11333482197673256", - "signature": "0xb0b05acde37f31c1f5c2591be9f373485527c13af385d188da70e78a7720393b428e698a4bdb3fedc7bdc9de7bfd0fb16607ef00357138f4a563c890feeb0a9e1c", - "premiumAvailable": "566107435773779181568", - "principalAvailable": "4995000000000000262144", - "sequence": 170882 + "price": "0.01828838656156156", + "signature": "0x7156a401383f614481b9b99d2a5de511c3375f8b60c8c013665e8540669f50d85d77407b1602743eb998d57899f6e92b7db5ca5bb9d7d13c8809da1dc281a7ad1c", + "premiumAvailable": "487202618", + "principalAvailable": "26640000000", + "sequence": 30343 } }, { "order": { - "key": "0x5d4bcc0f62469635bb8d1f76b9609025379c2a83b4087a47918fb1ee8351089d", - "maker": "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C", - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "key": "0x6bdb9058b9670510a54e80aa33c8f1d47ae0a7f9a1624d571914deada5984e03", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "vault": true, + "exit": true, + "principal": "1575116240", + "premium": "19204140", + "maturity": "1656039600", + "expiry": "1643359254" + }, + "meta": { + "price": "0.01219220493847489", + "signature": "0x7be539df695307f7e02d8ce46b70e6f5d3d3c19c55b33e5c871ebc42ba27b0fa7880a3a48dfcc27340a59123caf108f6fd2324d85ae6c121e578d5935e67b76b1b", + "premiumAvailable": "19204140", + "principalAvailable": "1575116240", + "sequence": 30344 + } + }, + { + "order": { + "key": "0xe6b5a96d9d33192db74ebad08e2000987b2fc11d0fe896bb0675303b6a629f10", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "vault": true, "exit": false, - "principal": "1248750000000000065536", - "premium": "116124602210005958656", - "maturity": "1669957199", - "expiry": "1642463976" + "principal": "5084883760", + "premium": "61996015", + "maturity": "1656039600", + "expiry": "1643359254" }, "meta": { - "price": "0.09299267444244722", - "signature": "0x72071a4834bc5d2231a0a812a20b9b12381bafbb6cbfbd798102336adf3cd6052032700bd3819030490d28c293ec17c2e4bb95e90eb6cb00247f16b17f46279d1b", - "premiumAvailable": "116124602210005958656", - "principalAvailable": "1248750000000000065536", - "sequence": 170883 + "price": "0.01219221872635295", + "signature": "0x55fd895caa4797f12bdeb430138d38d3d43abe0f0c0a9948b35d553b5709bcf3079b1df94405b86e77d1712839de089fddbc6c2796bec64f7a2b413d66fe8c8c1b", + "premiumAvailable": "61996015", + "principalAvailable": "5084883760", + "sequence": 30345 } }, { "order": { - "key": "0x6255198eccb64ee9cb25afee6c49fb585bee9661f20f091c3b6be01b00a7b65a", - "maker": "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C", - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "key": "0x7fb6805cc7aaefa6c7ce033257e99d19130661939f2cbdf669189e591f8d63fa", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "vault": true, "exit": false, - "principal": "2497500000000000131072", - "premium": "219548076053292548096", - "maturity": "1669957199", - "expiry": "1642463976" + "principal": "13320000000", + "premium": "142100592", + "maturity": "1656039600", + "expiry": "1643359254" }, "meta": { - "price": "0.08790713755887589", - "signature": "0xbcb5ab68384e8a3e839b62f70b2850c71bb9b11e0208b2515ebc700b45ff186c4b3c4ce384c1efb3993c32651dc42d7888ffea3a091c614ba1bb05ad82276ea01c", - "premiumAvailable": "219548076053292548096", - "principalAvailable": "2497500000000000131072", - "sequence": 170884 + "price": "0.010668212612612613", + "signature": "0x4b34b7d8b92cf9c1928086e5d1e0a432a68b2d0832fd35132499fda3f64804652e480d9668e235f9e8f0ecfe1d41da0a8fe9b1d03c9559e489a2fef73dbb7c661b", + "premiumAvailable": "142100592", + "principalAvailable": "13320000000", + "sequence": 30346 } }, { "order": { - "key": "0x0e21ac8eb7f8af8265db73077db690a615d3c985e8564dc8dcb0fa120786e54f", - "maker": "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C", - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "key": "0xd980dc6f8ccf1a71984cddd065c3ec6ff617ba089272833e1ce1b1bd7a2aa697", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "vault": true, "exit": false, - "principal": "4995000000000000262144", - "premium": "413693895373146292224", - "maturity": "1669957199", - "expiry": "1642463976" + "principal": "26640000000", + "premium": "243601199", + "maturity": "1656039600", + "expiry": "1643359254" }, "meta": { - "price": "0.08282160067530456", - "signature": "0x4af7244c7353088a9981fb4e054f84ad54213ce3c79f344c0e08a4bd778fc4534612995ff3a740ec03dbd7bb30cde193c103ba2878c07a2b3f3e81afbd877e0e1b", - "premiumAvailable": "413693895373146292224", - "principalAvailable": "4995000000000000262144", - "sequence": 170885 + "price": "0.009144189151651652", + "signature": "0x668a9ca4acf758e170ad852932b18b0f9712f0ac57656dcc60023d3b0569e3161e09d2b4444349ff08df069462c0afdb46826cb524caabd1cc052627568e75f21c", + "premiumAvailable": "243601199", + "principalAvailable": "26640000000", + "sequence": 30347 } }, { "order": { - "key": "0x68a2fbeae78ef187a2bf450faddedbb697ac41c6a0eeabbd74af273dcc4ba36f", - "maker": "0x3f60008Dfd0EfC03F476D9B489D6C5B13B3eBF2C", - "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", + "key": "0x67a9b2a2c73dd2f2ed4f77ba83d29cc2a4feea616b5374a554f549a57880d7f7", + "maker": "0xb42Af00422f53e09FC97C3Af041Ddd0B19E936A5", + "underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "vault": true, "exit": true, - "principal": "624375000000000032768", - "premium": "61232456250000007168", - "maturity": "1669957199", - "expiry": "1642463976" + "principal": "3330000000", + "premium": "45666183", + "maturity": "1656039600", + "expiry": "1643359254" }, "meta": { - "price": "0.09807", - "signature": "0x6a790549eaf0d19c5f7c64af023cc4d7ec0ea4e5335b74483c475a712df797ef2c7ae1b897b40b82c851f9d078a64503cb23ddaf74d2a5086a25506dc155fbbe1c", - "premiumAvailable": "61232456250000007168", - "principalAvailable": "624375000000000032768", - "sequence": 170886 + "price": "0.013713568468468468", + "signature": "0x673a6c2904ea2067c5eb4cad2ce5b9edd8c07711d4ae69f42699b86689ba8645762939e6621d13ed95fd1f5169da9db71d4c499bae4fc3ef31d72122b18fdebd1c", + "premiumAvailable": "45666183", + "principalAvailable": "3330000000", + "sequence": 30348 } } ] \ No newline at end of file diff --git a/swuniswap-v3-zcTokens.py b/swuniswap-v3-zcTokens.py index 01391ae..194f923 100644 --- a/swuniswap-v3-zcTokens.py +++ b/swuniswap-v3-zcTokens.py @@ -594,9 +594,6 @@ def rangeMultiTickMarketMake(underlying, maturity, upperRate, lowerRate, amount, elif NETWORK_STRING == "rinkeby": network = 4 swivelAddress = "0x4ccD4C002216f08218EdE1B13621faa80CecfC98" -elif NETWORK_STRING == "kovan": - network = 42 - swivelAddress = "0x301292f76885b5a20c7dbd0e06F093E9D4e5fA3F" else: print("Invalid network") exit(1) @@ -619,7 +616,7 @@ def rangeMultiTickMarketMake(underlying, maturity, upperRate, lowerRate, amount, if recoverString == 'N': if initializor == 0: (orders) = initialPositionCreation(UNDERLYING, MATURITY, UPPER_RATE, LOWER_RATE, AMOUNT, EXPIRY_LENGTH) - + compoundRate = underlying_compound_rate(UNDERLYING) else: (queuedOrders, queuedOrderSignatures, timeDiff, newExpiry) = adjustAndQueue(UNDERLYING, MATURITY, EXPIRY_LENGTH, orders) @@ -627,17 +624,21 @@ def rangeMultiTickMarketMake(underlying, maturity, upperRate, lowerRate, amount, with open("orders/orders.json", "w", encoding="utf-8") as writeJsonfile: json.dump(orders, writeJsonfile, indent=4,default=str) - + with open("orders/compound.json", "w", encoding="utf-8") as writeJsonfile: + json.dump(compoundRate, writeJsonfile, indent=4,default=str) else: - try: + try: orders = json.load(open('orders/orders.json')) + compoundRate = json.load(open('orders/compound.json')) (queuedOrders, queuedOrderSignatures, timeDiff, newExpiry) = adjustAndQueue(UNDERLYING, MATURITY, EXPIRY_LENGTH, orders) orders = combineAndPlace(queuedOrders,queuedOrderSignatures, timeDiff, newExpiry) + with open("orders/orders.json", "w", encoding="utf-8") as writeJsonfile: json.dump(orders, writeJsonfile, indent=4,default=str) - + with open("orders/compound.json", "w", encoding="utf-8") as writeJsonfile: + json.dump(compoundRate, writeJsonfile, indent=4,default=str) except: print('No orders to recover...') input('Press enter to exit...') diff --git a/swuniswap-v3.py b/swuniswap-v3.py index b8f88bd..26e1b0c 100644 --- a/swuniswap-v3.py +++ b/swuniswap-v3.py @@ -70,7 +70,14 @@ def initialPositionCreation(underlying, maturity, upperRate, lowerRate, amount, price = float(price) # use safe allocation of allocated capital safeAmount = amount * .999 * 10**int(DECIMALS) - midTickAmount = safeAmount / (2 ** (NUM_TICKS+2)) + + # Sum martingale weight of all orders + sum = 0 + for i in range (0, NUM_TICKS+1): + weight = 2**i + sum = sum + weight + + midTickAmount = (safeAmount / (sum)) # annualize price to get rate timeDiff = maturity - time.time() @@ -121,7 +128,7 @@ def initialPositionCreation(underlying, maturity, upperRate, lowerRate, amount, exponent = NUM_TICKS-i # determine order size (martingale weighted) - tickAmount = safeAmount / (2 ** (exponent+1)) + tickAmount = midTickAmount * 2**i # set specific order sizes principal = tickAmount @@ -173,7 +180,7 @@ def initialPositionCreation(underlying, maturity, upperRate, lowerRate, amount, exponent = NUM_TICKS-i - tickAmount = safeAmount / (2 ** (exponent+1)) + tickAmount = midTickAmount * 2**i principal = tickAmount premium = tickAmount * tickPrice @@ -217,7 +224,6 @@ def initialPositionCreation(underlying, maturity, upperRate, lowerRate, amount, print(f'Order Response: {orderResponse}\n') # Place the middle tick's order - midTickAmount = midTickAmount * 2 principal = midTickAmount premium = principal * midPrice @@ -594,9 +600,6 @@ def rangeMultiTickMarketMake(underlying, maturity, upperRate, lowerRate, amount, elif NETWORK_STRING == "rinkeby": network = 4 swivelAddress = "0x4ccD4C002216f08218EdE1B13621faa80CecfC98" -elif NETWORK_STRING == "kovan": - network = 42 - swivelAddress = "0x301292f76885b5a20c7dbd0e06F093E9D4e5fA3F" else: print("Invalid network") exit(1) @@ -619,7 +622,7 @@ def rangeMultiTickMarketMake(underlying, maturity, upperRate, lowerRate, amount, if recoverString == 'N': if initializor == 0: (orders) = initialPositionCreation(UNDERLYING, MATURITY, UPPER_RATE, LOWER_RATE, AMOUNT, EXPIRY_LENGTH) - + compoundRate = underlying_compound_rate(UNDERLYING) else: (queuedOrders, queuedOrderSignatures, timeDiff, newExpiry) = adjustAndQueue(UNDERLYING, MATURITY, EXPIRY_LENGTH, orders) @@ -627,17 +630,21 @@ def rangeMultiTickMarketMake(underlying, maturity, upperRate, lowerRate, amount, with open("orders/orders.json", "w", encoding="utf-8") as writeJsonfile: json.dump(orders, writeJsonfile, indent=4,default=str) - + with open("orders/compound.json", "w", encoding="utf-8") as writeJsonfile: + json.dump(compoundRate, writeJsonfile, indent=4,default=str) else: - try: + try: orders = json.load(open('orders/orders.json')) + compoundRate = json.load(open('orders/compound.json')) (queuedOrders, queuedOrderSignatures, timeDiff, newExpiry) = adjustAndQueue(UNDERLYING, MATURITY, EXPIRY_LENGTH, orders) orders = combineAndPlace(queuedOrders,queuedOrderSignatures, timeDiff, newExpiry) + with open("orders/orders.json", "w", encoding="utf-8") as writeJsonfile: json.dump(orders, writeJsonfile, indent=4,default=str) - + with open("orders/compound.json", "w", encoding="utf-8") as writeJsonfile: + json.dump(compoundRate, writeJsonfile, indent=4,default=str) except: print('No orders to recover...') input('Press enter to exit...')