* set limiter to first level mock data list and updated unit tests
* address nested slices length limit
* minor fix recording file and update unit tests
* minor updates on unit tests
* re-record mock files and minor fix on the unit tests ti adapt the mock data change
* improve http recording limit value and fix issues with mock data in binance
* added MockDataSliceLimit in request items and resolve minor unit test issues
* resolve missed conflict
* rename mock variables, resolve unit test issues, and other updates
* minor fix to CheckJSON and update unit tests
* minor unit test fix
* further optimization on mock CheckJSON method, unit tests, and re-record poloniex
* common and recording unit tests fix
* minor linter issues fix
* unit tests format fix
* fix miscellaneous error
* unit tests fix and minor docs update
* re-record and reduce mock file size
* indentation fix
* minor assertion test fix
* reverted log.Printf line in live testing
* rename variables
* update NewVCRServer unit test
* replace string comparison with *net.OpError check
* restructur net error test
* exchanges/mock: Remove redundant error assertion message in TestNewVCRServer
---------
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Added TimeInForce type and updated related files
* Linter issue fix and minor coinbasepro type update
* Bitrex consts update
* added unit test and minor changes in bittrex
* Unit tests update
* Fix minor linter issues
* Update TestStringToTimeInForce unit test
* fix conflict with gateio timeInForce
* Update order tests
* Complete updating the order unit tests
* update kucoin and deribit wrapper to match the time in force change
* fix time-in-force related test errors
* linter issue fix
* time in force constants, functions and unit tests update
* shift tif policies to TimeInForce
* Update time-in-force, related functions, and unit tests
* fix linter issue and time-in-force processing
* added a good till crossing tif value
* order type fix and fix related tim-in-force entries
* update time-in-force unmarshaling and unit test
* update order type to support time-in-force and hybrid order type representation
* added tests for type and time-in-force check from order type
* fix time-in-force error in gateio
* fix minor unit test issues
* linter issue fix
* update based on review comments
* add unit test and fix missing issues
* minor fix and added benchmark unit test
* change GTT to GTC for limit
* fix linter issue
* linter issues fix
* update order types declaration and handling by endpoints
* added time-in-force value to place order param
* fix minor issues based on review comment and move tif code to separate files
* update on exchanges linked to time-in-force
* resolve missing review comments
* minor linter issues fix
* added time-in-force handler and update timeInForce parametered endpoint
* minor fixes based on review
* nits fix
* update based on review
* linter fix
* rm getTimeInForce func and minor change to time-in-force
* minor change
* update based on review comments
* wrappers and time-in-force calling approach
* minor change
* update gateio string to timeInForce conversion and unit test
* fix types to string conversion
* fix build errors
* update on order types handling and unit tests
* fix linter issue
* order type unit tests update
* order types string as constant replacement and unit tests update
* update order type-string functions unit test
* codebase: Rid base64/hex to string common funcs
* codebase: Rid local scope variable usage and other improvements
* codebase: Refactor currency pair usage across multiple exchanges
- Updated HitBTC tests to use the new currency pair format.
- Modified Kraken futures types to use currency.Pair instead of string for Symbol.
- Adjusted Kraken wrapper methods to handle currency pairs correctly.
- Refined OKX tests and types to utilize currency.Pair for instrument IDs.
- Enhanced Poloniex tests to consistently use predefined currency pairs.
- Streamlined order and orderbook tests to replace string pairs with currency.NewBTCUSD().
- Improved Yobit tests to utilize a standardized currency pair format.
- Updated validator wrapper to use currency pairs directly instead of string conversions.
* codebase: Use types.Number where possible
* refactor: update PayoutFee type to types.Number for consistency
* Refactor: Remove crypto functions to use standard library and other minor changes
- Removed custom crypto functions for SHA256, SHA512, and MD5 from the common/crypto package.
- Replaced usages of removed functions with standard library implementations in various files including:
- cmd/websocket_client/main.go
- engine/apiserver.go
- exchanges/kraken/kraken.go
- exchanges/lbank/lbank.go
- exchanges/okx/okx_business_websocket.go
- exchanges/kucoin/kucoin_websocket.go
- gctscript/vm/vm.go
- Updated tests to reflect changes in the crypto functions.
- Renamed several functions for clarity, particularly in the context of order book updates across multiple exchanges.
* refactor: replace assert with require for consistency in test assertions
* refactor: Improve Binance futures candlestick test, standardise orderbook update function names and improve test parallelism
* refactor: Replace require.Len with require.Equal for better output in TestGetFuturesKlineData
* GHA, tests: Add additional checks for common issues
These checks include:
- Ensuring that all testify funcs use their formatted variants (e.g., `assert.Equalf(t, expected, actual)` instead of `assert.Equal(t, expected, actual)`).
- Replacing `%s` with %q
- Enforcing consistent usage of should/must wording for testify assert/require messages
* Add support for checking backticked string format specifiers and fix issues
* tests: Fix error comparisons
* tests: Replace errors.Is(err, nil) usage with testify and automate check
* refactor: Rename ExtractPort to ExtractPortOrDefault
* tests: Replace assert with require for error handling in multiple test files
* tests: Replace assert with require for error handling and improve assertions in data tests
* tests: Fix typo in assertion message for StreamVol test
* OKX: Fix GetOpenInterestAndVolumeStrike test with instrument selection and improved assertions
* OKX: Revert intentional error check
* Improve error message for expiry time check in GetOpenInterestAndVolumeStrike test
* Added TimeInForce type and updated related files
* Linter issue fix and minor coinbasepro type update
* Bitrex consts update
* added unit test and minor changes in bittrex
* Unit tests update
* Fix minor linter issues
* Update TestStringToTimeInForce unit test
* fix conflict with gateio timeInForce
* Update order tests
* Complete updating the order unit tests
* update kucoin and deribit wrapper to match the time in force change
* fix time-in-force related test errors
* linter issue fix
* time in force constants, functions and unit tests update
* shift tif policies to TimeInForce
* Update time-in-force, related functions, and unit tests
* fix linter issue and time-in-force processing
* added a good till crossing tif value
* order type fix and fix related tim-in-force entries
* update time-in-force unmarshaling and unit test
* fix time-in-force error in gateio
* linter issue fix
* update based on review comments
* add unit test and fix missing issues
* minor fix and added benchmark unit test
* change GTT to GTC for limit
* fix linter issue
* added time-in-force value to place order param
* fix minor issues based on review comment and move tif code to separate files
* update on exchanges linked to time-in-force
* resolve missing review comments
* minor linter issues fix
* added time-in-force handler and update timeInForce parametered endpoint
* minor fixes based on review
* nits fix
* update based on review
* linter fix
* rm getTimeInForce func and minor change to time-in-force
* minor change
* update based on review comments
* wrappers and time-in-force calling approach
* minor change
* update gateio string to timeInForce conversion and unit test
* updated order test unit tes functions
* minor fixes on unit tests
* nits fix based on feedback
* update TestDeriveCancel unit test assert messages
* update TestDeriveCancel unit test assert messages
* update timeInForceFromString method to return formatted error and update functions using it
* restructure and fix minor exchanges time-in-force handling issues
* replaced unused getTypeFromTimeInForce with inline switch-based order type check
* separated the repeated timeInForce conversion code to a function
* update exchanges time-in-force handling based on review comments
* limter fix
* edded comment to validTimesInForce var
* added comment to gateio's timeInForceString func
* added goodTillCancel switch case to gateio timeInForceString func
* Tests: Use currency.NewUSD and NewUSDT
Simple refactor to use the provided shortcut methods
* Github: Add CI check to ensure NewPair not used
Add a step to ensure NewPair(BTC, USD*) isn't used
* Exchanges: Remove cancel order walletAddress
* Order: Refactor TestMatchFilter
TestMatchFilter had inconsistent testing of empty values, and was
painful when a field was removed due to index methodology.
This should provide equal test clarity, but improve maintainability and
improve coverage on empty values.
* Config: Move assetEnabled upgrade to Version management
* Assets: Do not error on asset not enabled, or disabled
This became more messy with Disabling something that's defaulted to
disabled.
Taking an idealogical stance against erroring that what you want to have
done is already done.
* CurrencyManager: Set AssetEnabled when StorePairs(enabled)
* RPCServer: Fix tests expecting StoreAssetPairFormat to enable the asset
Also assertifies
* Bitfinex: Fix tests for MarginFunding subs
* GCTWrapper: Improve TestMain clarity
* BTSE: Add futures to testconfig
* Exchanges: Rename StoreAssetPairStore
Previously we were calling it "Format", but accepting everything from
the PairStore.
We were also defaulting to turning the Asset on.
Now callers need to get their AssetEnabled set as they want it, so
there's no magic
This change also moves responsibility for error wrapping outside to the
caller.
* Config: AssetEnabled upgrade should respect assetTypes
Previously we ignored the field and just turned on everything.
I think that was because we couldn't get at the old value.
In either case, we have the option to do better, and respect the
assetEnabled value
* Config: Improve exchange config version upgrade error messages
* build/ci: Update Go to v1.24, golangci-lint to v1.64.5 and fix issues
* Address shazbert's nitters
* linter/config: Fix new linter issue and use versionSize const
* Address gk's nitters and fix additional linter issue after rebase
* Address glorious nits
* staticcheck: Fix additional linter issues after upgrading to Go 1.24.1 and golangci-lint v1.64.6
Also addresses nits
* Improve testing, assertify usage and use common.ErrParsingWSField
* TestCreateNewStrategy: Replace must > should wording
* tag optional sonic and allow full library conversion
* Add workflow and disallow arm and darwin usage
* Add basic hotswap benchmark
* linter: fix
* use bash
* linter: fix?
* Fix whoopsie, add to make file, also add mention in features list.
* test enforcement
* actually read documentation see if this works
* linter: fix
* linter: fix
* sonic: bump tagged version
* encoding/json: drop build tag arch and os filters
* encoding/json: consolidate tests
* encoding/json: log build tag usage
* rm superfluous builds
* glorious/nits: add template change and regen docs
* glorious/nits: update commentary on nolint directive
* glorious/nits: rm init func and log results in main.go
* Test to actually pull flag in
* linter: fix
* thrasher: nits
* gk: nits 4 goflags goooooooooo!
* gk: nits rn
* make sonic default json implementation
* screen 386
* linter: fix
* Add commentary
* glorious: nits Makefile not working
* gk: nits
* gk: nits whoops
* whoopsirino
* mention 32bit systems won't be sonic
* gk: super-duper nit of extremes
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* update acccount ratelimits and added missing endpoints
* completed mapping missing trade accoung REST endpoints and Rate Limit
* added orderbook trading missing REST endpoints
* Added few missing endpoints and unit tests
* Completed grid trading and signal bot trading with unit tests
* Added Recurring Buy endpoints and corresponding unit tests
* Added copy trading endpoints and unit tests
* added newly added block trading and spread endpoints
* completed mapping spread endpoints
* Added new endpoints and unit tests
* Added round 1: Okx types and converts update.
* Update endpoints handling and types update
* Removed constants, updated unit tests, and updated endpoint methods
* Slight endpoint and unit test update
* Added spread and other websocket endpoints and update
* completed Spread WS Orderbook handler
* Added missing spread channels and handlers
* Adding Bussinss websocket and missing subscriptions, update unit tests, and endpoints
* Added spread endpoints to wrapper and unit tests update
* Added missing websocket subscriptions and copy trading endpoints
* Added missing endpoints and re-organize business websocket handlers
* Docs update
* Endpoints code updates
* types, unit test and endpoints update
* Minor unit tests update
* spelling fix
* fix unit test issues
* Updating unit tests error handling
* Updating unit tests error handling
* Unit tests assertion handling update
* Unit tests update
* Resolve linter issues
* linter issues fix
* Orderbook unit test error fix
* Minor fixes
* Change on test handling and types
* Updating unit tests and cleanups
* Fix unit test issues
* Add ratelimit test and update unit tests and methods
* Update method parameters and error declarations
* Added lending endpoints, unit tests, and update endpoint methods and error declarations
* Update ratelimiters, add missing lending and trading endpoints and unit tests
* Update websocket authentication and subscription handling
* Minor update to unit test and types
* Types, error handling, and other minor updates
* Update unit tests and endpoint functions
* error declarations update and unit tests
* Overall update on unit endpoint, unit tests, and types
* Adding review fixes
* Update on endpoints, order types, and unit tests
* Update unit tests and endpoint functions
* Update on endpoint and update missing parameters
* Implemented and tested newly added trading endpoints
* endpoints update and unit tests
* Update missing endpoints and update overall code
* added and testing funding and fiat related endpoints
* Update on convert and fiat related endpoints
* linter fix, types, endpoints, and unit tests update
* linter issues fix
* revert changes on tempos
* Fix Panic and update websocket auth calls handling
* config linter issue fix
* Fix panic issues and update unit tests
* Fix race condition, TestAllExchangeWrappers unit test issues
* Fix withdrawal manager test issue
* Rename ClosePositionForContractrID --> ClosePositionForContractID
* Rename ClosePositionForContractrID --> ClosePositionForContractID
* Fix error
* endpoints update and fix unit test issues
* added unit tests, updated comments, and code sections
* revert change in defaultSubscriptions
* few types comments update
* Minor changes
* remove lending endpoints
* rm mistakenly added code
* fix unit test
* minor unit test fix
* Adding offline error tests, update endpoints function, config update
* Update unit test coverage for offline error handliing
* Updating wrapper algo order coverage, endpoint calls, and unit tests
* Updating wrapper trade functions to accomodate algo orders
* update wrapper unit tests
* Fix wrapper order functions offline errors handling
* Tested and updated wrapper order functions
* Address review comments
* update order unit tests, and okx endpoint functions
* finalize affected order, endpoint, and margin endpoints
* Slight change on margin unit test
* fix margin unit test issues
* Minor change on unit test
* updates on contract settlement and future contract wrapper function
* add test coverage for contract functions and minor fix on wrapper
* Overall update and unit testing
* codespell, unit tests, type declaration and naming, and code-structure updates
* margin types value and validation function fix
* Update tests and helper funcs
* Improve test coverage
* helper functions and unit tests update
* Fix margin unit test
* Minor review updates
* minor fix on if statement
* Update helper functions
* error handling and functions naming update
* update comment
* minor error return fixes
* minor unit test fix
* Minor fix on spread websocket orders handling
* codespell fix
* skip orderbook depth with incomplete price
* skip orderbook depth with incomplete price
* Assets: Fix LinearContracts support
* Assets: Fix False positives with IsValid
supportedFlag&a is true for every even number, making the test pretty
close to meaningless.
[This
fix](5b33bc5324)
was a viable fix maintaining bit shifted iota, but there's no benefit to
it at all.
Simplifying.
* CI/build: Update Go version, linters and fix minor issues
* linters: Add intrange, copyloopvar, additional go vet linters to match gopls and fix issues
* Add in initial handling for quote/base currency deployment requirements
* include client order ID checking
* glorious: suggestions
* spell and fix
* linter/context/test
* rework tests and order side specific requirements
* linter
* mend panic at the disco
* mending more panics at the disco
* anudda fix brudda
* glorious: NITTTTTT BOOOOOMB
* leftover things and stuff
* whoops
* tie in gateio
* glorious: nit fixes life and everything.
* thrasher: nits
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* CI/build: Update Go version, linters and fix minor issues
* Bump golangci-lint to v1.56.1
* BinanceUS: Make uint usage consistent
* Throw blank identifiers into the trash
* adds funding rate implementations and improvements
* merge fixes x1
* lint
* kucoin funding rates func make
* migrate sync-manager to keys
* some kucoin work
* adds some kucoin wrapper funcs
* ehhh, todo
* kucoin position
* start of orders
* adds the kucoin tests yay
* multiplier
* nits, EWS includes order limits
* NotYetImplemented, IsPerp improvements, cleaning
* lint, test fix, huobi time
* fixes issues, improves testing
* fixes linters I WRECKED
* local lint but remote lint, lint, lint, lint
* fixes err
* skip CI
* lint
* Supported rates, binance endpoints
* fixes weird mocktest problems
* no, CZ is invalid
* fixes some new EWS test errors
* Okx: Fix WS order fields
* Fixes float64 with string annotation erroring on empty strings:
Okx Order Push Data error json: invalid use of ,string struct tag, trying to unmarshal "" into float64
Specifically this came from px field from a market order
* Switch to convert.StringToFloat64 instead of okxNumericalValue
* Fix typo in Notional* field names; Ironically prevented them from erroring
* Okx: Add tests for first order fields
* Okx: CID and maybe set WS order Filled time
* Tests: Set TestFixtureToDataHandler to t.Helper
* Orders: Add UnmarshalJSON to order.Side
* Okx: Fix FillTime not parsed for PendingOrder
* Okx: Switch to order.Side Unmarshal throughout
* Okx: Add Fee and FeeAsset to order processing
* Okx: Fix WS order.Detail amounts and Test
This fixes Amount vs QuoteAmount for market sells where tgtCcy is
quote_ccy
* Add comment to order.Side.UnmarshalJSON
* Okx: Replace PendingOrderItem Unmarshal with local types
* Okx: string type for WS order reduceOnly
Note: Not yet in unit tests, since it's not part of the spot tests I was
originally fixing. I'll circle back to adding full test support for
Reduce only and deleveraging positions.
* Okx: Fix TestOrderPushData Amount
We were expecting 0 when we're given a quoteAmount
In reality, we'll calculate the size from the price
* Okx: Fix order and remAmount in wsOrders
Improved handling for Float64 issues and boundaries when the order is
fully executed but not yet marked as Filled
* Fix ErrSideIsInvalid in tests
* init
* surprise train commit
* basic distinctions
* the terms of binance are confusing
* renames and introduction of allocatedMargin
* add new margin funcs
* pulling out wires
* implement proper getposition stuff
* bad coding day
* investigate order manager next
* a broken mess, but a progressing one
* finally completes some usdtmargined stuff
* coinMfutures eludes me
* expand to okx
* imports fix
* completes okx wrapper implementations
* cleans and polishes before rpc implementations
* rpc setup, order manager features, exch features
* more rpc, collateral and margin things
* mini test
* looking at rpc response, expansion of features
* reorganising before the storm
* changing how futures requests work
* cleanup and tests of cli usage
* remove silly client side logic
* cleanup
* collateral package, typo fix, margin err, rpc derive
* uses convert.StringToFloat ONLY ON STRUCTS FROM THIS PR
* fix binance order history bug
* niteroos
* adds new funcs to exchange standards testing
* more post merge fixes
* fix binance
* replace simepletimeformat
* fix for merge
* merge fixes
* micro fixes
* order side now required for leverage
* fix up the rest
* global -> portfolio collateral
* Update exchanges/collateral/collateral_test.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* adds fields and todos
* rm field redundancy
* lint fix oopsie daisy
* fixes panic, expands error and cli explanations (sorry shaz)
* ensures casing is appropriate for underlying
* Adds a shiny TODO
---------
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* starting public endpoints
* Adding public endpoints
* added public spot market endpoints
* websocket subscriptions updates
* websocket push data handlers completing
* linter fix
* Added funding private endpoints
* Adding authenticated account endpoints
* Added fiat and OTC-RFQ authenticated endpoints
* trading authenticated endpoints
* completing trade endpoints and add public wrapper endpoints
* Authenticated wrapper functions and corresponding unit test
* Adding authenticated websocket endpoint and fixing wrapper functions
* Documentation and exchange websocket update
* update websocket orderbook checksum handling
* linter issues fix and unit test update
* remove invalid orderbook endpoint and unit test
* Documentation, handlers, and model types update
* minot fix
* Minor fixes
* Updating unit tests and added missing endpoints
* Add missing credential check
* Minor unit test fixes
* fix minor linter issue
* add snaphot test unit test
* Fix on update checksum and documentation update
* update exchange, add UpdateOrderExecutionLimits, and update documentation
* Minor fix on tickers fetching
* Minor websocket fix and smaill unit tests
* Minor websocket and naming fixes
* uncomment default channels
* Fix type and unit test issues
* websocket channels and data handling update
* Update Advanced-Algo websocket handling and minor fixes
* documentation and minor code fixes
* Fix name changes
* documentation contribution update
* intervalToString method update
* fix exchange_wrapper_standard tests
* Fix minor issues based on exchange_wrapper_standards_test
* Fix wrapper extended candlestick check
* websocket orders fetching error check method update
* Exchange name check and change
* docs: Add missing contributors
---------
Co-authored-by: Adrian Gallagher <adrian.gallagher@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
* Modifications for a smoother live run
* Fixes data appending
* Successfully allows multi-currency live trading. Adds multiple currencies to live DCA strategy
* Attempting to get cash and carry working
* Poor attempts at sorting out data and appending it properly with USD in mind
* =designs new live data handler
* Updates cash and carry strat to work
* adds test coverage. begins closeallpositions function
* Updates cash and carry to work live
* New kline.Event type. Cancels orders on close. Rn types
* =Fixes USD funding issue
* =fixes tests
* fixes tests AGAIN
* adds coverage to close all orders
* crummy tests, should override
* more tests
* more tests
* more coverage
* removes scourge of currency.Pair maps. More tests
* missed currency stuff
* Fixes USD data issue & collateral issue. Needs to close ALL orders
* Now triggers updates on the very first data entry
* All my problems are solved now????
* fixes tests, extends coverage
* there is some really funky candle stuff going on
* my brain is melting
* better shutdown management, fixes freezing bug
* fixes data duplication issues, adds retries to requests
* reduces logging, adds verbose options
* expands coverage over all new functionality
* fixes fun bug from curr == curr to curr.Equal(curr)
* fixes setup issues and tests
* starts adding external wallet amounts for funding
* more setup for assets
* setup live fund calcs and placing orders
* successfully performs automated cash and carry
* merge fixes
* funding properly set at all times
* fixes some bugs, need to address currencystatistics still
* adds 'appeneded' trait, attempts to fix some stats
* fixes stat bugs, adds cool new fetchfees feature
* fixes terrible processing bugs
* tightens realorder stats, sadly loses some live stats
* this actually sets everything correctly for bothcd ..cd ..cd ..cd ..cd ..!
* fix tests
* coverage
* beautiful new test coverage
* docs
* adds new fee getter delayer
* commits from the correct directory
* Lint
* adds verbose to fund manager
* Fix bug in t2b2 strat. Update dca live config. Docs
* go mod tidy
* update buf
* buf + test improvement
* Post merge fixes
* fixes surprise offset bug
* fix sizing restrictions for cash and carry
* fix server lints
* merge fixes
* test fixesss
* lintle fixles
* slowloris
* rn run to task, bug fixes, close all on close
* rpc lint and fixes
* bugfix: order manager not processing orders properly
* somewhat addresses nits
* absolutely broken end of day commit
* absolutely massive knockon effects from nits
* massive knockon effects continue
* fixes things
* address remaining nits
* jk now fixes things
* addresses the easier nits
* more nit fixers
* more niterinos addressederinos
* refactors holdings and does some nits
* so buf
* addresses some nits, fixes holdings bugs
* cleanup
* attempts to fix alert chans to prevent many chans waiting?
* terrible code, will revert
* to be reviewed in detail tomorrow
* Fixes up channel system
* smashes those nits
* fixes extra candles, fixes collateral bug, tests
* fixes data races, introduces reflection
* more checks n tests
* Fixes cash and carry issues. Fixes more cool bugs
* fixes ~typer~ typo
* replace spot strats from ftx to binance
* fixes all the tests I just destroyed
* removes example path, rm verbose
* 1) what 2) removes FTX references from the Backtester
* renamed, non-working strategies
* Removes FTX references almost as fast as sbf removes funds
* regen docs, add contrib names,sort contrib names
* fixes merge renamings
* Addresses nits. Fixes setting API credentials. Fixes Binance limit retrieval
* Fixes live order bugs with real orders and without
* Apply suggestions from code review
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update backtester/engine/live.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update backtester/engine/live.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update backtester/config/strategyconfigbuilder/main.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* updates docs
* even better docs
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* orders: deprecate SubmitResponse return and change to *order.Detail construct detail from order.Submit struct
* orders: add coverage, fix tests
* coinut: rm test for checking
* orders: revert change for return and change field ID to a more explicit name OrderID
* orders: Add method to see if the order was placed
* order: change field name in Cancel type to be more explicit
* orders: standardize field -> OrderID
* backtester: populate change
* orders: add test
* gctscript: fix field name
* linter: fix issues
* linter: more fixes
* linter: forever
* exchanges_tests: populate order.Submit field exchange name
* Update exchanges/order/order_types.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/order/orders.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* glorious: nits
* thrasher: nits
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* orders: Add derive modify struct method to order.Detail and then subsequent method to derive and standardize response details
* exchanges: call modify method in wrappers
* linter: fixes
* engine/wsroutineman: remove print summary
* glorious: nits, removed modifyOrder functionality for Bithumb. There are not docs to support this.
* Update exchanges/order/orders.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* ordermanager: fix residual test issue from #917 and reduce some racey action
* glorious: nits; also removed functions that weren't being used and were unexported
* rm: pew
* linter: fix issues
* glourious: nits
* credentials: fix test issue with racey racey horse basey
* order: slight optimizations
* orders: add benchmarks, small optimize and change order side to uin8 for comparitive optimizations.
* orders: continue to convert string type -> uint
* orders/backtester: interim move type to orders package, later can expand or deprecate.
* orders: handle errors
* orders: optimize filters and remove error returns when its clearly not needed
* orders: remove log call
* backtester: zero value check
* orders/futures: zero value -> flag
* linter: fix
* linter: more fixes
* linters: rides again
* glorious: nits
* common: Add zero value unix check for time values; also addresses glorious nits
* glorious scott: nits
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* 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>
* currency: Add method to derive pair
* currency: Add method to lower entire charset but used the slice copy and returned that. This will change the original, just gotta see if this is an issue, but the slice usually goes out of scope anyway.
* currency/pairs: add filter method
* currency: add function to derive select currencies from currency pairs
* currency/engine: slight adjustments
* currency: fix linter issue also shift burden of proof to caller instead of repair, more performant.
* currency: more linter
* pairs: optimize; reduce allocs/op and B/op
* currency: Add in function 'NewPairsFromString' for testing purposes
* currency: don't suppress error
* currency: stop panic on empty currency code
* currency: Add helper method to match currencies between exchanges
* currency: fixed my bad spelling
* currency: Implement stable coin checks, refactored base code methods, optimized upper and lower case strings for currency code/pairs
* currency: add pairs method to derive stable coins from internal list.
* Currency: Cleanup, fix tests.
* engine/exchanges/currency: fix whoops
* Currency: force govet no copy on Item datatype
* Currency: fix naughty linter issues
* exchange: revert change
* currency/config: fix config upgrade mistake
* currency: re-implement currency sub-systems
* *RetrieveConfigCurrencyPairs removed
*CheckCurrencyConfigValues to only provide warnings, add additional support when, disable when support is lost or not available and set default values.
*Drop Cryptocurrencies from configuration as this is not needed.
*Drop REST Poll delay field as this was unused.
*Update default values for currencyFileUpdateDuration & foreignExchangeUpdateDuration.
*Allow Role to be marshalled for file type.
*Refactor RunUpdater to verify and check config values and set default running foreign exchange provider.
* currency: cleanup
* currency: change match -> equal for comparison which is more of a standard and little easier to find
* currency: address nits
* currency: fix whoops
* currency: Add some more pairs methods
* currency: linter issues
* currency: RM unused field
* currency: rm verbose
* currency: fix word
* currency: gocritic
* currency: fix another whoopsie
* example_config: default to show log system name
* Currency: Force all support packages to use Equal method for comparison as there is a small comparison bug when checking upper and lower casing, this has a more of a pronounced impact between exchanges and client instances of currency generation
* currency: fix log name
* ordermanager: fix potential panic
* currency: small optim.
* engine: display correct bool and force shutdown
* currency: add function and fix regression
* Change ConvertCurrency -> ConvertFiat to be more precise
* ADD GetForeignExchangeRate to get specific exchange rate for fiat pair
* Fix currency display and formatting regression and tied in with config.Currency fields
* engine: fix tests
* currency: return the amount when no conversion needs to take place
* currency: reduce method name
* currency: Address nits glorious nits
* currency: fix linter
* currency: addr nits
* currency: check underlying role in test
* gct: change to EMPTYCODE and EMPTYPAIR across codebase
* currency: fix nits
* currency: this fixes test race but this issue has not been resolved. Please see: https://trello.com/c/54eizOIo/143-currency-package-upgrades
* currency: Add temp dir for testing
* Update engine/engine.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* documentation: update and regen
* currency: Address niterinos
* currency: Add test case for config upgrade when falling over to exchange rate host as default from exchangeRates provider
* currency: addr nits
* currency: fix whoops
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Exchanges: enrich order history with avg executed price, cost, and more
* Fix division by zero in order detail enrichment
* Remove DateCompleted from Bithumb OrderData and fix OrderDate parsing
* Fixes on order detail fields and rename EnrichOrderDetail to CalculateCostsAndAmounts
* BTSE order history populate name and id
* Calculate average executed price for market order or when order amount is zero
* Minor fixes on infer order amounts, costs, and times
* Attach InferAmountsCostsAndTimes to Order.Detail
* Binance: fix order status
* Always use order.StringToOrderStatus() and ensure order has at least one of executed/remaining amount set
* Initial REST managed order updating
* Apply gloriousCode's changes.go patch
* Update internal order ID handling
* Check error
* Replace string with string pointer
* Avoid nil pointers in upsert
* Update test for UpdateOrderFromDetail()
* Add tests for orders.go
* Remove unnecessary newline
* Address comments
* Add missing nil check
* Add tests for new functions in order_manager.go
* Remove empty line
* Change log level for updates from Info to Debug (keep added orders at Info)
* Initialize orders before running the timer
* [TEMP] Add verbosity for debugging
* Nil checking on exchangeManager in GetExchanges()
- exchangeManager.GetExchanges() and iExchangeManager.GetExchanges() return an error on nil
- bot.GetExchanges() wraps exchangeManager.GetExchanges() and returns an empty slice
* Revert b5afe1a46b
* Do not start the order manager runner thread
Instead, mark the order manager as running
* Remove redundant error.Is() and remove print wrapper on msg
* Add atomic blocker and waitgroup on processOrders()
* Disable unnecessary orderManager runner thread for rpcserver_test
* Remove redundant err from orderStore.getActiveOrders()
* [FIX] Populate requiresProcessing using UpsertResponse data instead of REST return data
.. because the data returned by the REST calls do not include the internal user ID's
* [TEST] Verify that processOrders() actually processes queried order data
* Remove leftover warning and add nil check on wg.Done()
* Apply suggestions from code review
Log category changes - as suggested
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Return when no exchanges available
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* 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>
* 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
* Exchanges: Add in exchange defined tolerance settings to conform to min max amounts/price/notional etc (Initial)
* Add to tests fix linter
* Binance: Implement CMF and usdtMarginFutures fetching of currency information, addr nits
* binance: Add in test for tolerance set up
* exchanges: add in more tolerance settings and add tests
* nits: addr
* fix linter issue
* RPCServer: Use ordermanager instead of going direct to exchange
* Nits: Addr
* nits: glorious addr phase one
* nits: glorious nits phase 2
* exchange: move tolerance -> limits in order package add wrapper function, split binance functions to asset files
* nits: Addr thrasher + also include locking of limits struct when we update via syncer later on
* nits: mdc addr
* nits: glorious nits
* limits: unexport mutex
* limit: revert maths optim. and fix spelling
* limit: Add decimal package
* limit: don't check price on market order
* Orders: Add order execution checks on fake orders so as to always conform to tight specifications even in simulation
* binance: handle case where spot is not enabled but margin is
* backtester: add in amount conforming to back tested events to simulate realistic orders
* rm ln
* order limit: return amount when limit is nil and conformToAmount is requested
* nits: glorious nits + friends
* backtester/orders: fix tests
* nits: glorious nits
* nits: glorious nits
* RMLINE
* nits: more glorious nits!
* nits: pooosh
* binance: fix margin logic
* nits: Add warning, settings log and report item for exchange order execution limits
* backtester: add specific warnings in report output
* backtest: Adjust warnings