2418 Commits

Author SHA1 Message Date
Jun
06afde1460 okx: fix type for AccountConfigurationResponse (#1834)
* okx: fix type for AccountConfigurationResponse

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* OKX: Further AccountConfigurationResponse type adjustments

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-03-28 12:40:14 +11:00
Bea
9a6e230e40 BTC Markets: Fix sending trades to the websocket DataHandler (#1847)
* Fix websocket trade streaming

* Fix lint

* Rename trade.Data var

* Update wsTrade side type

* Add test for the invalid side

* Test the side
2025-03-25 16:20:54 +11:00
Jun
e5a238aa9d okx: optimise GetFuturesPositionOrders (#1830)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2025-03-25 16:12:20 +11:00
dependabot[bot]
40b49a305b build(deps): Bump github.com/bytedance/sonic from 1.13.1 to 1.13.2 (#1858)
Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.13.1 to 1.13.2.
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](https://github.com/bytedance/sonic/compare/v1.13.1...v1.13.2)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  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-03-25 09:52:03 +11:00
Adrian Gallagher
4651af5767 modernise: Run new gopls modernise tool against the codebase and fix minor issues (#1826)
* modernise: Run new gopls modernise tool against codebase

* Address shazbert's nits

* apichecker, gctcli: Simplify HTML scraping functions and improve depth limit handling

* refactor: Create minSyncInterval const and update order book limit handling for binance and binanceUS

* refactor: Various slice usage improvements and rename TODO

* tranches: Revert deleteByID changes due to performance decrease

Shazbert was a F1 driver in a past lifetime 🏎️

* tranches: Simply retrieve copy

Thanks to shazbert

* documentation: Sort contributors list by contributions

* tranches: Remove deadcode in deleteByID
2025-03-21 09:17:10 +11:00
Bea
d857d704e3 BTSE: Fix sending trades to the websocket DataHandler (#1845)
* Fix ws trades stream

Update the raw trade data to match the API docs
Fix extracting the pair from the topic
Update the test
Amend the configtest to enable the trade feed

* Rename the test, exctract pair from symbol

* Add check if neither trade feed or save trade data is enabled

* Update the channel name to match the API docs

* Change side parsing

* Change tradeHistory Side type

* Fix linter and nit

* Fix linter

* Fix the channel trades channel name
2025-03-20 12:33:08 +11:00
Gareth Kirwan
fafee93e1b sonic, exchanges/okx: Make sonic opt-in by default and fix various OKX issues (#1816)
* Sonic: Add sonic_on build tag

Thinking about other ways to do this, but they amount to the same thing.
It's messy, but I don't have another idea.

* Okx: Remove redundant useAsIs on slices

Slices are automatically used-as-is, so passing true for these types was
unnecessary.
Removing the field simplifies rationalising inverting the flag

* Okx: Unify timestamp response types

* Okx: Change ResetRFQMMPStatus to return a types.Time

* Okx: Move withdrawData type to types

* Okx: Fix AccountConfiguration slice return

* Okx: Improve SendHTTPRequest documentation

* Okx: Extend tests for UseAsIs non-defaults

* Okx: Fix GetPublicUnderlying with sonic 1.12.9

Using **result for slices with useAsItIs causes sonic to fail.
This might be addressed upstream, but it's also not clear what the
unmarshal behaviour for an untyped reference to a typed reference should
be in the RFC, so we could get a golang.org/encoding/json regression on
this too.

There's no harm in fixing this, for consistency, to match our handling
for non-slice []any wrapping to just use the pointer as is.

Note: As of today this requires sonic:main for this to work, because of
the other bug:
```
M go.mod
-	github.com/bytedance/sonic v1.12.9
+	github.com/bytedance/sonic v1.12.10-0.20250224121557-e30ac4f2e4fe
```

* Okx: Remove redundant slice check

This code didn't work, and if I make it look at rv.Elem().Kind() it
errors.
Haven't dug too deeply but right now I think we just remove it.

* Okx: Simplify SendHTTPRequest by removing UseAsIs

Looks to be entirely derivable

* Okx: Remove http check that resps must contain data

GetAnnouncementTyeps failing in US because of empty response.
But also any situation where there really is no data.
e.g. GetCandlesticks might return no candlesticks for a period and instrument, because there aren't any.
That shouldn't be an error.
More saliently if you request orders, or something similar.

So, since that check wasn't working before, and it's causing issues now, I'm going to remove it.

* Okx: Fix TestGetAnnouncementTypes failing in US

announcement-types returns empty in the US, where our github actions
run.
That's kinda okay. Just don't test we get any back

* Sonic: Default to sonic off

We've seen too many fatal panics and races with sonic, both in GCT runs
and being reported in sonic, to default to it being turned on right now.
Whilst we have faith sonic will get through these with time, for now the
sensible thing to do for our users is make sonic opt-in.

This also removes any of the conditions around 386, etc.
If someone wants to run with sonic, they can. Most notably if they're
trying out an experimental sonic branch that supports 386, etc.
2025-03-20 12:31:11 +11:00
Gareth Kirwan
ade3ac5c59 Config: OrderManager upgrade (#1737)
* Config: Allow missing Versions

This allows easier development of non-stacked version upgrades.
Though the PRs still need to be merged sequentially, or renumbered right
before merging

* Config: Move OrderManager upgrade to Version management
2025-03-19 16:11:28 +11:00
Adrian Gallagher
f5faca2eb2 linter: Enable gofumpt and run against codebase (#1848)
* linter: Enable gofumpt and run against codebase

* Address shazbert's nits

* gofumpt: Fix issues after rebase
2025-03-18 10:23:16 +11:00
Gareth Kirwan
748ed71455 Huobi: Fix TestPairFromContractExpiryCode NW contract failure (#1809)
Looks like "Within 2 weeks" fails on 22nd November during leap years.
On 2025-02-21 we saw NW come up with 2025-03-07 for a few hours,
and I'm guessing it's because they use local time.
Added 1 day leeway to account for that timezone difference.
2025-03-18 09:45:24 +11:00
Gareth Kirwan
16d2d9f35a Config: AssetEnabled upgrade (#1735)
* 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
2025-03-17 21:47:37 +11:00
dependabot[bot]
2a11c94dc4 build(deps): Bump github.com/spf13/viper from 1.19.0 to 1.20.0 (#1849)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.19.0 to 1.20.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.19.0...v1.20.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>
2025-03-17 21:35:58 +11:00
Bea
3d212b6279 Okx: Fix sending trades to the websocket DataHandler (#1833)
* Send trades down the DataHandler, add test

* Send the trades down to the DataHandler

Update the test to process trades for each asset type
Add raw trade data from OKX
Update the timestamp in the method

* Replace pair repetition with p var

* Update the test, remove repetition

* Rename trade var in the test

* Fix nits and slice sorting

* Compare trades

* Fix nits
2025-03-17 10:07:28 +11:00
Jun
e544e99c48 binance: use types.Time instead of time.Time (#1828)
* binance: use types.Time instead of time.Time

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* binance: remove type_convert.go

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
2025-03-13 13:59:26 +11:00
Jun
4474278053 exchanges/account: add UpdatedAt field to Balance and ProtectedBalance (#1827)
* add updatedAt for account balance

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* add nil pointer test for load

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* account: set default updatedAt to balance for Update

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* engine: add UpdatedAt for account info

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* account: force updatedAt for load balance

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* minor change for test

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
2025-03-13 13:57:14 +11:00
yuhangcangqian
138419e7a8 refactor: use t.TempDir() instead of os.MkdirTemp (#1832)
Signed-off-by: yuhangcangqian <cuibuwei@qq.com>
2025-03-13 10:21:56 +11:00
Jun
5c21e974ee okx: Move WsResponseMultiplexer to SetDefaults (#1829)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2025-03-11 13:37:17 +11:00
dependabot[bot]
568ed3021e build(deps): Bump google.golang.org/grpc from 1.70.0 to 1.71.0 (#1837)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.70.0 to 1.71.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.70.0...v1.71.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>
2025-03-11 11:52:38 +11:00
dependabot[bot]
0b3adadefc build(deps): Bump github.com/grpc-ecosystem/grpc-gateway/v2 (#1840)
Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.26.1 to 2.26.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.26.1...v2.26.3)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  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-03-11 11:04:58 +11:00
dependabot[bot]
b396ff5f71 build(deps): Bump golang.org/x/time from 0.10.0 to 0.11.0 (#1843)
Bumps [golang.org/x/time](https://github.com/golang/time) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/time/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/time
  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-03-11 10:27:38 +11:00
Bea
72a94a4b6c Huobi: Fix sending trades to the websocket DataHandler (#1817)
* Send trades down the DataHandler

* Send individual trades down the DataHandler

Update the test to send the multiple trades
Remove the ID setting to 0 in the test
Iterate through the trades to send them down individually
Rename the test to match the method

* Fix the timestamp conversion

* Fix the wording

* Update the expected data format

* Update the test name and description

* Fix error case
2025-03-11 10:21:28 +11:00
dependabot[bot]
8c29dd9f28 build(deps): Bump github.com/urfave/cli/v2 from 2.27.5 to 2.27.6 (#1839)
Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.27.5 to 2.27.6.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v2.27.5...v2.27.6)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v2
  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-03-10 16:36:50 +11:00
Adrian Gallagher
d64d56f77c build/ci: Update Go to v1.24, golangci-lint to v1.64.6 and fix issues (#1804)
* 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
2025-03-10 16:33:55 +11:00
dependabot[bot]
c086e281cf build(deps): Bump github.com/bytedance/sonic from 1.12.9 to 1.13.1 (#1838)
Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.12.9 to 1.13.1.
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](https://github.com/bytedance/sonic/compare/v1.12.9...v1.13.1)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  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-03-10 14:58:24 +11:00
dependabot[bot]
870206dde3 build(deps): Bump golang.org/x/net from 0.35.0 to 0.37.0 (#1842)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.35.0 to 0.37.0.
- [Commits](https://github.com/golang/net/compare/v0.35.0...v0.37.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  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-03-10 14:41:46 +11:00
Scott
6ee26a7da1 exchanges/margin: Fix marshalling issue (#1812)
* Fixes issue with marshalling margin types

* Update exchanges/order/order_test.go

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

* Update exchanges/margin/margin.go

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

* Update exchanges/order/order_test.go

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

* Update test name

---------

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-03-06 15:17:05 +11:00
Jun
7a6d6cc002 trade: remove exchangeName for AddTradesToBuffer (#1820)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2025-03-06 12:50:03 +11:00
Gareth Kirwan
9fcaa9130b Config: Tighten config version handling as uint16 (#1825)
* Config: Tighten config version handling as uint16

This constrains the versions to uint16 and improves error handling.
LatestVersion becomes literally that.
Fixes handling for negative or overflowing versions in config

* Config: Rename LatestVersion to UseLatestVersion
2025-03-06 12:12:57 +11:00
Gareth Kirwan
d069ff2bf4 Subscriptions: Fix no enabled pairs for one asset (#1792)
If one asset is enabled but has no enabled pairs, we should ignore that
asset, even for non-pair related subscriptions.
That matches the existing code, but wasn't happening in the context of
asset.All subscriptions with just one asset in this state.
If a user wanted to have non-pair subscriptions, they should use
asset.Empty. Would expect other breakages with no pairs enabled, too.

Note: No enabled pairs for an enabled asset is a transient issue which
can occur due to enableOnePair racing against no available pairs. The
second run, available pairs would be populated and enableOnePair would
work. This situation could persist due to running with --dry or
containerised, though.

Fixes:
`
Okx websocket: subscription failure, myOrders all : subscription template did not generate the expected number of pair records for spread: Got 1;
Expected 0
`

Relates to #1420
2025-03-06 12:08:08 +11:00
cangqiaoyuzhuo
0796e44063 Poloniex: Fix GetChartData error return value (#1819)
Signed-off-by: cangqiaoyuzhuo <850072022@qq.com>
2025-03-06 11:20:56 +11:00
Jun
8f63b0b07c bybit: support categorised channel (#1823)
* bybit: support categorised channel

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* remove comment for private func

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

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-03-06 11:15:22 +11:00
Bea
7fa2592e31 Kraken: Fix sending trades to the websocket DataHandler (#1813)
* Send trades down the DataHandler

When the tradeFeed is enabled, send the trades down the DataHandler
Add TestWSProcessTrades

* Update assertions

* Add check against null references in slices

* Add an error for ws parsing field to common

* Update kraken websocket ProcessTrades

Send individual trades down the DataHandler
Send multiple trades in test
Test error if the trade length is too short
Nits

* Fix nits
2025-03-04 17:06:07 +11:00
dependabot[bot]
3d2455b5fb build(deps): Bump golang.org/x/crypto from 0.34.0 to 0.35.0 (#1821)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.34.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  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-03-03 17:19:11 +11:00
dependabot[bot]
e632939836 build(deps): Bump github.com/bytedance/sonic from 1.12.7 to 1.12.9 (#1815)
Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.12.7 to 1.12.9.
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](https://github.com/bytedance/sonic/compare/v1.12.7...v1.12.9)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  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-02-24 17:03:22 +11:00
dependabot[bot]
17e26b532f build(deps): Bump golang.org/x/crypto from 0.33.0 to 0.34.0 (#1814)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.33.0 to 0.34.0.
- [Commits](https://github.com/golang/crypto/compare/v0.33.0...v0.34.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  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-02-24 17:01:38 +11:00
Ryan O'Hara-Reid
3a80cd2871 stream: force subscription store check as stop gap for wrapper side implementation (#1717)
* Add check for subscription store insertion and validation with tests

* bybit: fix subscriptions

* deribit: fix subscriptions

* linter: fix

* glorious/nits: add test for updateChannelSubscriptions RM GetChannelDifference method as its only used locally and Diff method can be accessed directly

* glorious/nits: add to store in the loop; add correct formatting to template for edge case perps with settlement

* spelling: fix

* glorious/nit: silly billy

* gk: nits

* gk/nits: split PartitionByPresence into Contained and Missing

* gk/nits: formatPerpetualPairWithSettlement -> formatChannelPair

* stream/websocket: stop full websocket disconnect on Connect when encountering subscription specific error paths

* stream/websocket: rm nil assignment

* glorious: nits

* gk: niterinos

* Update exchanges/stream/websocket_test.go

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

* Update exchanges/stream/websocket_test.go

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

* Update exchanges/stream/websocket_test.go

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

* thrasher: nits

---------

Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-02-24 15:25:49 +11:00
Adrian Gallagher
ef0f398455 exchanges/btse: Handle TRUMPSOL in MarketPair.Pair and add test coverage (#1808)
* exchanges/btse: Handle TRUMPSOL in MarketPair.Pair and add test coverage

* BTSE: Update test table

* nits: Make slight adjustments to test table
2025-02-24 14:26:11 +11:00
Adrian Gallagher
744ee7c099 CI, sonic: Replace backend-arm64 docker build with native GHA runner, disable sonic for arm64 (#1794)
* CI: Replace docker amd64 with native runner, switch Docker test arch to amd64

* tests: Remove spaces and new lines from test JSON timestamp fields

* builds: Disable sonic for arm64 due to OKX unmarshal issue

* nits: Improve Dockerfile comment and fix build tag
2025-02-24 12:38:12 +11:00
Ryan O'Hara-Reid
636adb8822 orderbook: Add methods for extracting associated details from depth (#1783)
* orderbook: return identification details from depth

* Add methods, drop error as you cannot deploy without it anyway, add tests

* Update exchanges/orderbook/depth_test.go

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

* linter: fix

* gk: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2025-02-20 16:10:07 +11:00
Ryan O'Hara-Reid
e99adca86f encoding/json: Add custom JSON package with build tag support for Sonic (#1623)
* 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>
2025-02-20 16:05:55 +11:00
Gareth Kirwan
3748c97b12 Config: Fix config version downgrade (#1770)
* Config: Rename DecryptConfigFile to DecryptConfigData

Because this isn't really a file, it's a byte slice

* Config: Rename EncryptConfigFile to EncryptConfigData

Because it's not actually a file

* Config: Fix config version downgrade

Fixes #1769
2025-02-20 09:27:52 +11:00
Gareth Kirwan
dc2d7770fb Huobi: V2 subscription support (#1703)
* Huobi: assertify tests

* Testing: Add FixtureToDataHandlerWithErrors

* Huobi: Add V2 websocket support

* Huobi: Fix tests racing on updatePairsOnce

* Huobi: Remove unnecessary funnelData

* Huobi: Clarify V1/V2 pings

* Huobi: Switch to types.Time

* Huobi: Disable websocket Futures and CoinMarginedFutures support

* Huobi: Fix test failures on futureContracts

Per-instance future codes not getting cached causin occassional fails

* Huobi: Fix idiosyncratic naming using TestWs instead of TestWS

* Huobi: Run WS tests in parallel
2025-02-19 16:42:25 +11:00
Ryan O'Hara-Reid
08e015a125 exchanges/wrappers: Refactor fetch orderbook/ticker/account info funcs (#1440)
* acrost: Pull thread, examine

* fix tests

* linter

* fix_linter

* revert rm ctx param to limit breakages when merging usptream

* linter fix

* Add in priority update grouping so that tests pass

* Update cmd/exchange_wrapper_standards/exchange_wrapper_standards_test.go

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

* glorious nits

* fixed spelling

* whoopsie

* aanother whoops

* glorious: NITTERS!

* glorious: further nitters

* srry linter gods

* glorious: nits continued

* sub test p ara lel

* drop main t.Parallel

* fix whoops

* wrappertests: use context with cancel (test)

* linter: fix

* ensure primary execution

* kucoin test fix

* revert standards test changes and bypass non critical errors

* rm single override

* wrap exported error for accounts

* thrasher: nits ch name

* gk: nits

* gk: nits FetchTickerCached -> GetCachedTicker

* gk: nits rn FetchOrderbookCached -> GetCachedOrderbook

* gk: nits rn FetchAccountInfoCached -> GetCachedAccountInfo

* linter: fix

* gk: nits

* thrasher: nitters 1

* thrasher: nitters tmpls

* gk: nitter

---------

Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2025-02-19 10:47:10 +11:00
dependabot[bot]
2fc7e8e3e3 build(deps): Bump golang.org/x/net from 0.34.0 to 0.35.0 (#1806)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.34.0 to 0.35.0.
- [Commits](https://github.com/golang/net/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  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-02-18 10:00:17 +11:00
Gareth Kirwan
5463e359bc Bitfinex: Fix websocket trade processing (#1754)
* Bitfinex: Fix WS trade processing

* Add handling for funding trades

Fixes #1746

* Linter: Disable shadow linting for err

It's been a year, and I'm still getting caught out by govet demanding I
don't shadow a var I was deliberately shadowing.
Made worse by an increase in clashes with stylecheck when they both want
opposite things on the same line.

* Bitfinex: Move websocket constants to websocket file

* Bitfinex: Rename channel consts

* Bitfinex: Send individual WS trades down the DataHandler
2025-02-17 13:20:14 +11:00
dependabot[bot]
8fad985669 build(deps): Bump golang.org/x/time from 0.9.0 to 0.10.0 (#1796)
Bumps [golang.org/x/time](https://github.com/golang/time) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/time/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/time
  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-02-10 17:26:10 +11:00
dependabot[bot]
abd1d746df build(deps): Bump golang.org/x/crypto from 0.32.0 to 0.33.0 (#1800)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.32.0 to 0.33.0.
- [Commits](https://github.com/golang/crypto/compare/v0.32.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  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-02-10 17:12:59 +11:00
dependabot[bot]
f181bc8344 build(deps): Bump github.com/grpc-ecosystem/grpc-gateway/v2 (#1798)
Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.26.0 to 2.26.1.
- [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.26.0...v2.26.1)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  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-02-10 17:01:19 +11:00
Ryan O'Hara-Reid
6613c56738 stream/buffer: remove time.ticker publish limiter for websocket orderbook updates (#1681)
* stream/buffer: remove publish period for for signalling change through data handler

* Add config upgrade and downgrade

* linter: fix

* GK: nits

* Update config/versions/v3.go

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

* Update config/versions/v3.go

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

* Update config/versions/v3.go

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

* Update config/versions/v3.go

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

* Update config/versions/v3.go

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

* config: fix up commited suggestion

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-02-10 16:15:33 +11:00
Ryan O'Hara-Reid
45652564f4 orderbook: fix fields not being retrieved when getting orderbook.Base (#1793)
* orderbook: fix fields not being retrieved

* glorious: nits

---------

Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
2025-02-10 13:54:02 +11:00