Commit Graph

1383 Commits

Author SHA1 Message Date
Ryan O'Hara-Reid
a2381310da GCT: general updates across codebase (#699)
* orderbook: export orderbook nodes for external strategy inspection

* orderbook: Add in methods for locking and unlocking multiple books at the same time e.g. book1.LockWith(book2); defer book1.UnlockWith(book2)

* include waiting functionality for depth change alert

* backtester: add word.

* log: include logger changes to impl with downstream integration

* engine: reduce params for loading exchange

* assort: rm verbose in tests, change wording in ob, expose sync.waitgroup for ext. sync options

* ticker: reduce map look ups and contention when using RW mutex when there are over 80% writes adds find last function to get the latest rate

* engine/syncmanager: add in waitgroup for step over for external package calls

* cleaup

* engine: linter fix

* currency/fx: include all references to fiat currencies to default

* orderbook: Add in fields to Unsafe type for strategies to detect potential out of sync book operations

* syncmanager: changed config variable to display correct time

* ordermanager: Add time when none provided

* currency/manager: update getasset param to get enabled assets for minor optimizations

* ftx: use get all wallet balances for a better accounts breakdown

* orderbook: unlock in reverse order

* bithumb: fixes bug on market buy and sell orders

* bithumb: fix bug for nonce is also time window sensitive

* bithumb: get orders add required parameter

* bithumb: Add asset type to account struct

* currency: improve log output when checking currency and it fails

* bithumb: Add error return on incomplete pair

* ticker:unexport all service related methods

* ticker/currency: fixes

* orderbook: fix comment

* engine: revert variable name in LoadExchange method

* sync_manager: fix panic when enabling disabling manager

* engine: fix naming convention of exported function and comments

* engine: update comment

* orderbook: fix comment for unsafe type
2021-07-29 14:42:28 +10:00
Yordan Miladinov
4f5ab42bd8 build: Enrich .gitignore (#728)
* gitignore: ignore __debug_bin (compiled by delve)

* gitignore: ignore coverage reports
2021-07-29 09:37:38 +10:00
Ryan O'Hara-Reid
9ea72f2193 ftx: add basic exchange order execution limits for lower bound (#725)
* ftx: add basic exchange order execution limits for lower bound

* ftx/binance: conform to standard logger output

* ftx: fix field from SizeIncrement -> MinProvideSize

* limits: fix whoopsie

* limit: add tests

* ftx: fix comment
2021-07-29 09:15:02 +10:00
Luis Rascão
a6e158ab0c Switch protobuf generation to buf cli tool (#720)
Current generation of protobuf stubs is hard and there's open issues
around it:
   https://github.com/grpc-ecosystem/grpc-gateway/issues/1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
2021-07-28 10:34:46 +10:00
Yordan Miladinov
4d9a49e7f7 gctrpc: endpoints now optionally return timestamps in nanoseconds (configurable) (#718)
* config: add remoteControl/gRPC/timeInNanoSeconds

* grpc: consult with remoteControl/gRPC/timeInNanoSeconds whether timestamps should be in seconds or nanos

* engine: test if RPCServer.unixTimestamp() respects config/remoteControl/gRPC/timeInNanoSeconds

* engine: implement TestRPCServer_GetTicker_LastUpdatedNanos that makes sure TickerResponse.LastUpdated is returned in nanoseconds if configured

* config_example.json: add remoteControl/gRPC/timeInNanoSeconds

* engine: (1) test RPCServer.unixTimestamp() in parallel, (2) increase time tolerance of TestRPCServer_GetTicker_LastUpdatedNanos()

* engine: TestRPCServer_GetTicker_LastUpdatedNanos() now fetches a mock-up ticker to check timestamps
2021-07-28 09:22:20 +10:00
Scott
b5aa3eddb2 backtester: Fix selling bug, add planned features list (#722)
* Fixes sell bug. Updates docs. Adds test

* Doc fixes

* reorder and lint

* Lint again!

* Minor improvement to ensure theoretical upsized orders don't exceed portfolio limits

* Fixes test error

* %vamoose!

* Fixes defaulting to int
2021-07-27 12:50:07 +10:00
Yordan Miladinov
c23d66b873 gctrpc: generate protobuf files with latest versions of tools (#721)
* gctrpc: generate protobuf files with latest versions of tools

* gctrpc: generation scripts now use protoc-gen-openapiv2 (instead of protoc-gen-swagger)

* gtcrpc: update readme
2021-07-27 12:37:30 +10:00
Yordan Miladinov
44ae89542f connchecker: initialCheck() now also respects CheckInterval (#719) 2021-07-26 12:31:47 +10:00
Luis Rascão
cb21caccd0 backtester: Improve test coverage (#717)
* Improve config test coverage

* Improve common test coverage

* Improve data test coverage

* Silence false positives on table tests
2021-07-23 13:14:22 +10:00
Mark Dzulko
e1eceeafe8 gctrpc/ordermanager/binance: Add new getManagedOrders command and various improvements (#712)
* first draft of getmanaged orders RPC call

* - ClientIDs for binance, especially spot asset
- applied old ClientOrderId for cancelled orders
- added clientOrderId to GCTRPC

* added tests for Matchfilter and GetManagedOrders

* smaller fixes

* comment fix
added getFilteredOrders to store
changed store mutex to RWMutex
smaller fixes

* fixed bug in Detail Copy and added test

* fixes for Scotts review

* processSubmittedOrder was missing clientOrderId

* changed: TestGetOrdersFiltered expanded
fixed: warning, where variable name collided with package name
fixed: used req.AssetType in binance_wrapper.go

Co-authored-by: Mark Dzulko <81071907+Mark-numus@users.noreply.github.com>
2021-07-20 10:27:16 +10:00
Scott
6182dd6fbc BUGFIX: GateIO candle retrieval, backtester formatting (#715)
* Fixes gateio candle retrieval. Fixes backtester exch & currency lookups

* Fixes strat whoopsie

* Using a helper function instead

* shadowy lint figures defeated

* Fixes fodmap typo

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2021-07-19 11:48:52 +10:00
dependabot[bot]
0965678fbf Bump github.com/mattn/go-sqlite3 from 1.14.7 to 1.14.8 (#714)
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-16 16:45:33 +10:00
Adrian Gallagher
214ae37b7c Exchanges: Remove LakeBTC exchange implementation (#713)
* Remove LakeBTC exchange

* Remove more LakeBTC remnants

* Update LBank comment

* go mod tiderinos

* Remove LakeBTC from backup.json file
2021-07-14 13:24:32 +10:00
snussik
9527614431 Backtester: Update flag typo (#711)
* Update flag typo

* configPath typo fix

related to adeb748651
2021-07-14 09:53:09 +10:00
Mark Dzulko
62ab2be90b Binance: Websocket order update fixes (#709)
* Binance exchange:
- added missing ClientID
- fixed ID mapping (Ignored entry for JSON unmarshall)
- fixed wrongly spelled "CANCELED"

* Binance exchange:
- added missing ClientID
- fixed ID mapping (Ignored entry for JSON unmarshall)
- fixed wrongly spelled "CANCELED"

* Update go.mod

* fix formatting

* fixed switch assignment

* fixed trailing space

* fixed gci error message

* restored protobuf dependencz

* fixed review issues

* fixed go.mod file

Co-authored-by: Mark Dzulko <81071907+Mark-numus@users.noreply.github.com>
2021-07-13 09:55:26 +10:00
Scott
63257ce4ca Improvement: Speeding up slow tests (#707)
* 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
2021-07-07 12:42:03 +10:00
dependabot[bot]
7815d0a1f4 Bump github.com/d5/tengo/v2 from 2.7.0 to 2.8.0 (#708)
Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/d5/tengo/releases)
- [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml)
- [Commits](https://github.com/d5/tengo/compare/v2.7.0...v2.8.0)

---
updated-dependencies:
- dependency-name: github.com/d5/tengo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-06 11:28:14 +10:00
Scott
197ef2df21 Feature: Data history manager engine subsystem (#693)
* Adds lovely initial concept for historical data doer

* Adds ability to save tasks. Adds config. Adds startStop to engine

* Has a database microservice without use of globals! Further infrastructure design. Adds readme

* Commentary to help design

* Adds migrations for database

* readme and adds database models

* Some modelling that doesn't work end of day

* Completes datahistoryjob sql.Begins datahistoryjobresult

* Adds datahistoryjob functions to retreive job results. Adapts subsystem

* Adds process for upserting jobs and job results to the database

* Broken end of day weird sqlboiler crap

* Fixes issue with SQL generation.

* RPC generation and addition of basic upsert command

* Renames types

* Adds rpc functions

* quick commit before context swithc. Exchanges aren't being populated

* Begin the tests!

* complete sql tests. stop failed jobs. CLI command creation

* Defines rpc commands

* Fleshes out RPC implementation

* Expands testing

* Expands testing, removes double remove

* Adds coverage of data history subsystem, expands errors and nil checks

* Minor logic improvement

* streamlines datahistory test setup

* End of day minor linting

* Lint, convert simplify, rpc expansion, type expansion, readme expansion

* Documentation update

* Renames for consistency

* Completes RPC server commands

* Fixes tests

* Speeds up testing by reducing unnecessary actions. Adds maxjobspercycle config

* Comments for everything

* Adds missing result string. checks interval supported. default start end cli

* Fixes ID problem. Improves binance trade fetch. job ranges are processed

* adds dbservice coverage. adds rpcserver coverage

* docs regen, uses dbcon interface, reverts binance, fixes races, toggle manager

* Speed up tests, remove bad global usage, fix uuid check

* Adds verbose. Updates docs. Fixes postgres

* Minor changes to logging and start stop

* Fixes postgres db tests, fixes postgres column typo

* Fixes old string typo,removes constraint,error parsing for nonreaders

* prevents dhm running when table doesn't exist. Adds prereq documentation

* Adds parallel, rmlines, err fix, comment fix, minor param fixes

* doc regen, common time range check and test updating

* Fixes job validation issues. Updates candle range checker.

* Ensures test cannot fail due to time.Now() shenanigans

* Fixes oopsie, adds documentation and a warn

* Fixes another time test, adjusts copy

* Drastically speeds up data history manager tests via function overrides

* Fixes summary bug and better logs

* Fixes local time test, fixes websocket tests

* removes defaults and comment,updates error messages,sets cli command args

* Fixes FTX trade processing

* Fixes issue where jobs got stuck if data wasn't returned but retrieval was successful

* Improves test speed. Simplifies trade verification SQL. Adds command help

* Fixes the oopsies

* Fixes use of query within transaction. Fixes trade err

* oopsie, not needed

* Adds missing data status. Properly ends job even when data is missing

* errors are more verbose and so have more words to describe them

* Doc regen for new status

* tiny test tinkering

* str := string("Removes .String()").String()

* Merge fixups

* Fixes a data race discovered during github actions

* Allows websocket test to pass consistently

* Fixes merge issue preventing datahistorymanager from starting via config

* Niterinos cmd defaults and explanations

* fixes default oopsie

* Fixes lack of nil protection

* Additional oopsie

* More detailed error for validating job exchange
2021-07-01 16:21:48 +10:00
dependabot[bot]
c109cfb6b4 Bump google.golang.org/grpc from 1.38.0 to 1.39.0 (#704)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.38.0 to 1.39.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.38.0...v1.39.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-30 09:16:51 +10:00
Adam
81249646da exchanges: API coverage improvements and helper functions (#681)
* improved functions and new helper functions

* bitfinex margin info func

* small rate change

* rate changes

* adding some currencies for margin funding translation

* adding index candles

* added test

* slight improvement in params

* time func

* orderbook helper avgprice func

* broken test + removing some tlogs and prints

* adding test cases

* error fix

* remove unused

* another unused

* shazbert changes

* wip

* bitfinex func and more nits

* final shazzy nits

* most shazzy nits

* few prior requested changes

* shazbert nits final WIP

* shazbert changes

* minor linter issue

* unused val

* glorious changes

* more verbositiy improvements

* quick changes

* unused remaining amount oops

* thrasher changes

* reverting changes that were only for testing purposes and bymistake pushed up

* bfx shadow dec + huobi fetch tradable pairs formatted so as to return config format for ease of comparison and requests

* more linters

* glorious final nits wip

* formatting tradable pairs for different asset types + remove println

* glorious changes
2021-06-29 15:47:03 +10:00
dependabot[bot]
0090400eae Bump google.golang.org/protobuf from 1.26.0 to 1.27.1 (#703)
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.26.0 to 1.27.1.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.26.0...v1.27.1)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-29 09:45:31 +10:00
dependabot[bot]
905214d90d Bump github.com/spf13/viper from 1.8.0 to 1.8.1 (#702)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-28 09:21:06 +10:00
Ryan O'Hara-Reid
79a47cf569 gctcli: bump urfave cli depends version (#698)
* gctcli: bump version

* gctcli: flag alias done differenttttttttttttt

* gctcli: add autocomplete scripts to folder within gctcli cmd folder structure
2021-06-24 15:02:21 +10:00
arttobe
d978b3bbdc Binance: Fix websocket subscribe error with many currency pairs enabled (#670)
* Fix subscribe error with many currency pairs

* Adds proper rate limit. Adds empty check.

Co-authored-by: gloriousCode <scott.grant@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2021-06-23 15:53:57 +10:00
Scott
83057ef515 Kraken: Authenticated websocket bugfix (#701)
* Allows auth kraken websocket connection and subscriptions

* Removes params and params check with more appropriate auth check
2021-06-23 15:17:11 +10:00
Max Gravitt
53e767f991 portfolio: Add support for bech32 segwit addresses (#691)
* added portfolio support for bech32 segwit addresses

* segwit addresses may have l values so including this

* removed debug line

* Expands bech32 address validation support

* lint

Co-authored-by: gloriousCode <scott.grant@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2021-06-23 11:42:40 +10:00
Ryan O'Hara-Reid
bbdaae0485 engine: Set full state on settings struct (#697)
* engine: Set full state on settings validation before flag check to minimise future work when settings are added.

* engine: purge sillyness comment

* engine: address logic issues with change

* engine: invert boolean check
2021-06-23 10:44:47 +10:00
dependabot[bot]
7a232df990 Bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.4.0 to 2.5.0 (#700)
Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.4.0...v2.5.0)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-23 10:36:11 +10:00
tk42
af73d7ea3b FTX: Fixed typos in ftx_types (#694)
* fixed typo

* added EstimatedLiquidationPrice and CollateralUsed
2021-06-17 15:29:02 +10:00
dependabot[bot]
79f574b1b6 Bump github.com/spf13/viper from 1.7.1 to 1.8.0 (#695)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.7.1...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-17 12:12:25 +10:00
Adrian Gallagher
f234726382 FTX: Add REST staking and basic subaccount functionality (#692)
* Add FTX staking, missing margin APIs and basic subaccount support

* Fix backtester tests and add optional subaccount support to exchange_wrapper_issues tool

* subAccount to subaccount

* Fix TyPo

* Expand test coverage

* Address nitterinos

* Fix typos

* Remove unusued error type
2021-06-02 15:52:46 +10:00
Scott
5ea5245afb Improvement: Subsystem separation (#664)
* Initial codes for a trade tracker

* Moving everything in a broken fashion

* Removes tradetracker. Removes some errors for subsystems

* Cleans up some subsystems, renames stuttering types. Removes some global Bot usage

* More basic subsystem renaming and file moving

* Removes engine dependency from events,ntpserver,ordermanager,comms manager

* Exports eventManager, fixes rpcserver. puts rpcserver back for now

* Removes redundant error message, further removes engine dependencies

* experimental end of day interface usage

* adds ability to build the application

* Withdraw and event manager handling

* cleans up apiserver and communications manager

* Cleans up some start/setup processes. Though should separate

* More consistency with Setup Start Stop IsRunning funcs

* Final consistency pass before testing phase

* Fixes engine tests. Fixes stop nil issue

* api server tests

* Communications manager testing

* Connection manager tests and nilsubsystem error

* End of day currencypairsyncer tests

* Adds databaseconnection/databaseconnection_test.go

* Adds withdrawal manager tests

* Deposit address testing. Moved orderbook sync first as its more important

* Adds test for event manager

* More full eventmanager testing

* Adds testfile. Enables skipped test.

* ntp manager tests

* Adds ordermanager tests, Extracts a whole new subsystem from engine and fanangles import cycles

* Adds websocket routine manager tests

* Basic portfolio manager testing

* Fixes issue with currency pair sync startup

* Fixes issue with event manager startup

* Starts the order manager before backtester starts

* Fixes fee tests. Expands testing. Doesnt fix races

* Fixes most test races

* Resolves data races

* Fixes subsystem test issues

* currency pair syncer coverage tests

* Refactors portfolio. Fixes tests. Withdraw validation

Portfolio didn't need to exist with a portfolio manager. Now the porfolio manager
is in charge how the portfolio is handled and all portfolio functions are attached
to the base instead of just exported at the package level

Withdrawal validation occurred at the exchange level when it can just be run at the
withdrawal manager level. All withdrawal requests go through that endpoint

* lint -fix

* golang lint fixes

* lints and comments everything

* Updates GCT logo, adds documentation for some subsystems

* More documentation and more logo updates

* Fixes backtesting and apiserver errors encountered

* Fixes errors and typos from reviewing

* More minor fixes

* Changes %h verb to %w

* reverbs to %s

* Humbly begins reverting to more flat engine package

The main reasoning for this is that the subsystem split doesn't make sense
in a golang environment. The subsystems are only meant to be used with engine
and so by placing them in a non-engine area, it does not work and is
inconsistent with the rest of the application's package layout.

This will begin salvaging the changes made by reverting to a flat
engine package, but maintaining the consistent designs introduced.
Further, I will look to remove any TestMains and decrease the scope
of testing to be more local and decrease the issues that have been
caused from our style of testing.

* Manages to re-flatten things. Everything is within its own file

* mini fixes

* Fixes tests and data races and lints

* Updates docs tool for engine to create filename readmes

* os -> ioutil

* remove err

* Appveyor version increase test

* Removes tCleanup as its unsupported on appveyor

* Adds stuff that I thought was in previous merge master commit

* Removes cancel from test

* Fixes really fun test-exclusive data race

* minor nit fixes

* niterinos

* docs gen

* rm;rf test

* Remove typoline. expands startstop helper. Splits apiserver

* Removes accidental folder

* Uses update instead of replace for order upsert

* addresses nits. Renames files. Regenerates documentation.

* lint and removal of comments

* Add new test for default scenario

* Fixes typo

* regen docs
2021-05-31 10:17:12 +10:00
Rocky Yang
0e7d530c71 Binance/proxy: Several fixes (#678)
* Binance: REST respect proxy variable

* Binance: add rest API functionality
* margin account
* move accountInfo to authenticated endpoints
* myTrades endpoint (not yet implemented)
* add BUSD (available in Binance) to currencies enumeration

* Binance: websocket fix

* like REST, websocket dialer respects HTTP(S)_PROXY env vars
* handle situation when orderbook buffers websocket depth updates, the check on FastUpdateID and FirstUpdateID is done right before WebsocketDepthStream gets staged in orderbook manager's buffer channel. The assertion is this depth's FirstUpdateID should equal (last depth's LastUpdateID + 1)

* Binance: add Margin account test case

* Binance: fix typo in MarginAccount, add more fields

* Binance: margin account holdings bookkeeping

* Binance: add rest API functionality
* spot historical trades (public), needs API key in header
* change how margin account holdings are accounted in accordance with the PR

* Binance: use websocket message timestamp as orderbook update time

* Binance:
* fix mock test TestGetHistoricalTrades
* comment exported types

* Binance: fix linter issue

* Binance: add a lock to prevent orderbook test race
2021-05-28 14:56:55 +10:00
dependabot[bot]
a75d7f83f5 Bump google.golang.org/grpc from 1.37.1 to 1.38.0 (#690)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.37.1 to 1.38.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.37.1...v1.38.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-21 12:13:09 +10:00
TaltaM
7e9266e438 Bittrex: Update API v1.1 to v3 and add websocket support (#646)
* Update Bittrex API from v1.1 to v3

V1.1 has been retired as of 9/30/2020

- Update REST to V3
- Add initial websocket support

* Bittrex update - enable websockets in testdata config file

* Update Bittrex - add Websocket capability to docs

* Update Bittrex connector

- AppVeyor warnings
- Update tests
- Generate documentation
- Fix nits

* Update Bittrex - add websocket order processing

* Update Bittrex connector

* Bittrex connector - fix ineffectual err assignment

* Fix nits

* Orderbook synchronization

* Remove redundant nil

* Log WS fetch orderbook message as debug message instead of as warning

* Update after rebase

* Add tests

* Add allowed candle interval values

* Replace literals with declared constants

* Replace variable name 'request' with 'req'

* Add check and update for deprecated REST URL

* Nits and some cleaning up

* Change ParseInt bit size to 64

* [FIX] Remove several shadow declarations

* Do not export constructTicker

* Remove parseTime()

* Update GetHistoricCandles()

* [FIX] Address gocritic nits

* [FIX] Address gocritic nits

* Use SendMessageReturnResponse() instead of local map

* Rate limit subscribing and unsubscribing

* [FIX] use go routine for subscribing and unsubscribing

* [FIX] Set correct index for map

* [FIX] Address unused vars, literals, time format

* Adjusted timing when subscribing to many order books

* Cache partial updates to tickers instead of calling REST function

* [FIX] Update sequence nr when multiple updates are queued

* Address golint issues

* Fix nits
2021-05-18 11:33:53 +10:00
dependabot[bot]
9b5619e40c Bump github.com/lib/pq from 1.10.1 to 1.10.2 (#689)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.1...v1.10.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-18 09:53:23 +10:00
Adam
57bdecac6b Binance: Update rate limits (#686)
* wip banned for 10m

* wip ban 2 final test

* testing complete

* glorious changes

* small fix
2021-05-14 10:14:08 +10:00
dependabot[bot]
b4dd570745 Bump google.golang.org/grpc from 1.37.0 to 1.37.1 (#688)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.37.0 to 1.37.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.37.0...v1.37.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 16:19:21 +10:00
Ryan O'Hara-Reid
f34cce1b86 Engine: Remove test file/folder (#685) 2021-05-10 15:13:02 +10:00
Adrian Gallagher
051675255d CI: Add support for GitHub actions (#680)
* Add initial workflows config

* Add PSQL service

* Add 32bit and frontend jobs

* Add gcc-multilib and fix typo

* Fix backtester test for linux/unix filesystem errors and npm commands

* 32-bit Add -race to purposefully throw an error to ensure envs are set correctly (will revert)

* Revert "32-bit Add -race to purposefully throw an error to ensure envs are set correctly (will revert)"

This reverts commit b97e66c49fca859f8738e01107f96f9ca4040b2e.

* Bump workers count for orderbook processing

* Remove comments to trigger 32-bit cache hit after job success

* Cancel addition plus version bump, spawn more overlords

* Update build badge to Github Actions

* Brach -> Branch
2021-05-06 14:35:05 +10:00
Adrian Gallagher
6ff453c364 Currency: Add new forex provider exchangerate.host (#682)
* Add new forex provider ExchangeRateHost.io

* Fix linter paramTypeComine

* Add templates and README files

* Convert all times to UTC

* Fix cosmetic issue and address nits

* Add support for fx exchangerate.host engine override

* Address nit plus use remove plural
2021-05-05 15:32:49 +10:00
dependabot[bot]
5d445991c7 Bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.3.0 to 2.4.0 (#676)
* Bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.3.0 to 2.4.0

Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.3.0...v2.4.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix deprecated  timestamp funcs

* Address nits

* Typo %w -> %s

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2021-05-03 11:31:42 +10:00
dependabot[bot]
696d9c76b4 Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.2.2 to 1.3.0 (#677)
Bumps [github.com/grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/grpc-ecosystem/go-grpc-middleware/releases)
- [Changelog](https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.2.2...v1.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 14:25:02 +10:00
dependabot[bot]
a422cb2e7f Bump github.com/google/go-querystring from 1.0.0 to 1.1.0 (#675)
Bumps [github.com/google/go-querystring](https://github.com/google/go-querystring) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/google/go-querystring/releases)
- [Commits](https://github.com/google/go-querystring/compare/v1.0.0...v1.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 13:50:59 +10:00
dependabot[bot]
4425132909 Bump github.com/lib/pq from 1.10.0 to 1.10.1 (#673)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.0...v1.10.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 13:45:03 +10:00
dependabot[bot]
2b5ab7f4f8 Bump github.com/mattn/go-sqlite3 from 1.14.6 to 1.14.7 (#672)
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.6 to 1.14.7.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.6...v1.14.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 12:13:22 +10:00
dependabot[bot]
6763f4b325 Bump google.golang.org/grpc from 1.36.0 to 1.37.0 (#671)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.36.0 to 1.37.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.36.0...v1.37.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 12:10:25 +10:00
Scott
36a4bf4c1f Bugfix: Orderbook locks (#666) 2021-04-29 11:27:19 +10:00
dependabot-preview[bot]
b7f111a1a4 Upgrade to GitHub-native Dependabot (#669)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-29 11:00:10 +10:00
TonyWang
ec271e5422 Backtester: Add buy and sell limit for strategies (#658)
* add buy and sell limit to signal event

* add buy limit and sell limit

* add test case

* add verify limit before order

* fix sell max && min bugs

* add equal when sell & buy limit comparison && add received to buy & sell limit testcase

* fix bugs in description of SetSellLimit

* remote backtester\eventhandlers\exchange\exchange.go:115: unnecessary trailing newline (whitespace)

* add timeout=10m to golangci-lint

* add timeout=10m to .golangci.yml

* Revert "remote backtester\eventhandlers\exchange\exchange.go:115: unnecessary trailing newline (whitespace)"

This reverts commit 5f7f34903eb9d11a83d3643141a26388c8364a67.

* Revert "add timeout=10m to .golangci.yml"

This reverts commit c83fa972b58327b8de7af3c8fc1d7c19f537838f.

* Revert "add timeout=10m to golangci-lint"

This reverts commit a9da40e91af05d4bb3eee52a61106686c03f9ff4.

* trailing whitespace && revert timeout for linter ci

* add check when buy & sell limit is 0 && passed test cases in size_test

* fix bugs when buy & sell min & max limit is zero && pass testcase TestExecuteOrder

* check MaximumSize if zero or not && add test cases TestExecuteOrderBuySellSizeLimit

* clean logs

* add update buy sell limit in exchange && update testcase

* fix bugs when max is zero calculateBuySize && add testcase TestMaximumBuySizeEqualZero

* fix bugs when max is zero calculateSellSize && add testcase TestMaximumSellSizeEqualZero

Co-authored-by: Tony Wang <tonywang.data@gmail.com>
2021-04-28 14:43:21 +10:00