* stream/buffer: Adds key map optimisation (cherry-pick)
* stream/buffer: Add buffer to DataHandler intermediary. Add field InitialUpdate bool to toggle when first update is seen for initial sync.
* whoops
* buffer: Add difference benchmarks for reference
* glorious: nits (reverting out of context changes)
* RM unused error that will be used later
* purge: benchmark
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* initial concept of a nice validation tester for exchanges
* adds some datahandler design
* expand testing
* more tests and fixes
* minor end of day fix for bithumb
* fixes implementation issues
* more test coverage and improvements, but not sure if i should continue
* fix more wrapper implementations
* adds error type, more fixes
* changes signature, fixes implementations
* fixes more wrapper implementations
* one more bit
* more cleanup
* WOW things work?
* lintle 1/1337
* mini bump
* fixes all linting
* neaten
* GetOrderInfo+ asset pair fixes+improvements
* adds new websocket test
* expand ws testing
* fix bug, expand tests, improve implementation
* code coverage of a lot of new codes
* fixes everything
* reverts accidental changes
* minor fixes from reviewing code
* removes Bitfinex cancelBatchOrder implementation
* fixes dumb baby typo for babies
* mini nit fixes
* so many nits to address
* addresses all the nits
* Titlecase
* switcheroo
* removes websocket testing for now
* fix appveyor, minor test fix
* fixes typo, re-kindles killed kode
* skip binance wrapper tests when running CI
* expired context, huobi okx fixes
* kodespull
* fix ordering
* time fix because why not
* fix exmo, others
* hopefully this fixes all of my life's problems
* last thing today
* huobi, more like hypotrophy
* golangci-lint, more like mypooroldknee-splint
* fix huobi times by removing them
* should fix okx currency issues
* blocks the application
* adds last little contingency for pairs
* addresses most nits and new problems
* lovely fixed before seeing why okx sucks
* fixes issues with okx websocket
* the classic receieieivaier
* lintle
* adds test and fixes existing tests
* expands error handling messages during setup
* fixes dumb okx bugs introduced
* quick fix for lint and exmo
* fixes nixes
* fix exmo deposit issue
* lint
* fixes issue with extra asset runs missing
* fix surprise race
* all the lint and merge fixes
* fixes surprise bugs in OKx
* fixes issues with times and chains
* fixing all the merge stuff
* merge fix
* rm logs and a panic potential
* lovely lint lament
* an easy demonstration of scenario, but not of initial purpose
* put it in the bin
* Revert "put it in the bin"
This reverts commit 15c6490f713233d43f10957367fcbf18e3818bdd.
* re-add after immediate error popup
* fix mini poor test design
* okx okay
* merge fixes
* fixes issues discovered in lovely test
* I FORGOT TO COMMIT THIS
* nit fixaroonaboo
* forgoetten test fix
* revert old okx asset intrument work
* fixes
* revert problems I didnt understand. update bybit
* fix merge bugs
* test cleanup
* further improvements
* reshuffle and lint
* rm redundant CI_TEST by rm the CI_TEST field that is redundant
* path fix
* move to its own section, dont run on 32 bit + appveyor
* lint
* fix lbank
* address nits
* let it rip
* fix failing test time range
* niteroo boogaloo
* mod tidy, use common.SimpleTimeFormat
* orderbook/buffer: data integrity and resubscription pass
* btcmarkets: REMOVE THAT LIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIINE!!!!!!!!!!!!!!!!!
* buffer: reinstate publish, refaactor, invalidate more and comments
* buffer/orderbook: improve update and snapshot performance. Move Update type to orderbook package to util. pointer through entire function calls. (cleanup). Change action string to uint8 for easier comparison. Add parsing helper. Update current test benchmark comments.
* dispatch: change publish func to variadic id param
* dispatch: remove sender receiver wait time as this adds overhead and complexity. update tests.
* dispatch: don't create pointers for every job container
* rpcserver: fix assertion issues with data publishing change
* linter: fixes
* glorious: nits addr
* depth: change validation handling to incorporate and store err
* linter: fix more issues
* dispatch: fix race
* travis: update before fetching
* depth: wrap and return wrapped error in invalidate call and fix tests
* btcmarkets: fix commenting
* workflow: check
* workflow: check
* orderbook: check error
* buffer/depth: return invalidation error and fix tests
* gctcli: display errors on orderbook streams
* buffer: remove unused types
* orderbook/bitmex: shift function to bitmex
* orderbook: Add specific comments to unexported functions that don't have locking require locking.
* orderbook: restrict published data functionality to orderbook.Outbound interface
* common: add assertion failure helper for error
* dispatch: remove atomics, add mutex protection, remove add/remove worker, redo main tests
* dispatch: export function
* engine: revert and change sub logger to manager
* engine: remove old test
* dispatch: add common variable ;)
* btcmarket: don't overflow int in tests on 32bit systems
* ci: force 1.17.7 usage for go
* Revert "ci: force 1.17.7 usage for go"
This reverts commit af2f95563bf218cf2b9f36a9fcf3258e2c6a2d91.
* golangci: bump version add and remove linter items
* Revert "golangci: bump version add and remove linter items"
This reverts commit 3c98bffc9d030e39faca0387ea40c151df2ab06b.
* dispatch: remove unsused mutex from mux
* order: slight optimizations
* nits: glorious
* dispatch: fix regression on uuid generation and input inline with master
* linter: fix
* linter: fix
* glorious: nit - rm slice segration
* account: fix test after merge
* coinbasepro: revert change
* account: close channel instead of needing a receiver, push alert in routine to prepare for waiter.
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* btcmarkets: add websocket checksum, fetch different book via REST
* Update exchanges/btcmarkets/btcmarkets_test.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* buffer: add explicit type for buffer related variables and comments, do all checks buffer side and load in setup as per glorious recom.
* buffer: fix tests add error
* buffer: test re-add code cov
* depth/stream/ws: fix tests, change field name to be more specific.
* buffer: rm unused field and small comment fixes
* btcm: remove redundant field
* glorious: nits
* buffer: fix commenting
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Allow configuration of orderbook publish period
For some applications that import GCT it's more interesting to be
immediately notified of an exchange orderbook update instead of
only getting notified every 10 seconds. This option allows that
to happen while keeping the previous default.
* exchanges: allow configuration of orderbook update period
* [FIX] Enable ws orderbook sync recovery by:
- Testing if books have been cleared
- Assigning options when loading snapshot
* orderbooks: remove setlastupdate method and on select depth method that updates linked list, this reduced lock contention across code base and fixes buffer bug on applying buffered updates
* WS - Introduce signaling for the need to fetch the orderbook
* Address nits
* Update error messages to include exchange name
Co-authored-by: shazbert <oharareid.ryan@gmail.com>
* Speeds up tests
* Reduces time.Sleeps, lowers CreateTestBot complexity. Breaks things
* Removal of unecessary config reads. Parallel tests. Lower times
* Speeds up recent trades results
* mini update
* zoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooom
* Removes the dupes
* Lint
* post cherrypick
* Fix rare kraken data race
* Fixes banking global issues. Fixes postgres trades
* rmline for appveyor test
* Expands timeout in event that channel is closed before send
* Fix data race
* No rows, no bows and definitely no shows
* Removes parallel from createsnapshot tests
* Extends timedmutext test a smidge. Exchange fatality
* Shorter end timeframe and bigger candle
* Exchanges: Initial implementation after rebase of depth (WIP)
* orderbook/buffer: convert and couple orderbook interaction functionality from buffer to orderbook linked list - Use single point reference for orderbook depth
* buffer/orderbook: conversion continued (WIP)
* exchange: buffer/linkedlist handover (WIP)
* Added some tests for yesterday
* linkedList: added more testing and trying to figure out broken things
* Started tying everything in
* continuous integration and testing
* orderbook: expanded tests
* go mod tidy
* Add in different synchornisation levels for protocols
Add in timer for the streaming system to reduce updates to datahandler
Add in more test code as I integrate more exchanges
* Depth: Add tests, add length check to call linked list updating, add in constructor.
Linked List: Improve tests, add in checks for zero liquidity on books.
Node: Added in cleaner POC, add in contructor.
Buffer: Fixed tests, checked benchmarks.
* orderbook: reinstate dispatch calls
* Addr glorious & madcozbad nits
* fix functionality and add tests
* Address linterinos
* remove label
* expanded comment
* fix races and and bitmex test
* reinstate go routine for alerting changes
* rm line :D
* fix more tests
* Addr glorious nits
* rm glorious field
* depth: defer unlock to stop deadlock
* orderbook: remove unused vars
* buffer: fix test to what it should be
* nits: madcosbad addr
* nits: glorious nits
* linkedlist: remove unused params
* orderbook: shift time call to outside of push to inline, add in case for update inster price for zero liquidity, nits
* orderbook: nits addressed
* engine: change stream -> websocket convention and remove unused function
* nits: glorious nits
* Websocket Buffer: Add verbosity switch
* linked list: Add comment
* linked list: fix spelling
* nits: glorious nits
* orderbook: Adds in test and explicit time type with constructor, fix nits
* linter
* spelling: removed the dere fence
* depth: Update alerting mechanism to a more battle tested state
* depth: spelling
* nits: glorious nits
* linked list: match cases
* buffer: fix linter issue
* golangci: increase timeout by 30 seconds
* nodes: update atomic checks
* spelling: fix
* node: add in commentary
* exchanges/syncer: add function to switch over to REST when websocket functionality is not available for a specific asset type
* linter: exchange linter issues
* syncer: Add in warning
* nits: glorious nits
* AssetWebsocketSupport: unexport map
* Nits: Adrr
* rm letter
* exchanges: Orderbook verification change for naming, deprecate checksum bypass as it has the potential to obfuscate errors that are at the tail end of the book, add in verification for websocket stream updates
* general: fix spelling remove breakpoint
* nits: fix more glorious nits until more are found
* orderbook: fix tests
* orderbook: fix wait tests and add in more checks
* nits: addr
* orderbook: remove dispatch reference
* linkedlist: consolidate bid/ask functions
* linked lisdt: remove words
* fix spelling
* port orderbook binance management from draft singular asset (spot) processing add additional updates to buffer management
* integrate port
* shifted burden of proof to exchange and remove repairing techniques that obfuscate issues and could caause artifacts
* WIP
* Update exchanges, update tests, update configuration so we can default off on buffer util.
* Add buffer enabled switching to all exchanges and some that are missing, default to off.
* lbtc set not aggregate books
* Addr linter issues
* EOD wip
* optimization and bug fix pass
* clean before test and benchmarking
* add testing/benchmarks to sorting/reversing functions, dropped pointer to slice as we aren't changing slice len or cap
* Add tests and removed ptr for main book as we just ammend amount
* addr exchange test issues
* ci issues
* addr glorious issues
* Addr MCB nits, fixed funding rate book for bitfinex and fixed potential panic on nil book return
* addr linter issues
* updated mistakes
* Fix more tests
* revert bypass
* Addr mcb nits
* fix zero price bug caused by exchange. Filted out bid result rather then unsubscribing. Updated orderbook to L2 so there is no aggregation.
* Allow for zero bid and ask books to be loaded and warn if found.
* remove authentication subscription conflicts as they do not have a channel ID return
* WIP - Batching outbound requests for kraken as they do not give you the partial if you subscribe to do many things.
* finalised outbound request for kraken
* filter zero value due to invalid returned data from exchange, add in max subscription amount and increased outbound batch limit
* expand to max allowed book length & fix issue where they were sending a zero length ask side when we sent a depth of zero
* Updated function comments and added in more realistic book sizing for sort cases
* change map ordering
* amalgamate maps in buffer
* Rm ln
* fix kraken linter issues
* add in buffer initialisation
* increase timout by 30seconds
* Coinbene: Add websocket orderbook length check.
* Engine: Improve switch statement for orderbook summary dissplay.
* Binance: Added tests, remove deadlock
* Exchanges: Change orderbook field -> IsFundingRate
* Orderbook Buffer: Added method to orderbookHolder
* Kraken: removed superfluous integer for sleep
* Bitmex: fixed error return
* cmd/gctcli: force 8 decimal place usage for orderbook streaming
* Kraken: Add checksum and fix bug where we were dropping returned data which was causing artifacts
* Kraken: As per orderbook documentation added in maxdepth field to update to filter depth that goes beyond current scope
* Bitfinex: Tracking down bug on margin-funding, added sequence and checksum validation websocket config on connect (WIP)
* Bitfinex: Complete implementation of checksum
* Bitfinex: Fix funding book insertion and checksum - Dropped updates and deleting items not on book are continuously occuring from stream
* Bitfinex: Fix linter issues
* Bitfinex: Fix even more linter issues.
* Bitmex: Populate orderbook base identification fields to be passed back when error occurrs
* OkGroup: Populate orderbook base identification fields to be passed back when error occurrs
* BTSE: Change string check to 'connect success' to capture multiple user successful strings
* Bitfinex: Updated handling of funding tickers
* Bitfinex: Fix undocumented alignment bug for funding rates
* Bitfinex: Updated error return with more information
* Bitfinex: Change REST fetching to Raw book to keep it in line with websocket implementation. Fix woopsy.
* Localbitcoins: Had to impose a rate limiter to stop errors, fixed return for easier error identification.
* Exchanges: Update failing tests
* LocalBitcoins: Addr nit and bumped time by 1 second for fetching books
* Kraken: Dynamically scale precision based on str return for checksum calculations
* Kraken: Add pair and asset type to validateCRC32 error reponse
* BTSE: Filter out zero amount orderbook price levels in websocket return
* Exchanges: Update orderbook functions to return orderbook base to differentiate errors.
* BTSE: Fix spelling
* Bitmex: Fix error return string
* BTSE: Add orderbook filtering function
* Coinbene: Change wording
* BTSE: Add test for filtering
* Binance: Addr nits, added in variables for buffers and worker amounts and fixed error log messages
* GolangCI: Remove excess 0
* Binance: Reduces double ups on asset and pair in errors
* Binance: Fix error checking
* initial update of currency system
* WIP progress
* Finish initial currency string error returns
* fix whoopsie testing for non https insecureinos
* Current WIP for getEnabledPairs check and error return
* WIP continued
* When getting enabled pairs throw error when item is not contained in available pairs list
* More updates -WIP
* Wip continued including potential interface
* Current WIP
* pairs manager pass
* drop asset string and just use the map key, plus return some errors and create more work for myself.
* clean and fixed a bug in currency.json, will not populate correctly without coinmarketcap api keys set.
* purge logger references after merge
* go mod tidy after merge
* Pointer change WIP
* fix some issues and added error returns to a few items (WIP)
* WIP
* Clean
* Fix some linter issues
* Fix more linter issues
* even more linters
* xtda nits
* revert pointer change and rm field
* Addr madcozbadd nits
* fix linter issues: shadow declarations
* Fix linter issues: gocritic huge things
* linter issue fix
* Addr nits
* flush go mod files
* after merge woops
* fix shadow dec
* Addr thrasher nits
* addr nits
* fix some issues
* more fixes
* RM println
* Addr glorious nits
* Add helper method for setting assets
* add missing format directive
* Addr nits
* Actually process new futures contracts -_- derp
* WIP for GRPC upgrade for pair management
* update config pairs
* finished disabling and enabling asset
* linked update of tradable pairs to cli
* fix oopsies
* defer writing to file on program termination for currency storage system
* update template
* don't add disabled asset items to initial sync
* Fix enable disabling a list of pairs and added in a slice error type so we can add whats allowable without throwing an error and return a report, also addressed some other nits
* WIP on getting a channel to unsub
* Wip track down unsubscribe bug and start creating streaming interface
* purge websocket orderbook object and centralised updating routine for orderbook
* general clean before interface implementation
* stage one connection interface WIP
* WIP
* repackage wshandler WIP
* find difference of subs and change signature of subscriber functions so we can batch subscriptions and unsubscription in exchanges that support it
* design change on mange subscription routine WIP
* integrated ZB with the new webosocket updates
* WIP - okex conversion
* integrate websocket upgrades for lakebtc, kraken, huobi, hitbtc, gateio, and WIP for coinbene
* integrate another range of exchanges for websocket update
* Added subscriber and unsubscriber methods to websocket functionality
* fixed tests WIP
* amalgamate cache setup with main websocket setup
* reinstate exported fields traffic alert and shutdownC to accommodate gemini and lakebtc implementations
* added in colon
* Updated websocket auth handling as they werent getting passed through. Added a setter method for websocket URL due to the Binance generated auth key/listenKey. Fixed bug which stopped reconnection.
* Fix subscribe candle bug
Fix time conversion in candle
Fix inititial candle history to datahandler
Include funding to orderbook handling
Include funding to trades
Reduce code duplication in sub and unsub functions
Added the ability to include funding currency websocket subscriptions
validated all channels and added more items todo list (Auth items)
* RM line
* bitstamp pass
* btcmarkets pass - still needs to implement unsubscriber functionality and pairs change test.
* Batch outgoing subscriptions and fix unsubscribe bug
* BTSE - bumped time to minute to reduce pinger calling by 75 calls per day. Fix authentication bug and add authentication pass into to-do. Batch outgoing subscription calls
* fix type field and batch outgoing subs and unsubs for coinbasepro
* Batch outgoing subs and unsubs
* Fixes bug when matching return from authentication
* Fix bug where params where being sent out of order due to map ,where depth items werent being subscribed too, where trying to subscribe to too many kline items caused error, where trying to get a nano secocond ID conflicted due to speed of generation.
* Add websocket capability for currency pair change by utilizing full channel subscription list in subscribe function.
* Add error handling
* Fix public: time conversions, subscription list, stopped pushing heartbeat to data handler, aggregated list of connections.
* hitBTC pass
* returned nil instead of error due to period null bids and asks updates coming through.
* Fix auth ping capture and reply. Added in interval handling for kline data. Added correct full trade data handling. Fix subscribe and unsubscribe.
* Fix when websocket auth conn and token generation fail we don't try and auth sub. Fix bug between auth and normal connection id generation and matching. Batch outgoing payloads to increase efficiency. Updated matching functions to utilise channels instead of waitgroups and go routines.
* RM debug output
* rm func to get shutdown channel
* Add unsubscriber functionality, added wsTicker type, removed return as this will impede data flow and cause reconnection when handling and processing data
* okgroup WIP
* *Added missing fields for websocket trades
*Fix bug processing kline interval
*Added fields for websocket ticker struct
*Fix auth bug
-Updated request and response matching param to interface so we can custom signature match. Stops auth subscribing before a reply is issued.
-Updated channel inclusion of pair fo auth subs as this was missing.
*Assortment of perfomance improvements
* poloniex pass
* send all trades to data handler, validated enabled and disable pairs
* initial clean
* centralised request matching mechanism
* websocket main improvements WIP
* WIP
* Websocket management via gctcli WIP
* GRPC expansion
* Updated GCTCLI with websocket url and proxy setting functionality which flushes connection
* Fix continuous spawning of routines bug on error with reconnection
* Addr linter issues
* fix subscription bug that I caused when I changed to a switch case
* fix linter issue
* fix woopsie
* End of day WIP
* Fix order submission REST, time conversion, order type conversion, orderID bugs
* fix gateio test and unsubscribe bug
* revert comment out code
* websocketAPI changed to to true in configtest.json
* fix race in gateio test
* End of day WIP for websocket tests.
* BugFix for binance when book isn't seeded. Updated websocket tests. Deprecated subscription manager. RM wrapper funcs.
* Added string title to exchange name as they are saved as lower case in type, reinstated verbose check in websocket.go
* Added verbosity check for setting websocket URL
* fix bug where the asset had a mind of its own
* purge dodgy coding
* Fix tests, drop blocking chan in websocket Dial function
* few more changes
* race condition fix for websocket tests.
* fix intermittent test failure due to underlying hash table storage
* Address madcuzbad nit
* RM superfluous printlines
* Add quick top example with paramater fields
* First pass Glorious nits
* As per madcozbad suggestion return error when enabled pair not found in full return map. Add test.
* addr madcozbadd nits
* as per glorious suggestion rm'd loadedJSON field
* adjusted ticker, added test and RM'd code that can never be executed
* Addr nits and add in crypto rand genration for ID's
* remove global channel declaration and rescoped as this was causing a lock
* as per glorious suggestion restructured return error for websocket
* addr glorious suggestions
* fix linter issues
* purge non-existent pair from testdata
* add side field to struct and parse
* addr glorious nits
* Add verbosity to error returns and logs and fix string parsing in GCTRPC
* fix speeling mistwake
* Adds websocket functionality check before flushing websocket connection
* Addr kraken panic and setting/flush websocket url stage one.
* added websocket url check before setting with tests
* Added in edge case test if by the time we call contains on available pairs it has been changed
* remove error return for func
* Continuation of tests
* continuation of tests
* Stop potential panic within pair creation function
* Implement changes to upstream
* rm sup comment
* fix bug when subscribing and unsubscribing. Also add in boolean to determine there are currencies that need to be flushed via set pairs via gctcli
* fix test
* Fix linter issues
* Fix tests
* turn websocket off in config example
* Fix issue where you cannot enable websocket when config is set to false, also added config websocket enable state saving
* Introduced err var for same error returns
* Add err var exchange base not found
* restructure function
* drop gctscript from generic response name
* drop managesub delay const as its not being used
* correctly implement websocket rate limiting for coinut
* remove quotations
* drop pair management check
* fix spelling
* return error in function to not update currency with unset role
* amalagamted enable/disable into set function and added in pairstore fetch function
* update error description
* rm function
* moved test function to sharedtestvals and move type to types.go
* append delimiter onto currency delimiter strings
* add test coverage
* rm functions as they are set as methods in base
* remove superfluous methods
* Fix issue that would occur when a subscription errored and not appending successful subs
* fix after rebase woopsie
* fix linter issues
* fix bug streamline code
* fix linter issues
* fix linter issues
* fix case where it should not change ID if set but append new
* fix whoopsie
* fix websocket tests
* fix readme, fix wrapper issues reporting template, go mod tidy
* add test coverage
* add test coverage and verified futures pariing
* add in futures bypass as its not currently supported on BTSE until API update and implementation
* removed downside/upside profit contract type as its no longer supported. Added in check in set config pairs to warn user of potential conflict and to manually remove or update.
* If asset enabled add pair and increase code coverage
* remove strings.title, set and fetch with strings.Lower but keep struct field exchangename unchanged. Streamline ticker and orderbook code.
* Add code coverage
* log error if setting default currency fails, add code coverage
* address glorious nits
* Addr xtda nits
* fix linter issues
* addr glorious nits
* xtda nits
* Addr glorious nits
* add subscription protection and removed a superfluous wait call
* fix test
* fix whoopsie
* addr xtda nits
* addr glorious nits
* Added asset types to subscriptions structs, also added in error handling for resubscription errors
* consolidated rpc returned type and added in sucessful strings
* dropped stream timing down to 100ms
* DOC changes
* proxy and url usage string additions
* WIP
* go mod tidy rides again
* Addr nits
* Addr nits, fix tests
* fix wording
* add in test case for currency matching
* Add byte length check on outbound websocket payload subscriptions
* addr thrasher nits
* Addr madcozbadd nits
* addr linter issues
* Addr glorious nits by amalgamating function into one mega amazing function.
* fix futures account subscription bug
* addr glorious nits and reinstated wg.Wait() checks
* changed string to currency delimiter string and setconnected by function