From c0f42d2d761b2f9abce2241f5db50bd6ce9f4880 Mon Sep 17 00:00:00 2001 From: Eddine Omar Date: Sat, 13 Feb 2021 20:17:59 +0100 Subject: [PATCH 1/6] create folder examples/python and a oracle_arb_finder project --- .../python/oracle_arb_finder/.env-example | 1 + examples/python/oracle_arb_finder/.gitignore | 148 ++++++++++++++++++ examples/python/oracle_arb_finder/README.md | 35 +++++ examples/python/oracle_arb_finder/app.py | 14 ++ .../python/oracle_arb_finder/core/__init__.py | 0 .../oracle_arb_finder/core/functions.py | 42 +++++ .../python/oracle_arb_finder/core/orfeed.py | 25 +++ .../python/oracle_arb_finder/core/registry.py | 17 ++ .../oracle_arb_finder/core/smartcontracts.py | 22 +++ .../oracle_arb_finder/core/token_infos.py | 79 ++++++++++ .../python/oracle_arb_finder/requirements.txt | 2 + examples/python/oracle_arb_finder/server.py | 12 ++ 12 files changed, 397 insertions(+) create mode 100644 examples/python/oracle_arb_finder/.env-example create mode 100644 examples/python/oracle_arb_finder/.gitignore create mode 100644 examples/python/oracle_arb_finder/README.md create mode 100644 examples/python/oracle_arb_finder/app.py create mode 100644 examples/python/oracle_arb_finder/core/__init__.py create mode 100644 examples/python/oracle_arb_finder/core/functions.py create mode 100644 examples/python/oracle_arb_finder/core/orfeed.py create mode 100644 examples/python/oracle_arb_finder/core/registry.py create mode 100644 examples/python/oracle_arb_finder/core/smartcontracts.py create mode 100644 examples/python/oracle_arb_finder/core/token_infos.py create mode 100644 examples/python/oracle_arb_finder/requirements.txt create mode 100644 examples/python/oracle_arb_finder/server.py diff --git a/examples/python/oracle_arb_finder/.env-example b/examples/python/oracle_arb_finder/.env-example new file mode 100644 index 0000000..ba4acce --- /dev/null +++ b/examples/python/oracle_arb_finder/.env-example @@ -0,0 +1 @@ +BLOCKCHAIN_PROVIDER= \ No newline at end of file diff --git a/examples/python/oracle_arb_finder/.gitignore b/examples/python/oracle_arb_finder/.gitignore new file mode 100644 index 0000000..c888ee2 --- /dev/null +++ b/examples/python/oracle_arb_finder/.gitignore @@ -0,0 +1,148 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +.vscode/ +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ diff --git a/examples/python/oracle_arb_finder/README.md b/examples/python/oracle_arb_finder/README.md new file mode 100644 index 0000000..881582d --- /dev/null +++ b/examples/python/oracle_arb_finder/README.md @@ -0,0 +1,35 @@ +# Oracle OrFeed + +Oracle OrFeed is a Python program which retrieves the prices of the tokens provided by the oracle OrFeed, and try to find arb opportunities. + +## Environnement +You have to rename `.env-example` to `.env`. Then insert your BLOCKCHAIN_PROVIDER in `.env` file. This can be +NB : Leave the variable network as is. +``` +BLOCKCHAIN_PROVIDER= +NETWORK=mainnet +``` + +## Installation + +Create a virtual environment and nstall the package listed in requirements.txt + +```bash +python3 -m venv venv +source venv/bin/activate +pip3 install -r requirements.txt +``` + +## Usage + +```python +python3 app.py +``` + +## Contributing +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. + +Please make sure to update tests as appropriate. + +## License +[MIT](https://choosealicense.com/licenses/mit/) \ No newline at end of file diff --git a/examples/python/oracle_arb_finder/app.py b/examples/python/oracle_arb_finder/app.py new file mode 100644 index 0000000..588f9c2 --- /dev/null +++ b/examples/python/oracle_arb_finder/app.py @@ -0,0 +1,14 @@ +from lib.get_price import get_raw_price_async, get_clean_price, compute_arb_opportunities, get_output +from pprint import pprint + +def get_list_arb(): + dict_price_raw = get_raw_price_async() + dict_clean_price = get_clean_price(dict_price_raw) + list_arb_price = compute_arb_opportunities(dict_clean_price) + res = get_output(list_arb_price) + sorted_list_arb = sorted(res.items(), key = lambda i: i[1]['%']) + pprint(sorted_list_arb) + return sorted_list_arb + +if __name__ == "__main__": + get_list_arb() diff --git a/examples/python/oracle_arb_finder/core/__init__.py b/examples/python/oracle_arb_finder/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/python/oracle_arb_finder/core/functions.py b/examples/python/oracle_arb_finder/core/functions.py new file mode 100644 index 0000000..3dfd392 --- /dev/null +++ b/examples/python/oracle_arb_finder/core/functions.py @@ -0,0 +1,42 @@ +import os +import time +import pprint +from core.token_infos import init_dict_token_dex +from core.orfeed import Orfeed +from dotenv import load_dotenv +load_dotenv() +import web3 +from web3 import Web3 +from tqdm import tqdm + +def getTokenToTokenPrice(orfeed_i, tokenSrc, tokenDst, provider, amount_wei=1): + res = orfeed_i.getExchangeRate(tokenSrc, tokenDst, provider, amount_wei) + + return { + "tokenSrc" : tokenSrc, + "tokenDst" : tokenDst, + "tokenPair" : tokenSrc + '-' + tokenDst, + "provider" : provider, + "price" : res + } + +def simple_getTokenToTokenPrice(orfeed_i, src_token, src_token_infos, dst_token, dst_token_infos): + result = {} + providers_list = ["UNISWAPBYSYMBOLV2", "KYBERBYSYMBOLV1"] + tmp_res = {} + for provider in providers_list: + buy = getTokenToTokenPrice(orfeed_i, src_token, dst_token, provider, amount_wei=10**src_token_infos['decimals']) + sell = getTokenToTokenPrice(orfeed_i, dst_token, src_token, provider, amount_wei=buy["price"]) + tmp_res[provider] = { + "buy_price_wei": buy["price"]/(10**dst_token_infos['decimals']), + "sell_price_wei": sell["price"]*buy["price"]/(10**(dst_token_infos['decimals'] + src_token_infos['decimals'])) + } + if buy["price"] > 0 and sell["price"] > 0: + tmp_res[provider] = { + "buy_price_wei": buy["price"]/(10**dst_token_infos['decimals']), + "sell_price_wei": sell["price"]*buy["price"]/(10**(dst_token_infos['decimals'] + src_token_infos['decimals'])) + } + else: + return None + result[provider] = tmp_res[provider] + return result diff --git a/examples/python/oracle_arb_finder/core/orfeed.py b/examples/python/oracle_arb_finder/core/orfeed.py new file mode 100644 index 0000000..521f49c --- /dev/null +++ b/examples/python/oracle_arb_finder/core/orfeed.py @@ -0,0 +1,25 @@ +from web3 import Web3 +from core.smartcontracts import my_smartcontracts + +class Orfeed: + def __init__(self, web3): + self.orfeed_address = Web3.toChecksumAddress(my_smartcontracts["orfeed"]["address"]) + self.w3 = web3 + self.orfeed_contract = self.w3.eth.contract(address=self.orfeed_address, abi=my_smartcontracts["orfeed"]["abi"]) + + def getExchangeRate(self, _from, _to, _provider, _amount): + if _from == _to or _amount <= 0: + return -1 + try: + return self.orfeed_contract.functions.getExchangeRate(_from, _to, _provider, _amount).call() + except Exception: + return -1 + + def getTokenAddress(self, symbol): + try: + return self.orfeed_contract.functions.getTokenAddress(symbol).call() + except Exception: + return -1 + + def getTokenDecimalCount(self, address): + return self.orfeed_contract.functions.getTokenDecimalCount(address).call() diff --git a/examples/python/oracle_arb_finder/core/registry.py b/examples/python/oracle_arb_finder/core/registry.py new file mode 100644 index 0000000..2479e7f --- /dev/null +++ b/examples/python/oracle_arb_finder/core/registry.py @@ -0,0 +1,17 @@ +import web3 +from web3 import Web3 +from smartcontracts import my_smartcontracts + +class Registry: + def __init__(self, web3): + self.registry_address = Web3.toChecksumAddress(my_smartcontracts["registry"]["address"]) + self.w3 = web3 + self.registry_contract = self.w3.eth.contract(address=self.registry_address, abi=my_smartcontracts["registry"]["abi"]) + + def getAllOracles(self): + res = self.registry_contract.functions.getAllOracles().call() + return res + + def getOracleInfo(self, name_reference=None): + res = self.registry_contract.functions.getOracleInfo(name_reference).call() + return res \ No newline at end of file diff --git a/examples/python/oracle_arb_finder/core/smartcontracts.py b/examples/python/oracle_arb_finder/core/smartcontracts.py new file mode 100644 index 0000000..b353c5c --- /dev/null +++ b/examples/python/oracle_arb_finder/core/smartcontracts.py @@ -0,0 +1,22 @@ +import os +from dotenv import load_dotenv +load_dotenv() + +orfeed_contract_address_mainnet = "0x8316b082621cfedab95bf4a44a1d4b64a6ffc336" +registry_contract_address_mainnet = "0x74b5CE2330389391cC61bF2287BDC9Ac73757891" +aave_liquidity_provider = "0x3dfd23a6c5e8bbcfc9581d2e864a68feb6a076d3" + +registry_abi_mainnet = [{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"newOrSameOracleAddress","type":"address"}],"name":"editOracleAddress","outputs":[{"name":"","type":"bool"}],"payable":True,"stateMutability":"payable","type":"function"},{"constant":True,"inputs":[{"name":"selectedOracle","type":"string"},{"name":"fromParam","type":"string"},{"name":"toParam","type":"string"},{"name":"side","type":"string"},{"name":"amount","type":"uint256"}],"name":"getPriceFromOracle","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[],"name":"withdrawBalance","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"getAllOracles","outputs":[{"name":"","type":"string[]"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"newFee","type":"uint256"}],"name":"changeFee","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"requestedAddress","type":"address"},{"name":"info","type":"string"}],"name":"registerOracle","outputs":[{"name":"","type":"bool"}],"payable":True,"stateMutability":"payable","type":"function"},{"constant":True,"inputs":[{"name":"nameReference","type":"string"}],"name":"getOracleInfo","outputs":[{"name":"","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"nameReference","type":"string"}],"name":"getOracleOwner","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"info","type":"string"}],"name":"editOracleInfo","outputs":[{"name":"","type":"bool"}],"payable":True,"stateMutability":"payable","type":"function"},{"constant":False,"inputs":[{"name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"nameReference","type":"string"}],"name":"getOracleAddress","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"toAddress","type":"address"}],"name":"transferOracleName","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":True,"stateMutability":"payable","type":"constructor"}] + +orfeed_abi_mainnet = [{ "constant": False, "inputs": [{ "name": "symb", "type": "string" }, { "name": "tokenAddress", "type": "address" }, { "name": "byteCode", "type": "bytes32" }], "name": "addFreeCurrency", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "fromSymbol", "type": "string" }, { "name": "toSymbol", "type": "string" }, { "name": "venue", "type": "string" }, { "name": "amount", "type": "uint256" }, { "name": "referenceId", "type": "string" }], "name": "requestAsyncExchangeRateResult", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": True, "inputs": [{ "name": "eventName", "type": "string" }, { "name": "source", "type": "string" }, { "name": "referenceId", "type": "string" }], "name": "getAsyncEventResult", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter2", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "synth", "type": "bytes32" }, { "name": "token", "type": "address" }, { "name": "inputAmount", "type": "uint256" }], "name": "getSynthToTokenOutputAmount", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "symb", "type": "string" }, { "name": "tokenAddress", "type": "address" }], "name": "addFreeToken", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "_a", "type": "string" }, { "name": "_b", "type": "string" }], "name": "compare", "outputs": [{ "name": "", "type": "int256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateForexOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "_a", "type": "string" }, { "name": "_b", "type": "string" }], "name": "equal", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "eventName", "type": "string" }, { "name": "source", "type": "string" }], "name": "getEventResult", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateSynthAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter1", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter3", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "fromSymbol", "type": "string" }, { "name": "toSymbol", "type": "string" }, { "name": "venue", "type": "string" }, { "name": "amount", "type": "uint256" }], "name": "getExchangeRate", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "symb", "type": "string" }], "name": "removeFreeToken", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateEthTokenAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "fundsReturnToAddress", "type": "address" }, { "name": "liquidityProviderContractAddress", "type": "address" }, { "name": "tokens", "type": "string[]" }, { "name": "amount", "type": "uint256" }, { "name": "exchanges", "type": "string[]" }], "name": "arb", "outputs": [{ "name": "", "type": "bool" }], "payable": True, "stateMutability": "payable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updatePremiumSubOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "_haystack", "type": "string" }, { "name": "_needle", "type": "string" }], "name": "indexOf", "outputs": [{ "name": "", "type": "int256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "symb", "type": "string" }], "name": "removeFreeCurrency", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateAsyncOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "venueToCheck", "type": "string" }], "name": "isFreeVenueCheck", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "symToCheck", "type": "string" }], "name": "isFree", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newAddress", "type": "address" }], "name": "updateArbContractAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOwner", "type": "address" }], "name": "changeOwner", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateAsyncEventsAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "tokenAddress", "type": "address" }], "name": "getTokenDecimalCount", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": True, "inputs": [{ "name": "a", "type": "string" }, { "name": "b", "type": "string" }], "name": "compareStrings", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "eventName", "type": "string" }, { "name": "source", "type": "string" }], "name": "requestAsyncEvent", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "symbol", "type": "string" }], "name": "getTokenAddress", "outputs": [{ "name": "", "type": "address" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "token", "type": "address" }, { "name": "synth", "type": "bytes32" }, { "name": "inputAmount", "type": "uint256" }], "name": "getTokenToSynthOutputAmount", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "source", "type": "string" }], "name": "stringToBytes32", "outputs": [{ "name": "result", "type": "bytes32" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "fromSymbol", "type": "string" }, { "name": "toSymbol", "type": "string" }, { "name": "venue", "type": "string" }, { "name": "amount", "type": "uint256" }], "name": "requestAsyncExchangeRate", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateTokenOracleAddress2", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateSyncEventsAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "symbol", "type": "string" }], "name": "getSynthBytes32", "outputs": [{ "name": "", "type": "bytes32" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "fromSymb", "type": "string" }, { "name": "toSymb", "type": "string" }, { "name": "amount", "type": "uint256" }], "name": "getFreeExchangeRate", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateTokenOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter4", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "symbol", "type": "string" }], "name": "getForexAddress", "outputs": [{ "name": "", "type": "address" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "param1", "type": "string" }, { "name": "param2", "type": "string" }, { "name": "param3", "type": "string" }, { "name": "param4", "type": "string" }], "name": "callExtraFunction", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": True, "stateMutability": "payable", "type": "constructor" }, { "payable": True, "stateMutability": "payable", "type": "fallback" }] + +my_smartcontracts = {} +if os.getenv("NETWORK") == "mainnet": + my_smartcontracts["orfeed"] = { + "address" : orfeed_contract_address_mainnet, + "abi" : orfeed_abi_mainnet + } + my_smartcontracts["registry"] = { + "address" : registry_contract_address_mainnet, + "abi" : registry_abi_mainnet + } diff --git a/examples/python/oracle_arb_finder/core/token_infos.py b/examples/python/oracle_arb_finder/core/token_infos.py new file mode 100644 index 0000000..217c532 --- /dev/null +++ b/examples/python/oracle_arb_finder/core/token_infos.py @@ -0,0 +1,79 @@ +token_symbols = { + "DAI": { + 'address' : 0x6b175474e89094c44da98b954eedeac495271d0f, + 'decimals' : 18 + }, + "USDC": { + 'address' : 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, + 'decimals' : 6 + }, + "MKR" : { + 'address' : 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2, + 'decimals' : 18 + }, + "LINK" : { + 'address' : 0x514910771af9ca656af840dff83e8264ecf986ca, + 'decimals' : 18 + }, + "BAT" : { + 'address' : 0x0d8775f648430679a709e98d2b0cb6250d2887ef, + 'decimals' : 18 + }, + "WBTC" : { + 'address' : 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599, + 'decimals' : 8 + }, + "USDT" : { + 'address' : 0xdac17f958d2ee523a2206206994597c13d831ec7, + 'decimals' : 6 + }, + "OMG" : { + 'address' : 0xd26114cd6EE289AccF82350c8d8487fedB8A0C07, + 'decimals' : 18 + }, + "ZRX" : { + 'address' : 0xe41d2489571d322189246dafa5ebde1f4699f498, + 'decimals' : 18 + }, + "TUSD" : { + 'decimals': 18 + }, + "LEND" : { + 'address' : 0x80fB784B7eD66730e8b1DBd9820aFD29931aab03, + 'decimals' : 18 + }, + "REP" : { + 'address' : 0x221657776846890989a759ba2973e427dff5c9bb, + 'decimals' : 18 + }, + "BNT" : { + 'address' : 0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c, + 'decimals' : 18 + }, + "PAX" : { + 'address' : 0x8e870d67f660d95d5be530380d0ec0bd388289e1, + 'decimals' : 18 + }, + "SUSD" : { + 'address' : 0x57ab1ec28d129707052df4df418d58a2d46d5f51, + 'decimals' : 18 + }, + "KNC" : { + 'address' : 0xdd974d5c2e2928dea5f71b9825b8b646686bd200, + 'decimals' : 18 + }, + "ETH" : { + # 'address' : 0xdd974d5c2e2928dea5f71b9825b8b646686bd200, + 'decimals' : 18 + } + } + +orfeed_list_providers = ["UNISWAPBYSYMBOLV1", "UNISWAPBYSYMBOLV2", "KYBERBYSYMBOLV1"] + +def init_dict_token_dex(): + token_dex = {} + for token in token_symbols: + token_dex[token] = {} + for provider in orfeed_list_providers: + token_dex[token][provider] = 0 + return token_dex diff --git a/examples/python/oracle_arb_finder/requirements.txt b/examples/python/oracle_arb_finder/requirements.txt new file mode 100644 index 0000000..534c302 --- /dev/null +++ b/examples/python/oracle_arb_finder/requirements.txt @@ -0,0 +1,2 @@ +web3==5.13.1 +python-dotenv==0.15.0 diff --git a/examples/python/oracle_arb_finder/server.py b/examples/python/oracle_arb_finder/server.py new file mode 100644 index 0000000..6445b5a --- /dev/null +++ b/examples/python/oracle_arb_finder/server.py @@ -0,0 +1,12 @@ +from flask import Flask +from app import get_list_arb + +app = Flask(__name__) + +@app.route('/arb') +def arb(): + return {"result": get_list_arb()}, 200 + + +if __name__=='__main__': + app.run(debug=True) From 29e7fe603417b89a0fee41f81d19893b71bb61bc Mon Sep 17 00:00:00 2001 From: Eddine Omar Date: Sat, 13 Feb 2021 20:19:20 +0100 Subject: [PATCH 2/6] move nodeJS example to folder ./examples/nodeJS --- .../nodeJS}/OrFeedBinaryOption/LICENSE | 0 .../OrFeedBinaryOption/contracts/BinaryOption.sol | 0 .../OrFeedBinaryOption/contracts/Migrations.sol | 0 .../OrFeedBinaryOption/contracts/TestContract.sol | 0 .../migrations/1_initial_migration.js | 0 .../migrations/2_TestMigration.js | 0 .../nodeJS}/OrFeedBinaryOption/package.json | 0 .../nodeJS}/OrFeedBinaryOption/test/TestContract.js | 0 .../nodeJS}/OrFeedBinaryOption/truffle.js | 0 .../nodeJS}/TokenSetRebalancerExample/Procfile | 0 .../nodeJS}/TokenSetRebalancerExample/README.md | 0 .../nodeJS}/TokenSetRebalancerExample/app.json | 0 .../nodeJS}/TokenSetRebalancerExample/index.js | 0 .../TokenSetRebalancerExample/package-lock.json | 0 .../nodeJS}/TokenSetRebalancerExample/package.json | 0 .../TokenSetRebalancerExample/public/lang-logo.png | Bin .../TokenSetRebalancerExample/public/node.svg | 0 .../public/stylesheets/main.css | 0 .../nodeJS}/TokenSetRebalancerExample/test.js | 0 .../TokenSetRebalancerExample/views/pages/db.ejs | 0 .../TokenSetRebalancerExample/views/pages/index.ejs | 0 .../views/partials/header.ejs | 0 .../views/partials/nav.ejs | 0 .../nodeJS}/YieldFarmingEntryAndExit/Procfile | 0 .../nodeJS}/YieldFarmingEntryAndExit/README.md | 0 .../nodeJS}/YieldFarmingEntryAndExit/app.json | 0 .../nodeJS}/YieldFarmingEntryAndExit/index.js | 0 .../YieldFarmingEntryAndExit/package-lock.json | 0 .../nodeJS}/YieldFarmingEntryAndExit/package.json | 0 .../YieldFarmingEntryAndExit/public/lang-logo.png | Bin .../YieldFarmingEntryAndExit/public/node.svg | 0 .../public/stylesheets/main.css | 0 .../nodeJS}/YieldFarmingEntryAndExit/test.js | 0 .../YieldFarmingEntryAndExit/views/pages/db.ejs | 0 .../YieldFarmingEntryAndExit/views/pages/index.ejs | 0 .../views/partials/header.ejs | 0 .../YieldFarmingEntryAndExit/views/partials/nav.ejs | 0 .../nodeJS}/basicArbExample /.gitignore | 0 .../nodeJS}/basicArbExample /Procfile | 0 .../nodeJS}/basicArbExample /README.md | 0 .../nodeJS}/basicArbExample /app.json | 0 .../nodeJS}/basicArbExample /index.js | 0 .../nodeJS}/basicArbExample /package.json | 0 .../nodeJS}/basicArbExample /public/lang-logo.png | Bin .../nodeJS}/basicArbExample /public/node.svg | 0 .../basicArbExample /public/stylesheets/main.css | 0 .../nodeJS}/basicArbExample /views/pages/db.ejs | 0 .../nodeJS}/basicArbExample /views/pages/index.ejs | 0 .../basicArbExample /views/partials/header.ejs | 0 .../nodeJS}/basicArbExample /views/partials/nav.ejs | 0 .../nodeJS}/basicNodeExample/.gitignore | 0 .../nodeJS}/basicNodeExample/Procfile | 0 .../nodeJS}/basicNodeExample/README.md | 0 .../nodeJS}/basicNodeExample/app.json | 0 .../nodeJS}/basicNodeExample/index.js | 0 .../nodeJS}/basicNodeExample/package.json | 0 .../nodeJS}/basicNodeExample/public/lang-logo.png | Bin .../nodeJS}/basicNodeExample/public/node.svg | 0 .../basicNodeExample/public/stylesheets/main.css | 0 .../nodeJS}/basicNodeExample/views/pages/db.ejs | 0 .../nodeJS}/basicNodeExample/views/pages/index.ejs | 0 .../basicNodeExample/views/partials/header.ejs | 0 .../nodeJS}/basicNodeExample/views/partials/nav.ejs | 0 .../nodeJS}/oracleNodeExampleApp/Procfile | 0 .../nodeJS}/oracleNodeExampleApp/README.md | 0 .../nodeJS}/oracleNodeExampleApp/app.json | 0 .../nodeJS}/oracleNodeExampleApp/index.js | 0 .../nodeJS}/oracleNodeExampleApp/package.json | 0 .../oracleNodeExampleApp/public/lang-logo.png | Bin .../nodeJS}/oracleNodeExampleApp/public/node.svg | 0 .../public/stylesheets/main.css | 0 .../nodeJS}/oracleNodeExampleApp/views/pages/db.ejs | 0 .../oracleNodeExampleApp/views/pages/index.ejs | 0 .../oracleNodeExampleApp/views/partials/header.ejs | 0 .../oracleNodeExampleApp/views/partials/nav.ejs | 0 .../nodeJS}/orfeedapi/Procfile | 0 .../nodeJS}/orfeedapi/app.json | 0 .../nodeJS}/orfeedapi/index.js | 0 .../nodeJS}/orfeedapi/package.json | 0 79 files changed, 0 insertions(+), 0 deletions(-) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/LICENSE (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/contracts/BinaryOption.sol (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/contracts/Migrations.sol (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/contracts/TestContract.sol (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/migrations/1_initial_migration.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/migrations/2_TestMigration.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/package.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/test/TestContract.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/OrFeedBinaryOption/truffle.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/Procfile (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/README.md (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/app.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/index.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/package-lock.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/package.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/public/lang-logo.png (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/public/node.svg (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/public/stylesheets/main.css (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/test.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/views/pages/db.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/views/pages/index.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/views/partials/header.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/TokenSetRebalancerExample/views/partials/nav.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/Procfile (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/README.md (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/app.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/index.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/package-lock.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/package.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/public/lang-logo.png (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/public/node.svg (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/public/stylesheets/main.css (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/test.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/views/pages/db.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/views/pages/index.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/views/partials/header.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/YieldFarmingEntryAndExit/views/partials/nav.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /.gitignore (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /Procfile (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /README.md (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /app.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /index.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /package.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /public/lang-logo.png (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /public/node.svg (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /public/stylesheets/main.css (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /views/pages/db.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /views/pages/index.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /views/partials/header.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicArbExample /views/partials/nav.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/.gitignore (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/Procfile (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/README.md (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/app.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/index.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/package.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/public/lang-logo.png (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/public/node.svg (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/public/stylesheets/main.css (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/views/pages/db.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/views/pages/index.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/views/partials/header.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/basicNodeExample/views/partials/nav.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/Procfile (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/README.md (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/app.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/index.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/package.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/public/lang-logo.png (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/public/node.svg (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/public/stylesheets/main.css (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/views/pages/db.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/views/pages/index.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/views/partials/header.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/oracleNodeExampleApp/views/partials/nav.ejs (100%) rename {nodeJSAppExamples => examples/nodeJS}/orfeedapi/Procfile (100%) rename {nodeJSAppExamples => examples/nodeJS}/orfeedapi/app.json (100%) rename {nodeJSAppExamples => examples/nodeJS}/orfeedapi/index.js (100%) rename {nodeJSAppExamples => examples/nodeJS}/orfeedapi/package.json (100%) diff --git a/nodeJSAppExamples/OrFeedBinaryOption/LICENSE b/examples/nodeJS/OrFeedBinaryOption/LICENSE similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/LICENSE rename to examples/nodeJS/OrFeedBinaryOption/LICENSE diff --git a/nodeJSAppExamples/OrFeedBinaryOption/contracts/BinaryOption.sol b/examples/nodeJS/OrFeedBinaryOption/contracts/BinaryOption.sol similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/contracts/BinaryOption.sol rename to examples/nodeJS/OrFeedBinaryOption/contracts/BinaryOption.sol diff --git a/nodeJSAppExamples/OrFeedBinaryOption/contracts/Migrations.sol b/examples/nodeJS/OrFeedBinaryOption/contracts/Migrations.sol similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/contracts/Migrations.sol rename to examples/nodeJS/OrFeedBinaryOption/contracts/Migrations.sol diff --git a/nodeJSAppExamples/OrFeedBinaryOption/contracts/TestContract.sol b/examples/nodeJS/OrFeedBinaryOption/contracts/TestContract.sol similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/contracts/TestContract.sol rename to examples/nodeJS/OrFeedBinaryOption/contracts/TestContract.sol diff --git a/nodeJSAppExamples/OrFeedBinaryOption/migrations/1_initial_migration.js b/examples/nodeJS/OrFeedBinaryOption/migrations/1_initial_migration.js similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/migrations/1_initial_migration.js rename to examples/nodeJS/OrFeedBinaryOption/migrations/1_initial_migration.js diff --git a/nodeJSAppExamples/OrFeedBinaryOption/migrations/2_TestMigration.js b/examples/nodeJS/OrFeedBinaryOption/migrations/2_TestMigration.js similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/migrations/2_TestMigration.js rename to examples/nodeJS/OrFeedBinaryOption/migrations/2_TestMigration.js diff --git a/nodeJSAppExamples/OrFeedBinaryOption/package.json b/examples/nodeJS/OrFeedBinaryOption/package.json similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/package.json rename to examples/nodeJS/OrFeedBinaryOption/package.json diff --git a/nodeJSAppExamples/OrFeedBinaryOption/test/TestContract.js b/examples/nodeJS/OrFeedBinaryOption/test/TestContract.js similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/test/TestContract.js rename to examples/nodeJS/OrFeedBinaryOption/test/TestContract.js diff --git a/nodeJSAppExamples/OrFeedBinaryOption/truffle.js b/examples/nodeJS/OrFeedBinaryOption/truffle.js similarity index 100% rename from nodeJSAppExamples/OrFeedBinaryOption/truffle.js rename to examples/nodeJS/OrFeedBinaryOption/truffle.js diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/Procfile b/examples/nodeJS/TokenSetRebalancerExample/Procfile similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/Procfile rename to examples/nodeJS/TokenSetRebalancerExample/Procfile diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/README.md b/examples/nodeJS/TokenSetRebalancerExample/README.md similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/README.md rename to examples/nodeJS/TokenSetRebalancerExample/README.md diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/app.json b/examples/nodeJS/TokenSetRebalancerExample/app.json similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/app.json rename to examples/nodeJS/TokenSetRebalancerExample/app.json diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/index.js b/examples/nodeJS/TokenSetRebalancerExample/index.js similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/index.js rename to examples/nodeJS/TokenSetRebalancerExample/index.js diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/package-lock.json b/examples/nodeJS/TokenSetRebalancerExample/package-lock.json similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/package-lock.json rename to examples/nodeJS/TokenSetRebalancerExample/package-lock.json diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/package.json b/examples/nodeJS/TokenSetRebalancerExample/package.json similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/package.json rename to examples/nodeJS/TokenSetRebalancerExample/package.json diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/public/lang-logo.png b/examples/nodeJS/TokenSetRebalancerExample/public/lang-logo.png similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/public/lang-logo.png rename to examples/nodeJS/TokenSetRebalancerExample/public/lang-logo.png diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/public/node.svg b/examples/nodeJS/TokenSetRebalancerExample/public/node.svg similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/public/node.svg rename to examples/nodeJS/TokenSetRebalancerExample/public/node.svg diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/public/stylesheets/main.css b/examples/nodeJS/TokenSetRebalancerExample/public/stylesheets/main.css similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/public/stylesheets/main.css rename to examples/nodeJS/TokenSetRebalancerExample/public/stylesheets/main.css diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/test.js b/examples/nodeJS/TokenSetRebalancerExample/test.js similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/test.js rename to examples/nodeJS/TokenSetRebalancerExample/test.js diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/views/pages/db.ejs b/examples/nodeJS/TokenSetRebalancerExample/views/pages/db.ejs similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/views/pages/db.ejs rename to examples/nodeJS/TokenSetRebalancerExample/views/pages/db.ejs diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/views/pages/index.ejs b/examples/nodeJS/TokenSetRebalancerExample/views/pages/index.ejs similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/views/pages/index.ejs rename to examples/nodeJS/TokenSetRebalancerExample/views/pages/index.ejs diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/views/partials/header.ejs b/examples/nodeJS/TokenSetRebalancerExample/views/partials/header.ejs similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/views/partials/header.ejs rename to examples/nodeJS/TokenSetRebalancerExample/views/partials/header.ejs diff --git a/nodeJSAppExamples/TokenSetRebalancerExample/views/partials/nav.ejs b/examples/nodeJS/TokenSetRebalancerExample/views/partials/nav.ejs similarity index 100% rename from nodeJSAppExamples/TokenSetRebalancerExample/views/partials/nav.ejs rename to examples/nodeJS/TokenSetRebalancerExample/views/partials/nav.ejs diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/Procfile b/examples/nodeJS/YieldFarmingEntryAndExit/Procfile similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/Procfile rename to examples/nodeJS/YieldFarmingEntryAndExit/Procfile diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/README.md b/examples/nodeJS/YieldFarmingEntryAndExit/README.md similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/README.md rename to examples/nodeJS/YieldFarmingEntryAndExit/README.md diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/app.json b/examples/nodeJS/YieldFarmingEntryAndExit/app.json similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/app.json rename to examples/nodeJS/YieldFarmingEntryAndExit/app.json diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/index.js b/examples/nodeJS/YieldFarmingEntryAndExit/index.js similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/index.js rename to examples/nodeJS/YieldFarmingEntryAndExit/index.js diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/package-lock.json b/examples/nodeJS/YieldFarmingEntryAndExit/package-lock.json similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/package-lock.json rename to examples/nodeJS/YieldFarmingEntryAndExit/package-lock.json diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/package.json b/examples/nodeJS/YieldFarmingEntryAndExit/package.json similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/package.json rename to examples/nodeJS/YieldFarmingEntryAndExit/package.json diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/public/lang-logo.png b/examples/nodeJS/YieldFarmingEntryAndExit/public/lang-logo.png similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/public/lang-logo.png rename to examples/nodeJS/YieldFarmingEntryAndExit/public/lang-logo.png diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/public/node.svg b/examples/nodeJS/YieldFarmingEntryAndExit/public/node.svg similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/public/node.svg rename to examples/nodeJS/YieldFarmingEntryAndExit/public/node.svg diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/public/stylesheets/main.css b/examples/nodeJS/YieldFarmingEntryAndExit/public/stylesheets/main.css similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/public/stylesheets/main.css rename to examples/nodeJS/YieldFarmingEntryAndExit/public/stylesheets/main.css diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/test.js b/examples/nodeJS/YieldFarmingEntryAndExit/test.js similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/test.js rename to examples/nodeJS/YieldFarmingEntryAndExit/test.js diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/db.ejs b/examples/nodeJS/YieldFarmingEntryAndExit/views/pages/db.ejs similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/db.ejs rename to examples/nodeJS/YieldFarmingEntryAndExit/views/pages/db.ejs diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/index.ejs b/examples/nodeJS/YieldFarmingEntryAndExit/views/pages/index.ejs similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/index.ejs rename to examples/nodeJS/YieldFarmingEntryAndExit/views/pages/index.ejs diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/header.ejs b/examples/nodeJS/YieldFarmingEntryAndExit/views/partials/header.ejs similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/header.ejs rename to examples/nodeJS/YieldFarmingEntryAndExit/views/partials/header.ejs diff --git a/nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/nav.ejs b/examples/nodeJS/YieldFarmingEntryAndExit/views/partials/nav.ejs similarity index 100% rename from nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/nav.ejs rename to examples/nodeJS/YieldFarmingEntryAndExit/views/partials/nav.ejs diff --git a/nodeJSAppExamples/basicArbExample /.gitignore b/examples/nodeJS/basicArbExample /.gitignore similarity index 100% rename from nodeJSAppExamples/basicArbExample /.gitignore rename to examples/nodeJS/basicArbExample /.gitignore diff --git a/nodeJSAppExamples/basicArbExample /Procfile b/examples/nodeJS/basicArbExample /Procfile similarity index 100% rename from nodeJSAppExamples/basicArbExample /Procfile rename to examples/nodeJS/basicArbExample /Procfile diff --git a/nodeJSAppExamples/basicArbExample /README.md b/examples/nodeJS/basicArbExample /README.md similarity index 100% rename from nodeJSAppExamples/basicArbExample /README.md rename to examples/nodeJS/basicArbExample /README.md diff --git a/nodeJSAppExamples/basicArbExample /app.json b/examples/nodeJS/basicArbExample /app.json similarity index 100% rename from nodeJSAppExamples/basicArbExample /app.json rename to examples/nodeJS/basicArbExample /app.json diff --git a/nodeJSAppExamples/basicArbExample /index.js b/examples/nodeJS/basicArbExample /index.js similarity index 100% rename from nodeJSAppExamples/basicArbExample /index.js rename to examples/nodeJS/basicArbExample /index.js diff --git a/nodeJSAppExamples/basicArbExample /package.json b/examples/nodeJS/basicArbExample /package.json similarity index 100% rename from nodeJSAppExamples/basicArbExample /package.json rename to examples/nodeJS/basicArbExample /package.json diff --git a/nodeJSAppExamples/basicArbExample /public/lang-logo.png b/examples/nodeJS/basicArbExample /public/lang-logo.png similarity index 100% rename from nodeJSAppExamples/basicArbExample /public/lang-logo.png rename to examples/nodeJS/basicArbExample /public/lang-logo.png diff --git a/nodeJSAppExamples/basicArbExample /public/node.svg b/examples/nodeJS/basicArbExample /public/node.svg similarity index 100% rename from nodeJSAppExamples/basicArbExample /public/node.svg rename to examples/nodeJS/basicArbExample /public/node.svg diff --git a/nodeJSAppExamples/basicArbExample /public/stylesheets/main.css b/examples/nodeJS/basicArbExample /public/stylesheets/main.css similarity index 100% rename from nodeJSAppExamples/basicArbExample /public/stylesheets/main.css rename to examples/nodeJS/basicArbExample /public/stylesheets/main.css diff --git a/nodeJSAppExamples/basicArbExample /views/pages/db.ejs b/examples/nodeJS/basicArbExample /views/pages/db.ejs similarity index 100% rename from nodeJSAppExamples/basicArbExample /views/pages/db.ejs rename to examples/nodeJS/basicArbExample /views/pages/db.ejs diff --git a/nodeJSAppExamples/basicArbExample /views/pages/index.ejs b/examples/nodeJS/basicArbExample /views/pages/index.ejs similarity index 100% rename from nodeJSAppExamples/basicArbExample /views/pages/index.ejs rename to examples/nodeJS/basicArbExample /views/pages/index.ejs diff --git a/nodeJSAppExamples/basicArbExample /views/partials/header.ejs b/examples/nodeJS/basicArbExample /views/partials/header.ejs similarity index 100% rename from nodeJSAppExamples/basicArbExample /views/partials/header.ejs rename to examples/nodeJS/basicArbExample /views/partials/header.ejs diff --git a/nodeJSAppExamples/basicArbExample /views/partials/nav.ejs b/examples/nodeJS/basicArbExample /views/partials/nav.ejs similarity index 100% rename from nodeJSAppExamples/basicArbExample /views/partials/nav.ejs rename to examples/nodeJS/basicArbExample /views/partials/nav.ejs diff --git a/nodeJSAppExamples/basicNodeExample/.gitignore b/examples/nodeJS/basicNodeExample/.gitignore similarity index 100% rename from nodeJSAppExamples/basicNodeExample/.gitignore rename to examples/nodeJS/basicNodeExample/.gitignore diff --git a/nodeJSAppExamples/basicNodeExample/Procfile b/examples/nodeJS/basicNodeExample/Procfile similarity index 100% rename from nodeJSAppExamples/basicNodeExample/Procfile rename to examples/nodeJS/basicNodeExample/Procfile diff --git a/nodeJSAppExamples/basicNodeExample/README.md b/examples/nodeJS/basicNodeExample/README.md similarity index 100% rename from nodeJSAppExamples/basicNodeExample/README.md rename to examples/nodeJS/basicNodeExample/README.md diff --git a/nodeJSAppExamples/basicNodeExample/app.json b/examples/nodeJS/basicNodeExample/app.json similarity index 100% rename from nodeJSAppExamples/basicNodeExample/app.json rename to examples/nodeJS/basicNodeExample/app.json diff --git a/nodeJSAppExamples/basicNodeExample/index.js b/examples/nodeJS/basicNodeExample/index.js similarity index 100% rename from nodeJSAppExamples/basicNodeExample/index.js rename to examples/nodeJS/basicNodeExample/index.js diff --git a/nodeJSAppExamples/basicNodeExample/package.json b/examples/nodeJS/basicNodeExample/package.json similarity index 100% rename from nodeJSAppExamples/basicNodeExample/package.json rename to examples/nodeJS/basicNodeExample/package.json diff --git a/nodeJSAppExamples/basicNodeExample/public/lang-logo.png b/examples/nodeJS/basicNodeExample/public/lang-logo.png similarity index 100% rename from nodeJSAppExamples/basicNodeExample/public/lang-logo.png rename to examples/nodeJS/basicNodeExample/public/lang-logo.png diff --git a/nodeJSAppExamples/basicNodeExample/public/node.svg b/examples/nodeJS/basicNodeExample/public/node.svg similarity index 100% rename from nodeJSAppExamples/basicNodeExample/public/node.svg rename to examples/nodeJS/basicNodeExample/public/node.svg diff --git a/nodeJSAppExamples/basicNodeExample/public/stylesheets/main.css b/examples/nodeJS/basicNodeExample/public/stylesheets/main.css similarity index 100% rename from nodeJSAppExamples/basicNodeExample/public/stylesheets/main.css rename to examples/nodeJS/basicNodeExample/public/stylesheets/main.css diff --git a/nodeJSAppExamples/basicNodeExample/views/pages/db.ejs b/examples/nodeJS/basicNodeExample/views/pages/db.ejs similarity index 100% rename from nodeJSAppExamples/basicNodeExample/views/pages/db.ejs rename to examples/nodeJS/basicNodeExample/views/pages/db.ejs diff --git a/nodeJSAppExamples/basicNodeExample/views/pages/index.ejs b/examples/nodeJS/basicNodeExample/views/pages/index.ejs similarity index 100% rename from nodeJSAppExamples/basicNodeExample/views/pages/index.ejs rename to examples/nodeJS/basicNodeExample/views/pages/index.ejs diff --git a/nodeJSAppExamples/basicNodeExample/views/partials/header.ejs b/examples/nodeJS/basicNodeExample/views/partials/header.ejs similarity index 100% rename from nodeJSAppExamples/basicNodeExample/views/partials/header.ejs rename to examples/nodeJS/basicNodeExample/views/partials/header.ejs diff --git a/nodeJSAppExamples/basicNodeExample/views/partials/nav.ejs b/examples/nodeJS/basicNodeExample/views/partials/nav.ejs similarity index 100% rename from nodeJSAppExamples/basicNodeExample/views/partials/nav.ejs rename to examples/nodeJS/basicNodeExample/views/partials/nav.ejs diff --git a/nodeJSAppExamples/oracleNodeExampleApp/Procfile b/examples/nodeJS/oracleNodeExampleApp/Procfile similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/Procfile rename to examples/nodeJS/oracleNodeExampleApp/Procfile diff --git a/nodeJSAppExamples/oracleNodeExampleApp/README.md b/examples/nodeJS/oracleNodeExampleApp/README.md similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/README.md rename to examples/nodeJS/oracleNodeExampleApp/README.md diff --git a/nodeJSAppExamples/oracleNodeExampleApp/app.json b/examples/nodeJS/oracleNodeExampleApp/app.json similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/app.json rename to examples/nodeJS/oracleNodeExampleApp/app.json diff --git a/nodeJSAppExamples/oracleNodeExampleApp/index.js b/examples/nodeJS/oracleNodeExampleApp/index.js similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/index.js rename to examples/nodeJS/oracleNodeExampleApp/index.js diff --git a/nodeJSAppExamples/oracleNodeExampleApp/package.json b/examples/nodeJS/oracleNodeExampleApp/package.json similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/package.json rename to examples/nodeJS/oracleNodeExampleApp/package.json diff --git a/nodeJSAppExamples/oracleNodeExampleApp/public/lang-logo.png b/examples/nodeJS/oracleNodeExampleApp/public/lang-logo.png similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/public/lang-logo.png rename to examples/nodeJS/oracleNodeExampleApp/public/lang-logo.png diff --git a/nodeJSAppExamples/oracleNodeExampleApp/public/node.svg b/examples/nodeJS/oracleNodeExampleApp/public/node.svg similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/public/node.svg rename to examples/nodeJS/oracleNodeExampleApp/public/node.svg diff --git a/nodeJSAppExamples/oracleNodeExampleApp/public/stylesheets/main.css b/examples/nodeJS/oracleNodeExampleApp/public/stylesheets/main.css similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/public/stylesheets/main.css rename to examples/nodeJS/oracleNodeExampleApp/public/stylesheets/main.css diff --git a/nodeJSAppExamples/oracleNodeExampleApp/views/pages/db.ejs b/examples/nodeJS/oracleNodeExampleApp/views/pages/db.ejs similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/views/pages/db.ejs rename to examples/nodeJS/oracleNodeExampleApp/views/pages/db.ejs diff --git a/nodeJSAppExamples/oracleNodeExampleApp/views/pages/index.ejs b/examples/nodeJS/oracleNodeExampleApp/views/pages/index.ejs similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/views/pages/index.ejs rename to examples/nodeJS/oracleNodeExampleApp/views/pages/index.ejs diff --git a/nodeJSAppExamples/oracleNodeExampleApp/views/partials/header.ejs b/examples/nodeJS/oracleNodeExampleApp/views/partials/header.ejs similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/views/partials/header.ejs rename to examples/nodeJS/oracleNodeExampleApp/views/partials/header.ejs diff --git a/nodeJSAppExamples/oracleNodeExampleApp/views/partials/nav.ejs b/examples/nodeJS/oracleNodeExampleApp/views/partials/nav.ejs similarity index 100% rename from nodeJSAppExamples/oracleNodeExampleApp/views/partials/nav.ejs rename to examples/nodeJS/oracleNodeExampleApp/views/partials/nav.ejs diff --git a/nodeJSAppExamples/orfeedapi/Procfile b/examples/nodeJS/orfeedapi/Procfile similarity index 100% rename from nodeJSAppExamples/orfeedapi/Procfile rename to examples/nodeJS/orfeedapi/Procfile diff --git a/nodeJSAppExamples/orfeedapi/app.json b/examples/nodeJS/orfeedapi/app.json similarity index 100% rename from nodeJSAppExamples/orfeedapi/app.json rename to examples/nodeJS/orfeedapi/app.json diff --git a/nodeJSAppExamples/orfeedapi/index.js b/examples/nodeJS/orfeedapi/index.js similarity index 100% rename from nodeJSAppExamples/orfeedapi/index.js rename to examples/nodeJS/orfeedapi/index.js diff --git a/nodeJSAppExamples/orfeedapi/package.json b/examples/nodeJS/orfeedapi/package.json similarity index 100% rename from nodeJSAppExamples/orfeedapi/package.json rename to examples/nodeJS/orfeedapi/package.json From cf90b50c7902556059477fa8bd63f0dd2c350bb0 Mon Sep 17 00:00:00 2001 From: Eddine Omar Date: Sat, 13 Feb 2021 20:26:47 +0100 Subject: [PATCH 3/6] add infos about author --- examples/python/oracle_arb_finder/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/python/oracle_arb_finder/README.md b/examples/python/oracle_arb_finder/README.md index 881582d..ad6d962 100644 --- a/examples/python/oracle_arb_finder/README.md +++ b/examples/python/oracle_arb_finder/README.md @@ -26,6 +26,9 @@ pip3 install -r requirements.txt python3 app.py ``` +## Author +This project is forked from [https://github.com/edd34/oracle_orfeed](https://github.com/edd34/oracle_orfeed) + ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. From 1cf77219216b08269492e2332b81addd0571b71b Mon Sep 17 00:00:00 2001 From: Eddine Omar Date: Thu, 18 Feb 2021 17:03:39 +0100 Subject: [PATCH 4/6] Revert "move nodeJS example to folder ./examples/nodeJS" This reverts commit 29e7fe603417b89a0fee41f81d19893b71bb61bc. --- .../OrFeedBinaryOption/LICENSE | 0 .../OrFeedBinaryOption/contracts/BinaryOption.sol | 0 .../OrFeedBinaryOption/contracts/Migrations.sol | 0 .../OrFeedBinaryOption/contracts/TestContract.sol | 0 .../migrations/1_initial_migration.js | 0 .../migrations/2_TestMigration.js | 0 .../OrFeedBinaryOption/package.json | 0 .../OrFeedBinaryOption/test/TestContract.js | 0 .../OrFeedBinaryOption/truffle.js | 0 .../TokenSetRebalancerExample/Procfile | 0 .../TokenSetRebalancerExample/README.md | 0 .../TokenSetRebalancerExample/app.json | 0 .../TokenSetRebalancerExample/index.js | 0 .../TokenSetRebalancerExample/package-lock.json | 0 .../TokenSetRebalancerExample/package.json | 0 .../TokenSetRebalancerExample/public/lang-logo.png | Bin .../TokenSetRebalancerExample/public/node.svg | 0 .../public/stylesheets/main.css | 0 .../TokenSetRebalancerExample/test.js | 0 .../TokenSetRebalancerExample/views/pages/db.ejs | 0 .../TokenSetRebalancerExample/views/pages/index.ejs | 0 .../views/partials/header.ejs | 0 .../views/partials/nav.ejs | 0 .../YieldFarmingEntryAndExit/Procfile | 0 .../YieldFarmingEntryAndExit/README.md | 0 .../YieldFarmingEntryAndExit/app.json | 0 .../YieldFarmingEntryAndExit/index.js | 0 .../YieldFarmingEntryAndExit/package-lock.json | 0 .../YieldFarmingEntryAndExit/package.json | 0 .../YieldFarmingEntryAndExit/public/lang-logo.png | Bin .../YieldFarmingEntryAndExit/public/node.svg | 0 .../public/stylesheets/main.css | 0 .../YieldFarmingEntryAndExit/test.js | 0 .../YieldFarmingEntryAndExit/views/pages/db.ejs | 0 .../YieldFarmingEntryAndExit/views/pages/index.ejs | 0 .../views/partials/header.ejs | 0 .../YieldFarmingEntryAndExit/views/partials/nav.ejs | 0 .../basicArbExample /.gitignore | 0 .../basicArbExample /Procfile | 0 .../basicArbExample /README.md | 0 .../basicArbExample /app.json | 0 .../basicArbExample /index.js | 0 .../basicArbExample /package.json | 0 .../basicArbExample /public/lang-logo.png | Bin .../basicArbExample /public/node.svg | 0 .../basicArbExample /public/stylesheets/main.css | 0 .../basicArbExample /views/pages/db.ejs | 0 .../basicArbExample /views/pages/index.ejs | 0 .../basicArbExample /views/partials/header.ejs | 0 .../basicArbExample /views/partials/nav.ejs | 0 .../basicNodeExample/.gitignore | 0 .../basicNodeExample/Procfile | 0 .../basicNodeExample/README.md | 0 .../basicNodeExample/app.json | 0 .../basicNodeExample/index.js | 0 .../basicNodeExample/package.json | 0 .../basicNodeExample/public/lang-logo.png | Bin .../basicNodeExample/public/node.svg | 0 .../basicNodeExample/public/stylesheets/main.css | 0 .../basicNodeExample/views/pages/db.ejs | 0 .../basicNodeExample/views/pages/index.ejs | 0 .../basicNodeExample/views/partials/header.ejs | 0 .../basicNodeExample/views/partials/nav.ejs | 0 .../oracleNodeExampleApp/Procfile | 0 .../oracleNodeExampleApp/README.md | 0 .../oracleNodeExampleApp/app.json | 0 .../oracleNodeExampleApp/index.js | 0 .../oracleNodeExampleApp/package.json | 0 .../oracleNodeExampleApp/public/lang-logo.png | Bin .../oracleNodeExampleApp/public/node.svg | 0 .../public/stylesheets/main.css | 0 .../oracleNodeExampleApp/views/pages/db.ejs | 0 .../oracleNodeExampleApp/views/pages/index.ejs | 0 .../oracleNodeExampleApp/views/partials/header.ejs | 0 .../oracleNodeExampleApp/views/partials/nav.ejs | 0 .../nodeJS => nodeJSAppExamples}/orfeedapi/Procfile | 0 .../nodeJS => nodeJSAppExamples}/orfeedapi/app.json | 0 .../nodeJS => nodeJSAppExamples}/orfeedapi/index.js | 0 .../orfeedapi/package.json | 0 79 files changed, 0 insertions(+), 0 deletions(-) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/LICENSE (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/contracts/BinaryOption.sol (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/contracts/Migrations.sol (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/contracts/TestContract.sol (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/migrations/1_initial_migration.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/migrations/2_TestMigration.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/package.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/test/TestContract.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/OrFeedBinaryOption/truffle.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/Procfile (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/README.md (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/app.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/index.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/package-lock.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/package.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/public/lang-logo.png (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/public/node.svg (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/public/stylesheets/main.css (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/test.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/views/pages/db.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/views/pages/index.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/views/partials/header.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/TokenSetRebalancerExample/views/partials/nav.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/Procfile (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/README.md (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/app.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/index.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/package-lock.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/package.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/public/lang-logo.png (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/public/node.svg (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/public/stylesheets/main.css (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/test.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/views/pages/db.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/views/pages/index.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/views/partials/header.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/YieldFarmingEntryAndExit/views/partials/nav.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /.gitignore (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /Procfile (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /README.md (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /app.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /index.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /package.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /public/lang-logo.png (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /public/node.svg (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /public/stylesheets/main.css (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /views/pages/db.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /views/pages/index.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /views/partials/header.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicArbExample /views/partials/nav.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/.gitignore (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/Procfile (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/README.md (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/app.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/index.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/package.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/public/lang-logo.png (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/public/node.svg (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/public/stylesheets/main.css (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/views/pages/db.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/views/pages/index.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/views/partials/header.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/basicNodeExample/views/partials/nav.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/Procfile (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/README.md (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/app.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/index.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/package.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/public/lang-logo.png (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/public/node.svg (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/public/stylesheets/main.css (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/views/pages/db.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/views/pages/index.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/views/partials/header.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/oracleNodeExampleApp/views/partials/nav.ejs (100%) rename {examples/nodeJS => nodeJSAppExamples}/orfeedapi/Procfile (100%) rename {examples/nodeJS => nodeJSAppExamples}/orfeedapi/app.json (100%) rename {examples/nodeJS => nodeJSAppExamples}/orfeedapi/index.js (100%) rename {examples/nodeJS => nodeJSAppExamples}/orfeedapi/package.json (100%) diff --git a/examples/nodeJS/OrFeedBinaryOption/LICENSE b/nodeJSAppExamples/OrFeedBinaryOption/LICENSE similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/LICENSE rename to nodeJSAppExamples/OrFeedBinaryOption/LICENSE diff --git a/examples/nodeJS/OrFeedBinaryOption/contracts/BinaryOption.sol b/nodeJSAppExamples/OrFeedBinaryOption/contracts/BinaryOption.sol similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/contracts/BinaryOption.sol rename to nodeJSAppExamples/OrFeedBinaryOption/contracts/BinaryOption.sol diff --git a/examples/nodeJS/OrFeedBinaryOption/contracts/Migrations.sol b/nodeJSAppExamples/OrFeedBinaryOption/contracts/Migrations.sol similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/contracts/Migrations.sol rename to nodeJSAppExamples/OrFeedBinaryOption/contracts/Migrations.sol diff --git a/examples/nodeJS/OrFeedBinaryOption/contracts/TestContract.sol b/nodeJSAppExamples/OrFeedBinaryOption/contracts/TestContract.sol similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/contracts/TestContract.sol rename to nodeJSAppExamples/OrFeedBinaryOption/contracts/TestContract.sol diff --git a/examples/nodeJS/OrFeedBinaryOption/migrations/1_initial_migration.js b/nodeJSAppExamples/OrFeedBinaryOption/migrations/1_initial_migration.js similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/migrations/1_initial_migration.js rename to nodeJSAppExamples/OrFeedBinaryOption/migrations/1_initial_migration.js diff --git a/examples/nodeJS/OrFeedBinaryOption/migrations/2_TestMigration.js b/nodeJSAppExamples/OrFeedBinaryOption/migrations/2_TestMigration.js similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/migrations/2_TestMigration.js rename to nodeJSAppExamples/OrFeedBinaryOption/migrations/2_TestMigration.js diff --git a/examples/nodeJS/OrFeedBinaryOption/package.json b/nodeJSAppExamples/OrFeedBinaryOption/package.json similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/package.json rename to nodeJSAppExamples/OrFeedBinaryOption/package.json diff --git a/examples/nodeJS/OrFeedBinaryOption/test/TestContract.js b/nodeJSAppExamples/OrFeedBinaryOption/test/TestContract.js similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/test/TestContract.js rename to nodeJSAppExamples/OrFeedBinaryOption/test/TestContract.js diff --git a/examples/nodeJS/OrFeedBinaryOption/truffle.js b/nodeJSAppExamples/OrFeedBinaryOption/truffle.js similarity index 100% rename from examples/nodeJS/OrFeedBinaryOption/truffle.js rename to nodeJSAppExamples/OrFeedBinaryOption/truffle.js diff --git a/examples/nodeJS/TokenSetRebalancerExample/Procfile b/nodeJSAppExamples/TokenSetRebalancerExample/Procfile similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/Procfile rename to nodeJSAppExamples/TokenSetRebalancerExample/Procfile diff --git a/examples/nodeJS/TokenSetRebalancerExample/README.md b/nodeJSAppExamples/TokenSetRebalancerExample/README.md similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/README.md rename to nodeJSAppExamples/TokenSetRebalancerExample/README.md diff --git a/examples/nodeJS/TokenSetRebalancerExample/app.json b/nodeJSAppExamples/TokenSetRebalancerExample/app.json similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/app.json rename to nodeJSAppExamples/TokenSetRebalancerExample/app.json diff --git a/examples/nodeJS/TokenSetRebalancerExample/index.js b/nodeJSAppExamples/TokenSetRebalancerExample/index.js similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/index.js rename to nodeJSAppExamples/TokenSetRebalancerExample/index.js diff --git a/examples/nodeJS/TokenSetRebalancerExample/package-lock.json b/nodeJSAppExamples/TokenSetRebalancerExample/package-lock.json similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/package-lock.json rename to nodeJSAppExamples/TokenSetRebalancerExample/package-lock.json diff --git a/examples/nodeJS/TokenSetRebalancerExample/package.json b/nodeJSAppExamples/TokenSetRebalancerExample/package.json similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/package.json rename to nodeJSAppExamples/TokenSetRebalancerExample/package.json diff --git a/examples/nodeJS/TokenSetRebalancerExample/public/lang-logo.png b/nodeJSAppExamples/TokenSetRebalancerExample/public/lang-logo.png similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/public/lang-logo.png rename to nodeJSAppExamples/TokenSetRebalancerExample/public/lang-logo.png diff --git a/examples/nodeJS/TokenSetRebalancerExample/public/node.svg b/nodeJSAppExamples/TokenSetRebalancerExample/public/node.svg similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/public/node.svg rename to nodeJSAppExamples/TokenSetRebalancerExample/public/node.svg diff --git a/examples/nodeJS/TokenSetRebalancerExample/public/stylesheets/main.css b/nodeJSAppExamples/TokenSetRebalancerExample/public/stylesheets/main.css similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/public/stylesheets/main.css rename to nodeJSAppExamples/TokenSetRebalancerExample/public/stylesheets/main.css diff --git a/examples/nodeJS/TokenSetRebalancerExample/test.js b/nodeJSAppExamples/TokenSetRebalancerExample/test.js similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/test.js rename to nodeJSAppExamples/TokenSetRebalancerExample/test.js diff --git a/examples/nodeJS/TokenSetRebalancerExample/views/pages/db.ejs b/nodeJSAppExamples/TokenSetRebalancerExample/views/pages/db.ejs similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/views/pages/db.ejs rename to nodeJSAppExamples/TokenSetRebalancerExample/views/pages/db.ejs diff --git a/examples/nodeJS/TokenSetRebalancerExample/views/pages/index.ejs b/nodeJSAppExamples/TokenSetRebalancerExample/views/pages/index.ejs similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/views/pages/index.ejs rename to nodeJSAppExamples/TokenSetRebalancerExample/views/pages/index.ejs diff --git a/examples/nodeJS/TokenSetRebalancerExample/views/partials/header.ejs b/nodeJSAppExamples/TokenSetRebalancerExample/views/partials/header.ejs similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/views/partials/header.ejs rename to nodeJSAppExamples/TokenSetRebalancerExample/views/partials/header.ejs diff --git a/examples/nodeJS/TokenSetRebalancerExample/views/partials/nav.ejs b/nodeJSAppExamples/TokenSetRebalancerExample/views/partials/nav.ejs similarity index 100% rename from examples/nodeJS/TokenSetRebalancerExample/views/partials/nav.ejs rename to nodeJSAppExamples/TokenSetRebalancerExample/views/partials/nav.ejs diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/Procfile b/nodeJSAppExamples/YieldFarmingEntryAndExit/Procfile similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/Procfile rename to nodeJSAppExamples/YieldFarmingEntryAndExit/Procfile diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/README.md b/nodeJSAppExamples/YieldFarmingEntryAndExit/README.md similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/README.md rename to nodeJSAppExamples/YieldFarmingEntryAndExit/README.md diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/app.json b/nodeJSAppExamples/YieldFarmingEntryAndExit/app.json similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/app.json rename to nodeJSAppExamples/YieldFarmingEntryAndExit/app.json diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/index.js b/nodeJSAppExamples/YieldFarmingEntryAndExit/index.js similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/index.js rename to nodeJSAppExamples/YieldFarmingEntryAndExit/index.js diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/package-lock.json b/nodeJSAppExamples/YieldFarmingEntryAndExit/package-lock.json similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/package-lock.json rename to nodeJSAppExamples/YieldFarmingEntryAndExit/package-lock.json diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/package.json b/nodeJSAppExamples/YieldFarmingEntryAndExit/package.json similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/package.json rename to nodeJSAppExamples/YieldFarmingEntryAndExit/package.json diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/public/lang-logo.png b/nodeJSAppExamples/YieldFarmingEntryAndExit/public/lang-logo.png similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/public/lang-logo.png rename to nodeJSAppExamples/YieldFarmingEntryAndExit/public/lang-logo.png diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/public/node.svg b/nodeJSAppExamples/YieldFarmingEntryAndExit/public/node.svg similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/public/node.svg rename to nodeJSAppExamples/YieldFarmingEntryAndExit/public/node.svg diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/public/stylesheets/main.css b/nodeJSAppExamples/YieldFarmingEntryAndExit/public/stylesheets/main.css similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/public/stylesheets/main.css rename to nodeJSAppExamples/YieldFarmingEntryAndExit/public/stylesheets/main.css diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/test.js b/nodeJSAppExamples/YieldFarmingEntryAndExit/test.js similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/test.js rename to nodeJSAppExamples/YieldFarmingEntryAndExit/test.js diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/views/pages/db.ejs b/nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/db.ejs similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/views/pages/db.ejs rename to nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/db.ejs diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/views/pages/index.ejs b/nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/index.ejs similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/views/pages/index.ejs rename to nodeJSAppExamples/YieldFarmingEntryAndExit/views/pages/index.ejs diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/views/partials/header.ejs b/nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/header.ejs similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/views/partials/header.ejs rename to nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/header.ejs diff --git a/examples/nodeJS/YieldFarmingEntryAndExit/views/partials/nav.ejs b/nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/nav.ejs similarity index 100% rename from examples/nodeJS/YieldFarmingEntryAndExit/views/partials/nav.ejs rename to nodeJSAppExamples/YieldFarmingEntryAndExit/views/partials/nav.ejs diff --git a/examples/nodeJS/basicArbExample /.gitignore b/nodeJSAppExamples/basicArbExample /.gitignore similarity index 100% rename from examples/nodeJS/basicArbExample /.gitignore rename to nodeJSAppExamples/basicArbExample /.gitignore diff --git a/examples/nodeJS/basicArbExample /Procfile b/nodeJSAppExamples/basicArbExample /Procfile similarity index 100% rename from examples/nodeJS/basicArbExample /Procfile rename to nodeJSAppExamples/basicArbExample /Procfile diff --git a/examples/nodeJS/basicArbExample /README.md b/nodeJSAppExamples/basicArbExample /README.md similarity index 100% rename from examples/nodeJS/basicArbExample /README.md rename to nodeJSAppExamples/basicArbExample /README.md diff --git a/examples/nodeJS/basicArbExample /app.json b/nodeJSAppExamples/basicArbExample /app.json similarity index 100% rename from examples/nodeJS/basicArbExample /app.json rename to nodeJSAppExamples/basicArbExample /app.json diff --git a/examples/nodeJS/basicArbExample /index.js b/nodeJSAppExamples/basicArbExample /index.js similarity index 100% rename from examples/nodeJS/basicArbExample /index.js rename to nodeJSAppExamples/basicArbExample /index.js diff --git a/examples/nodeJS/basicArbExample /package.json b/nodeJSAppExamples/basicArbExample /package.json similarity index 100% rename from examples/nodeJS/basicArbExample /package.json rename to nodeJSAppExamples/basicArbExample /package.json diff --git a/examples/nodeJS/basicArbExample /public/lang-logo.png b/nodeJSAppExamples/basicArbExample /public/lang-logo.png similarity index 100% rename from examples/nodeJS/basicArbExample /public/lang-logo.png rename to nodeJSAppExamples/basicArbExample /public/lang-logo.png diff --git a/examples/nodeJS/basicArbExample /public/node.svg b/nodeJSAppExamples/basicArbExample /public/node.svg similarity index 100% rename from examples/nodeJS/basicArbExample /public/node.svg rename to nodeJSAppExamples/basicArbExample /public/node.svg diff --git a/examples/nodeJS/basicArbExample /public/stylesheets/main.css b/nodeJSAppExamples/basicArbExample /public/stylesheets/main.css similarity index 100% rename from examples/nodeJS/basicArbExample /public/stylesheets/main.css rename to nodeJSAppExamples/basicArbExample /public/stylesheets/main.css diff --git a/examples/nodeJS/basicArbExample /views/pages/db.ejs b/nodeJSAppExamples/basicArbExample /views/pages/db.ejs similarity index 100% rename from examples/nodeJS/basicArbExample /views/pages/db.ejs rename to nodeJSAppExamples/basicArbExample /views/pages/db.ejs diff --git a/examples/nodeJS/basicArbExample /views/pages/index.ejs b/nodeJSAppExamples/basicArbExample /views/pages/index.ejs similarity index 100% rename from examples/nodeJS/basicArbExample /views/pages/index.ejs rename to nodeJSAppExamples/basicArbExample /views/pages/index.ejs diff --git a/examples/nodeJS/basicArbExample /views/partials/header.ejs b/nodeJSAppExamples/basicArbExample /views/partials/header.ejs similarity index 100% rename from examples/nodeJS/basicArbExample /views/partials/header.ejs rename to nodeJSAppExamples/basicArbExample /views/partials/header.ejs diff --git a/examples/nodeJS/basicArbExample /views/partials/nav.ejs b/nodeJSAppExamples/basicArbExample /views/partials/nav.ejs similarity index 100% rename from examples/nodeJS/basicArbExample /views/partials/nav.ejs rename to nodeJSAppExamples/basicArbExample /views/partials/nav.ejs diff --git a/examples/nodeJS/basicNodeExample/.gitignore b/nodeJSAppExamples/basicNodeExample/.gitignore similarity index 100% rename from examples/nodeJS/basicNodeExample/.gitignore rename to nodeJSAppExamples/basicNodeExample/.gitignore diff --git a/examples/nodeJS/basicNodeExample/Procfile b/nodeJSAppExamples/basicNodeExample/Procfile similarity index 100% rename from examples/nodeJS/basicNodeExample/Procfile rename to nodeJSAppExamples/basicNodeExample/Procfile diff --git a/examples/nodeJS/basicNodeExample/README.md b/nodeJSAppExamples/basicNodeExample/README.md similarity index 100% rename from examples/nodeJS/basicNodeExample/README.md rename to nodeJSAppExamples/basicNodeExample/README.md diff --git a/examples/nodeJS/basicNodeExample/app.json b/nodeJSAppExamples/basicNodeExample/app.json similarity index 100% rename from examples/nodeJS/basicNodeExample/app.json rename to nodeJSAppExamples/basicNodeExample/app.json diff --git a/examples/nodeJS/basicNodeExample/index.js b/nodeJSAppExamples/basicNodeExample/index.js similarity index 100% rename from examples/nodeJS/basicNodeExample/index.js rename to nodeJSAppExamples/basicNodeExample/index.js diff --git a/examples/nodeJS/basicNodeExample/package.json b/nodeJSAppExamples/basicNodeExample/package.json similarity index 100% rename from examples/nodeJS/basicNodeExample/package.json rename to nodeJSAppExamples/basicNodeExample/package.json diff --git a/examples/nodeJS/basicNodeExample/public/lang-logo.png b/nodeJSAppExamples/basicNodeExample/public/lang-logo.png similarity index 100% rename from examples/nodeJS/basicNodeExample/public/lang-logo.png rename to nodeJSAppExamples/basicNodeExample/public/lang-logo.png diff --git a/examples/nodeJS/basicNodeExample/public/node.svg b/nodeJSAppExamples/basicNodeExample/public/node.svg similarity index 100% rename from examples/nodeJS/basicNodeExample/public/node.svg rename to nodeJSAppExamples/basicNodeExample/public/node.svg diff --git a/examples/nodeJS/basicNodeExample/public/stylesheets/main.css b/nodeJSAppExamples/basicNodeExample/public/stylesheets/main.css similarity index 100% rename from examples/nodeJS/basicNodeExample/public/stylesheets/main.css rename to nodeJSAppExamples/basicNodeExample/public/stylesheets/main.css diff --git a/examples/nodeJS/basicNodeExample/views/pages/db.ejs b/nodeJSAppExamples/basicNodeExample/views/pages/db.ejs similarity index 100% rename from examples/nodeJS/basicNodeExample/views/pages/db.ejs rename to nodeJSAppExamples/basicNodeExample/views/pages/db.ejs diff --git a/examples/nodeJS/basicNodeExample/views/pages/index.ejs b/nodeJSAppExamples/basicNodeExample/views/pages/index.ejs similarity index 100% rename from examples/nodeJS/basicNodeExample/views/pages/index.ejs rename to nodeJSAppExamples/basicNodeExample/views/pages/index.ejs diff --git a/examples/nodeJS/basicNodeExample/views/partials/header.ejs b/nodeJSAppExamples/basicNodeExample/views/partials/header.ejs similarity index 100% rename from examples/nodeJS/basicNodeExample/views/partials/header.ejs rename to nodeJSAppExamples/basicNodeExample/views/partials/header.ejs diff --git a/examples/nodeJS/basicNodeExample/views/partials/nav.ejs b/nodeJSAppExamples/basicNodeExample/views/partials/nav.ejs similarity index 100% rename from examples/nodeJS/basicNodeExample/views/partials/nav.ejs rename to nodeJSAppExamples/basicNodeExample/views/partials/nav.ejs diff --git a/examples/nodeJS/oracleNodeExampleApp/Procfile b/nodeJSAppExamples/oracleNodeExampleApp/Procfile similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/Procfile rename to nodeJSAppExamples/oracleNodeExampleApp/Procfile diff --git a/examples/nodeJS/oracleNodeExampleApp/README.md b/nodeJSAppExamples/oracleNodeExampleApp/README.md similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/README.md rename to nodeJSAppExamples/oracleNodeExampleApp/README.md diff --git a/examples/nodeJS/oracleNodeExampleApp/app.json b/nodeJSAppExamples/oracleNodeExampleApp/app.json similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/app.json rename to nodeJSAppExamples/oracleNodeExampleApp/app.json diff --git a/examples/nodeJS/oracleNodeExampleApp/index.js b/nodeJSAppExamples/oracleNodeExampleApp/index.js similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/index.js rename to nodeJSAppExamples/oracleNodeExampleApp/index.js diff --git a/examples/nodeJS/oracleNodeExampleApp/package.json b/nodeJSAppExamples/oracleNodeExampleApp/package.json similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/package.json rename to nodeJSAppExamples/oracleNodeExampleApp/package.json diff --git a/examples/nodeJS/oracleNodeExampleApp/public/lang-logo.png b/nodeJSAppExamples/oracleNodeExampleApp/public/lang-logo.png similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/public/lang-logo.png rename to nodeJSAppExamples/oracleNodeExampleApp/public/lang-logo.png diff --git a/examples/nodeJS/oracleNodeExampleApp/public/node.svg b/nodeJSAppExamples/oracleNodeExampleApp/public/node.svg similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/public/node.svg rename to nodeJSAppExamples/oracleNodeExampleApp/public/node.svg diff --git a/examples/nodeJS/oracleNodeExampleApp/public/stylesheets/main.css b/nodeJSAppExamples/oracleNodeExampleApp/public/stylesheets/main.css similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/public/stylesheets/main.css rename to nodeJSAppExamples/oracleNodeExampleApp/public/stylesheets/main.css diff --git a/examples/nodeJS/oracleNodeExampleApp/views/pages/db.ejs b/nodeJSAppExamples/oracleNodeExampleApp/views/pages/db.ejs similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/views/pages/db.ejs rename to nodeJSAppExamples/oracleNodeExampleApp/views/pages/db.ejs diff --git a/examples/nodeJS/oracleNodeExampleApp/views/pages/index.ejs b/nodeJSAppExamples/oracleNodeExampleApp/views/pages/index.ejs similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/views/pages/index.ejs rename to nodeJSAppExamples/oracleNodeExampleApp/views/pages/index.ejs diff --git a/examples/nodeJS/oracleNodeExampleApp/views/partials/header.ejs b/nodeJSAppExamples/oracleNodeExampleApp/views/partials/header.ejs similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/views/partials/header.ejs rename to nodeJSAppExamples/oracleNodeExampleApp/views/partials/header.ejs diff --git a/examples/nodeJS/oracleNodeExampleApp/views/partials/nav.ejs b/nodeJSAppExamples/oracleNodeExampleApp/views/partials/nav.ejs similarity index 100% rename from examples/nodeJS/oracleNodeExampleApp/views/partials/nav.ejs rename to nodeJSAppExamples/oracleNodeExampleApp/views/partials/nav.ejs diff --git a/examples/nodeJS/orfeedapi/Procfile b/nodeJSAppExamples/orfeedapi/Procfile similarity index 100% rename from examples/nodeJS/orfeedapi/Procfile rename to nodeJSAppExamples/orfeedapi/Procfile diff --git a/examples/nodeJS/orfeedapi/app.json b/nodeJSAppExamples/orfeedapi/app.json similarity index 100% rename from examples/nodeJS/orfeedapi/app.json rename to nodeJSAppExamples/orfeedapi/app.json diff --git a/examples/nodeJS/orfeedapi/index.js b/nodeJSAppExamples/orfeedapi/index.js similarity index 100% rename from examples/nodeJS/orfeedapi/index.js rename to nodeJSAppExamples/orfeedapi/index.js diff --git a/examples/nodeJS/orfeedapi/package.json b/nodeJSAppExamples/orfeedapi/package.json similarity index 100% rename from examples/nodeJS/orfeedapi/package.json rename to nodeJSAppExamples/orfeedapi/package.json From 6d0ff575a40848615450588939fa8f0338db125d Mon Sep 17 00:00:00 2001 From: Eddine Omar Date: Fri, 19 Feb 2021 13:39:18 +0100 Subject: [PATCH 5/6] add comment and format code --- examples/python/oracle_arb_finder/app.py | 16 +- .../oracle_arb_finder/core/functions.py | 69 +- .../python/oracle_arb_finder/core/orfeed.py | 50 +- .../python/oracle_arb_finder/core/registry.py | 13 +- .../oracle_arb_finder/core/smartcontracts.py | 595 +++++++++++++++++- .../oracle_arb_finder/core/token_infos.py | 90 +-- examples/python/oracle_arb_finder/server.py | 5 +- 7 files changed, 739 insertions(+), 99 deletions(-) diff --git a/examples/python/oracle_arb_finder/app.py b/examples/python/oracle_arb_finder/app.py index 588f9c2..0a6f31c 100644 --- a/examples/python/oracle_arb_finder/app.py +++ b/examples/python/oracle_arb_finder/app.py @@ -1,14 +1,26 @@ -from lib.get_price import get_raw_price_async, get_clean_price, compute_arb_opportunities, get_output +from lib.get_price import ( + get_raw_price_async, + get_clean_price, + compute_arb_opportunities, + get_output, +) from pprint import pprint + def get_list_arb(): + """Run the arb finder + + Returns: + List: List sorted by % of all arb opportunities found. + """ dict_price_raw = get_raw_price_async() dict_clean_price = get_clean_price(dict_price_raw) list_arb_price = compute_arb_opportunities(dict_clean_price) res = get_output(list_arb_price) - sorted_list_arb = sorted(res.items(), key = lambda i: i[1]['%']) + sorted_list_arb = sorted(res.items(), key=lambda i: i[1]["%"], reverse=True) pprint(sorted_list_arb) return sorted_list_arb + if __name__ == "__main__": get_list_arb() diff --git a/examples/python/oracle_arb_finder/core/functions.py b/examples/python/oracle_arb_finder/core/functions.py index 3dfd392..9018fb9 100644 --- a/examples/python/oracle_arb_finder/core/functions.py +++ b/examples/python/oracle_arb_finder/core/functions.py @@ -4,37 +4,78 @@ from core.token_infos import init_dict_token_dex from core.orfeed import Orfeed from dotenv import load_dotenv + load_dotenv() import web3 from web3 import Web3 from tqdm import tqdm -def getTokenToTokenPrice(orfeed_i, tokenSrc, tokenDst, provider, amount_wei=1): - res = orfeed_i.getExchangeRate(tokenSrc, tokenDst, provider, amount_wei) + +def getTokenToTokenPrice(orfeed_i, tokenSrc, tokenDst, dex, amount_src_token=1): + """Get the rate of swap tokenSrc to tokenDst in a given Dex + + Args: + orfeed_i (OrFeed): The instance of OrFeed class + tokenSrc (Symbol): Symbol of src token + tokenDst (Symbol): Symbol of dst token + dex (str): The Dex where the rate is going to be requested + amount_src_token (int, optional): Amount of src token. Defaults to 1 src token unit. + + Returns: + Dict: Return a dict containing all relevant infos about the request + """ + res = orfeed_i.getExchangeRate(tokenSrc, tokenDst, dex, amount_src_token) return { - "tokenSrc" : tokenSrc, - "tokenDst" : tokenDst, - "tokenPair" : tokenSrc + '-' + tokenDst, - "provider" : provider, - "price" : res + "tokenSrc": tokenSrc, + "tokenDst": tokenDst, + "tokenPair": tokenSrc + "-" + tokenDst, + "provider": dex, + "price": res, } -def simple_getTokenToTokenPrice(orfeed_i, src_token, src_token_infos, dst_token, dst_token_infos): + +def simple_getTokenToTokenPrice( + orfeed_i, src_token, src_token_infos, dst_token, dst_token_infos +): + """For a pair of token, retrieve prices between Uniswap Dex and Kyber Dex. + + Args: + orfeed_i (OrFeed): Instance of OrFeed + src_token (Symbol): : Symbol of src token + src_token_infos (Dict): Dict containing src token infos (number of decimals and address) + dst_token (Symbol): Symbol of dst_token + dst_token_infos (Symbol): Dict containing dst token infos (number of decimals and address) + + Returns: + Dict: Dict containing all infos about buy/sell. + """ result = {} providers_list = ["UNISWAPBYSYMBOLV2", "KYBERBYSYMBOLV1"] tmp_res = {} for provider in providers_list: - buy = getTokenToTokenPrice(orfeed_i, src_token, dst_token, provider, amount_wei=10**src_token_infos['decimals']) - sell = getTokenToTokenPrice(orfeed_i, dst_token, src_token, provider, amount_wei=buy["price"]) + buy = getTokenToTokenPrice( + orfeed_i, + src_token, + dst_token, + provider, + amount_src_token=10 ** src_token_infos["decimals"], + ) + sell = getTokenToTokenPrice( + orfeed_i, dst_token, src_token, provider, amount_src_token=buy["price"] + ) tmp_res[provider] = { - "buy_price_wei": buy["price"]/(10**dst_token_infos['decimals']), - "sell_price_wei": sell["price"]*buy["price"]/(10**(dst_token_infos['decimals'] + src_token_infos['decimals'])) + "buy_price_wei": buy["price"] / (10 ** dst_token_infos["decimals"]), + "sell_price_wei": sell["price"] + * buy["price"] + / (10 ** (dst_token_infos["decimals"] + src_token_infos["decimals"])), } if buy["price"] > 0 and sell["price"] > 0: tmp_res[provider] = { - "buy_price_wei": buy["price"]/(10**dst_token_infos['decimals']), - "sell_price_wei": sell["price"]*buy["price"]/(10**(dst_token_infos['decimals'] + src_token_infos['decimals'])) + "buy_price_wei": buy["price"] / (10 ** dst_token_infos["decimals"]), + "sell_price_wei": sell["price"] + * buy["price"] + / (10 ** (dst_token_infos["decimals"] + src_token_infos["decimals"])), } else: return None diff --git a/examples/python/oracle_arb_finder/core/orfeed.py b/examples/python/oracle_arb_finder/core/orfeed.py index 521f49c..02821a9 100644 --- a/examples/python/oracle_arb_finder/core/orfeed.py +++ b/examples/python/oracle_arb_finder/core/orfeed.py @@ -1,25 +1,69 @@ from web3 import Web3 from core.smartcontracts import my_smartcontracts + class Orfeed: + """OrFeed class + Initialise the blockchain provider + Implement some methods in order to call method in OrFeed smartcontract + https://etherscan.io/address/0x8316b082621cfedab95bf4a44a1d4b64a6ffc336 + """ def __init__(self, web3): - self.orfeed_address = Web3.toChecksumAddress(my_smartcontracts["orfeed"]["address"]) + """Initialize the blockchain provider + + Args: + web3 (string): url of blockchain provider, can be Infura or AlchemyAPI + """ + self.orfeed_address = Web3.toChecksumAddress( + my_smartcontracts["orfeed"]["address"] + ) self.w3 = web3 - self.orfeed_contract = self.w3.eth.contract(address=self.orfeed_address, abi=my_smartcontracts["orfeed"]["abi"]) + self.orfeed_contract = self.w3.eth.contract( + address=self.orfeed_address, abi=my_smartcontracts["orfeed"]["abi"] + ) def getExchangeRate(self, _from, _to, _provider, _amount): + """getExchange rate between two ERC20 tokens on a given DEX + + Args: + _from (str): symbol of ERC20 token. Source token. + _to (str): symbol of ERC20 token. Destination token. + _provider (str): the Dex where you want to swap your tokens. + _amount (str): amount of source token you want to exchange. + + Returns: + str: The amount of destination you get. + """ if _from == _to or _amount <= 0: return -1 try: - return self.orfeed_contract.functions.getExchangeRate(_from, _to, _provider, _amount).call() + return self.orfeed_contract.functions.getExchangeRate( + _from, _to, _provider, _amount + ).call() except Exception: return -1 def getTokenAddress(self, symbol): + """Return address of a ERC20 token. + + Args: + symbol (str): ERC20 token. + + Returns: + str: address of ERC20 token in the blockchain. + """ try: return self.orfeed_contract.functions.getTokenAddress(symbol).call() except Exception: return -1 def getTokenDecimalCount(self, address): + """Retrieve number of decimals of an ERC20 token. + + Args: + address (str): address of ERC20 token. + + Returns: + str: Number of decimals of the ERC20 token given in arg. + """ return self.orfeed_contract.functions.getTokenDecimalCount(address).call() diff --git a/examples/python/oracle_arb_finder/core/registry.py b/examples/python/oracle_arb_finder/core/registry.py index 2479e7f..6f8efb0 100644 --- a/examples/python/oracle_arb_finder/core/registry.py +++ b/examples/python/oracle_arb_finder/core/registry.py @@ -2,16 +2,21 @@ from web3 import Web3 from smartcontracts import my_smartcontracts + class Registry: def __init__(self, web3): - self.registry_address = Web3.toChecksumAddress(my_smartcontracts["registry"]["address"]) + self.registry_address = Web3.toChecksumAddress( + my_smartcontracts["registry"]["address"] + ) self.w3 = web3 - self.registry_contract = self.w3.eth.contract(address=self.registry_address, abi=my_smartcontracts["registry"]["abi"]) - + self.registry_contract = self.w3.eth.contract( + address=self.registry_address, abi=my_smartcontracts["registry"]["abi"] + ) + def getAllOracles(self): res = self.registry_contract.functions.getAllOracles().call() return res def getOracleInfo(self, name_reference=None): res = self.registry_contract.functions.getOracleInfo(name_reference).call() - return res \ No newline at end of file + return res diff --git a/examples/python/oracle_arb_finder/core/smartcontracts.py b/examples/python/oracle_arb_finder/core/smartcontracts.py index b353c5c..d87e4a3 100644 --- a/examples/python/oracle_arb_finder/core/smartcontracts.py +++ b/examples/python/oracle_arb_finder/core/smartcontracts.py @@ -1,22 +1,605 @@ import os from dotenv import load_dotenv + load_dotenv() orfeed_contract_address_mainnet = "0x8316b082621cfedab95bf4a44a1d4b64a6ffc336" registry_contract_address_mainnet = "0x74b5CE2330389391cC61bF2287BDC9Ac73757891" aave_liquidity_provider = "0x3dfd23a6c5e8bbcfc9581d2e864a68feb6a076d3" -registry_abi_mainnet = [{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"newOrSameOracleAddress","type":"address"}],"name":"editOracleAddress","outputs":[{"name":"","type":"bool"}],"payable":True,"stateMutability":"payable","type":"function"},{"constant":True,"inputs":[{"name":"selectedOracle","type":"string"},{"name":"fromParam","type":"string"},{"name":"toParam","type":"string"},{"name":"side","type":"string"},{"name":"amount","type":"uint256"}],"name":"getPriceFromOracle","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[],"name":"withdrawBalance","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"getAllOracles","outputs":[{"name":"","type":"string[]"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"newFee","type":"uint256"}],"name":"changeFee","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"requestedAddress","type":"address"},{"name":"info","type":"string"}],"name":"registerOracle","outputs":[{"name":"","type":"bool"}],"payable":True,"stateMutability":"payable","type":"function"},{"constant":True,"inputs":[{"name":"nameReference","type":"string"}],"name":"getOracleInfo","outputs":[{"name":"","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"nameReference","type":"string"}],"name":"getOracleOwner","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"info","type":"string"}],"name":"editOracleInfo","outputs":[{"name":"","type":"bool"}],"payable":True,"stateMutability":"payable","type":"function"},{"constant":False,"inputs":[{"name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"nameReference","type":"string"}],"name":"getOracleAddress","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"name","type":"string"},{"name":"toAddress","type":"address"}],"name":"transferOracleName","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":True,"stateMutability":"payable","type":"constructor"}] +registry_abi_mainnet = [ + { + "constant": False, + "inputs": [ + {"name": "name", "type": "string"}, + {"name": "newOrSameOracleAddress", "type": "address"}, + ], + "name": "editOracleAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": True, + "stateMutability": "payable", + "type": "function", + }, + { + "constant": True, + "inputs": [ + {"name": "selectedOracle", "type": "string"}, + {"name": "fromParam", "type": "string"}, + {"name": "toParam", "type": "string"}, + {"name": "side", "type": "string"}, + {"name": "amount", "type": "uint256"}, + ], + "name": "getPriceFromOracle", + "outputs": [{"name": "", "type": "uint256"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [], + "name": "withdrawBalance", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [], + "name": "getAllOracles", + "outputs": [{"name": "", "type": "string[]"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newFee", "type": "uint256"}], + "name": "changeFee", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "name", "type": "string"}, + {"name": "requestedAddress", "type": "address"}, + {"name": "info", "type": "string"}, + ], + "name": "registerOracle", + "outputs": [{"name": "", "type": "bool"}], + "payable": True, + "stateMutability": "payable", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "nameReference", "type": "string"}], + "name": "getOracleInfo", + "outputs": [{"name": "", "type": "string"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "nameReference", "type": "string"}], + "name": "getOracleOwner", + "outputs": [{"name": "", "type": "address"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "name", "type": "string"}, + {"name": "info", "type": "string"}, + ], + "name": "editOracleInfo", + "outputs": [{"name": "", "type": "bool"}], + "payable": True, + "stateMutability": "payable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOwner", "type": "address"}], + "name": "changeOwner", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "nameReference", "type": "string"}], + "name": "getOracleAddress", + "outputs": [{"name": "", "type": "address"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "name", "type": "string"}, + {"name": "toAddress", "type": "address"}, + ], + "name": "transferOracleName", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "inputs": [], + "payable": True, + "stateMutability": "payable", + "type": "constructor", + }, +] -orfeed_abi_mainnet = [{ "constant": False, "inputs": [{ "name": "symb", "type": "string" }, { "name": "tokenAddress", "type": "address" }, { "name": "byteCode", "type": "bytes32" }], "name": "addFreeCurrency", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "fromSymbol", "type": "string" }, { "name": "toSymbol", "type": "string" }, { "name": "venue", "type": "string" }, { "name": "amount", "type": "uint256" }, { "name": "referenceId", "type": "string" }], "name": "requestAsyncExchangeRateResult", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": True, "inputs": [{ "name": "eventName", "type": "string" }, { "name": "source", "type": "string" }, { "name": "referenceId", "type": "string" }], "name": "getAsyncEventResult", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter2", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "synth", "type": "bytes32" }, { "name": "token", "type": "address" }, { "name": "inputAmount", "type": "uint256" }], "name": "getSynthToTokenOutputAmount", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "symb", "type": "string" }, { "name": "tokenAddress", "type": "address" }], "name": "addFreeToken", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "_a", "type": "string" }, { "name": "_b", "type": "string" }], "name": "compare", "outputs": [{ "name": "", "type": "int256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateForexOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "_a", "type": "string" }, { "name": "_b", "type": "string" }], "name": "equal", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "eventName", "type": "string" }, { "name": "source", "type": "string" }], "name": "getEventResult", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateSynthAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter1", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter3", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "fromSymbol", "type": "string" }, { "name": "toSymbol", "type": "string" }, { "name": "venue", "type": "string" }, { "name": "amount", "type": "uint256" }], "name": "getExchangeRate", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "symb", "type": "string" }], "name": "removeFreeToken", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateEthTokenAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "fundsReturnToAddress", "type": "address" }, { "name": "liquidityProviderContractAddress", "type": "address" }, { "name": "tokens", "type": "string[]" }, { "name": "amount", "type": "uint256" }, { "name": "exchanges", "type": "string[]" }], "name": "arb", "outputs": [{ "name": "", "type": "bool" }], "payable": True, "stateMutability": "payable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updatePremiumSubOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "_haystack", "type": "string" }, { "name": "_needle", "type": "string" }], "name": "indexOf", "outputs": [{ "name": "", "type": "int256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "symb", "type": "string" }], "name": "removeFreeCurrency", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateAsyncOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "venueToCheck", "type": "string" }], "name": "isFreeVenueCheck", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "symToCheck", "type": "string" }], "name": "isFree", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newAddress", "type": "address" }], "name": "updateArbContractAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOwner", "type": "address" }], "name": "changeOwner", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateAsyncEventsAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "tokenAddress", "type": "address" }], "name": "getTokenDecimalCount", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": True, "inputs": [{ "name": "a", "type": "string" }, { "name": "b", "type": "string" }], "name": "compareStrings", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "eventName", "type": "string" }, { "name": "source", "type": "string" }], "name": "requestAsyncEvent", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "symbol", "type": "string" }], "name": "getTokenAddress", "outputs": [{ "name": "", "type": "address" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "token", "type": "address" }, { "name": "synth", "type": "bytes32" }, { "name": "inputAmount", "type": "uint256" }], "name": "getTokenToSynthOutputAmount", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "source", "type": "string" }], "name": "stringToBytes32", "outputs": [{ "name": "result", "type": "bytes32" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "fromSymbol", "type": "string" }, { "name": "toSymbol", "type": "string" }, { "name": "venue", "type": "string" }, { "name": "amount", "type": "uint256" }], "name": "requestAsyncExchangeRate", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateTokenOracleAddress2", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateSyncEventsAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "symbol", "type": "string" }], "name": "getSynthBytes32", "outputs": [{ "name": "", "type": "bytes32" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "fromSymb", "type": "string" }, { "name": "toSymb", "type": "string" }, { "name": "amount", "type": "uint256" }], "name": "getFreeExchangeRate", "outputs": [{ "name": "", "type": "uint256" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newOracle", "type": "address" }], "name": "updateTokenOracleAddress", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": False, "inputs": [{ "name": "newDiv", "type": "uint256" }, { "name": "newMul", "type": "uint256" }], "name": "updateMulDivConverter4", "outputs": [{ "name": "", "type": "bool" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "constant": True, "inputs": [{ "name": "symbol", "type": "string" }], "name": "getForexAddress", "outputs": [{ "name": "", "type": "address" }], "payable": False, "stateMutability": "view", "type": "function" }, { "constant": False, "inputs": [{ "name": "param1", "type": "string" }, { "name": "param2", "type": "string" }, { "name": "param3", "type": "string" }, { "name": "param4", "type": "string" }], "name": "callExtraFunction", "outputs": [{ "name": "", "type": "string" }], "payable": False, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": True, "stateMutability": "payable", "type": "constructor" }, { "payable": True, "stateMutability": "payable", "type": "fallback" }] +orfeed_abi_mainnet = [ + { + "constant": False, + "inputs": [ + {"name": "symb", "type": "string"}, + {"name": "tokenAddress", "type": "address"}, + {"name": "byteCode", "type": "bytes32"}, + ], + "name": "addFreeCurrency", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [ + {"name": "fromSymbol", "type": "string"}, + {"name": "toSymbol", "type": "string"}, + {"name": "venue", "type": "string"}, + {"name": "amount", "type": "uint256"}, + {"name": "referenceId", "type": "string"}, + ], + "name": "requestAsyncExchangeRateResult", + "outputs": [{"name": "", "type": "uint256"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": True, + "inputs": [ + {"name": "eventName", "type": "string"}, + {"name": "source", "type": "string"}, + {"name": "referenceId", "type": "string"}, + ], + "name": "getAsyncEventResult", + "outputs": [{"name": "", "type": "string"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "newDiv", "type": "uint256"}, + {"name": "newMul", "type": "uint256"}, + ], + "name": "updateMulDivConverter2", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "synth", "type": "bytes32"}, + {"name": "token", "type": "address"}, + {"name": "inputAmount", "type": "uint256"}, + ], + "name": "getSynthToTokenOutputAmount", + "outputs": [{"name": "", "type": "uint256"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "symb", "type": "string"}, + {"name": "tokenAddress", "type": "address"}, + ], + "name": "addFreeToken", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "_a", "type": "string"}, {"name": "_b", "type": "string"}], + "name": "compare", + "outputs": [{"name": "", "type": "int256"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateForexOracleAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "_a", "type": "string"}, {"name": "_b", "type": "string"}], + "name": "equal", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [ + {"name": "eventName", "type": "string"}, + {"name": "source", "type": "string"}, + ], + "name": "getEventResult", + "outputs": [{"name": "", "type": "string"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateSynthAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "newDiv", "type": "uint256"}, + {"name": "newMul", "type": "uint256"}, + ], + "name": "updateMulDivConverter1", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "newDiv", "type": "uint256"}, + {"name": "newMul", "type": "uint256"}, + ], + "name": "updateMulDivConverter3", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [ + {"name": "fromSymbol", "type": "string"}, + {"name": "toSymbol", "type": "string"}, + {"name": "venue", "type": "string"}, + {"name": "amount", "type": "uint256"}, + ], + "name": "getExchangeRate", + "outputs": [{"name": "", "type": "uint256"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "symb", "type": "string"}], + "name": "removeFreeToken", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateEthTokenAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "fundsReturnToAddress", "type": "address"}, + {"name": "liquidityProviderContractAddress", "type": "address"}, + {"name": "tokens", "type": "string[]"}, + {"name": "amount", "type": "uint256"}, + {"name": "exchanges", "type": "string[]"}, + ], + "name": "arb", + "outputs": [{"name": "", "type": "bool"}], + "payable": True, + "stateMutability": "payable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updatePremiumSubOracleAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "_haystack", "type": "string"}, + {"name": "_needle", "type": "string"}, + ], + "name": "indexOf", + "outputs": [{"name": "", "type": "int256"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "symb", "type": "string"}], + "name": "removeFreeCurrency", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateAsyncOracleAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "venueToCheck", "type": "string"}], + "name": "isFreeVenueCheck", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "symToCheck", "type": "string"}], + "name": "isFree", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newAddress", "type": "address"}], + "name": "updateArbContractAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOwner", "type": "address"}], + "name": "changeOwner", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateAsyncEventsAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "tokenAddress", "type": "address"}], + "name": "getTokenDecimalCount", + "outputs": [{"name": "", "type": "uint256"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "a", "type": "string"}, {"name": "b", "type": "string"}], + "name": "compareStrings", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "eventName", "type": "string"}, + {"name": "source", "type": "string"}, + ], + "name": "requestAsyncEvent", + "outputs": [{"name": "", "type": "string"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "symbol", "type": "string"}], + "name": "getTokenAddress", + "outputs": [{"name": "", "type": "address"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "token", "type": "address"}, + {"name": "synth", "type": "bytes32"}, + {"name": "inputAmount", "type": "uint256"}, + ], + "name": "getTokenToSynthOutputAmount", + "outputs": [{"name": "", "type": "uint256"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "source", "type": "string"}], + "name": "stringToBytes32", + "outputs": [{"name": "result", "type": "bytes32"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "fromSymbol", "type": "string"}, + {"name": "toSymbol", "type": "string"}, + {"name": "venue", "type": "string"}, + {"name": "amount", "type": "uint256"}, + ], + "name": "requestAsyncExchangeRate", + "outputs": [{"name": "", "type": "string"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateTokenOracleAddress2", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateSyncEventsAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "symbol", "type": "string"}], + "name": "getSynthBytes32", + "outputs": [{"name": "", "type": "bytes32"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "fromSymb", "type": "string"}, + {"name": "toSymb", "type": "string"}, + {"name": "amount", "type": "uint256"}, + ], + "name": "getFreeExchangeRate", + "outputs": [{"name": "", "type": "uint256"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [{"name": "newOracle", "type": "address"}], + "name": "updateTokenOracleAddress", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "newDiv", "type": "uint256"}, + {"name": "newMul", "type": "uint256"}, + ], + "name": "updateMulDivConverter4", + "outputs": [{"name": "", "type": "bool"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "constant": True, + "inputs": [{"name": "symbol", "type": "string"}], + "name": "getForexAddress", + "outputs": [{"name": "", "type": "address"}], + "payable": False, + "stateMutability": "view", + "type": "function", + }, + { + "constant": False, + "inputs": [ + {"name": "param1", "type": "string"}, + {"name": "param2", "type": "string"}, + {"name": "param3", "type": "string"}, + {"name": "param4", "type": "string"}, + ], + "name": "callExtraFunction", + "outputs": [{"name": "", "type": "string"}], + "payable": False, + "stateMutability": "nonpayable", + "type": "function", + }, + { + "inputs": [], + "payable": True, + "stateMutability": "payable", + "type": "constructor", + }, + {"payable": True, "stateMutability": "payable", "type": "fallback"}, +] my_smartcontracts = {} if os.getenv("NETWORK") == "mainnet": my_smartcontracts["orfeed"] = { - "address" : orfeed_contract_address_mainnet, - "abi" : orfeed_abi_mainnet + "address": orfeed_contract_address_mainnet, + "abi": orfeed_abi_mainnet, } my_smartcontracts["registry"] = { - "address" : registry_contract_address_mainnet, - "abi" : registry_abi_mainnet + "address": registry_contract_address_mainnet, + "abi": registry_abi_mainnet, } diff --git a/examples/python/oracle_arb_finder/core/token_infos.py b/examples/python/oracle_arb_finder/core/token_infos.py index 217c532..bea8d11 100644 --- a/examples/python/oracle_arb_finder/core/token_infos.py +++ b/examples/python/oracle_arb_finder/core/token_infos.py @@ -1,75 +1,29 @@ token_symbols = { - "DAI": { - 'address' : 0x6b175474e89094c44da98b954eedeac495271d0f, - 'decimals' : 18 - }, - "USDC": { - 'address' : 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, - 'decimals' : 6 - }, - "MKR" : { - 'address' : 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2, - 'decimals' : 18 - }, - "LINK" : { - 'address' : 0x514910771af9ca656af840dff83e8264ecf986ca, - 'decimals' : 18 - }, - "BAT" : { - 'address' : 0x0d8775f648430679a709e98d2b0cb6250d2887ef, - 'decimals' : 18 - }, - "WBTC" : { - 'address' : 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599, - 'decimals' : 8 - }, - "USDT" : { - 'address' : 0xdac17f958d2ee523a2206206994597c13d831ec7, - 'decimals' : 6 - }, - "OMG" : { - 'address' : 0xd26114cd6EE289AccF82350c8d8487fedB8A0C07, - 'decimals' : 18 - }, - "ZRX" : { - 'address' : 0xe41d2489571d322189246dafa5ebde1f4699f498, - 'decimals' : 18 - }, - "TUSD" : { - 'decimals': 18 - }, - "LEND" : { - 'address' : 0x80fB784B7eD66730e8b1DBd9820aFD29931aab03, - 'decimals' : 18 - }, - "REP" : { - 'address' : 0x221657776846890989a759ba2973e427dff5c9bb, - 'decimals' : 18 - }, - "BNT" : { - 'address' : 0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c, - 'decimals' : 18 - }, - "PAX" : { - 'address' : 0x8e870d67f660d95d5be530380d0ec0bd388289e1, - 'decimals' : 18 - }, - "SUSD" : { - 'address' : 0x57ab1ec28d129707052df4df418d58a2d46d5f51, - 'decimals' : 18 - }, - "KNC" : { - 'address' : 0xdd974d5c2e2928dea5f71b9825b8b646686bd200, - 'decimals' : 18 - }, - "ETH" : { - # 'address' : 0xdd974d5c2e2928dea5f71b9825b8b646686bd200, - 'decimals' : 18 - } - } + "DAI": {"address": 0x6B175474E89094C44DA98B954EEDEAC495271D0F, "decimals": 18}, + "USDC": {"address": 0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48, "decimals": 6}, + "MKR": {"address": 0x9F8F72AA9304C8B593D555F12EF6589CC3A579A2, "decimals": 18}, + "LINK": {"address": 0x514910771AF9CA656AF840DFF83E8264ECF986CA, "decimals": 18}, + "BAT": {"address": 0x0D8775F648430679A709E98D2B0CB6250D2887EF, "decimals": 18}, + "WBTC": {"address": 0x2260FAC5E5542A773AA44FBCFEDF7C193BC2C599, "decimals": 8}, + "USDT": {"address": 0xDAC17F958D2EE523A2206206994597C13D831EC7, "decimals": 6}, + "OMG": {"address": 0xD26114CD6EE289ACCF82350C8D8487FEDB8A0C07, "decimals": 18}, + "ZRX": {"address": 0xE41D2489571D322189246DAFA5EBDE1F4699F498, "decimals": 18}, + "TUSD": {"decimals": 18}, + "LEND": {"address": 0x80FB784B7ED66730E8B1DBD9820AFD29931AAB03, "decimals": 18}, + "REP": {"address": 0x221657776846890989A759BA2973E427DFF5C9BB, "decimals": 18}, + "BNT": {"address": 0x1F573D6FB3F13D689FF844B4CE37794D79A7FF1C, "decimals": 18}, + "PAX": {"address": 0x8E870D67F660D95D5BE530380D0EC0BD388289E1, "decimals": 18}, + "SUSD": {"address": 0x57AB1EC28D129707052DF4DF418D58A2D46D5F51, "decimals": 18}, + "KNC": {"address": 0xDD974D5C2E2928DEA5F71B9825B8B646686BD200, "decimals": 18}, + "ETH": { + # 'address' : 0xdd974d5c2e2928dea5f71b9825b8b646686bd200, + "decimals": 18 + }, +} orfeed_list_providers = ["UNISWAPBYSYMBOLV1", "UNISWAPBYSYMBOLV2", "KYBERBYSYMBOLV1"] + def init_dict_token_dex(): token_dex = {} for token in token_symbols: diff --git a/examples/python/oracle_arb_finder/server.py b/examples/python/oracle_arb_finder/server.py index 6445b5a..8f20e2b 100644 --- a/examples/python/oracle_arb_finder/server.py +++ b/examples/python/oracle_arb_finder/server.py @@ -3,10 +3,11 @@ app = Flask(__name__) -@app.route('/arb') + +@app.route("/arb") def arb(): return {"result": get_list_arb()}, 200 -if __name__=='__main__': +if __name__ == "__main__": app.run(debug=True) From 25d22ef79817861d7f7acef333cf1f9db395fffc Mon Sep 17 00:00:00 2001 From: Eddine Omar Date: Fri, 19 Feb 2021 13:41:56 +0100 Subject: [PATCH 6/6] add helper module and update app.py --- examples/python/oracle_arb_finder/app.py | 2 +- .../oracle_arb_finder/helper/get_price.py | 157 ++++++++++++++++++ 2 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 examples/python/oracle_arb_finder/helper/get_price.py diff --git a/examples/python/oracle_arb_finder/app.py b/examples/python/oracle_arb_finder/app.py index 0a6f31c..2f3466f 100644 --- a/examples/python/oracle_arb_finder/app.py +++ b/examples/python/oracle_arb_finder/app.py @@ -1,4 +1,4 @@ -from lib.get_price import ( +from helper.get_price import ( get_raw_price_async, get_clean_price, compute_arb_opportunities, diff --git a/examples/python/oracle_arb_finder/helper/get_price.py b/examples/python/oracle_arb_finder/helper/get_price.py new file mode 100644 index 0000000..4537529 --- /dev/null +++ b/examples/python/oracle_arb_finder/helper/get_price.py @@ -0,0 +1,157 @@ +from threading import Thread +import os, time, pprint +from web3 import Web3, eth +from tqdm import tqdm +from core.functions import simple_getTokenToTokenPrice +from core.orfeed import Orfeed +from core.token_infos import token_symbols + +w3 = Web3(Web3.HTTPProvider(os.getenv("BLOCKCHAIN_PROVIDER"))) +# w3 = Web3(Web3.HTTPProvider('http://127.0.0.1:8545')) # uncomment if you use ganache-cli +orfeed_i = Orfeed(w3) + + +class ThreadWithReturnValue(Thread): + def __init__( + self, group=None, target=None, name=None, args=(), kwargs={}, Verbose=None + ): + Thread.__init__(self, group, target, name, args, kwargs) + self._return = None + + def run(self): + # print(type(self._target)) + if self._target is not None: + self._return = self._target(*self._args, **self._kwargs) + + def join(self, *args): + Thread.join(self, *args) + return self._return + + +def get_raw_price_async(): + list_thread = {} + for src_token in token_symbols: + for dst_token in token_symbols: + if src_token != dst_token: + list_thread[src_token + "/" + dst_token] = ThreadWithReturnValue( + target=simple_getTokenToTokenPrice, + args=( + orfeed_i, + src_token, + token_symbols[src_token], + dst_token, + token_symbols[dst_token], + ), + ) + list_thread[src_token + "/" + dst_token].start() + + # res = [{i: list_thread[i].join()} for i in list_thread if list_thread[i].join() != -1] + res = {} + for i in list_thread: + res[i] = list_thread[i].join() + return res + + +def get_clean_price(list_raw_price, coeff=2000): + result = {} + dex_list = ["UNISWAPBYSYMBOLV2", "KYBERBYSYMBOLV1"] + for pair in list_raw_price: + if list_raw_price[pair] is None: + continue + + buy_price_ratio = ( + list_raw_price[pair][dex_list[0]]["buy_price_wei"] + / list_raw_price[pair][dex_list[1]]["buy_price_wei"] + ) + sell_price_ratio = ( + list_raw_price[pair][dex_list[0]]["sell_price_wei"] + / list_raw_price[pair][dex_list[1]]["sell_price_wei"] + ) + if (buy_price_ratio > coeff or 1 / buy_price_ratio > coeff) or ( + sell_price_ratio > coeff or 1 / sell_price_ratio > coeff + ): + continue + + for dex in dex_list: + if ( + list_raw_price[pair][dex]["buy_price_wei"] > 0 + and list_raw_price[pair][dex]["sell_price_wei"] > 0 + ): + result[pair] = list_raw_price[pair] + return result + + +def compute_arb_opportunities(list_clean_price): + dex_list = ["UNISWAPBYSYMBOLV2", "KYBERBYSYMBOLV1"] + for pair in list_clean_price: + path = { + "one": ( + list_clean_price[pair][dex_list[1]]["sell_price_wei"] + - list_clean_price[pair][dex_list[0]]["buy_price_wei"] + ) + / list_clean_price[pair][dex_list[0]]["buy_price_wei"], + "two": ( + list_clean_price[pair][dex_list[0]]["sell_price_wei"] + - list_clean_price[pair][dex_list[1]]["buy_price_wei"] + ) + / list_clean_price[pair][dex_list[1]]["buy_price_wei"], + } + if path["one"] > path["two"] and path["one"] > 0: + list_clean_price[pair]["%"] = path["one"] + list_clean_price[pair]["code"] = 1 + elif path["two"] > path["one"] and path["two"] > 0: + list_clean_price[pair]["%"] = path["two"] + list_clean_price[pair]["code"] = 2 + + return { + k: v + for k, v in list_clean_price.items() + if list_clean_price[k].get("%") is not None + } + + +def get_output(list_arb_price): + hint_msg = "swap {amount_src_token} {src_token} for {amount_dst_token} {dst_token} in {dex}" + [dex_1, dex_2] = ["UNISWAPBYSYMBOLV2", "KYBERBYSYMBOLV1"] + for pair in list_arb_price: + [src_token, dst_token] = pair.split("/") + if list_arb_price[pair]["code"] == 1: + amount_src_token = list_arb_price[pair][dex_1]["buy_price_wei"] + amount_dst_token = list_arb_price[pair][dex_2]["sell_price_wei"] + dict_var_msg_1 = { + "src_token": src_token, + "dst_token": dst_token, + "amount_src_token": 1, + "amount_dst_token": amount_src_token, + "dex": dex_1, + } + dict_var_msg_2 = { + "src_token": dst_token, + "dst_token": src_token, + "amount_src_token": amount_dst_token, + "amount_dst_token": 1, + "dex": dex_2, + } + list_arb_price[pair]["swap_1"] = hint_msg.format(**dict_var_msg_1) + list_arb_price[pair]["swap_2"] = hint_msg.format(**dict_var_msg_2) + else: + amount_src_token = list_arb_price[pair][dex_2]["buy_price_wei"] + amount_dst_token = list_arb_price[pair][dex_1]["sell_price_wei"] + dict_var_msg_1 = { + "src_token": dst_token, + "dst_token": src_token, + "amount_src_token": amount_src_token, + "amount_dst_token": 1, + "dex": dex_1, + } + dict_var_msg_2 = { + "src_token": src_token, + "dst_token": dst_token, + "amount_src_token": 1, + "amount_dst_token": amount_dst_token, + "dex": dex_2, + } + list_arb_price[pair]["swap_1"] = hint_msg.format(**dict_var_msg_2) + list_arb_price[pair]["swap_2"] = hint_msg.format(**dict_var_msg_1) + + return list_arb_price