* Initial changes, removing exchange name as an arg and puts it in the pointer struct. Adds case to ws routines
* Adds CancelAllOrders func, adds GetByExchangeAndID. Adds modify handler in routines.go
* initial poor attempts to have bitmex work with new datahandler handlers. fixes ordersides
* bitmex Completes new order
* Better bitmex handling, but not complete. Begins a gargantuan task of unifying order data structs. Sometimes an order update will contain lot's of information, so its best to be able to update all fields of our orders, rather than just an arbitrary subset. As a result, everything will be broken for the foreseeable future :glitch_crab:
* Removes old order handler which did nothing. Updates order properties for everything everywhere - now consistent. Changes order status. Adds asset type and wallet address to all order types
* Adds order updater to update only relevant fields since the object is generic, we don't know what fields are passed from what exchanges. Adds "lastupdated" field to order.Detail. Expands order cancellation for engine orders.
* Ensures that new orders are added to the ordermanager's order store. Saaa many comments. Internalises orderStore get func. Adds internalOrderID to orderdetail and adds websocket support for it
* Fixes a cancelAllOrders oopsie doopsie
* Adds potential func to update orderdetails from an orderdetail struct. Unsure if will keep.
* Begins btcmarkets implementation. Expands order "stringToOrder" funcs to allow for some more flexible string coversions. Removes order.Submit via websocket as it would cause unlimited order place issues :D
* Finishes btc markets without testing
* Adds untested ws auth func to btse
* Finises btse, fixes btcmarkets bug
* Adds coinbasepro support
* Fixes a few more fields in coinbase pro and readds the extra subs
* Begins work on coinbene. Plus theyve added a new ws connection yeee
* Wasted a bunch of time adding support to an additional websocket that isn't needed ;_; Fixed a bug in coinbasepro. Fully kitted out coinbene support. Updates order types with all fields
* Removes extra websocket connection ;_;
* Finishes gemini. Fixes order side unknown
* Adds okgroup support. Moves byte reading to another function to allow for unit testing. Updates routines to use pointers. Updates date update handling for order details
* Finishes order data for okgroup websocket, but starts the STRANGE process of converting all other websocket endpoints to be a little less silly
* Cleans up okroup websocket implementation. Fixes bug in Gemini
* Adds poloniex support. Updates ws order handling
* new bitmex support. Adds some tests now that its all in its own func. Fixes poloniex bug
* Begins work on authenticated binance websocket
* Attempts to track user data via binance websocket
* Maybe finishes Binance websocket support
* Begins adding test coverage to orders.go. Updates names of script properties to match updated
* Begins an experiment with code coverage. Fixes more rebase issues
* Completes orders coverage. Botches a few other things though. Fixes more scripting stuff
* All tests in engine package pass
* Adds some loevely routine tests
* Moves ordermanager to test Bot ordermanager
Adds lovely routine tests to ensure things that get sent to be handled the data handler are handled by the data handler by handling them
* Replaces "wsHandleData" with "wsReadData" as that's what its going to do now.
* Splits all wsHandleData into wsReadData and wsHandleData to allow for easy testing via sending []byte json examples to test proper functionality. Breaks so many tests
* Fixes majority of test issues. But data races which are tough on the engine package
* "Fixes" test by removing shutdown test. It interferes with too many things. Requires some thought
* Tests all the binance websocket points
* Adds better bitfinex websocket support.
* Adds testing for bitfinex, bitstamp and btcmarkets. Fixes websocket bugs encountered
* Adds BTSE ws tests. Fixes bugs in ws
* Adds coinbase pro tests. Fixes any issues
* Coinbene tests
* Starts to handle coinut. Runs into a problem conceptually regarding websocket roundtrip and orders. Both events need to happen without impacting eachother/racing
* Addresses a data race issue regarding websocket and bot order management submission - order submission locks at an earlier point to prevent routines.go from creating an order before order submission creates it. Updates rpcserver to use order management bot to submit orders.
* Finishes the hectic coinut testing
* Adds tests for gateio
* Fixes rebase issues. Updates tests to work without being overloaded
* Begins testing of gemini. fixes up minor issues
* ginishes gemini tests and fixes
* Adds hitbtc tests. Fixes all the many issues with hitbtc websocket
* Adds remaining tests. Increases default test channel limit again
* Begins work towards huobi tests
* Finishes huobi tests
* Fixed all mythical rebase adventures
* Begins kraken transformation
* Finishes kraken. Fixes coinbene leverage now that its changed
* Begins okgroup testing
* Adds okgroup ws tests
* Does some poloniex
* Fixes basic curreny issue by extracting to func
* Begins redesign of poloniex websocket datahandling. Completes authenticated handling, now onto unauth
* Finishes poloniex revision
* Finishes ZB additions
* Fixes data races
* Fixes rebase issues. Fixes bad kraken logic
* Fixes after reviewing code
* lint everywhere
* Fixes lingering lints
* lint
* Adds test coverage to order detail and modify updating
* Fixes linting
* Fixes huge int, fixes date tests
* Adds GetByExchange, adds test for it. Protects fakepass echange. Renames DisplayQty to DisplayQuantity. Removes verbose. Adds some websocket properties. Updates bitmex asset type in test
* Addresses timestamps, type abbreviations, verbosity. Expands binance kline switch cases. Updates some websocket capabilities.
* Adds coverage to the stringToOrderType/Status functions introduced in PR
* Minor fixes addressing some time, error text and use of StringDataCompareInsensitive
* Introduces shiny new system which checks if there is an awaiting ID, if found, processes via wrapper method, else, goes through wsHandleData method. Removes weird locking system from wrapper/websocket data race. Updates bitfinex to properly handle websocket order requests and notifications
* Moves fakePassingExchange to test_helper. Fixes some order side implementations for trades. Botches a new error type
* Adds new error type to track and handle order classification errors separately
* Fully fleshes out ClassificationError for all instances of status conversion. Even in order trades and some wrapper functions
* Introduces common.SimpleTimeFormat for "2006-01-02 15:04:05". Fixes binance and bitfinex issues with auth endpoint use, map casting. Expands more order.ClassificationError usage. Fixes some more generic websocket response errors
* Future proofs order updating by utilising asset types. Expands testing to accomodate. Adds shiny new time type. Expands wrapper websocket functionality definitions
* minty linty
* Broken end of day code addressing basic nits on comments, returns and currency conversion
* Adds testing to btcmarkets websocket. Also updates websocket orderbook to use update instead
* Fixes fun rebase fun fun so fun
* Addresses minor nits regarding changed interface and comments
* Creates new function `GetRequestFormattedPairAndAssetType` to retrieve a currency pair and asset type based on a string. It will iterate over enabled pairs and compare them to formatted pairs and then return that pair if found.
* Fixes test
* Adds a single line to the end of the file, because that would be really bad if it wasn't there
* Updates fakepassexchange to not use params, updates test params, uses fatal in some tests where its important, updates order manager to have a rwmutex, removes some returns, improves ws key test for binance, updates properties to reflect their actual values, adds some more websocket properties
* Addresses binance switch linting
* Updates leverage property to int64
* Fixes what was broken
* renamed package to log to stop side import requirement
* reverted comment changes
* reverted comment changes
* one more reverting wording back to logger
* wording changes on comments
* Add exchange manager to engine
* Several improvements for engine and friends
1) New file.Exists func
2) gRPC TLS cert expiration date check and regeneration
3) New donation var for use across the codebase
4) Use Go log package until the logger is initialised
* Add cert tests and create dir tree if it doesn't exist for file.Write
* Link up donation address to documentation tool plus minor adjustments
* Fix remaining donation addrs
* Move non-needed reload exchange funcs
* Revert accidental config_example.json changes 🕯️
* Use go logger for logging until the logger has initiliased, otherwise no output will be seen
* Link up portfolio delay val and other fixes
* Run go mod tidy after dependabot PR
* Address nitterinos
* bug fix for websocket orderbook processing
* Fix more panics
* fix linter issue
* kick panic can down the road
* temp fix for issue with a 404 returned error as chainz.cryptoid dropped eth support
* Address nits and fixed orderbook updating
* Fix trade data, rm'd event time from struct
* fix time conversion for huobi
* Actually process kline data and fix time stamps
* btse time conversion fix and RM log, as it seems that the gain is reflecting transaction side. Drop ticker fetching support because there does not seem to be support on docs. And added trade fetching support.
* revert huobi println
* Adressed suggestion
* rm unnecessary assignment
* rm unnecessary check and assign
* fix conversion mishap
* fix currency conversion bug
* update websocket logging
* RM websocket type which stops conversion and copy
* fix linter issue, add in unknown side type
* Start Coinbene SWAP implementation
* Flesh out more API endpoints
* Code cleanup
* Add more endpoints, bug fixes and order validation checks
* More endpoints, tests and bugfixes
* Remove omitempty for enabled/available pairs
* Basic concept commit
* Initial changes to support bitfinex v2. Reverts linter changes as they suck. Exports bitfinex ws types
* Adds ticker, trade and orderbook support
* Candles sub that returns no data COMPLETE
* Adds authenticated ws support
* Adds the barebones endpoints to support
* Adds more endpoints
* Even more endpoints
* minicommit to switch and test
* All the interactive types
* Adds support for simultaneous connections. Updates tests. Nothing is working
* Successfully adds place order. Moves all authenticated endpoints to new switch case
* Cancel order and modify order
* Cancel all orders, cancel multi orders
* Finalises implementation. Uses testMain
* Adds WS wrapper support for some funcs
* Fixing rebasing issues
* Replaces use of currency as a variable. Updates a lot of coinut websocket auth endpoint stuff
* Fixes some fun for loops with GetEnabledPairs
* Fixes tests impacted by currency var change
* Adds coinut support for WS functions. Replaces `order` vars with `ord`. Fixes some for loops too. Removes verbose from bitfinex
* So many panics
* I'm fixing a hole, where the panics get in, and stops my mind from wandering, where it will go
* Moves func `CanUseAuthenticatedWebsocketEndpoint` to Websocket package as it fits better. Adds test coverage of `CanUseAuthenticatedWebsocketEndpoint`
* Finishes up all of coinuts ws implementations.
* GateIO implementation
* Adds some helper funcs for types, sides and status. Adds support for huobi. Removes unnecessary type
* Adds forgotten huobi endpoint
* Fixes cancel order endpoint
* go hates my formatting and so do I
* The process to get authenticated kraken websocket to work. Uses testmain. Adds new auth channel, auth subscriptions, auth data handling. Not working yet
* Finishes open orders handling
* Mini update for status only updates
* Fixes some kraken points
* Finishes WS kraken since it doesn't work
* Unfinished commit, cleaning up types
* Finishes the const replacing
* Fixes extra GetNAmes after rebase
* An end to the cleanup. testmain for gateio
* Adds ZB support
* Bitfinex cleanup. Renamed func
* Testmain-47s for everyone!!! yayaaaaaaa
* Adds kraken websocket wrapper support
* Fixes rebase issues
* Fixes tests from rebase
* Adds test for conversion. Fixes for loop. Updates test order pricing. Fixes some poor made tests. Adds proper error handling for ws responses instead of logging them. Fixed issue where commented code ruined kraken ws.
* Fixes secret linting issues. Prioritises bitfinex channelID responses over authorised
* Fixes sloppy error/var declarations
* Fixes crazy bad logic where submit order errors weren't really considered. Parralols alphapoint/alphapoint_test.go. Removes buffer for multi-websocket comms channel.
* Removal of inline string and removal of redundant nil checkerinos
* Fixes err checks. Checks whether float has decimal. Fixes append. Drops omitempties. Parallel to some tests. Moves var declarations
* Replaces my lazy sprintfs with strconv.FormatInt(time.Now().Unix(), 10)
* Adds shiny new FullyMatched bool. Fixes coinbene buy sell consts
* Fixes oopsie with coinbene const replacement
* Fixes currency issue
* Cleans up new places that use JSONDecode
* Fixes huge panic bug from string int conversion. Adds large testtable for strings to order types
* Fixes some more strconversion issues. Fixes table test var usage. Changes mapperino name
* Added some new scenarios for number splitting
* Fixes lint issues
* negative num fix
* Typo fix
* Accuracy warning comment
* 1) Update Dockerfile/docker-compose.yml
2) Remove inline strings for buy/sell/test pairs
3) Remove dangerous order submission values
4) Fix consistency with audit_events (all other spec files use
CamelCase)
5) Update web websocket endpoint
6) Fix main param set (and induce dryrun mode on specific command line
params)
* Engine QA
Link up exchange syncer to cmd params, disarm market selling bombs and fix OKEX endpoints
* Fix linter issue after merge
* Engine QA changes
Template updates
Wrapper code cleanup
Disarmed order bombs
Documentation updates
* Daily engine QA
Bitstamp improvements
Spelling mistakes
Add Coinbene exchange to support list
Protect API authenticated calls for Coinbene/LBank
* Engine QA changes
Fix exchange_wrapper_coverage tool
Add SupportsAsset to exchange interface
Fix inline string usage and add BCH withdrawal support
* Engine QA
Fix Bitstamp types
Inform user of errors when parsing time accross the codebase
Change time parsing warnings to errors (as they are)
Update markdown docs [with linter fixes]
* Engine QA changes
1) Add test for dryrunParamInteraction
2) Disarm OKCoin/OKEX bombs if someone accidently sets canManipulateRealOrders to true and runs all package tests
3) Actually check exchange setup errors for BTSE and Coinbene, plus address this in the wrapper template
4) Hardcode missing/non-retrievable contributors and bump the contributors
5) Convert numbers/strings to meaningful types in Bitstamp and OKEX
6) If WS is supported for the exchange wrapper template, preset authWebsocketSupport var
* Fix the shadow people
* Link the SyncContinuously paramerino
* Also show SyncContinuously in engine.PrintSettings
* Address nitterinos and use correct filepath for logs
* Bitstamp: Extract ALL THE APM
* Fix additional nitterinos
* Fix time parsing error for Bittrex
* Improved error message when no config is set on startup
* Change inccorect error wording
* bump Bitfinex websocket orderbook return length to max
* temporary fix of incorrect orderbook updates, limit to bid and ask len of 100, will be extended later if needed
* Fixed issue in binance websocket that appended 0 volume bid/ask items
* Fix panic when unmarshalling an empty pair from config
* Add get pair asset method for exchange base
Fix Bitmex orderbook stream
Unbuffer Bitmex orderbook stream
* force syncer to update ticker instead of fetch, which allows a stream
* Fix websocket last price for coinbasepro
* fix websocket ticker for coinut
* Fix websocket orderbook stream Huobi
* increase orderbook depth REST for Huobi
* Fix websocket support and ensure data integrity
* Fix time parsing issue after error checks
* check error, only process enabled currency pairs, signal websocket data processing
* expanded websocket functionality for okgroup
* Add logic to not process zero length slice for orderbooks
* fix websocket ticker only updating enabled and individual book updates
* ZB fixes to order submission/retrieval/cancellation w/ general fixes
* Quiet unnecessary warning
* updated config entry values for REST and websocket (initial hack until I come up with a better solution for asset types)
* Ch GetName function to field access modifyer & rm useless code
* Add in error I missed
* Nits addressed
* some more fixes
* Turned kraken default websocket to true and some small changes
* fixes linter issues
* Ensured okgroup books and sent update through to datahandler. Zb update as well.
* Add test case to get asset type from pair
* Add test for pairs unmarshal
* Add testing and addressed nits
* FIX linter issue
* Addressed Gees nits
* Thanks glorious spotter
* more nitorinos
* Addres even more nits
* Add stringerino 4000
* Fix for panic cause by sort slice out of range, also nits addressed
* fix linter issues
* Changed from function to field access
* Changed from function to field access
* fix for orderbook update panic, removes quick fix - caused by sync item fetching through same protocol
* Add new test and update random generator
* pass in invalid string to future ob fetching, due to futures contract expire and a http 400 error is returned
* Initial commit tearing down the websocket connection management. The purpose is to remove the traffic monitoring and dropping as syncer.go is a better manager
* Adds a readwrite mutex and helper functions to minimise inline lock/unlocks and prevent races
* Creates new WebsocketType struct to contain all parameters required. Deletes WebsocketReset. Utilises ReadMessageErrors channel for all websocket readmessages to analyse when an error returned is due to a disconnect
* Fixes issue with syncer trying to connect while connecting
* Simplifies initialisation function for websocket. Reconnects and resubscribes after disconnection
* Adds WebsocketTimeout config value to dictate when the websocket traffic monitor should die. Default to two minutes of no traffic activity. Increases test coverage and updates existing tests to work with new technologic. RE-ADDS TESTS I ACCIDENTALLY DELETED FROM PREVIOUS PR
* Removes snapshot override as its always necessary when considering reconnections. Increases test coverage. Re-adds tests that were ACCIDENTALLY DELETED. Removes unused websocket channels. Bug fix for traffic monitor to shutdown via goroutine instead of killing itself
* Fixes gateio bug for authentication errors when null. Adds little entry to syncer for when websocket is switched to rest and then back, you get a log notifying of the return. Fixes okgroup bug where ws message is sent on a disconnected ws, causing panic. Renames setConnectionStatus to setConnectedStatus. Puts connection monitor log behind verbose bool
* Fixes lingering races. Fixes bug where websocket was enabled whether you liked it or not. Removes demonstration test
* Fixes log message, renames unc, removes comments
* Fixes data race
* Removes verbosity, ensures shutdown sets connection status appropriately
* Removes go routine causing CPU spike. Stops timers properly and resets timers properly
* Renames `WsEnabled` to `Enabled`. Increases test coverage. Fixes typos. Handles unhandled errors
* The forgotten lint
* With using RWlocks, removes the channel nil check and relies on !w.IsConnected() to prevent a shutdown from recurring
* Removes extra closure step in the defer as it causes all the issues
* Prevents timer channel hangups. Minimises use of websocket Connect(). Expands disconnection error definition. Removes routine disconnection error handling. Ensures only one traffic monitor can ever be run. Renames subscriptionLock to subscriptionMutext for consistency
* Extends timeout to 30 seconds to cover for non-popular exchanges and non-popular currencies
* Updates test from rebase to use new websocket setup function
* Fixes test to ensure it tests what it says it does
1) Although gRPC does server side validation currently, validate basic things
on gctcli before relaying the request to the gRPC server
2) Make pair format consistent for the exchange sycner
3) Fix OKEX ticker failure due to thinking futures info is authenticated
4) Start filling out config tests
5) Extend timeout for golangci config so that AppVeyor has time to
complete (Travis is fine)
6) Add IsSupported exchange func for easy lookup
* Adds extra properties to Websocket ticker. Adds new properties to binance and bitfinex, but doesn't test anything yet. Changes names and properties of ticker package to make more streamlined
* Adds support for coinbasepro, coinut, gateio, gitbtc, huobi, hadax, kraken, okex, okcoin. Adds quoteVolume
* Adds poloniex and ZB ticker datas
* Updates ANX, Binance, Bitfinex, Bistamp, Bittrex, BTCMarkets, BTSE, CoinbasePRo, Coinut, Exmo tickers. It looks like a whole bunch of stuff is wrong in how tickers are done though :/
* Updates tickers everywhere. Will revert batch ones
* Re-Preseves ticker batching
* Minor fixes to ticks and removal of comment
* Logging errors instead of returning mid loop. Adds bitfinex batch ticker processing. Fixes unrelated okgroup wallet bug
* Removes bad code I wrote preventing function from running if feature not enabled
* Fixes issue with bitmex and rebase issues
* Fixes bitmex iterator error, splits hitbtc ticker requests
* Fixes okgroup currency pair formatting. Updates okgroup to use ticker batching. Fixes okgroup ticker issues due to assetTypes. Fixes okgroup ws pinging. Fixes Kraken's currency pairs formatting. Reverts ANXs auto parsing back to strings because ANX json makes me cry. Minor property improvements for coinut, coinbasepro, btse, exmo. Protects wshandler manageSubscriptions() from running and returning an error when feature not supported
* Updates config example to reflect the underscore dash situation
* Fixes a config delimiter oopsie. Simplifies ANX wrapper ticker parsing. Fixes bittrex date parsing. Simplifies okcoin switch to if.
* Fixes super fun issue where kraken has updated their currency pair format and must add new delimiter support. Fixes super fun issue where okex has updated their currency pair format and must add new delimiter support. Fixes super fun issue where okcoin has updated their currency pair format and must add new delimiter support.
* Updates config example for kraken
* Adds lbank batch ticker support. Adds details to errors
* Updates FetchTradablePairs to use the config delimiter to prevent issues if the delimiter ever changes
* Fixes nil reference bug. Uses NAme not GetNAme
* Fixes hardcoded delimiter in Binance. Expands bitfinex websocket ticker fields. Updates Bitstamp rate limits. Expands BTSE ticker data fields. Fixes typo in coibasepro. Expands Coinut ticker data. Renames currency to curr as it conflicts with package name. Expands GateIO websocket ticker data. Fixes ticker data implementation for huobi and huobi hadax. Reverts ticker map to string instead of assetType. Fixes real stupid bug I introduced which preveted subscriptions from running :glitch_crab: Adds Price ATH to ws ticker type. Adds quotevolume to yobit ticker. Uses delimiter in ZB rather than hardcoded field.
* Fixes bug in syncer where if the websocket is already connected, then UsingWebsocket is not set
* Updates broken tests
* Simplifies poloniex frozen check
* Updates configtest.json with new delimiters
* Renames shorthand properties of structs. Fixes delimiter referencing
* Fixes some bugs and nits around variable declaration, currency pairs and config upscaling
* Adds config upgrade path for okcoin and okex. Reverts configtest.json.
* Fixes okex futures currency formatting by no longer using global currency format. updates Run code to adapt. Removes BTSE value
* Adds ":" as a delimiter for when a delimiter only shows up SOMETIMES
* Adds support for optional delimiter
* 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