Commit Graph

2410 Commits

Author SHA1 Message Date
stringscut
a2c7837a63 chore: Improve code comments clarity (#2135)
Signed-off-by: stringscut <stringscut@outlook.jp>
2025-12-18 17:17:21 +11:00
Ryan O'Hara-Reid
7f412e2772 Kucoin: Update order execution limits (#2124)
* refactor(kucoin): enhance contract and symbol structures, update order execution limits tests

* fix(number): handle null input in UnmarshalJSON and update tests

* Update exchanges/kucoin/kucoin_futures_types.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kucoin/kucoin_futures_types.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kucoin/kucoin_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kucoin/kucoin_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kucoin/kucoin_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kucoin/kucoin_types.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kucoin/kucoin_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: destroyed this code across all implementations

* glorious: rename

* ai overlord: nit

* Update exchanges/kucoin/kucoin_futures_types.go

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

* thrasher: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-12-17 12:42:34 +11:00
Adrian Gallagher
b1e4983f49 modernize: Exclude specific packages and improve URL query string handling (#2131)
* modernize: exclude specific packages and improve URL query string handling

* refactor: simplify URL query string removal in websocket connection
2025-12-17 09:26:58 +11:00
dependabot[bot]
43d83769ec build(deps): Bump actions/cache from 4 to 5 (#2130)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 17:15:00 +11:00
dependabot[bot]
e50ff7618f build(deps): Bump google.golang.org/protobuf from 1.36.10 to 1.36.11 (#2127)
Bumps google.golang.org/protobuf from 1.36.10 to 1.36.11.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.11
  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>
2025-12-15 16:55:50 +11:00
dependabot[bot]
b0c1d9bd9f build(deps): Bump golang.org/x/crypto from 0.45.0 to 0.46.0 (#2126)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.45.0 to 0.46.0.
- [Commits](https://github.com/golang/crypto/compare/v0.45.0...v0.46.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.46.0
  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>
2025-12-15 16:37:27 +11:00
findfluctuate
a2d90c0ab9 chore: drop legacy build tags (#2125)
Signed-off-by: findfluctuate <findfluctuate@outlook.com>
2025-12-15 12:40:41 +11:00
Romano
1b83db3489 signaler: improve cross-platform signal compatibility (#1952)
* signaler: improve cross-platform signal compatibility

- Add runtime-based platform detection for signal handling
- Include os.Kill only on Windows (cannot be caught/ignored on Unix)
- Refactor signal initialization into separate getPlatformSignals function

* signaler: add dependency injection and improve docs

- Introduce SignalNotifier interface for testability
- Add osSignalNotifier implementation and factory function
- Enhance package and function documentation
- Maintain backward compatibility with existing API

* [signaler] simplify shutdown handling; drop SIGABRT/os.Kill

* skip signaler tests on windows

* support signaler interrupt tests and improve signal handling tests

* removing getPlatformSignal function

* remove signaler readme

* Signaler: Return a channel from WaitForInterrupt

* Signaler: fix comment

Co-authored-by: Ryan O'Hara-Reid <oharareid.ryan@gmail.com>

* Signaler: require NoError to NoErrorf

Co-authored-by: Ryan O'Hara-Reid <oharareid.ryan@gmail.com>

---------

Co-authored-by: Ryan O'Hara-Reid <oharareid.ryan@gmail.com>
2025-12-10 16:44:48 +11:00
suranmiao
78382afb14 refactor: use reflect.TypeFor instead of reflect.TypeOf and improve related tests (#2101)
* refactor: using reflect.TypeFor

Signed-off-by: suranmiao <solsui@outlook.com>

* refactor: remove unused reflect.TypeFor calls and improve test assertions

* refactor: simplify TestSetup by removing reflect.TypeFor

* test: enhance test assertions and improve parallel execution in TestSetup

---------

Signed-off-by: suranmiao <solsui@outlook.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-12-10 10:54:54 +11:00
cranktakular
8260aad9fd Fixes live testing for Bybit (#2120) 2025-12-09 15:59:14 +11:00
Gareth Kirwan
6ae40f3688 Kucoin: Fix intermittent TestPushData failure (#2116)
* Testing: Fix FixtureToDataHandlerWithErrors logging []byte

* Kucoin: Fix global mutexes and maps

Highlighted by:
```
go test -count 2 -run TestPushData
```

that the second run wasn't finding a futures orderbook, because the
instance had changed but kucoin was using a global map
2025-12-01 11:07:13 +11:00
Adrian Gallagher
dbf3b772b6 google gemini: Add initial configuration for code review integration (#2117)
Co-authored-by: Adrian Gallagher <adrian.gallagher@example.com>
2025-12-01 09:53:58 +11:00
Ryan O'Hara-Reid
cf54764cb7 GateIO: Update websocket orderbook manager (#1989)
* gateio: websocket ob manager fix (cherry-pick me)

* fix(gateio): update websocket orderbook manager to support delay and deadline parameters
    feat(subscriptions): mv ChannelKey type for subscription management from gateio to subscriptions
    test(gateio): enhance tests for orderbook update manager and subscription keys

* ai: nits

* linter: fix

* Fix asset typo and add in case test

* cranktakular: nits

* cranktakular: nits after merge master

* bump time delay for cache

* fix bug where on error it never initiates another orderbook fetch

* lint: fix

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* linter: fix

* Update exchanges/gateio/gateio_wrapper_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_wrapper_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* Update exchanges/gateio/gateio_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* bossking: nits

* Update exchanges/gateio/ws_ob_update_manager_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* apply patch

* rm error state as this was on the same thread as cacheStateQueuing and had the potential to drop messages, add tests.

* linter: fix

* mock live request

* misc: fix

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/ws_ob_update_manager.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* field name from mtx -> m

* lint: fix

* race: check fix

* thrasher-: patch adams

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-11-27 12:21:17 +11:00
Ryan O'Hara-Reid
719e6bebfe request/ratelimit: Add context value check and fix bug (#2073)
* Add WithNoDelayPermitted and fix bug on cancel all

* rm reservations as it is only for last reservation when cancelling and needed to take into account of the actual offset delay for correct returning of tokens, update tests

* export error

* misc fix

* more misc fix

* Add concurrent protection, cancel in reverse and add tests

* lint: fix

* Update exchanges/request/limit.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/request/limit.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/request/limit.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/request/limit.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits doo

* linter: fix

* boss king: nits

* crank: nits

* crank: test patch which was cooked and had to be done manually

* Update exchanges/request/limit.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* linter: fix

* thrasher: nits

* use error collector in tests

* nolint: direction

* gk: fixup!

* my life has elapsed

* thrasher-: Because of synctest, we can now be deterministic with values. This rids a lot of the redundant wait calls which served no purpose

* thrasher-: patched

---------

Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: shazbert <shazbert@DESKTOP-3QKKR6J.localdomain>
2025-11-27 11:10:11 +11:00
dependabot[bot]
2943a7f800 build(deps): Bump google.golang.org/grpc from 1.76.0 to 1.77.0 (#2113)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.76.0 to 1.77.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.76.0...v1.77.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.77.0
  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>
2025-11-24 16:38:30 +11:00
dependabot[bot]
9e87855576 build(deps): Bump actions/checkout from 5 to 6 (#2114)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 16:30:26 +11:00
dependabot[bot]
8c99bbaaa2 build(deps): Bump golang.org/x/crypto from 0.43.0 to 0.45.0 (#2112)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.43.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.43.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  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>
2025-11-24 16:17:50 +11:00
Ryan O'Hara-Reid
7f1bbfc48c GateIO: Add various risk API endpoints (#2106)
* gateio: risk update and tests (cherry-pick)

* Update exchanges/gateio/risk.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update exchanges/gateio/risk.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* ai: nits

* Update exchanges/gateio/gateio_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* Update exchanges/gateio/risk.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: paging mr pedantic

* Update exchanges/gateio/risk.go

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

* linter: fix

* crank: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-11-19 13:21:36 +11:00
Pavlo Olizko
a1e464c275 docs: Correct table formatting in README (#2107)
* Correct table formatting in README

Fix formatting issue in the Exchange Support Table.

* format: Fix formatting for Exchange Support Table
2025-11-17 09:36:08 +11:00
Ryan O'Hara-Reid
a70c834f04 GateIO: Add GetEstimatedInterestRate REST endpoint (#2102)
* gateio: Add func GetEstimatedInterestRate (cherry-pickable)

* Add tests

* Update exchanges/gateio/gateio.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* thrasher-: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-11-11 15:47:37 +11:00
Ryan O'Hara-Reid
497e13dc62 common: Update ErrorCollector to use mutex and simplify error collection in concurrent operations (#2090)
* refactor: Update ErrorCollector to use mutex and simplify error collection in concurrent operations

* glorious: nits

* linter: fix

* another find

* Apply suggestion from @gbjk

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Apply suggestion from @gbjk

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* one liner defer

* Update common/common.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* Update common/common_test.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* thrasher-: nits

---------

Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: shazbert <shazbert@DESKTOP-3QKKR6J.localdomain>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2025-11-11 15:08:48 +11:00
Ryan O'Hara-Reid
fefb866b02 exchanges/GateIO, OKX: Fix and optimise websocket request ID message generation (#2103)
* gatio: fix MessageID regression (cherry-pick me)

* Update exchanges/gateio/gateio_wrapper_test.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* glorious: AI

* Update exchanges/gateio/gateio_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* thrasher: use optimisation in okx as well

* okx: Add length check in tests for string -> uuid conversion

* thrasher: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-11-11 14:25:21 +11:00
cranktakular
2fd4f5ec5b cmd/exchange_template: Update wrapper template, improve documentation (#2009)
* Updating wrapper template, updating documentation, regenerating documentation

* Renaming "streaming api" to "websocket"

* Context is now t

* Update docs/ADD_NEW_EXCHANGE.md

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

* Update cmd/documentation/root_templates/root_readme.tmpl

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

* Fixes an improper example and regenerates documentation

* Corrects typos

* Makes a table label consistent across files

---------

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-11-11 11:07:26 +11:00
dependabot[bot]
6077707690 build(deps): Bump golangci/golangci-lint-action from 8 to 9 (#2104)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 8 to 9.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v8...v9)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 16:31:56 +11:00
Scott
61d720b72f exchanges: Use singular futures settlement currency (#2092)
* Change settlement to singular currency

* whoops.go

* bitmex fix

* minor updates

* 64 divided by 2

* whoops2.go

* ROBOT ROCK

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* ROCK ROCK ROCK ROCK ROBOT

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* shazNit

* currencies unmarshal and code use

* Update currency/currencies.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/btse/btse_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* reuse comment for better clarity

* collapses entire thing

* shazLint

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-11-10 13:21:54 +11:00
Ryan O'Hara-Reid
9441f33f42 bybit: Enhance order execution limits (#2069)
* refactor(gateio): enhance order execution limits and currency pair details

* Update exchanges/gateio/gateio_wrapper.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* REEEEEHHHHHH

* linter: fix

* fix GetOpenInterest when a contract is delisted

* add handling for delisting end time correctly

* Update exchange/order/limits/limits_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchange/order/limits/limits_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* gci: fix

* linter: fix

* gateio: Add launch and update tests (cherry-pick)

* bybit: enhance order execution limits (cherry-pick)

* relax test to not break all the others and add Delivery field lost in cherry-pick wonderland

* boss king nits

* Update exchanges/bybit/bybit_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* Update exchanges/bybit/bybit_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/bybit/bybit_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk:nits

* Update exchanges/bybit/bybit_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk:nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
Co-authored-by: shazbert <shazbert@DESKTOP-3QKKR6J.localdomain>
2025-11-05 16:38:08 +11:00
dependabot[bot]
c8e449dbb2 build(deps): Bump github.com/bytedance/sonic from 1.14.1 to 1.14.2 (#2100)
Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.14.1 to 1.14.2.
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](https://github.com/bytedance/sonic/compare/v1.14.1...v1.14.2)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-version: 1.14.2
  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>
2025-11-03 17:00:58 +11:00
Copilot
fe6f762ab8 exchange_wrapper_standards: Add order execution limit errors to acceptableErrors list (#2096)
* Initial plan

* Add order execution limit errors to acceptableErrors list

Add all order execution limit validation errors from the limits package
to the acceptableErrors list. This fixes intermittent test failures when
exchanges have different minimum/maximum limits for price and amount that
don't match the hardcoded test values.

The test uses hardcoded values (150) for price and amount, but exchanges
like Binance have varying limits (e.g., BTCUSDPERP has a minimum price of
1000). By treating these limit validation errors as acceptable, the test
properly validates that exchanges correctly enforce their limits without
causing false test failures.

Fixes the CheckOrderExecutionLimits failure for Binance coinmarginedfutures
BTCUSDPERP where the hardcoded price of 150 is below the minimum limit of
1000.

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

* Remove self-explanatory comments from limit errors

Remove comments that don't add information beyond the error names
for the newly added order execution limit errors, as requested in
code review feedback.

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>
2025-10-31 17:26:44 +11:00
Gareth Kirwan
5d6755b76e linters: Exclude govet shadow check on exchange instances (#2097)
* Linters: Exclude govet shadow check on e in tests

* Linters: Remove nolint rule for new(Exchange) in tests

Replay with:
```
perl -pi -e 's{(\se\s:=\s.*?)\s*//nolint:govet // Intentional shadow.*}{$1}' **/*_test.go
```
2025-10-29 09:30:23 +11:00
Gareth Kirwan
a7ff3efdcc Deribit: Fix future_combo instrument parsing and enhance tests (#2094)
Deribit seems to have opened up more instruments for future combos and
is using a `-` delimiter in them, throwing off our parsing rule that
it's always 3 parts for them.

This change adds in the "FS" part, which seems consistent.

I would have added checking for such a part to option_combo but some of
them are missing it :/
2025-10-28 16:56:36 +11:00
Gareth Kirwan
73e200e4e7 accounts: Move to instance methods, fix races and isolate tests (#1923)
* Bybit: Fix race in TestUpdateAccountInfo and  TestWSHandleData

* DriveBy rename TestWSHandleData
* This doesn't address running with -race=2+ due to the singleton

* Accounts: Add account.GetService()

* exchange: Assertify TestSetupDefaults

* Exchanges: Add account.Service override for testing

* Exchanges: Remove duplicate IsWebsocketEnabled test from TestSetupDefaults

* Dispatch: Replace nil checks with NilGuard

* Engine: Remove deprecated printAccountHoldingsChangeSummary

* Dispatcher: Add EnsureRunning method

* Accounts: Move singleton accounts service to exchange Accounts

* Move singleton accounts service to exchange Accounts

This maintains the concept of a global store, whilst allowing exchanges
to override it when needed, particularly for testing.

APIServer:

* Remove getAllActiveAccounts from apiserver

Deprecated apiserver only thing using this, so remove it instead of
updating it

* Update comment for UpdateAccountBalances everywhere

* Docs: Add punctuation to function comments

* Bybit: Coverage for wsProcessWalletPushData Save
2025-10-28 13:52:45 +11:00
Gareth Kirwan
bda9bbec66 websocket: Remove GenerateMessageID (#2008)
* Exchanges: Remove example BespokeGenerateMessageID

* Okx: Replace conn.RequestIDGenerator with MesssageID

Continued overall direction to remove the closed-loop of e => conn => e
roundtrip for message ids

* Exchanges: Add MessageSequence

This method removes the either/or nature of message id generation.
We don't tie the message ids to connections, or to anything.
Consumers just call whichever they want, or even combine them as they
want.
Anything more complicated will need a separate installation anyway

* GateIO: Split usage of MessageID and MessageSequence

* Binance: Switch to UUID message IDs

* Kraken: Switch to e.MessageSequence

* Kucoin: Switch to MessageID

* HitBTC: Switch to UUIDv7 for ws message ID

* Bybit: Switch to UUIDv7 for ws message ID

* Bitfinex: Switch to UUIDv7 and MessageSequence

Tested CID - It accepts 53 bits only for an int, so MessageSequence
makes sense. Can't use MessageID

* Websocket: Remove now unused MessageID function

Moved all MessageID usage into funcs and onto base methods, to remove
the closed loop of message IDs

* Docs: Update guidance for message signatures
2025-10-24 11:14:24 +11:00
Gareth Kirwan
0f70cfd8b6 HitBTC: Fix panic in FetchTradablePairs (#2091)
```
❯ go test ./engine/... -run TestGetDefaultConfig
--- FAIL: TestGetDefaultConfigurations (2.01s)
    --- FAIL: TestGetDefaultConfigurations/hitbtc (0.39s)
panic: runtime error: slice bounds out of range [:-1] [recovered, repanicked]
```

The code was using strings.Index to find the quote currency position in the
symbol ID, then slicing the ID. When Index returns -1 (not found), it caused
a panic with 'slice bounds out of range [:-1]'.

Fixed by using the BaseCurrency and QuoteCurrency fields directly from the
Symbol struct, which is the correct approach and what the API provides.
2025-10-22 18:25:13 +11:00
Copilot
5d4e5b0627 engine/DataHistoryManager: Fix race condition in TestRunJob by isolating DHM instances (#2082)
* Initial plan

* Fix race condition in TestRunJob by creating separate DHM instances

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>
2025-10-16 13:50:32 +11:00
Copilot
7134ea0393 Backtester: Fix intermittent race condition in TestExecuteStrategy (#2080)
* Initial plan

* Fix intermittent race condition in TestExecuteStrategy

Add synchronization point after async ExecuteStrategy call to wait for
background goroutine completion before resetting metadata. This prevents
the race condition where Stop() could be called after metadata reset,
causing errAlreadyRan instead of the expected errLiveOnly.

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

* Use assert.Eventually instead of manual polling loop

Replace manual for-loop polling with assert.Eventually for cleaner
and more idiomatic test synchronization.

Co-authored-by: gloriousCode <9261323+gloriousCode@users.noreply.github.com>

* Use require.Eventually instead of assert.Eventually

Change to require.Eventually to ensure test stops immediately if the
async goroutine doesn't complete, preventing potential race conditions
from leaking into subsequent test assertions.

Co-authored-by: shazbert <9391715+shazbert@users.noreply.github.com>

* Change error message from "should" to "must"

Update assertion message to reflect mandatory nature of the condition
when using require.Eventually.

Co-authored-by: shazbert <9391715+shazbert@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>
Co-authored-by: gloriousCode <9261323+gloriousCode@users.noreply.github.com>
Co-authored-by: shazbert <9391715+shazbert@users.noreply.github.com>
2025-10-16 13:49:16 +11:00
Copilot
3eb4c7fa92 exchange/websocket: Fix TestMatchReturnResponses race condition causing index out of range panic (#2079)
* Initial plan

* Fix TestMatchReturnResponses race condition panic

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

* Add require.NotEmpty check on resp.Responses to prevent panic

Co-authored-by: shazbert <9391715+shazbert@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>
Co-authored-by: shazbert <9391715+shazbert@users.noreply.github.com>
2025-10-14 09:10:16 +11:00
Copilot
a9f23018e3 Deribit: Remove deprecated RFQ endpoints (#2078)
* Initial plan

* Remove deprecated Deribit RFQ endpoints

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

* Remove extra newline before TestGetTradeVolumes

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

* Remove extra newline before TestSetMMPConfig

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>
2025-10-14 09:08:45 +11:00
dependabot[bot]
85a4ea6b3f build(deps): Bump google.golang.org/grpc from 1.75.1 to 1.76.0 (#2085)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.75.1 to 1.76.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.75.1...v1.76.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.76.0
  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>
2025-10-13 17:01:30 +11:00
dependabot[bot]
f3065edd5c build(deps): Bump ikalnytskyi/action-setup-postgres from 7 to 8 (#2084)
Bumps [ikalnytskyi/action-setup-postgres](https://github.com/ikalnytskyi/action-setup-postgres) from 7 to 8.
- [Release notes](https://github.com/ikalnytskyi/action-setup-postgres/releases)
- [Commits](https://github.com/ikalnytskyi/action-setup-postgres/compare/v7...v8)

---
updated-dependencies:
- dependency-name: ikalnytskyi/action-setup-postgres
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-13 16:34:09 +11:00
dependabot[bot]
6a06339f64 build(deps): Bump golang.org/x/time from 0.13.0 to 0.14.0 (#2088)
Bumps [golang.org/x/time](https://github.com/golang/time) from 0.13.0 to 0.14.0.
- [Commits](https://github.com/golang/time/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/time
  dependency-version: 0.14.0
  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>
2025-10-13 16:32:46 +11:00
dependabot[bot]
0468bf79b2 build(deps): Bump golang.org/x/crypto from 0.42.0 to 0.43.0 (#2086)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.42.0 to 0.43.0.
- [Commits](https://github.com/golang/crypto/compare/v0.42.0...v0.43.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.43.0
  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>
2025-10-13 16:21:38 +11:00
dazi005
cce28f9d2b OKX: Fix authenticated websocket login (#2051)
* Okx:remove

* Okx:replace

* Okx:ping gws.PingMessage

* Okx:ping gws.PingMessage

* Okx: add authenticateConnection

* Okx: fix pingHandler

* Update exchanges/okx/okx_business_websocket.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/okx/okx_business_websocket.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/okx/okx_websocket.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/okx/okx_business_websocket.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Okx:UseMultiConnectionManagement

* Okx:rm UseMultiConnectionManagement

* Okx:roll back

* Okx:apply diff

* Okx:make lint fix

* Okx:make lint fix

* Okx:make lint fix

* Okx:fix

* Okx:fix name

* Okx:fix NilGuard depends on #2076

* Okx:remove comment

---------

Co-authored-by: Ryan O'Hara-Reid <oharareid.ryan@gmail.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-10-10 10:59:08 +11:00
dependabot[bot]
3ae0197e68 build(deps): Bump github.com/grpc-ecosystem/grpc-gateway/v2 (#2075)
Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.27.2 to 2.27.3.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/main/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.27.2...v2.27.3)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  dependency-version: 2.27.3
  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>
2025-10-07 09:45:33 +11:00
dependabot[bot]
ed8e6f691f build(deps): Bump google.golang.org/protobuf from 1.36.9 to 1.36.10 (#2074)
Bumps google.golang.org/protobuf from 1.36.9 to 1.36.10.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.10
  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>
2025-10-07 09:40:19 +11:00
Ryan O'Hara-Reid
dcf98ec700 exchanges/order, GateIO: Update USDT margined futures pathway for cancel all orders (#2021)
* order/gateio: update USDT margined futures pathway for cancel all orders and drop count field

* gateio: add and expand tests for CancelAllOrders and getExchangeSide

* Add test for load

* linter: fix

* Update exchanges/kraken/kraken_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* Update exchanges/order/orders.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* glorious: nits

* reverted change for options

* Update exchanges/gateio/gateio_wrapper_test.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/gateio/gateio_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/deribit/deribit_wrapper.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_wrapper_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_wrapper_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Add consts for cancel side references

* Update exchanges/gateio/gateio_wrapper.go

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

* Update exchanges/gateio/gateio_wrapper.go

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

* Update exchanges/gateio/gateio_websocket_request_futures.go

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

* thrasher-: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-10-02 15:50:51 +10:00
Ryan O'Hara-Reid
e11765bc36 GateIO: Enhance order execution limits and currency pair details (#2018)
* refactor(gateio): enhance order execution limits and currency pair details

* Update exchanges/gateio/gateio_wrapper.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* REEEEEHHHHHH

* linter: fix

* fix GetOpenInterest when a contract is delisted

* add handling for delisting end time correctly

* Update exchange/order/limits/limits_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchange/order/limits/limits_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* gci: fix

* linter: fix

* gateio: Add launch and update tests (cherry-pick)

* gk: nits + removed spot setting delisting as delisted because it is not a start time value

* glorious: apply diff

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-10-02 14:55:43 +10:00
Ryan O'Hara-Reid
ac91fabcd5 orderbook: consolidate slice array types to orderbook package (#1992)
* orderbook: consolidate slice array types to orderbook package

* Update exchanges/bybit/bybit_types.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* linter: fix and add test

* cranktakular: nits

* cranktakular: nits

* Update exchanges/orderbook/orderbook_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits consolidation

* gk: rm unifySpotOrderbook func

* gk: nit but different

* linter: fix

* gk: nits

* glorious: nits

* Update exchanges/binance/binance.go

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

* Update exchanges/binance/binance_cfutures.go

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

* Update exchanges/binanceus/binanceus.go

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

* thrasher-:nits

* thrasher-: more nit

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-10-02 14:22:20 +10:00
Ryan O'Hara-Reid
eb60a3c40e bybit: Add convert functions (#1993)
* bybit: Add convert functions

* Update exchanges/bybit/convert.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* rm exported type and inline it within func dec

* Update exchanges/bybit/convert.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/bybit/convert.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* glorious: catch

* glorious: int -> int64

* bossking: nits

* Update exchanges/bybit/convert.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/bybit/convert.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/bybit/convert.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/bybit/convert_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/bybit/convert_types.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/bybit/convert.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits v1

* gk: mock what I can

* Fix broken things that I broke

* gk: nits

* Update exchanges/bybit/convert_types.go

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

* thrasher-: nits and bits

* linter: fix

* thrasher-:nits updoo

* cranktakular: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-10-02 11:20:27 +10:00
Adrian Gallagher
bb122dcafa codebase: Remove web frontend and related services (#2067)
* codebase: Remove web frontend and related services

* refactor: Update StartPPROF to accept context and adjust related tests

* refactor: Simplify SetIfZero functions and update related tests

* config: Clarify DowngradeConfig method documentation regarding permanent removal of deprecated fields

* refactor: Rename setIfZeroAndWarn to setDefaultIfZeroWarn for clarity and update related calls

* refactor: Update error handling in DataHistoryManager and remove redundant error variable
2025-09-30 13:32:09 +10:00
Ryan O'Hara-Reid
0b60693ff5 exchanges: Update ModifyOrder comments for clarity (#2044)
Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
2025-09-30 11:23:10 +10:00