Commit Graph

1072 Commits

Author SHA1 Message Date
Adrian Gallagher
b178dd2c1d Linter fixes 2019-08-08 23:02:27 -07:00
Adrian Gallagher
8ecd8a0c16 Merge branch 'master' into engine 2019-08-09 15:46:24 +10:00
Adrian Gallagher
2078ba907f Update URLs for transfer into org repo (#338)
* Update URLs for transfer into org repo

* Update codecov, travis and othe remaining links

* Update appveyor paths
2019-08-09 11:50:39 +10:00
Scott
e209d85d0d Websocket request-response correlation (#328)
* Establishes new websocket functionality. Begins the creation of the websocket request

* Adding a wrapper over gorilla websocket connect,send,receive to handle ID messages. Doesn't work

* Successfully moved exchange_websocket into its own wshandler namespace. oof

* Sets up ZB to use a round trip WS request system

* Adds Kraken ID support to subscriptions. Renames duplicate func name UnsubscribeToChannels to RemoveSubscribedChannels. Adds some helper methods in the WebsocketConn to reduce duplicate code. Cleans up ZB implementation

* Fixes double locking which caused no websocket data to be read. Fixes requestid for kraken subscriptions

* Completes Huobi and Hadax implementation. Extends ZB error handling. Adds GZip support for reading messages

* Adds HitBTC support. Adds GetCurrencies, GetSymbols, GetTrades WS funcs. Adds super fun new parameter to GenerateMessageID for Unix and UnixNano

* Adds GateIO id support

* Adds Coinut support. Prevents nil reference error in constatus when there isnt one

* Standardises all Exchange websockets to use the wshandler websocket. Removes the wsRequestMtx as wshandler handles that now. Makes the Dialer a dialer, its not externally referenced that I can see.

* Fixes issue with coinut implementation. Updates bitmex currencies. Removes redundant log messages which are used to log messages

* Starts testing. Renames files

* Adds tests for websocket connection

* Reverts request.go change

* Linting everything

* Fixes rebase issue

* Final changes. Fixes variable names, removes log.Debug, removes lines, rearranges test types, removes order correlation websocket type

* Final final commit, fixing ZB issues.

* Adds traffic alerts where missed. Changes empty struct pointer addresses to nil instead. Removes empty lines

* Fixed string conversion

* Fixes issue with ZB not sending success codes

* Fixes issue with coinut processing due to nonce handling with subscriptions

* Fixes issue where ZB test failure was not caught. Removes unnecessary error handling from other ZB tests

* Removes unused interface

* Renames wshandler.Init() to wshandler.Run()

* Updates template file

* Capitalises cryptocurrencies in struct. Moves websocketResponseCheckTimeout and websocketResponseMaxLimit into config options. Moves connection configuration to main exchange Setup (where appropriate). Reverts currencylastupdated ticks. Improves reader close error checking

* Fixes two inconsistent websocket delay times

* Creates a default variable for websocket ResponseMaxLimit and ResponseCheckTimeout, then applies it to setdefaults and all tests

* Updates exchange template to set and use default websocket response limits
2019-08-07 15:15:01 +10:00
Adrian Gallagher
e8c9a9a2a4 Minor linter/test fixes after merging master 2019-08-06 16:08:52 +10:00
Adrian Gallagher
23206caffa Merge branch 'master' into engine 2019-08-06 16:05:35 +10:00
Adrian Gallagher
f061bfee20 Merge branch 'master' into engine 2019-08-06 15:26:29 +10:00
Luke Hamilton
6e70f0642a Refactor main.go to improve startup execution flow (#334)
Much easier to work on a project when you can clearly see its execution path.
2019-08-06 15:20:29 +10:00
Adrian Gallagher
20a5ff256e Update codelingo.yaml (#335)
* Update codelingo.yaml

* Import comment-first-word-when-empty again
2019-08-06 15:19:57 +10:00
Morten Sørensen
3f71050881 Bitmex compare initial orderbook snapsnot insensitive (#331) 2019-07-31 15:58:20 +10:00
Scott
eb07c7e495 Implements endpoint GetAggregatedBalance for Hadax too. (#330) 2019-07-19 09:00:54 +02:00
Yunseok
e0aea96a5c Add Huobi GetAggregatedBalance api (#329)
Add Huobi GetAggregatedBalance api that returns the balances of all the
sub-account aggregated.

See also
  - https://huobiapi.github.io/docs/spot/v1/en/#get-the-aggregated-balance-of-all-sub-accounts-of-the-current-user
2019-07-18 05:10:30 +02:00
DirectX
4222b327c6 Fixes to OKEX and Binance WS trades data mapping (#326)
* Fixes to OKEX and Binance WS trades data mapping

* Small improvement using semantic time.Milliscond unit

* gofmt -s file
2019-07-15 13:36:18 +10:00
Adrian Gallagher
db7aa5df65 Merge branch 'master' into engine 2019-07-07 06:06:30 +10:00
Andrew
3de1d94e5f New logging system (#319)
* First pass at adding new logging system

* NewLogger

* NewLogger

* WIP

* silly bug fix

* :D removed files

* removed old logging interface

* added tests

* added tests

* Started to add new lines to all f calls

* Added subsystem log types

* Logger improvements

* Further performance improvements

* changes to logger and sublogger creation

* Renamed Logging types

* removed old print statement

* changes based on feedback

* moved sublogger types to own file

* :)

* added console as output type

* added get level command

* added get/set log level via grpc command

* added check for output being empty for migration support

* first pass at log rotation

* added log rotation

* :D derp fixed

* added tests

* changes based on feedback

* changed log type

* comments

* renamed file -> fileSettings

* typo fix

* changes based on feedback

* gofmt ran on additional files

* gofmt ran on additional files
2019-07-07 05:20:31 +10:00
Scott
5b270f5ec9 Adds support for kraken websocket 0.2.0 (#324)
* Adds support for kraken 0.2.0

* Updates Kraken websocket logs. Removes commented out code

* Runs gofmt a second time
2019-07-05 06:02:55 +10:00
Adrian Gallagher
7112a89491 Add orderbook calculator and verify func 2019-07-04 07:22:12 +10:00
dependabot-preview[bot]
e60dda0879 Bump github.com/gorilla/mux from 1.7.2 to 1.7.3 (#323)
Bumps [github.com/gorilla/mux](https://github.com/gorilla/mux) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/gorilla/mux/releases)
- [Commits](https://github.com/gorilla/mux/compare/v1.7.2...v1.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-02 15:54:02 +10:00
Adrian Gallagher
7dbfcb311c Config: Check asset type when obtaining pair format 2019-06-27 13:58:12 +10:00
Adrian Gallagher
6de0606d55 Add order validation test code and use GetPairFormat where necessary 2019-06-25 17:44:46 +10:00
Adrian Gallagher
1daaa66830 Engine changes
Add addr helpers (will be split off into own package)
Engine status updates (log and data dir display)
Use GetPairFormat for various exchanges instead of calling the config
QA fixes
Implement GCTRPC exchange deposit address handling
2019-06-24 17:38:11 +10:00
Adrian Gallagher
9ff4471a45 Merge branch 'master' into engine 2019-06-21 18:10:55 +10:00
Ryan O'Hara-Reid
897bcfd9a4 Documentation Update (#318)
* Initial update

* update

* Fix linter issues

* Add new documentation template and fix
2019-06-21 12:38:35 +10:00
Scott
3a66e99899 Authenticated Websocket support (#315)
* Improves subscribing by not allowing duplicates. Adds bitmex auth support

* Adds coinbase pro support. Partial BTCC support. Adds WebsocketAuthenticatedEndpointsSupported websocket feature. Adds GateIO support

* Adds Coinut support

* Moves Coinut WS types to file. Implements Gemini's secure WS endpoint

* Adds HitBTC ws authenticated support. Fixes var names

* Adds huobi and hadax authenticated websocket support

* Adds auth to okgroup (okex, okcoin). Fixes some linting

* Adds Poloniex support

* Adds ZB support

* Adds proper bitmex support

* Improves bitfinex support, improves websocket functionality definitions

* Fixes coinbasepro auth

* Tests all endpoints

* go formatting, importing, linting run

* Adds wrapper supports

* General clean up. Data race destruction

* Improves testing on all exchanges except ZB

* Fixes ZB hashing, parsing and tests

* minor nits before someone else sees them <_<

* Fixes some nits pertaining to variable usage, comments, typos and rate limiting

* Addresses nits regarding types and test responses where applicable

* fmt import

* Fixes linting issues

* No longer returns an error on failure to authenticate, just logs. Adds new AuthenticatedWebsocketAPISupport config value to allow a user to seperate auth from REST and WS. Prevents WS auth if AuthenticatedWebsocketAPISupport is false, adds additional login check 'CanUseAuthenticatedEndpoints' for when login only occurs once (not per request). Removes unnecessary time.Sleeps from code. Moves WS auth error logic to auth function so that wrappers can get involved in all the auth fun. New-fandangled shared test package, used exclusively in testing, will be the store of all the constant boilerplate things like timeout values. Moves WS test setup function to only run once when there are multiple WS endpoint tests. Cleans up some struct types

* Increases test coverage with tests for config.areAuthenticatedCredentialsValid config.CheckExchangeConfigValues, exchange.SetAPIKeys, exchange.GetAuthenticatedAPISupport, exchange_websocket.CanUseAuthenticatedEndpoitns and exchange_websocket.SetCanUseAuthenticatedEndpoints. Adds b.Websocket.SetCanUseAuthenticatedEndpoints(false) when bitfinex fails to authenticate
Fixes a typo. gofmt and goimport

* Trim Test Typos

* Reformats various websocket types. Adds more specific error messaging to config.areAuthenticatedCredentialsValid
2019-06-19 13:19:01 +10:00
Adrian Gallagher
4a41c5cff3 Merge branch 'master' into engine 2019-06-17 14:36:06 +10:00
Adrian Gallagher
67a58a10bd Fix ticker empty err and improve test/consistency for orderbook/ticke… (#317)
* Fix ticker empty err and improve test/consistency for orderbook/ticker pkgs
2019-06-17 13:43:13 +10:00
Ryan O'Hara-Reid
20c24601fb Asset update to fix minor stutter (#316) 2019-06-17 09:02:07 +10:00
Adrian Gallagher
b901c4b670 Engine improvements
Add back events tests
Fill out SMTP comms handler
Add getcommunicationrelayers gRPC command
2019-06-14 18:00:42 +10:00
Adrian Gallagher
6b2cfe7905 Daily engine improvements
Link up various subsystems to be managed atomically with the ability to start/stop them
New subsystem APIs
Comms changes
2019-06-13 17:30:50 +10:00
Adrian Gallagher
33085318c4 Switch connchecker to service 2019-06-12 17:52:40 +10:00
Adrian Gallagher
2ad808e70c Daily engine improvements:
New GetExchangeOTPs API
CLI validation
Standardised pairs for GCTCLI
Expand test coverage
Trim SMS global from name is len > 11
Linter fixes
2019-06-11 17:02:00 +10:00
Adrian Gallagher
f777e68716 Engine improvements 2019-06-10 20:02:09 +10:00
Adrian Gallagher
04c7c4895f Split common package more and QA 2019-06-07 20:52:44 +10:00
Adrian Gallagher
cbd3e7bacd Order manager changes 2019-06-07 17:52:53 +10:00
Adrian Gallagher
bd8dc47c38 daily progress build 2019-06-06 17:20:40 +10:00
Adrian Gallagher
26795508ff Merge branch 'master' into engine 2019-06-06 14:57:32 +10:00
Adrian Gallagher
92d798ef2a BTCMarkets: Fix order JSON unmarshal response (#314) 2019-06-06 11:37:54 +10:00
Adrian Gallagher
3010b62ac1 Use string.EqualFold where necessary 2019-06-04 17:27:00 +10:00
Adrian Gallagher
e965e54e09 Split up common.go, file path fixes and much more 2019-06-04 17:04:32 +10:00
Adrian Gallagher
8c62316e82 websocket QA 2019-06-04 14:34:00 +10:00
Adrian Gallagher
6ebafb0f33 Merge branch 'master' into engine 2019-06-04 12:25:40 +10:00
Adrian Gallagher
d639f6e4a6 Ignore gocryptotrader binary on macOS/Linux builds
Also fix go fmt issues
2019-06-03 00:48:33 -07:00
Adrian Gallagher
8048962b60 Remove BTCC exchange 2019-06-03 17:17:17 +10:00
Adrian Gallagher
94ac7c917d Huobi/Hadax: Update test symbol to fix tests 2019-06-03 17:00:34 +10:00
Ryan O'Hara-Reid
a80acb16de General fixes for CancelAllOrders exchange wrapper function (#313)
* General fixes for CancelAllOrders

* Fix error shadowing issue

* Initialise order status map and rm reduntant initialisations
2019-05-31 16:06:10 +10:00
Shogin Michael
416fbbd5ae Unit tests for communication/base package (#312)
* Added tests

* Added tests communications base

* Removed unnecessary field

* Review corrections: linter

* Review corrections: typo
2019-05-30 13:35:22 +10:00
Adrian Gallagher
39718b7f01 Merge branch 'master' into engine 2019-05-29 11:15:50 +10:00
Ryan O'Hara-Reid
e8bc3b5e76 Bump golangci-lint version to 1.16.0 (#311) 2019-05-27 14:10:54 +10:00
Adrian Gallagher
993b73f5cc AppVeyor: Add cache (#309)
* AppVeyor: Add cache

* Add go-build to cache
2019-05-24 14:13:43 +10:00
Adrian Gallagher
f5914e8c10 Engine changes 2019-05-22 17:06:38 +10:00