├── .gitignore
├── LICENSE
├── README.md
├── __init__.py
├── account
└── templates
│ └── account
│ ├── login.html
│ ├── profile.html
│ └── register.html
├── djangoTrade
├── __init__.py
├── celery.py
├── routing.py
├── settings.py
├── urls.py
└── wsgi.py
├── dump.json
├── images
├── candelsticks.jpg
├── final_screen.jpg
├── home_page.jpg
└── ongrid-systems-cover.png
├── manage.py
├── requirements.txt
├── templates
└── 404.html
├── ticker_app
├── __init__.py
├── admin.py
├── apps.py
├── migrations
│ ├── 0001_initial.py
│ └── __init__.py
├── models.py
├── routers.py
├── tests.py
└── views.py
├── trade
├── __init__.py
├── admin.py
├── apps.py
├── forms.py
├── migrations
│ ├── 0001_initial.py
│ └── __init__.py
├── models.py
├── static
│ ├── css
│ │ ├── highcharts.css
│ │ ├── images
│ │ │ ├── animated-overlay.gif
│ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png
│ │ │ ├── ui-bg_flat_75_ffffff_40x100.png
│ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png
│ │ │ ├── ui-bg_glass_65_ffffff_1x400.png
│ │ │ ├── ui-bg_glass_75_dadada_1x400.png
│ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png
│ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png
│ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png
│ │ │ ├── ui-icons_222222_256x240.png
│ │ │ ├── ui-icons_2e83ff_256x240.png
│ │ │ ├── ui-icons_454545_256x240.png
│ │ │ ├── ui-icons_888888_256x240.png
│ │ │ └── ui-icons_cd0a0a_256x240.png
│ │ ├── jqChart.css
│ │ ├── jqRangeSlider.css
│ │ ├── jquery-ui-1.10.4.css
│ │ ├── materialize.css
│ │ ├── setup.css
│ │ └── style.css
│ ├── fonts
│ │ └── roboto
│ │ │ ├── Roboto-Bold.woff
│ │ │ ├── Roboto-Bold.woff2
│ │ │ ├── Roboto-Light.woff
│ │ │ ├── Roboto-Light.woff2
│ │ │ ├── Roboto-Medium.woff
│ │ │ ├── Roboto-Medium.woff2
│ │ │ ├── Roboto-Regular.woff
│ │ │ ├── Roboto-Regular.woff2
│ │ │ ├── Roboto-Thin.woff
│ │ │ └── Roboto-Thin.woff2
│ ├── images
│ │ ├── cryptotokens
│ │ │ ├── .png
│ │ │ ├── ardor.png
│ │ │ ├── augur.png
│ │ │ ├── bitcoin.png
│ │ │ ├── bitcoindark.png
│ │ │ ├── bitconnect.png
│ │ │ ├── bitshares.png
│ │ │ ├── blackcoin.png
│ │ │ ├── blocknet.png
│ │ │ ├── bytecoin-bcn.png
│ │ │ ├── counterparty.png
│ │ │ ├── dash.png
│ │ │ ├── decred.png
│ │ │ ├── digibyte.png
│ │ │ ├── dogecoin.png
│ │ │ ├── ethereum-classic.png
│ │ │ ├── ethereum.png
│ │ │ ├── etheroll.png
│ │ │ ├── factom.png
│ │ │ ├── gamecredits.png
│ │ │ ├── gnosis-gno.png
│ │ │ ├── golem-network-tokens.png
│ │ │ ├── library-credit.png
│ │ │ ├── lisk.png
│ │ │ ├── litecoin.png
│ │ │ ├── maidsafecoin.png
│ │ │ ├── monero.png
│ │ │ ├── namecoin.png
│ │ │ ├── nem.png
│ │ │ ├── nxt.png
│ │ │ ├── peercoin.png
│ │ │ ├── potcoin.png
│ │ │ ├── reddcoin.png
│ │ │ ├── ripple.png
│ │ │ ├── siacoin.png
│ │ │ ├── steem.png
│ │ │ ├── stratis.png
│ │ │ ├── syscoin.png
│ │ │ ├── tether.png
│ │ │ ├── viacoin.png
│ │ │ └── zcash.png
│ │ └── logo.png
│ ├── js
│ │ ├── coinmarketcup.js
│ │ ├── exporting.js
│ │ ├── highstock.js
│ │ ├── jqChart.js
│ │ ├── jqRangeSlider.js
│ │ ├── materialize.js
│ │ ├── script.js
│ │ └── setup.js
│ └── trade
│ │ └── 404.jpg
├── tasks.py
├── templates
│ ├── account
│ │ ├── account_inactive.html
│ │ ├── base.html
│ │ ├── email.html
│ │ ├── email
│ │ │ ├── email_confirmation_message.txt
│ │ │ ├── email_confirmation_signup_message.txt
│ │ │ ├── email_confirmation_signup_subject.txt
│ │ │ ├── email_confirmation_subject.txt
│ │ │ ├── password_reset_key_message.txt
│ │ │ └── password_reset_key_subject.txt
│ │ ├── email_confirm.html
│ │ ├── login.html
│ │ ├── logout.html
│ │ ├── messages
│ │ │ ├── cannot_delete_primary_email.txt
│ │ │ ├── email_confirmation_sent.txt
│ │ │ ├── email_confirmed.txt
│ │ │ ├── email_deleted.txt
│ │ │ ├── logged_in.txt
│ │ │ ├── logged_out.txt
│ │ │ ├── password_changed.txt
│ │ │ ├── password_set.txt
│ │ │ ├── primary_email_set.txt
│ │ │ └── unverified_primary_email.txt
│ │ ├── password_change.html
│ │ ├── password_reset.html
│ │ ├── password_reset_done.html
│ │ ├── password_reset_from_key.html
│ │ ├── password_reset_from_key_done.html
│ │ ├── password_set.html
│ │ ├── signup.html
│ │ ├── signup_closed.html
│ │ ├── snippets
│ │ │ └── already_logged_in.html
│ │ ├── verification_sent.html
│ │ └── verified_email_required.html
│ ├── openid
│ │ ├── base.html
│ │ └── login.html
│ ├── socialaccount
│ │ ├── authentication_error.html
│ │ ├── base.html
│ │ ├── connections.html
│ │ ├── login_cancelled.html
│ │ ├── messages
│ │ │ ├── account_connected.txt
│ │ │ ├── account_connected_other.txt
│ │ │ └── account_disconnected.txt
│ │ ├── signup.html
│ │ └── snippets
│ │ │ ├── login_extra.html
│ │ │ └── provider_list.html
│ └── trade
│ │ ├── base.html
│ │ ├── coins.html
│ │ ├── home.html
│ │ ├── transactions.html
│ │ ├── user_summaries.html
│ │ └── wallet_info.html
├── templatetags
│ ├── __init__.py
│ ├── coin_full_name.py
│ ├── coins.py
│ ├── summary_balance.py
│ ├── transactions.py
│ ├── value_to_cryptotoken.py
│ └── wallet_information.py
├── tests.py
└── views.py
├── tradeBOT
├── __init__.py
├── admin.py
├── apps.py
├── consumers.py
├── migrations
│ ├── 0001_initial.py
│ └── __init__.py
├── models.py
├── tasks.py
├── templates
│ └── tradeBOT
│ │ ├── Coins.html
│ │ ├── coin_info.html
│ │ ├── exchange_primary_coins.html
│ │ ├── get_primary_pairs.html
│ │ ├── index.html
│ │ ├── orders.html
│ │ ├── pairs.html
│ │ ├── primary_coin_pairs.html
│ │ ├── relations.html
│ │ ├── setup.html
│ │ ├── test.html
│ │ ├── to_trade.html
│ │ └── user_primary.html
├── templatetags
│ ├── __init__.py
│ ├── get_coin_info.py
│ ├── get_exchange_coins.py
│ ├── relations.py
│ └── tradeBot_filters.py
├── tests.py
└── views.py
└── user_profile
├── __init__.py
├── admin.py
├── apps.py
├── migrations
└── __init__.py
├── models.py
├── templates
└── user_profile
│ └── profile.html
├── tests.py
└── views.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Linux template
3 | *~
4 |
5 | # temporary files which can be created if a process still has a handle open of a deleted file
6 | .fuse_hidden*
7 |
8 | # KDE directory preferences
9 | .directory
10 |
11 | # Linux trash folder which might appear on any partition or disk
12 | .Trash-*
13 |
14 | # .nfs files are created when an open file is removed but is still being accessed
15 | .nfs*
16 | ### Python template
17 | # Byte-compiled / optimized / DLL files
18 | __pycache__/
19 | *.py[cod]
20 | *$py.class
21 |
22 | # C extensions
23 | *.so
24 |
25 | # Distribution / packaging
26 | .Python
27 | build/
28 | develop-eggs/
29 | dist/
30 | downloads/
31 | eggs/
32 | .eggs/
33 | lib/
34 | lib64/
35 | parts/
36 | sdist/
37 | var/
38 | wheels/
39 | *.egg-info/
40 | .installed.cfg
41 | *.egg
42 | MANIFEST
43 |
44 | # PyInstaller
45 | # Usually these files are written by a python script from a template
46 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
47 | *.manifest
48 | *.spec
49 |
50 | # Installer logs
51 | pip-log.txt
52 | pip-delete-this-directory.txt
53 |
54 | # Unit test / coverage reports
55 | htmlcov/
56 | .tox/
57 | .coverage
58 | .coverage.*
59 | .cache
60 | nosetests.xml
61 | coverage.xml
62 | *.cover
63 | .hypothesis/
64 |
65 | # Translations
66 | *.mo
67 | *.pot
68 |
69 | # Django stuff:
70 | *.log
71 | .static_storage/
72 | .media/
73 | local_settings.py
74 |
75 | # Flask stuff:
76 | instance/
77 | .webassets-cache
78 |
79 | # Scrapy stuff:
80 | .scrapy
81 |
82 | # Sphinx documentation
83 | docs/_build/
84 |
85 | # PyBuilder
86 | target/
87 |
88 | # Jupyter Notebook
89 | .ipynb_checkpoints
90 |
91 | # pyenv
92 | .python-version
93 |
94 | # celery beat schedule file
95 | celerybeat-schedule
96 |
97 | # SageMath parsed files
98 | *.sage.py
99 |
100 | # Environments
101 | .env
102 | .venv
103 | env/
104 | venv/
105 | ENV/
106 | env.bak/
107 | venv.bak/
108 |
109 | # Spyder project settings
110 | .spyderproject
111 | .spyproject
112 |
113 | # Rope project settings
114 | .ropeproject
115 |
116 | # mkdocs documentation
117 | /site
118 |
119 | # mypy
120 | .mypy_cache/
121 | ### JetBrains template
122 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
123 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
124 |
125 | # User-specific stuff:
126 | .idea/**/workspace.xml
127 | .idea/**/tasks.xml
128 | .idea/dictionaries
129 |
130 | # Sensitive or high-churn files:
131 | .idea/**/dataSources/
132 | .idea/**/dataSources.ids
133 | .idea/**/dataSources.xml
134 | .idea/**/dataSources.local.xml
135 | .idea/**/sqlDataSources.xml
136 | .idea/**/dynamic.xml
137 | .idea/**/uiDesigner.xml
138 |
139 | # Gradle:
140 | .idea/**/gradle.xml
141 | .idea/**/libraries
142 |
143 | # CMake
144 | cmake-build-debug/
145 |
146 | # Mongo Explorer plugin:
147 | .idea/**/mongoSettings.xml
148 |
149 | ## File-based project format:
150 | *.iws
151 |
152 | ## Plugin-specific files:
153 |
154 | # IntelliJ
155 | out/
156 |
157 | # mpeltonen/sbt-idea plugin
158 | .idea_modules/
159 |
160 | # JIRA plugin
161 | atlassian-ide-plugin.xml
162 |
163 | # Cursive Clojure plugin
164 | .idea/replstate.xml
165 |
166 | # Crashlytics plugin (for Android Studio and IntelliJ)
167 | com_crashlytics_export_strings.xml
168 | crashlytics.properties
169 | crashlytics-build.properties
170 | fabric.properties
171 |
172 | .idea/
173 | /logs/
174 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 OnGrid Systems
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://ongrid.pro/)
2 |
3 | 
4 | 
5 | 
6 |
7 |
8 | # CATEd - Cryptocurrency Analytics and Trading Engine for Django
9 |
10 | ## Overview
11 |
12 | [HabraHabr article in Russian](https://habrahabr.ru/users/proofx/posts/)
13 |
14 | CATEd is the cryptocurrency trading bot written on Python 3 with feature-rich management Web interface (Django, Celery).
15 |
16 | Main features:
17 | * View the status of exchange accounts, transactions and orders on them;
18 | * View the status of cold wallets and transactions details;
19 | * History of deposits and withdrawals on graphical diagram;
20 | * Configurable buy/sell/hold logic, (allowed tokens and proportions);
21 | * Keeping the balances of different tokens at the configured levels;
22 |
23 | 
24 |
25 | 
26 |
27 | ## Install
28 |
29 | You need python3, mysql-server, rabbitmq-server and redis-server to be installed.
30 |
31 | Create python virtual env and activate it in your favorite way.
32 |
33 | Clone project
34 | ```sh
35 | git clone git@github.com:OnGridSystems/CATEd.git
36 | ```
37 | Go to project dir
38 | ```sh
39 | cd CATEd
40 | ```
41 | Create mysql databases
42 | ```sh
43 | echo "create database trade character set utf8; create database celery_result; create database portal_ticker;" | mysql -u root
44 | ```
45 | And migrate
46 | ```sh
47 | python manage.py migrate
48 | ```
49 | Load initial data with some exchanges and wallets
50 | ```sh
51 | python manage.py loaddata dump.json
52 | ```
53 |
54 | Create you own superuser with
55 | ```sh
56 | python manage.py createsuperuser
57 | ```
58 | Before starting the bot should read the list of currencies from the site coinmarketcup.com. To do this run following code
59 | with activated virtual environment.
60 | ```sh
61 | read -d "" PYTASKS <<"EOF"
62 | from tradeBOT import tasks
63 | coinmarketcup = tasks.pull_coinmarketcup()
64 | EOF
65 | echo "$PYTASKS" | python manage.py shell
66 | ```
67 | And runserver
68 | ```sh
69 | python manage.py runserver
70 | ```
71 | Now you can add your api keys.
72 |
73 | **Add NEW api keys for use bot.**
74 |
75 | To do this open http://127.0.0.1:8000/ in your browser, login and click red "plus" button in the lower right corner.
76 |
77 | Bot uses several celery queues for trade, and main is triggered by a signal from a first worker named celery@worker_high.
78 | Another worker - worker_set_orders checks for already existing orders and try keeps them up to date.
79 | There are also queues low and normal, for calculating users' orders and pulling their balances.
80 |
81 | You can run celery in several terminal windows or screen sessions:
82 | ```sh
83 | celery worker -A djangoTrade -n worker_high -l info -c 1 -Q high
84 | celery worker -A djangoTrade -n worker_set_orders -l info -c 1 -Q set_orders
85 | celery worker -A djangoTrade -n worker_low -l info -c 2 -Q low
86 | celery worker -A djangoTrade -n worker_normal -l info -c 2 -Q normal
87 | ```
88 |
89 | Example of running celery with supervisor daemon:
90 |
91 | ```sh
92 | wget https://raw.githubusercontent.com/celery/celery/4.0/extra/generic-init.d/celeryd -O /etc/init.d/celeryd
93 | wget https://raw.githubusercontent.com/celery/celery/4.0/extra/generic-init.d/celerybeat -O /etc/init.d/celerybeat
94 | chmod +x /etc/init.d/celeryd /etc/init.d/celerybeat
95 |
96 | #add celery config
97 | read -d "" CELERYD_CFG <<"EOF"
98 | CELERYD_NODES="worker_set_orders worker_low worker_normal worker_high"
99 | CELERY_BIN="/opt/env/bin/python -m celery"
100 | CELERY_APP="djangoTrade"
101 | CELERYD_CHDIR="/opt/ongrid_portal"
102 | CELERYD_OPTS="-Q:worker_set_orders set_orders -Q:worker_low low -Q:worker_normal normal -Q:worker_high high -c:worker_set_orders 1 -c:worker_low 3 -c:worker_normal 3 -c:worker_high 1"
103 | CELERYD_LOG_FILE="/var/log/celery/%n%I.log"
104 | CELERYD_PID_FILE="/var/run/celery/%n.pid"
105 | CELERYD_USER="root"
106 | CELERYD_GROUP="root"
107 | DJANGO_SETTINGS_MODULE="djangoTrade.settings"
108 | CELERY_CREATE_DIRS=1
109 | SECRET_KEY="ada#qadaa2d#1232%!^*(&@(!&Y!*T!@(^F#!@F!@F!(@"
110 | EOF
111 | echo "$CELERYD_CFG" > /etc/default/celeryd
112 |
113 | read -d "" CELERYBEAT_CFG <<"EOF"
114 | CELERY_BIN="/opt/env/bin/python -m celery"
115 | CELERY_APP="djangoTrade"
116 | CELERYD_CHDIR="/opt/ongrid_portal"
117 | DJANGO_SETTINGS_MODULE="djangoTrade.settings"
118 | CELERYBEAT_USER="root"
119 | CELERYBEAT_GROUP="root"
120 | EOF
121 | echo "$CELERYBEAT_CFG" > /etc/default/celerybeat
122 |
123 | /etc/init.d/celeryd create-paths
124 | /etc/init.d/celeryd start
125 | /etc/init.d/celeryd stop
126 | /etc/init.d/celerybeat create-paths
127 | /etc/init.d/celerybeat start
128 | /etc/init.d/celerybeat stop
129 | sudo update-rc.d celeryd defaults
130 | sudo update-rc.d celerybeat defaults
131 | ```
132 |
133 | ## Authors
134 | * OnGrid Systems: [Site](https://ongrid.pro), [GitHub](https://github.com/OnGridSystems/), [FaceBook](https://www.facebook.com/ongrid.pro/), [Youtube](https://www.youtube.com/channel/UCT8s-f1FInO6ivn_dp-W34g), [LinkedIn](https://www.linkedin.com/company/ongridpro/)
135 | * Sergey Korotko [FaceBook](https://www.facebook.com/s.korotko), [GitHub](https://github.com/achievement008)
136 | * Dmitry Suldin [FaceBook](https://www.facebook.com/novator.klin), [GitHub](https://github.com/Klyaus)
137 | * Kirill Varlamov: [GitHub](https://github.com/ongrid/), [FaceBook](https://www.facebook.com/kirill.varlamov.12), [LinkedIn](https://www.linkedin.com/in/kvarlamo/)
138 |
139 | ## License
140 |
141 | Copyright (c) 2018 OnGrid Systems.
142 |
143 | Each file included in this repository is licensed under the [MIT license](LICENSE).
--------------------------------------------------------------------------------
/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/__init__.py
--------------------------------------------------------------------------------
/account/templates/account/login.html:
--------------------------------------------------------------------------------
1 | {% extends 'trade/base.html' %}
2 | {% block content %}
3 |
21 | {% endblock %}
--------------------------------------------------------------------------------
/account/templates/account/profile.html:
--------------------------------------------------------------------------------
1 | {% extends 'trade/base.html' %}
2 | {% block content %}
3 | Мой профиль
4 |
5 |
6 |
7 |
Complete your user profile to increase your limits.
8 |
9 |
37 | {{ form.as_p }}
38 |
39 |
40 |
41 |
42 | {% endblock %}
--------------------------------------------------------------------------------
/account/templates/account/register.html:
--------------------------------------------------------------------------------
1 | {% extends 'trade/base.html' %}
2 | {% block content %}
3 |
26 | {% endblock %}
--------------------------------------------------------------------------------
/djangoTrade/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | from .celery import app as celery_app
--------------------------------------------------------------------------------
/djangoTrade/celery.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, unicode_literals
2 | import os
3 | from celery import Celery
4 | from django.conf import settings
5 | from kombu import Queue, Exchange
6 |
7 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoTrade.settings')
8 | app = Celery('djangoTrade')
9 | app.config_from_object('django.conf:settings')
10 | app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
11 | app.conf.task_queues = {
12 | Queue('high', Exchange('high'), routing_key='high'),
13 | Queue('normal', Exchange('normal'), routing_key='normal'),
14 | Queue('low', Exchange('low'), routing_key='low'),
15 | Queue('set_orders', Exchange('set_orders'), routing_key='set_orders'),
16 | }
17 | app.conf.task_default_queue = 'normal'
18 | app.conf.task_default_exchange_type = 'direct'
19 | app.conf.task_default_routing_key = 'normal'
20 |
21 |
22 | @app.task(bind=True)
23 | def debug_task(self):
24 | print('Request: {0!r}'.format(self.request))
25 |
--------------------------------------------------------------------------------
/djangoTrade/routing.py:
--------------------------------------------------------------------------------
1 | from channels.routing import route
2 | from tradeBOT.consumers import ws_add, ws_disconnect
3 |
4 | channel_routing = [
5 | route("websocket.connect", ws_add, path=r'^/trade/'),
6 | route("websocket.disconnect", ws_disconnect),
7 | ]
8 |
--------------------------------------------------------------------------------
/djangoTrade/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for djangoTrade project.
3 |
4 | Generated by 'django-admin startproject' using Django 1.11.1.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/1.11/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/1.11/ref/settings/
11 | """
12 | from __future__ import absolute_import, unicode_literals
13 | import os
14 |
15 | # Celery options
16 | from kombu import Queue, Exchange
17 |
18 | CELERY_BROKER_URL = 'amqp://guest:guest@localhost//'
19 | CELERY_ACCEPT_CONTENT = ['json']
20 | CELERY_RESULT_BACKEND = 'db+mysql://root:@localhost/celery_result'
21 | CELERY_TASK_SERIALIZER = 'json'
22 | CELERY_TIMEZONE = 'Europe/Moscow'
23 | CELERY_SEND_TASK_ERROR_EMAILS = False
24 | CELERYD_MAX_TASKS_PER_CHILD = 5
25 |
26 | CELERY_ROUTES = {
27 | 'trade.tasks.pull_exchanges_balances': {'queue': 'low'},
28 | 'trade.tasks.pull_exchanges_tickers': {'queue': 'low'},
29 | }
30 |
31 | CELERY_CREATE_MISSING_QUEUES = True
32 |
33 | # AllAuth setting
34 | ACCOUNT_EMAIL_REQUIRED = True
35 | ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
36 | ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 1
37 | LOGIN_REDIRECT_URL = '/'
38 | ACCOUNT_LOGOUT_REDIRECT_URL = '/'
39 | ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
40 |
41 | # redis sessions
42 | SESSION_ENGINE = 'redis_sessions.session'
43 |
44 | # Email
45 | EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
46 |
47 | DEFAULT_INDEX_TABLESPACE = 10
48 |
49 | ADMINS = (('Сергей', 'achievement008@gmail.com'),)
50 |
51 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
52 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
53 |
54 | # Quick-start development settings - unsuitable for production
55 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
56 |
57 | # SECURITY WARNING: keep the secret key used in production secret!
58 | SECRET_KEY = '1j&=q!62_%51y9!=97n=)bel8+#y+lup1bsy31d%s=sm!9q_c+'
59 |
60 | # SECURITY WARNING: don't run with debug turned on in production!
61 | DEBUG = True
62 |
63 | ALLOWED_HOSTS = ['*']
64 |
65 | # Application definition
66 |
67 | INSTALLED_APPS = [
68 | 'django.contrib.admin',
69 | 'django.contrib.auth',
70 | 'django.contrib.contenttypes',
71 | 'django.contrib.sessions',
72 | 'django.contrib.messages',
73 | 'django.contrib.staticfiles',
74 | 'django.contrib.sites',
75 | 'trade',
76 | 'tradeBOT',
77 | 'user_profile',
78 | 'django_celery_beat',
79 | 'allauth',
80 | 'allauth.account',
81 | 'allauth.socialaccount',
82 | 'django.contrib.humanize',
83 | 'ticker_app',
84 | 'django_extensions',
85 | 'channels',
86 | ]
87 |
88 | SITE_ID = 1
89 |
90 | MIDDLEWARE = [
91 | 'django.middleware.security.SecurityMiddleware',
92 | 'django.contrib.sessions.middleware.SessionMiddleware',
93 | 'django.middleware.common.CommonMiddleware',
94 | 'django.middleware.csrf.CsrfViewMiddleware',
95 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
96 | 'django.contrib.messages.middleware.MessageMiddleware',
97 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
98 | ]
99 |
100 | AUTHENTICATION_BACKENDS = (
101 | 'django.contrib.auth.backends.ModelBackend',
102 | 'allauth.account.auth_backends.AuthenticationBackend',
103 | )
104 |
105 | ROOT_URLCONF = 'djangoTrade.urls'
106 |
107 | TEMPLATES = [
108 | {
109 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
110 | 'DIRS': [],
111 | 'APP_DIRS': True,
112 | 'OPTIONS': {
113 | 'context_processors': [
114 | 'django.template.context_processors.debug',
115 | 'django.template.context_processors.request',
116 | 'django.contrib.auth.context_processors.auth',
117 | 'django.contrib.messages.context_processors.messages',
118 | ],
119 | },
120 | },
121 | ]
122 |
123 | WSGI_APPLICATION = 'djangoTrade.wsgi.application'
124 |
125 | # Database
126 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
127 |
128 | DATABASES = {
129 | 'default': {
130 | 'ENGINE': 'django.db.backends.mysql',
131 | 'NAME': 'trade',
132 | 'USER': 'root',
133 | 'PASSWORD': '',
134 | 'default-character-set': 'utf-8',
135 | },
136 | 'portal_ticker': {
137 | 'ENGINE': 'django.db.backends.mysql',
138 | 'NAME': 'portal_ticker',
139 | 'USER': 'root',
140 | 'PASSWORD': '',
141 | }
142 | }
143 |
144 | DATABASE_ROUTERS = ['ticker_app.routers.DBRouter', 'ticker_app.routers.PrimaryRouter']
145 |
146 | # Password validation
147 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
148 |
149 | AUTH_PASSWORD_VALIDATORS = [
150 | {
151 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
152 | },
153 | {
154 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
155 | },
156 | {
157 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
158 | },
159 | {
160 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
161 | },
162 | ]
163 |
164 | # Internationalization
165 | # https://docs.djangoproject.com/en/1.11/topics/i18n/
166 |
167 | LANGUAGE_CODE = 'en-US'
168 |
169 | TIME_ZONE = 'Europe/Moscow'
170 |
171 | USE_I18N = True
172 |
173 | USE_L10N = True
174 |
175 | USE_TZ = True
176 |
177 | STATIC_URL = '/static/'
178 |
179 | LOGIN_URL = '/accounts/login/'
180 |
181 | # yandex money settings
182 | YANDEX_MONEY_CLIENT_ID = None # set before start
183 |
184 | YANDEX_MONEY_REDIRECT_URI = None # set before start
185 |
186 | YANDEX_MONEY_CLIENT_SECRET = None # set before start
187 |
188 | STATIC_ROOT = '/opt/portal_ongrid/static'
189 | MEDIA_ROOT = '/opt/portal_ongrid/media'
190 | MEDIA_URL = '/media/'
191 |
192 | # channels
193 | CHANNEL_LAYERS = {
194 | "default": {
195 | "BACKEND": "asgi_redis.RedisChannelLayer",
196 | "CONFIG": {
197 | "hosts": [("localhost", 6379)],
198 | },
199 | "ROUTING": "djangoTrade.routing.channel_routing",
200 | },
201 | }
202 |
203 | # минимальное значение изменения цены за секунду
204 | DEPTH_COEFFICIENT = 0.5
205 |
206 | # активные биржи для торговли
207 | TRADING_EXCHANGES = ['poloniex']
208 |
209 | # Time to life order, mins
210 | ORDER_TTL = 5
211 |
212 | # минимальное кол-во элементов серии
213 | RATE_CHANGE_SERIES_MIN_COUNT = 2
214 |
215 | # количество направлений
216 | DIRECTIONS_COUNT = 7
217 |
218 | # количество однонапрвленных (первых) направлений
219 | UNIDIRECTIONAL_COUNT = 4
220 |
--------------------------------------------------------------------------------
/djangoTrade/urls.py:
--------------------------------------------------------------------------------
1 | """djangoTrade URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/1.11/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.conf.urls import url, include
14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
15 | """
16 | from django.conf import settings
17 | from django.conf.urls import url, include
18 | from django.conf.urls.static import static
19 | from django.contrib import admin
20 | from trade import views as tradeViews
21 | from tradeBOT import views as tradeBOTViews
22 | from ticker_app import views as tickerViews
23 | from allauth import urls as allauth_urls
24 | from user_profile import views as user_profile_views
25 | from django.contrib.auth.decorators import permission_required
26 |
27 | urlpatterns = [
28 | url(r'^admin/', admin.site.urls),
29 | url(r'^accounts/', include(allauth_urls)),
30 | url(r'^profile/$', user_profile_views.profile, name='user_profile'),
31 | url(r'^change_status/$', permission_required('is_superuser')(tradeViews.change_status),
32 | name='change_status'),
33 | url(r'^$', tradeViews.index, name='index'),
34 | url(r'^exchange/$', permission_required('is_superuser')(tradeViews.exchange), name='exchange'),
35 | url(r'^wallet/$', permission_required('is_superuser')(tradeViews.wallet), name='wallet'),
36 | url(r'^api/$', tradeViews.get_holding, name='get_holding'),
37 | url(r'^transaction/new_comment/$',
38 | permission_required('is_superuser')(tradeViews.add_new_transaction_comment), name='new_comment'),
39 | url(r'^trade/setup/(?P[0-9]+)/$', tradeBOTViews.setup, name='tradeBotSetup'),
40 | url(r'^trade/addusercoin/$', tradeBOTViews.add_user_pair, name='add_user_pair'),
41 | url(r'^trade/changerank/$', tradeBOTViews.change_rank, name='changerank'),
42 | url(r'^trade/set_share/$', tradeBOTViews.set_share, name='set_share'),
43 | url(r'^trade/set_pair_add/$', tradeBOTViews.set_pair_add, name='set_pair_add'),
44 | url(r'^trade/delete_user_pair/$', tradeBOTViews.delete_user_pair, name='delete_user_pair'),
45 | url(r'^trade/change_primary_coin/$', tradeBOTViews.change_primary_coin, name='change_primary_coin'),
46 | url(r'^trade/change_primary_coin_rank/$', tradeBOTViews.change_primary_coin_rank,
47 | name='change_primary_coin_rank'),
48 | url(r'^trade/relations/$', tradeBOTViews.relations, name='relations'),
49 | url(r'^trade/exchange_script_activity/$', tradeBOTViews.change_user_exchange_script_activity,
50 | name='change_user_exchange_script_activity'),
51 | url(r'^trade/exchange_depth_to_trade/$', tradeBOTViews.exchange_depth_to_trade,
52 | name='exchange_depth_to_trade'),
53 | url(r'^trade/get_ticker/$', tickerViews.get_ticker, name='get_ticker'),
54 | url(r'^trade/get_new_orders_to_trade/$', tradeBOTViews.get_new_to_trade, name='get_new_to_trade'),
55 | ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
56 |
--------------------------------------------------------------------------------
/djangoTrade/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for djangoTrade project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoTrade.settings")
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/dump.json:
--------------------------------------------------------------------------------
1 | [{"model": "trade.exchanges", "pk": 1, "fields": {"name": "poloniex", "info_frozen_key": "-isFrozen"}}, {"model": "trade.wallets", "pk": 1, "fields": {"name": "BTC"}}, {"model": "trade.wallets", "pk": 2, "fields": {"name": "ETH"}}, {"model": "trade.wallets", "pk": 3, "fields": {"name": "Yandex Money"}}]
--------------------------------------------------------------------------------
/images/candelsticks.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/images/candelsticks.jpg
--------------------------------------------------------------------------------
/images/final_screen.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/images/final_screen.jpg
--------------------------------------------------------------------------------
/images/home_page.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/images/home_page.jpg
--------------------------------------------------------------------------------
/images/ongrid-systems-cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/images/ongrid-systems-cover.png
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 |
4 | if __name__ == "__main__":
5 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoTrade.settings")
6 | try:
7 | from django.core.management import execute_from_command_line
8 | except ImportError:
9 | # The above import may fail for some other reason. Ensure that the
10 | # issue is really that Django is missing to avoid masking other
11 | # exceptions on Python 2.
12 | try:
13 | import django
14 | except ImportError:
15 | raise ImportError(
16 | "Couldn't import Django. Are you sure it's installed and "
17 | "available on your PYTHONPATH environment variable? Did you "
18 | "forget to activate a virtual environment?"
19 | )
20 | raise
21 | execute_from_command_line(sys.argv)
22 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | aiodns==1.1.1
2 | aiohttp==2.2.5
3 | amqp==2.2.2
4 | anyjson==0.3.3
5 | asgi-redis==1.4.2
6 | asgiref==1.1.2
7 | asn1crypto==0.22.0
8 | async-timeout==1.4.0
9 | attrs==17.2.0
10 | autobahn==17.7.1
11 | Automat==0.6.0
12 | Babel==2.4.0
13 | bcrypt==3.1.3
14 | billiard==3.5.0.3
15 | bittrex==0.1.4
16 | cchardet==2.1.1
17 | ccxt==1.8.49
18 | celery==4.1.0
19 | certifi==2017.4.17
20 | cffi==1.10.0
21 | channels==1.1.6
22 | chardet==3.0.4
23 | constantly==15.1.0
24 | coverage==4.4.1
25 | cryptography==1.9
26 | daemon==1.1
27 | daphne==1.3.0
28 | defusedxml==0.5.0
29 | Django==1.11.5
30 | django-allauth==0.32.0
31 | django-celery==3.2.1
32 | django-celery-beat==1.0.1
33 | django-extensions==2.0.6
34 | django-redis-sessions==0.5.6
35 | flower==0.9.1
36 | future==0.16.0
37 | gevent==1.2.2
38 | greenlet==0.4.12
39 | gunicorn==19.7.1
40 | hyperlink==17.3.0
41 | idna==2.5
42 | incremental==17.5.0
43 | jsonpickle==0.9.5
44 | kombu==4.1.0
45 | msgpack-python==0.4.8
46 | multidict==3.2.0
47 | mysqlclient==1.3.10
48 | oauthlib==2.0.2
49 | paramiko==2.2.1
50 | poloniex==0.0.7
51 | pyasn1==0.2.3
52 | pyasn1-modules==0.0.9
53 | pycares==2.3.0
54 | pycparser==2.17
55 | PyNaCl==1.1.2
56 | pyOpenSSL==17.0.0
57 | pyTelegramBotAPI==3.2.0
58 | python3-openid==3.1.0
59 | pytz==2018.4
60 | redis==2.10.5
61 | requests==2.18.4
62 | requests-oauthlib==0.8.0
63 | service-identity==17.0.0
64 | signalr-client==0.0.7
65 | six==1.10.0
66 | slackclient==1.0.9
67 | SQLAlchemy==1.2.6
68 | sseclient==0.0.18
69 | TelegramBotAPI==0.3.2
70 | tornado==4.2
71 | Twisted==17.5.0
72 | txaio==2.8.1
73 | urllib3==1.21.1
74 | vine==1.1.4
75 | websocket==0.2.1
76 | websocket-client==0.44.0
77 | websockets==3.3
78 | yandex-money-sdk==0.1.3
79 | yarl==0.12.0
80 | zope.interface==4.4.2
81 | pip==10.0.0
82 |
--------------------------------------------------------------------------------
/templates/404.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 | You've ripped a hole in the fabric of the internet. Love, Chris from CSS-Tricks
7 |
8 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/ticker_app/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/ticker_app/__init__.py
--------------------------------------------------------------------------------
/ticker_app/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from ticker_app import models
3 |
4 |
5 | class ExchangeTickerAdmin(admin.ModelAdmin):
6 | list_display = [field.name for field in models.ExchangeTicker._meta.fields]
7 |
8 | class Meta:
9 | model = models.ExchangeTicker
10 |
11 | admin.site.register(models.ExchangeTicker, ExchangeTickerAdmin)
12 |
--------------------------------------------------------------------------------
/ticker_app/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class TickerAppConfig(AppConfig):
5 | name = 'ticker_app'
6 |
--------------------------------------------------------------------------------
/ticker_app/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.11.5 on 2017-09-29 08:29
3 | from __future__ import unicode_literals
4 |
5 | from django.db import migrations, models
6 |
7 |
8 | class Migration(migrations.Migration):
9 |
10 | initial = True
11 |
12 | dependencies = [
13 | ]
14 |
15 | operations = [
16 | migrations.CreateModel(
17 | name='ExchangeTicker',
18 | fields=[
19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20 | ('exchange_id', models.IntegerField()),
21 | ('pair_id', models.IntegerField()),
22 | ('high', models.DecimalField(decimal_places=15, max_digits=30)),
23 | ('last', models.DecimalField(decimal_places=15, max_digits=30)),
24 | ('low', models.DecimalField(decimal_places=15, max_digits=30)),
25 | ('bid', models.DecimalField(decimal_places=15, max_digits=30)),
26 | ('ask', models.DecimalField(decimal_places=15, max_digits=30)),
27 | ('base_volume', models.DecimalField(blank=True, decimal_places=15, max_digits=30, null=True)),
28 | ('percent_change', models.DecimalField(decimal_places=8, default=0, max_digits=10)),
29 | ('date_time', models.DateTimeField()),
30 | ],
31 | options={
32 | 'verbose_name': 'Данные тикера',
33 | 'verbose_name_plural': 'Данные тикеров',
34 | },
35 | ),
36 | ]
37 |
--------------------------------------------------------------------------------
/ticker_app/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/ticker_app/migrations/__init__.py
--------------------------------------------------------------------------------
/ticker_app/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from trade import models as trade_models
3 |
4 |
5 | # Create your models here.
6 | class ExchangeTicker(models.Model):
7 | exchange_id = models.IntegerField()
8 | pair_id = models.IntegerField()
9 | high = models.DecimalField(max_digits=30, decimal_places=15)
10 | last = models.DecimalField(max_digits=30, decimal_places=15)
11 | low = models.DecimalField(max_digits=30, decimal_places=15)
12 | bid = models.DecimalField(max_digits=30, decimal_places=15)
13 | ask = models.DecimalField(max_digits=30, decimal_places=15)
14 | base_volume = models.DecimalField(max_digits=30, decimal_places=15, null=True, blank=True)
15 | percent_change = models.DecimalField(max_digits=10, decimal_places=8, default=0)
16 | date_time = models.DateTimeField(blank=False, null=False)
17 |
18 | def __str__(self):
19 | # return trade_models.Exchanges.objects.get(pk=self.exchange_id).name + ': ' + self.pair.main_coin.symbol.upper() + '-' + self.pair.second_coin.symbol.upper()
20 | return '{}: {}'.format(self.exchange_id, self.pair_id)
21 |
22 | class Meta:
23 | verbose_name = 'Данные тикера'
24 | verbose_name_plural = 'Данные тикеров'
25 |
--------------------------------------------------------------------------------
/ticker_app/routers.py:
--------------------------------------------------------------------------------
1 | class DBRouter:
2 | def db_for_read(self, model, **hints):
3 | if model._meta.app_label == 'ticker_app':
4 | return 'portal_ticker'
5 | return None
6 |
7 | def db_for_write(self, model, **hints):
8 | if model._meta.app_label == 'ticker_app':
9 | return 'portal_ticker'
10 | return None
11 |
12 | def allow_relation(self, obj1, obj2, **hints):
13 | if obj1._meta.app_label == 'ticker_app' and obj2._meta.app_label == 'ticker_app':
14 | return True
15 | elif 'ticker_app' not in [obj1._meta.app_label, obj2._meta.app_label]:
16 | return None
17 | return False
18 |
19 | def allow_migrate(self, db, app_label, model_name=None, **hints):
20 | if app_label == 'ticker_app':
21 | return db == 'portal_ticker'
22 | elif db == 'portal_ticker':
23 | return False
24 | return None
25 |
26 |
27 | class PrimaryRouter:
28 | def db_for_read(self, model, **hints):
29 | return 'default'
30 |
31 | def db_for_write(self, model, **hints):
32 | return 'default'
33 |
34 | def allow_relation(self, obj1, obj2, **hints):
35 | db_list = ('default',)
36 | if obj1._state.db in db_list and obj2._state.db in db_list:
37 | return True
38 | return None
39 |
40 | def allow_migrate(self, db, app_label, model_name=None, **hints):
41 | return True
42 |
--------------------------------------------------------------------------------
/ticker_app/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/ticker_app/views.py:
--------------------------------------------------------------------------------
1 | from django.conf import settings
2 | from django.core.serializers.json import DjangoJSONEncoder
3 | from django.http import HttpResponse
4 | from .models import ExchangeTicker
5 | from django.utils import timezone
6 | import datetime
7 | from tradeBOT.models import Extremum
8 | import json
9 |
10 |
11 | def get_ticker(request):
12 | if request.is_ajax():
13 | pair_id = request.POST.get('pair_id')
14 | intervale = int(request.POST.get('intervale'))
15 | zoom = request.POST.get('zoom')
16 | chart_data = {}
17 | ticker_list = []
18 | extremums_list = []
19 | intervales = []
20 | if zoom == 'all':
21 | ticker = list(ExchangeTicker.objects.values('date_time', 'last').filter(pair_id=pair_id))
22 | else:
23 | ticker = list(ExchangeTicker.objects.values('date_time', 'last').filter(pair_id=pair_id,
24 | date_time__gte=timezone.now() - datetime.timedelta(
25 | hours=int(zoom))))
26 | if len(ticker) > 0:
27 | extremums = Extremum.objects.filter(pair_id=pair_id,
28 | date__gte=ticker[0]['date_time'])
29 | for item in extremums:
30 | extremums_list.append([item.date, item.price, item.ext_type])
31 | s_date = ticker[0]['date_time']
32 | while s_date < timezone.now():
33 | intervales.append(s_date)
34 | s_date = s_date + datetime.timedelta(minutes=intervale)
35 | if len(intervales) > 0:
36 | s_date = intervales.pop(0)
37 | # print('От {} до {}'.format(s_date, s_date + datetime.timedelta(minutes=intervale)))
38 | s_chain = [x for x in ticker if
39 | s_date + datetime.timedelta(minutes=intervale) > x['date_time'] >= s_date]
40 | while len(intervales) > 0:
41 | try:
42 | ticker_list.append({'date': s_date,
43 | 'open': s_chain[0]['last'],
44 | 'close': s_chain[-1]['last'],
45 | 'low': min([x['last'] for x in s_chain]),
46 | 'high': max([x['last'] for x in s_chain])})
47 | except IndexError:
48 | pass
49 | s_date = intervales.pop(0)
50 | # print('Новая от {} до {}'.format(s_date, s_date + datetime.timedelta(minutes=intervale)))
51 | s_chain = [x for x in ticker if
52 | s_date + datetime.timedelta(minutes=intervale) > x['date_time'] >= s_date]
53 | # print("Выборка {}".format(s_chain))
54 | chart_data['ticker'] = ticker_list
55 | chart_data['extremums'] = extremums_list
56 | return HttpResponse(json.dumps(chart_data, cls=DjangoJSONEncoder), status=200)
57 |
--------------------------------------------------------------------------------
/trade/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/__init__.py
--------------------------------------------------------------------------------
/trade/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from .models import Exchanges, UserExchange, UserBalance, Coin, Wallets, UserWallet, UserHoldings, Transaction
3 |
4 |
5 | class TransactionAdmin(admin.ModelAdmin):
6 | list_display = ['name', 't_type', 'date', 'type', 'value']
7 |
8 | class Meta:
9 | model = Transaction
10 |
11 |
12 | class UserBalancesAdmin(admin.ModelAdmin):
13 | list_display = [field.name for field in UserBalance._meta.fields]
14 | list_filter = ['ue']
15 |
16 | class Meta:
17 | model = UserBalance
18 |
19 |
20 | admin.site.register(Exchanges)
21 | admin.site.register(UserExchange)
22 | admin.site.register(UserBalance, UserBalancesAdmin)
23 | admin.site.register(Coin)
24 | admin.site.register(Wallets)
25 | admin.site.register(Transaction, TransactionAdmin)
26 | admin.site.register(UserWallet)
27 | admin.site.register(UserHoldings)
28 |
--------------------------------------------------------------------------------
/trade/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class TradeConfig(AppConfig):
5 | name = 'trade'
6 |
--------------------------------------------------------------------------------
/trade/forms.py:
--------------------------------------------------------------------------------
1 | from django.forms import ModelForm
2 | from trade.models import UserExchange, UserWallet
3 | from django.contrib.auth.models import User
4 | from django import forms
5 | from django.forms.extras.widgets import SelectDateWidget
6 |
7 |
8 | class UserWalletForm(ModelForm):
9 | class Meta:
10 | model = UserWallet
11 | fields = ['wallet', 'address']
12 |
13 |
14 | class UserExchangesForm(ModelForm):
15 | class Meta:
16 | model = UserExchange
17 | fields = ['exchange', 'apikey', 'apisecret']
18 |
--------------------------------------------------------------------------------
/trade/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.11.5 on 2017-09-29 08:29
3 | from __future__ import unicode_literals
4 |
5 | from django.conf import settings
6 | from django.db import migrations, models
7 | import django.db.models.deletion
8 |
9 |
10 | class Migration(migrations.Migration):
11 |
12 | initial = True
13 |
14 | dependencies = [
15 | migrations.swappable_dependency(settings.AUTH_USER_MODEL),
16 | ]
17 |
18 | operations = [
19 | migrations.CreateModel(
20 | name='Coin',
21 | fields=[
22 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
23 | ('short_name', models.CharField(max_length=20)),
24 | ('full_name', models.CharField(max_length=40)),
25 | ],
26 | options={
27 | 'verbose_name': 'Криптовалюта',
28 | 'verbose_name_plural': 'Криптовалюты',
29 | },
30 | ),
31 | migrations.CreateModel(
32 | name='Exchanges',
33 | fields=[
34 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
35 | ('name', models.CharField(max_length=255)),
36 | ('info_frozen_key', models.CharField(max_length=31)),
37 | ],
38 | options={
39 | 'verbose_name': 'Биржа',
40 | 'verbose_name_plural': 'Биржи',
41 | },
42 | ),
43 | migrations.CreateModel(
44 | name='Transaction',
45 | fields=[
46 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
47 | ('name', models.CharField(max_length=50)),
48 | ('t_type', models.CharField(max_length=20)),
49 | ('number', models.BigIntegerField()),
50 | ('date', models.DateTimeField()),
51 | ('t_from', models.TextField()),
52 | ('t_to', models.TextField()),
53 | ('type', models.CharField(max_length=10)),
54 | ('value', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
55 | ('block_hash', models.CharField(default=None, max_length=127, null=True)),
56 | ('hash', models.CharField(max_length=127)),
57 | ('comment', models.TextField(default='', null=True)),
58 | ('title', models.CharField(default='', max_length=255, null=True)),
59 | ('details', models.CharField(default='', max_length=255, null=True)),
60 | ('usd_value', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
61 | ('user_comment', models.CharField(blank=True, default=None, max_length=255, null=True)),
62 | ('currency', models.CharField(blank=True, default=None, max_length=10, null=True)),
63 | ],
64 | options={
65 | 'verbose_name': 'Транзакциия',
66 | 'verbose_name_plural': 'Транзакции',
67 | },
68 | ),
69 | migrations.CreateModel(
70 | name='UserBalance',
71 | fields=[
72 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
73 | ('coin', models.CharField(max_length=10)),
74 | ('total', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
75 | ('used', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
76 | ('free', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
77 | ('conversions', models.CharField(max_length=255)),
78 | ('btc_value', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
79 | ('last_update', models.DateTimeField(auto_now=True)),
80 | ],
81 | options={
82 | 'verbose_name': 'Баланс пользователя',
83 | 'verbose_name_plural': 'Балансы пользователей',
84 | },
85 | ),
86 | migrations.CreateModel(
87 | name='UserExchange',
88 | fields=[
89 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
90 | ('apikey', models.CharField(max_length=127)),
91 | ('apisecret', models.CharField(max_length=255)),
92 | ('is_active', models.BooleanField(default=False)),
93 | ('is_active_script', models.BooleanField(default=False)),
94 | ('is_correct', models.BooleanField(default=True)),
95 | ('total_btc', models.DecimalField(decimal_places=8, max_digits=30)),
96 | ('total_usd', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
97 | ('coefficient_of_depth', models.IntegerField(default=0)),
98 | ('error', models.CharField(blank=True, max_length=255)),
99 | ('exchange', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='trade.Exchanges')),
100 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
101 | ],
102 | options={
103 | 'verbose_name': 'Биржа пользователя',
104 | 'verbose_name_plural': 'Биржи пользователей',
105 | },
106 | ),
107 | migrations.CreateModel(
108 | name='UserHoldings',
109 | fields=[
110 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
111 | ('type', models.CharField(max_length=255)),
112 | ('total_btc', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
113 | ('total_usd', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
114 | ('date_time', models.DateTimeField()),
115 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
116 | ],
117 | options={
118 | 'verbose_name': 'История баланса',
119 | 'verbose_name_plural': 'Истории балансов',
120 | },
121 | ),
122 | migrations.CreateModel(
123 | name='UserWallet',
124 | fields=[
125 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
126 | ('address', models.CharField(max_length=511)),
127 | ('access_token', models.CharField(blank=True, default=None, max_length=511, null=True)),
128 | ('balance', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
129 | ('total_btc', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
130 | ('total_usd', models.DecimalField(decimal_places=8, default=0, max_digits=30)),
131 | ('last_update', models.DateTimeField(auto_now=True)),
132 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
133 | ],
134 | options={
135 | 'verbose_name': 'Кошелёк пользователя',
136 | 'verbose_name_plural': 'Кошельки пользователей',
137 | },
138 | ),
139 | migrations.CreateModel(
140 | name='Wallets',
141 | fields=[
142 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
143 | ('name', models.CharField(max_length=255)),
144 | ],
145 | options={
146 | 'verbose_name': 'Кошелёк',
147 | 'verbose_name_plural': 'Кошельки',
148 | },
149 | ),
150 | migrations.AddField(
151 | model_name='userwallet',
152 | name='wallet',
153 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='trade.Wallets'),
154 | ),
155 | migrations.AddField(
156 | model_name='userbalance',
157 | name='ue',
158 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='trade.UserExchange'),
159 | ),
160 | migrations.AlterUniqueTogether(
161 | name='transaction',
162 | unique_together=set([('name', 't_type', 'hash')]),
163 | ),
164 | ]
165 |
--------------------------------------------------------------------------------
/trade/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/migrations/__init__.py
--------------------------------------------------------------------------------
/trade/models.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 | from decimal import Decimal
4 | from django.contrib.auth.models import User
5 | from django.db import models
6 | from pytz import utc
7 | import time
8 |
9 |
10 | class Exchanges(models.Model):
11 | name = models.CharField(max_length=255)
12 | info_frozen_key = models.CharField(max_length=31)
13 |
14 | def __str__(self):
15 | return self.name
16 |
17 | class Meta:
18 | verbose_name = "Биржа"
19 | verbose_name_plural = "Биржи"
20 |
21 |
22 | class UserExchange(models.Model):
23 | user = models.ForeignKey(User)
24 | exchange = models.ForeignKey(Exchanges)
25 | apikey = models.CharField(max_length=127)
26 | apisecret = models.CharField(max_length=255)
27 | is_active = models.BooleanField(default=False)
28 | is_active_script = models.BooleanField(default=False)
29 | is_correct = models.BooleanField(default=True)
30 | total_btc = models.DecimalField(max_digits=30, decimal_places=8)
31 | total_usd = models.DecimalField(max_digits=30, decimal_places=8, default=0)
32 | coefficient_of_depth = models.IntegerField(default=0)
33 | error = models.CharField(max_length=255, blank=True)
34 |
35 | def __str__(self):
36 | return self.user.username + ': ' + self.exchange.name + ' (' + str(self.pk) + ')'
37 |
38 | class Meta:
39 | verbose_name = "Биржа пользователя"
40 | verbose_name_plural = "Биржи пользователей"
41 |
42 |
43 | class UserBalance(models.Model):
44 | ue = models.ForeignKey(UserExchange)
45 | coin = models.CharField(max_length=10)
46 | total = models.DecimalField(max_digits=30, decimal_places=8, default=0)
47 | used = models.DecimalField(max_digits=30, decimal_places=8, default=0)
48 | free = models.DecimalField(max_digits=30, decimal_places=8, default=0)
49 | conversions = models.CharField(max_length=255)
50 | btc_value = models.DecimalField(max_digits=30, decimal_places=8, default=0)
51 | last_update = models.DateTimeField(auto_now=True)
52 |
53 | def __str__(self):
54 | return self.ue.exchange.name + ' ' + self.ue.user.username + ' ' + self.coin + ': ' + str(self.total)
55 |
56 | class Meta:
57 | verbose_name = "Баланс пользователя"
58 | verbose_name_plural = "Балансы пользователей"
59 |
60 |
61 | class Coin(models.Model):
62 | short_name = models.CharField(max_length=20)
63 | full_name = models.CharField(max_length=40)
64 |
65 | def __str__(self):
66 | return self.short_name + '-' + self.full_name
67 |
68 | class Meta:
69 | verbose_name = 'Криптовалюта'
70 | verbose_name_plural = 'Криптовалюты'
71 |
72 |
73 | class Wallets(models.Model):
74 | name = models.CharField(max_length=255)
75 |
76 | def __str__(self):
77 | return self.name
78 |
79 | class Meta:
80 | verbose_name = 'Кошелёк'
81 | verbose_name_plural = "Кошельки"
82 |
83 |
84 | class UserWallet(models.Model):
85 | user = models.ForeignKey(User)
86 | wallet = models.ForeignKey(Wallets)
87 | address = models.CharField(max_length=511)
88 | access_token = models.CharField(max_length=511, blank=True, default=None, null=True)
89 | balance = models.DecimalField(max_digits=30, decimal_places=8, default=0)
90 | total_btc = models.DecimalField(max_digits=30, decimal_places=8, default=0)
91 | total_usd = models.DecimalField(max_digits=30, decimal_places=8, default=0)
92 | last_update = models.DateTimeField(auto_now=True)
93 |
94 | def __str__(self):
95 | return '<' + self.user.username + ' ' + self.wallet.name + ': ' + str(self.balance) + '>'
96 |
97 | class Meta:
98 | verbose_name = 'Кошелёк пользователя'
99 | verbose_name_plural = 'Кошельки пользователей'
100 |
101 |
102 | class Transaction(models.Model):
103 | name = models.CharField(max_length=50)
104 | t_type = models.CharField(max_length=20)
105 | number = models.BigIntegerField(blank=False, null=False)
106 | date = models.DateTimeField(blank=False)
107 | t_from = models.TextField()
108 | t_to = models.TextField()
109 | type = models.CharField(max_length=10)
110 | value = models.DecimalField(max_digits=30, decimal_places=8, default=0)
111 | block_hash = models.CharField(max_length=127, default=None, null=True)
112 | hash = models.CharField(max_length=127)
113 | comment = models.TextField(default='', null=True)
114 | title = models.CharField(max_length=255, default='', null=True)
115 | details = models.CharField(max_length=255, default='', null=True)
116 | usd_value = models.DecimalField(max_digits=30, decimal_places=8, default=0)
117 | user_comment = models.CharField(max_length=255, blank=True, default=None, null=True)
118 | currency = models.CharField(max_length=10, blank=True, default=None, null=True)
119 |
120 | def __str__(self):
121 | return '<' + self.name + ' ' + self.type + ' ' + str(self.value) + '>'
122 |
123 | class Meta:
124 | verbose_name = 'Транзакциия'
125 | verbose_name_plural = 'Транзакции'
126 | unique_together = ('name', 't_type', 'hash')
127 |
128 |
129 | class UserHoldings(models.Model):
130 | user = models.ForeignKey(User)
131 | type = models.CharField(max_length=255)
132 | total_btc = models.DecimalField(max_digits=30, decimal_places=8, default=0)
133 | total_usd = models.DecimalField(max_digits=30, decimal_places=8, default=0)
134 | date_time = models.DateTimeField(blank=False)
135 |
136 | def __str__(self):
137 | return '<' + self.user.username + ' - ' + self.type + ': ' + str(self.total_btc) + '>'
138 |
139 | class Meta:
140 | verbose_name_plural = 'Истории балансов'
141 | verbose_name = 'История баланса'
142 |
143 | def as_list(self):
144 | return [
145 | int(time.mktime(self.date_time.timetuple()) * 1000),
146 | float(Decimal(self.total_btc).quantize(Decimal('.00000001')))
147 | ]
148 |
--------------------------------------------------------------------------------
/trade/static/css/images/animated-overlay.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/animated-overlay.gif
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_flat_0_aaaaaa_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_flat_0_aaaaaa_40x100.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_flat_75_ffffff_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_flat_75_ffffff_40x100.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_glass_55_fbf9ee_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_glass_55_fbf9ee_1x400.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_glass_65_ffffff_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_glass_65_ffffff_1x400.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_glass_75_dadada_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_glass_75_dadada_1x400.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_glass_75_e6e6e6_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_glass_75_e6e6e6_1x400.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_glass_95_fef1ec_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_glass_95_fef1ec_1x400.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-icons_222222_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-icons_222222_256x240.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-icons_2e83ff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-icons_2e83ff_256x240.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-icons_454545_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-icons_454545_256x240.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-icons_888888_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-icons_888888_256x240.png
--------------------------------------------------------------------------------
/trade/static/css/images/ui-icons_cd0a0a_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/css/images/ui-icons_cd0a0a_256x240.png
--------------------------------------------------------------------------------
/trade/static/css/jqChart.css:
--------------------------------------------------------------------------------
1 | .ui-jqchart {
2 | position: relative;
3 | }
4 |
5 | .ui-jqchart .ui-jqchart-toolbar {
6 | position: absolute;
7 | margin: 0;
8 | padding: 2px;
9 | list-style-type: none;
10 | white-space: nowrap;
11 | }
12 |
13 | .ui-jqchart .ui-jqchart-toolbar li {
14 | display: inline-block;
15 | vertical-align: top;
16 | margin: 0 2px;
17 | padding: 2px 0;
18 | cursor: pointer;
19 | }
20 |
21 | .ui-jqchart .ui-jqchart-toolbar span.ui-icon {
22 | float: left;
23 | margin: 0 2px;
24 | }
25 |
26 | .ui-jqchart .ui-jqchart-toolbar-separator {
27 | height: 16px;
28 | width: 1px;
29 | }
30 |
31 | .ui-jqchart .ui-jqchart-tooltip {
32 | position: absolute;
33 | white-space: nowrap;
34 | padding: .2em .4em;
35 | z-index: 9999;
36 | border: 1px solid #dddddd;
37 | color: #333333;
38 | background: white;
39 | -moz-border-radius: 4px;
40 | -webkit-border-radius: 4px;
41 | border-radius: 4px;
42 | -o-box-shadow: 0 0 5px #aaa;
43 | -moz-box-shadow: 0 0 5px #aaa;
44 | -webkit-box-shadow: 0 0 5px #aaa;
45 | box-shadow: 0 0 5px #aaa;
46 | }
47 |
48 | * html .ui-jqchart .ui-jqchart-tooltip {
49 | background-image: none;
50 | }
51 |
52 | body .ui-jqchart .ui-jqchart-tooltip {
53 | border-width: 2px;
54 | }
--------------------------------------------------------------------------------
/trade/static/css/jqRangeSlider.css:
--------------------------------------------------------------------------------
1 | .ui-jqrangeslider { position: relative; }
2 |
3 | .ui-jqrangeslider .ui-jqrangeslider-arrow-left { position: absolute; width: 18px; cursor: pointer; vertical-align: middle; }
4 | .ui-jqrangeslider .ui-jqrangeslider-arrow-icon-left { position: absolute; }
5 | .ui-jqrangeslider .ui-jqrangeslider-arrow-right { position: absolute; width: 18px; cursor: pointer; }
6 | .ui-jqrangeslider .ui-jqrangeslider-arrow-icon-right { position: absolute; }
7 | .ui-jqrangeslider .ui-jqrangeslider-handle-left { position: absolute; width: 12px; cursor: ew-resize; }
8 | .ui-jqrangeslider .ui-jqrangeslider-handle-icon-left { position: absolute; }
9 | .ui-jqrangeslider .ui-jqrangeslider-handle-right { position: absolute; width: 12px; cursor: ew-resize; }
10 | .ui-jqrangeslider .ui-jqrangeslider-handle-icon-right { position: absolute; }
11 | .ui-jqrangeslider .ui-jqrangeslider-slider-horizontal { position: absolute; cursor: move; cursor: grab; cursor: -moz-grab; }
12 | .ui-jqrangeslider .ui-jqrangeslider-slider-horizontal-dragging { cursor: -moz-grabbing; cursor: grabbing; }
13 | .ui-jqrangeslider .ui-jqrangeslider-background-horizontal { position: absolute; }
14 | .ui-jqrangeslider .ui-jqrangeslider-background-horizontal-left { position: absolute; }
15 | .ui-jqrangeslider .ui-jqrangeslider-background-horizontal-right { position: absolute; }
16 |
17 | .ui-jqrangeslider .ui-jqrangeslider-arrow-bottom { position: absolute; height: 18px; cursor: pointer; }
18 | .ui-jqrangeslider .ui-jqrangeslider-arrow-icon-bottom { position: absolute; }
19 | .ui-jqrangeslider .ui-jqrangeslider-arrow-top { position: absolute; height: 18px; cursor: pointer; }
20 | .ui-jqrangeslider .ui-jqrangeslider-arrow-icon-top { position: absolute; }
21 | .ui-jqrangeslider .ui-jqrangeslider-handle-bottom { position: absolute; height: 12px; cursor: ns-resize; }
22 | .ui-jqrangeslider .ui-jqrangeslider-handle-icon-bottom { position: absolute; }
23 | .ui-jqrangeslider .ui-jqrangeslider-handle-top { position: absolute; height: 12px; cursor: ns-resize; }
24 | .ui-jqrangeslider .ui-jqrangeslider-handle-icon-top { position: absolute; }
25 | .ui-jqrangeslider .ui-jqrangeslider-slider-vertical { position: absolute; cursor: move; cursor: grab; cursor: -moz-grab; }
26 | .ui-jqrangeslider .ui-jqrangeslider-slider-vertical-dragging { cursor: -moz-grabbing; cursor: grabbing; }
27 | .ui-jqrangeslider .ui-jqrangeslider-background-vertical { position: absolute; }
28 | .ui-jqrangeslider .ui-jqrangeslider-background-vertical-bottom { position: absolute; }
29 | .ui-jqrangeslider .ui-jqrangeslider-background-vertical-top { position: absolute; }
--------------------------------------------------------------------------------
/trade/static/css/setup.css:
--------------------------------------------------------------------------------
1 | .chart-info {
2 | font-size: 0.8rem;
3 | min-width: 50%;
4 | float: right;
5 | display: flex;
6 | display: -webkit-flex;
7 | -webkit-justify-content: space-around;
8 | justify-content: space-around;
9 | }
10 |
11 | .btn-mini {
12 | padding: 1px 6px;
13 | height: 20px;
14 | line-height: 20px;
15 | }
16 |
17 | .graph-block, .order_table {
18 | border: 1px slategrey solid;
19 | background: #fafafa;
20 | }
21 |
22 | .exchange-coins-block {
23 | max-height: 600px;
24 | border: 1px slategrey solid;
25 | background: #fafafa;
26 | }
27 |
28 | .exchange-coins-block-scroll {
29 | overflow-y: scroll;
30 | max-height: 390px;
31 | font-size: 10px;
32 | }
33 |
34 | .header h5 {
35 | margin-top: 0 !important;
36 | }
37 |
38 | .header {
39 | padding: 10px 0 4px 0;
40 | }
41 |
42 | .directions_block {
43 | width: 100%;
44 | height: 300px;
45 | overflow-x: scroll;
46 | }
47 |
48 | .priceChangeUp {
49 | background-color: #ceebd3 !important;
50 | border-top: 1px double #27892f;
51 | border-bottom: 1px double #27892f;
52 | -webkit-transition: all .3s;
53 | -moz-transition: all .3s;
54 | -ms-transition: all .3s;
55 | -o-transition: all .3s;
56 | transition: all .3s;
57 | }
58 |
59 | .priceChangeDown {
60 | background-color: #f6d4d1 !important;
61 | border-top: 1px double #c02a1d;
62 | border-bottom: 1px double #c02a1d;
63 | -webkit-transition: all .3s;
64 | -moz-transition: all .3s;
65 | -ms-transition: all .3s;
66 | -o-transition: all .3s;
67 | transition: all .3s;
68 | }
69 |
70 | #buttons-zoom button, #buttons button {
71 | margin: -2px;
72 | border-radius: 0;
73 | background-image: linear-gradient(#ffffff, #c4d5db);
74 | background-color: white;
75 | box-shadow: none;
76 | border: 1px solid #91abac;
77 | color: black;
78 | border-left-width: 0;
79 | font-size: 11px;
80 | }
81 |
82 | #buttons-zoom div button:first-child, #buttons div button:first-child {
83 | border-top-left-radius: 10px;
84 | border-bottom-left-radius: 10px;
85 | }
86 |
87 | #buttons-zoom div button:last-child, #buttons div button:last-child {
88 | border-top-right-radius: 10px;
89 | border-bottom-right-radius: 10px;
90 | }
91 |
92 | .ui-jqchart-toolbar.ui-widget.ui-widget-content.ui-corner-all {
93 | position: absolute;
94 | right: 100px !important;
95 | left: auto !important;
96 | }
--------------------------------------------------------------------------------
/trade/static/css/style.css:
--------------------------------------------------------------------------------
1 | .main-nav {
2 | background: #388e3c;
3 | }
4 |
5 | .main-nav li {
6 | border-left: 1px solid #2e7d32;
7 | border-right: 1px solid #1b5e20;
8 | font-weight: bold;
9 | text-transform: uppercase;
10 | font-size: 14px;
11 | }
12 |
13 | .main-nav li:first-child {
14 | border-left: 1px solid #2e7d32;
15 | }
16 |
17 | .main-nav li a {
18 | color: lightgray;
19 | }
20 |
21 | .brand-logo img {
22 | margin: 0 auto;
23 | padding: 10px;
24 | }
25 |
26 | .exchange {
27 | width: 100%;
28 | text-align: center;
29 | }
30 |
31 |
32 | .exchange th {
33 | border: none;
34 | color: #1e2324;
35 | text-align: center;
36 | background: #a5d6a7;
37 | font-weight: bolder;
38 | }
39 | .user_coins td {
40 | border-bottom: 1px solid #e8e0e0;
41 | }
42 |
43 | .workers {
44 | width: 100%;
45 | text-align: center;
46 | }
47 |
48 | .workers td{
49 | border-left: 1px solid gray;
50 | border-bottom: 1px solid gray;
51 | }
52 |
53 | .workers td:last-child{
54 | border-right: 1px solid gray;
55 | }
56 |
57 |
58 | .workers th {
59 | border: none;
60 | color: #1e2324;
61 | text-align: center;
62 | background: #a5d6a7;
63 | font-weight: bolder;
64 | }
65 |
66 | .user_coins td:first-child {
67 | font-weight: bolder;
68 | text-align: left;
69 | text-transform: uppercase;
70 | }
71 |
72 | tr.balances td:last-child {
73 | text-align: right;
74 | }
75 |
76 | .mysize {
77 | font-size: 1.5rem !important;
78 | }
79 |
80 | .exchange-header th:nth-child(1) {
81 | width: 10% !important;
82 | }
83 |
84 | .main-content {
85 | margin-top: 30px;
86 | padding: 48px 0 48px 0;
87 | background-color: #e5f0e6;
88 | min-height: 200px;
89 | }
90 |
91 | .user-info {
92 | border-right: 1px solid lightgray;
93 | }
94 |
95 | .totalBTC {
96 | font-family: Roboto, serif;
97 | font-size: xx-large;
98 | display: block;
99 | text-align: center;
100 | }
101 |
102 | .wallet {
103 | padding: 20px;
104 | margin-bottom: 50px;
105 | background: #b3d5d6;
106 | }
107 |
108 | .transactions-table {
109 | max-width: 100%;
110 | width: 100%;
111 | }
112 |
113 | .transactions-table thead th {
114 | background: #009688;
115 | color: white;
116 | }
117 |
118 | .transactions-table tbody td {
119 | border-bottom: 1px solid grey;
120 | }
121 |
122 | .transactions-table tbody td:last-child {
123 | word-break: break-all;
124 | }
125 |
126 | .transaction-type {
127 | padding: 2px;
128 | border-radius: 2px;
129 | }
130 |
131 | .table-bordered {
132 | border: 1px solid #c7ecb8;
133 | border-collapse: separate;
134 | *border-collapse: collapsed;
135 | border-left: 0;
136 | -webkit-border-radius: 4px;
137 | -moz-border-radius: 4px;
138 | border-radius: 4px;
139 | }
140 |
141 | .table-bordered th,
142 | .table-bordered td {
143 | border-bottom: 1px solid #c7ecb8;
144 | }
145 |
146 | .fa-commenting {
147 | cursor: pointer;
148 | }
149 |
150 | .alert-new {
151 | padding: 10px;
152 | font-weight: bold;
153 | border-radius: 4px;
154 | font-size: 1.1rem;
155 | margin: 0 0 2em 0;
156 | }
157 |
158 | .transaction-info td {
159 | border-bottom: 1px solid grey;
160 | }
161 |
162 | .transaction-info {
163 | color: black;
164 | background: white;
165 | border: 1px solid white;
166 | text-align: left !important;
167 | }
168 |
169 | .second-nav {
170 | height: 26px;
171 | line-height: 26px;
172 | }
173 |
174 | .exchange-coins {
175 | border: 1px solid grey;
176 | width: 80%;
177 | border-spacing: 0;
178 | }
179 |
180 | .exchange-coins td {
181 | height: 30px;
182 | line-height: 30px;
183 | border-bottom: 1px solid grey
184 | }
185 |
186 | .exchange-coins td i {
187 | cursor: pointer;
188 | }
189 |
190 | .rank-up, .rank-down, .primary-rank {
191 | padding: 3px 5px;
192 | color: white;
193 | }
194 |
195 | .pair {
196 | background: #4caf50;
197 | }
198 |
199 | .unactive {
200 | background: #f44336 !important;
201 | }
202 |
203 | .pair-share {
204 | width: 80%;
205 | }
206 |
207 | .primary-coins {
208 | display: -webkit-flex;
209 | display: flex;
210 | -webkit-justify-content: space-around;
211 | justify-content: space-around;
212 | -webkit-flex-wrap: wrap;
213 | flex-wrap: wrap;
214 | }
215 |
216 | .primary-coin {
217 | width: 50%;
218 | text-align: center;
219 | padding: 10px;
220 | }
221 |
222 | .primary-rank {
223 | display: none !important;
224 | cursor: pointer;
225 | }
226 |
227 | .rank:hover .primary-rank {
228 | display: inline !important;
229 | }
230 |
231 | .border {
232 | border: 1px solid red;
233 | }
234 |
235 | ::-webkit-scrollbar {
236 | width: 3px;
237 | }
238 |
239 | #buttons, #buttons-zoom {
240 | padding: 10px;
241 | }
242 |
243 | .ui-jqchart-tooltip {
244 | background: white;
245 | color: black;
246 | padding: 10px;
247 | border-radius: 10px;
248 | z-index: 10;
249 | border: 1px solid black;
250 | }
251 |
252 | .coinmarketcap-currency-widget div {
253 | border-radius: 0 !important;
254 | }
255 | .coinmarketcap-currency-widget > div > div:last-child {
256 | opacity: 0;
257 | height: 0 !important;
258 | padding: 0 !important;
259 | }
260 |
261 | .pair-advanced {
262 | padding-bottom: 10px;
263 | }
264 |
265 | .pair-advanced input {
266 | width: 100px;
267 | }
268 |
269 | .active_pair {
270 | background-image: linear-gradient(#ebdf95, #fbf4c7 15%);
271 | border-right: 0;
272 | border-left: 0;
273 | }
274 |
275 | .active_pair td {
276 | border-top: 1px solid #f7ab1c !important;
277 | border-bottom: 1px solid #f7ab1c !important;
278 | }
279 |
280 | .pair_tr td{
281 | -webkit-transition: all .3s;
282 | -moz-transition: all .3s;
283 | -ms-transition: all .3s;
284 | -o-transition: all .3s;
285 | transition: all .3s;
286 | }
287 |
288 | .orders td {
289 | font-size: 10px;
290 | padding: 0 !important;
291 | }
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Bold.woff
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Bold.woff2
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Light.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Light.woff
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Light.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Light.woff2
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Medium.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Medium.woff
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Medium.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Medium.woff2
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Regular.woff
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Regular.woff2
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Thin.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Thin.woff
--------------------------------------------------------------------------------
/trade/static/fonts/roboto/Roboto-Thin.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/fonts/roboto/Roboto-Thin.woff2
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/ardor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/ardor.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/augur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/augur.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/bitcoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/bitcoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/bitcoindark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/bitcoindark.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/bitconnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/bitconnect.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/bitshares.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/bitshares.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/blackcoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/blackcoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/blocknet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/blocknet.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/bytecoin-bcn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/bytecoin-bcn.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/counterparty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/counterparty.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/dash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/dash.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/decred.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/decred.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/digibyte.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/digibyte.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/dogecoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/dogecoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/ethereum-classic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/ethereum-classic.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/ethereum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/ethereum.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/etheroll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/etheroll.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/factom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/factom.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/gamecredits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/gamecredits.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/gnosis-gno.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/gnosis-gno.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/golem-network-tokens.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/golem-network-tokens.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/library-credit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/library-credit.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/lisk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/lisk.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/litecoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/litecoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/maidsafecoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/maidsafecoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/monero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/monero.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/namecoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/namecoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/nem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/nem.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/nxt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/nxt.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/peercoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/peercoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/potcoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/potcoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/reddcoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/reddcoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/ripple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/ripple.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/siacoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/siacoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/steem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/steem.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/stratis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/stratis.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/syscoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/syscoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/tether.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/tether.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/viacoin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/viacoin.png
--------------------------------------------------------------------------------
/trade/static/images/cryptotokens/zcash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/cryptotokens/zcash.png
--------------------------------------------------------------------------------
/trade/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OnGridSystems/CATEd/5023b4a271fa8dab2352e9981fca02d0d133d1f2/trade/static/images/logo.png
--------------------------------------------------------------------------------
/trade/static/js/coinmarketcup.js:
--------------------------------------------------------------------------------
1 | !function(){var e;if(void 0===window.jQuery||"1.11.1"!==window.jQuery.fn.jquery){var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src","https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"),t.readyState?t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||a()}:t.onload=a,(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(t)}else e=window.jQuery,n();function a(){e=window.jQuery.noConflict(!0),n()}function i(e){var t=" "+document.cookie,a=" "+e+"=",i=null,n=0,r=0;return t.length>0&&-1!=(n=t.indexOf(a))&&(n+=a.length,-1==(r=t.indexOf(";",n))&&(r=t.length),i=unescape(t.substring(n,r))),i}function n(){var t,a,n=(t=i("_locale")||void 0,a=!("object"!=typeof Intl||!Intl||"function"!=typeof Intl.NumberFormat),{toLocaleString:function(e,i){var n=Number(e);if(isNaN(n))return e;var r,o,c,l,s=i&&i.minDecimalPlaces,d=i&&i.maxDecimalPlaces;return void 0===s||void 0===d?(r=n,a?r.toLocaleString(t):r.toLocaleString()):(o=n,c=s,l=d,a?o.toLocaleString(t,{minimumFractionDigits:c,maximumFractionDigits:l}):o.toFixed(l))}});function r(e,t){var a=t;t=Math.pow(10,t);for(var i=["K","M","B","T"],r=i.length-1;r>=0;r--){var o=Math.pow(10,3*(r+1));if(o<=e){1e3==(e=Math.round(e*t/o)/t)&&r=1e3?n.toLocaleString(Math.round(e)):e>=1?n.toLocaleString(e,{minDecimalPlaces:8,maxDecimalPlaces:8}):e<1e-8?Number(e).toExponential(4):n.toLocaleString(e,{minDecimalPlaces:8,maxDecimalPlaces:8});return e}(e):function(e){e=e>=1?e>=1e5?n.toLocaleString(Math.round(e)):n.toLocaleString(e,{minDecimalPlaces:2,maxDecimalPlaces:2}):e<1e-6?Number(e).toExponential(2):n.toLocaleString(e,{minDecimalPlaces:6,maxDecimalPlaces:6});return e}(e)}function c(e,t,a){var i=t,n={btc:"฿",usd:"$",eur:"€",cny:"¥",gbp:"£",cad:"$",rub:"
",hkd:"$",jpy:"ВҐ",aud:"$",brl:"R$",inr:"в‚№",krw:"в‚©",mxn:"$",idr:"Rp",chf:"Fr"};return e.toLowerCase()in n&&(i=n[e.toLowerCase()]+i),a&&(i=i+' '+e.toUpperCase()+""),i}function l(e,t,a,i,l,s,d,p,m,u,h,g,v,f,x,y,b,w){var L=w?"https://s2.coinmarketcap.com/static/img/coins/64x64/"+w+".png":"https://files.coinmarketcap.com/static/widget/coins_legacy/64x64/"+e+".png",k="#093";m<0&&(k="#d14836"),m=n.toLocaleString(m,{minDecimalPlaces:2,maxDecimalPlaces:2}),valTickerHTML=v?"("+a+")":"",valPrice=s?o(s,i):"?",valPercentHTML=m?'('+m+"%)":"",valMarketCap=u?r(u,2):"?",valVolume=h?r(h,2):"?",d?(mainLineHeight=25,valPriceSecondary=p?o(p,d):"?",secondaryHTML='
'+valPriceSecondary+" "+d+" "):(mainLineHeight=30,secondaryHTML="");var E="utm_medium=widget&utm_campaign=cmcwidget&utm_source="+location.hostname+"&utm_content="+e,P=' ';return P+=function(e,t,a,i,n,r,o,l){var s=0,d=0,p="",m="",u="";if(e&&s++,t&&s++,a&&s++,0==s)return"";1==s&&(d=100),2==s&&(d=49.8),3==s&&(d=33),e&&(borderWidth=0,(a||t)&&(borderWidth=1),p='
RANK
'+r+"
");a&&(borderWidth=0,t&&(borderWidth=1),m='
MARKET CAP
'+c(n,o,i)+"
");t&&(u='
VOLUME (24H)
'+c(n,l,i)+"
");return detailedHTML='
'+p+m+u+"
",detailedHTML}(f,x,y,b,l,g,valMarketCap,valVolume),P+='
'}e(document).ready(function(e){e(".coinmarketcap-currency-widget").each(function(){var t=e(this).attr("data-currency"),a=e(this).data("currencyid"),i=e(this).attr("data-base").toUpperCase(),n=e(this).attr("data-secondary");n="BTC"==(n=n?n.toUpperCase():null)||"USD"==n?n:null;var r=e(this).attr("data-stats");r=(r=r?r.toUpperCase():null)==i?i:"USD";var o,c,s=!1!==e(this).data("ticker"),d=!1!==e(this).data("rank"),p=!1!==e(this).data("marketcap"),m=!1!==e(this).data("volume"),u=!1!==e(this).data("statsticker"),h=this;a?(o="https://widgets.coinmarketcap.com/v2/ticker/"+a+"/?ref=widget&convert="+i,c="volume_24h_"):(o="https://widgets.coinmarketcap.com/v1/ticker/"+t+"/?ref=widget&convert="+i,c="24h_volume_"),e.get({url:o,success:function(o){o=o.length?o[0]:o.data,t||(t=o.website_slug);var g="price_"+i.toLowerCase(),v=n?"price_"+n.toLowerCase():null,f="market_cap_"+r.toLowerCase(),x=c+r.toLowerCase(),y=parseFloat(o[g]),b=v?parseFloat(o[v]):null,w=parseInt(o[f]),L=parseInt(o[x]),k=o.name,E=o.symbol,P=Number(o.percent_change_24h),M=o.rank,C=l(t,k,E,i,r,y,n,b,P,w,L,M,s,d,m,p,u,a);e(h).html(C),e(h).find("a").css({"text-decoration":"none",color:"#428bca"})}})})})}}();
2 |
--------------------------------------------------------------------------------
/trade/static/js/exporting.js:
--------------------------------------------------------------------------------
1 | /*
2 | Highcharts JS v5.0.12 (2017-05-24)
3 | Exporting module
4 |
5 | (c) 2010-2017 Torstein Honsi
6 |
7 | License: www.highcharts.com/license
8 | */
9 | (function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(e){var p=e.defaultOptions,t=e.doc,B=e.Chart,u=e.addEvent,K=e.removeEvent,H=e.fireEvent,n=e.createElement,D=e.discardElement,I=e.css,x=e.merge,E=e.pick,k=e.each,F=e.objectEach,y=e.extend,z=e.win,J=z.navigator.userAgent,G=e.SVGRenderer,L=e.Renderer.prototype.symbols,M=/Edge\/|Trident\/|MSIE /.test(J),N=/firefox/i.test(J);y(p.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",
10 | downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});p.navigation={buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}};p.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",
11 | menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};e.post=function(a,b,c){var d=n("form",x({method:"post",action:a,enctype:"multipart/form-data"},c),
12 | {display:"none"},t.body);F(b,function(a,b){n("input",{type:"hidden",name:b,value:a},null,d)});d.submit();D(d)};y(B.prototype,{sanitizeSVG:function(a,b){if(b&&b.exporting&&b.exporting.allowHTML){var c=a.match(/<\/svg>(.*?$)/);c&&c[1]&&(c='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+b.chart.width+'" height\x3d"'+b.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+c[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",a=a.replace("\x3c/svg\x3e",c+"\x3c/svg\x3e"))}return a=a.replace(/zIndex="[^"]+"/g,
13 | "").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/