Skip to content

[pull] master from thrasher-corp:master#111

Merged
pull[bot] merged 2 commits intosyther-labs:masterfrom
thrasher-corp:master
Feb 27, 2026
Merged

[pull] master from thrasher-corp:master#111
pull[bot] merged 2 commits intosyther-labs:masterfrom
thrasher-corp:master

Conversation

@pull
Copy link

@pull pull bot commented Feb 27, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

thrasher- and others added 2 commits February 27, 2026 16:22
…d-state flakiness (#2191)

* engine: harden orderbook nominal/impact tests against nil panics and shared state

* engine: use counter-based unique test exchange names
* fix: update Gate.io websocket handling for size and amount conversions

- Added "X-Gate-Size-Decimal" header in the websocket connection for spot trading.
- Updated futures and options processing to convert sizes and amounts to float64 where necessary.
- Ensured consistency in handling size and amount across various functions in the Gate.io exchange wrapper.

* rm verbosity

* docs: Update type usage guidelines for API number handling due to benchmarks below

`types.Number` vs `float64` with `,string` — benchmark findings

Benchmarked at count=100 on AMD Ryzen 7 5800X (Windows, amd64):

| Field type | Avg ns/op | B/op | allocs/op |
|---|---|---|---|
| `float64` (bare number) | ~414 | 216 | 4 |
| `types.Number` (quoted string) | ~403 | 216 | 4 |
| `float64` + `,string` tag (quoted string) | ~506 | 264 | **7** |

`types.Number` is identical in cost to a bare `float64` — the custom `UnmarshalJSON` allocates nothing of its own (the compiler eliminates the `string(data)` conversion in `strconv.ParseFloat`). By contrast, `float64` with `,string` is ~25% slower and produces 3 extra allocations and 48 extra bytes per decode due to the stdlib reflection path it takes.

+**Calling `.Float64()` on a `types.Number` field is optional** — `types.Number` is defined as `type Number float64`, so a direct conversion `float64(n)` or storing it as `types.Number` and passing it where a `float64` is needed are both zero-cost. `.Float64()` is a convenience accessor and may be omitted when the call site already works with `types.Number` directly.

* glorious: don't send header down the spot connection, mv it to the futures connection

* crank/glorious: nits

* thrasher-:nits

* glorious: nits in your head

* Update exchanges/gateio/gateio_test.go

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

* Update exchanges/gateio/gateio_test.go

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

* Update exchanges/gateio/gateio_test.go

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

* gate f usage

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
@pull pull bot locked and limited conversation to collaborators Feb 27, 2026
@pull pull bot added the ⤵️ pull label Feb 27, 2026
@pull pull bot merged commit 97c28a8 into syther-labs:master Feb 27, 2026
8 of 13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants