Commit Graph

744 Commits

Author SHA1 Message Date
Ryan O'Hara-Reid
a0bc2c0cf3 gateio: Implement UpdateOrderExecutionLimits for spot instruments (#1281)
* gateio: limits (cherry-pick)

* clean

* linter: fix

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-07-31 18:17:58 +10:00
Bea
0cae2ad804 Bitfinex: Implement UpdateOrderExecutionLimits and tests (#1269)
* Bitfinex: Order Execution Limits and Testing

* Bitfinex: added proposed changes

* Bitfinex: lint fixes- removed the unnecessary whitespace and replaced the value with indexing

* Bitfinex: Moved data len check before the string conversion, moved the error for the array conversion before the info len check

* Bitfinex: Change GetSiteInfoConfigData to return slice, add tests

* Bitfinex: Fixed lint issue by preallocating pairs
2023-07-31 17:56:45 +10:00
Bea
123ec8c73d Bitstamp: Implement UpdateOrderExecutionLimits and testing (#1264)
* Bitstamp: OrderExecutionLimits and testing

* Bitstamp: Fix FetchTradablePairs Loading Limits

* Bitstamp: Limit for the step increment added, type convert replaced with regular expression

* Update exchanges/bitstamp/bitstamp_type_convert.go

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

* Bitstamp: Changed MinimumBaseAmount to MinimumQuoteAmount

* Bitstamp: changed riceStepIncrementSize and AmountStepIncrementSize to math.Pow(-value)

---------

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2023-07-28 15:43:32 +10:00
Gareth Kirwan
1e96453e2a Kraken: Fix websocket new order pair symbol format (#1283) 2023-07-28 14:53:28 +10:00
Gareth Kirwan
5d5f88c82a Orders: Fix Pending status not parsed (#1284) 2023-07-28 13:16:33 +10:00
Gareth Kirwan
c5a1a88292 Kraken: Fix websocket open orders orderType parsing (#1285) 2023-07-28 13:16:11 +10:00
Ryan O'Hara-Reid
4dd3008fd4 Kraken: fix websocket orderbook processing (#1279)
* kraken: fix websocket orderbook processing

* kraken: clean

* glorious: nits also add todo

* more: add required checksum to TODO for future, move variable to top

* glorious: get mad

* orderbook: fix retrieve issue

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-07-26 16:35:43 +10:00
Scott
471f4f21c4 Binance,OKx: Implement fetching funding rates (#1239)
* adds basic groundwork for rates on binance

* more into rates on binance

* rm redudant redundancy, add payments

* mini commit before merging with testnet ability branch

* changes function signature and fixes resulting build

* gets billing data too

* funding rates package, features use, testnet reimpl

* new endpoint, refinements and tests

* cli fix, rpc impl, testing, payments

* fixups from looking at code

* typo fix

* niteroos

* merge fixes

* adds test, fixes cli issues

* woah nelly
2023-07-26 14:25:43 +10:00
Bea
0522a54681 Kraken: Load order execution limits for tradable pairs (#1255)
* Kraken: Load asset limits for pairs

* Kraken: Add test for spot order limit loading

* Kraken: move Limits to UpdateExecutionLimits

* Kraken: Whitespace fixed

* Kraken: added ErrNotYetImplemented for the futures

* Kraken: Fix FetchTradablePairs Loading Limits

* Kraken: changed the error to match the Go 1.13 error package

---------

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2023-07-24 13:42:49 +10:00
Ryan O'Hara-Reid
b797934854 bitfinex: fix websocket subscribing issue caused by formatting (#1276)
* bitfinex: fix subscribing issue caused by formatting

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-07-24 13:26:50 +10:00
Gareth Kirwan
69d0f1d9a7 Kraken: Fix Balances reporting 0 free (#1267)
* Kraken: Fix Balances reporting 0 Free

This switches to BalancesEx(tended) to get Held assets so we can
construct a Total, Held and Free.
Without this fix we get 0 balance from GetFree()
Haven't added tests because no construct for mocks and it's private
data. Considering adding mocks a bridge to far for this fix.

* Kraken: Simplify GetBalance
2023-07-18 15:22:51 +10:00
Gareth Kirwan
4a8eedf3f7 Bitstamp: Fix USDT balance not loading (#1265)
* Bitstamp: Fix USDT balance not loading

* Bitstamp: Fix GetBalance losing Fees
2023-07-18 13:44:30 +10:00
Gareth Kirwan
ce3d29f5d5 Okx: Fix panic during shutdown due to race (#1240)
* Okx: Fix panic during shutdown due to race

Error:
```
panic: runtime error: slice bounds out of range [:13340] with capacity 8192
bufio.(*Reader).Read(0x14000038540, {0x1400059cffc?, 0x4?, 0x0?})
        /usr/local/go/src/bufio/bufio.go:250 +0x33c
github.com/gorilla/websocket.(*messageReader).Read(0x1400098bb78, {0x1400059cffc, 0x4, 0x4})
        /Users/gbjk/go/pkg/mod/github.com/gorilla/websocket@v1.5.0/conn.go:1050 +0x208
io.ReadAll({0x12f36c618, 0x1400098bb78})
        /usr/local/go/src/io/io.go:701 +0xe4
io/ioutil.ReadAll(...)
        /usr/local/go/src/io/ioutil/ioutil.go:27
github.com/gorilla/websocket.(*Conn).ReadMessage(0x3?)
        /Users/gbjk/go/pkg/mod/github.com/gorilla/websocket@v1.5.0/conn.go:1097 +0x54
github.com/thrasher-corp/gocryptotrader/exchanges/stream.(*WebsocketConnection).ReadMessage(0x140006622d0)
        /Users/gbjk/go/pkg/mod/github.com/gbjk/gocryptotrader@v0.0.0-20230619070715-ae6f283f6be6/exchanges/stream/websocket_connection.go:217 +0x30
github.com/thrasher-corp/gocryptotrader/exchanges/okx.(*Okx).wsFunnelConnectionData(0x140019321e0?, {0x106909450, 0x140006622d0})
        /Users/gbjk/go/pkg/mod/github.com/gbjk/gocryptotrader@v0.0.0-20230619070715-ae6f283f6be6/exchanges/okx/okx_websocket.go:346 +0x94
created by github.com/thrasher-corp/gocryptotrader/exchanges/okx.(*Okx).WsConnect
        /Users/gbjk/go/pkg/mod/github.com/gbjk/gocryptotrader@v0.0.0-20230619070715-ae6f283f6be6/exchanges/okx/okx_websocket.go:234 +0x134
exit status 2
```
This happens when there's a race in calls to bufio because it over-reads. See [this comment](https://github.com/golang/go/issues/42289#issuecomment-723393783)
Detected using go -race:
```
WARNING: DATA RACE
Read at 0x00c000818bc0 by goroutine 2156:
  github.com/gorilla/websocket.(*Conn).NextReader()
      /Users/gbjk/go/pkg/mod/github.com/gorilla/websocket@v1.5.0/conn.go:1000 +0x38
  github.com/gorilla/websocket.(*Conn).ReadMessage()
      /Users/gbjk/go/pkg/mod/github.com/gorilla/websocket@v1.5.0/conn.go:1093 +0x28
  github.com/thrasher-corp/gocryptotrader/exchanges/stream.(*WebsocketConnection).ReadMessage()
      /Users/gbjk/go/pkg/mod/github.com/gbjk/gocryptotrader@v0.0.0-20230619070715-ae6f283f6be6/exchanges/stream/websocket_connection.go:217 +0x44
  github.com/thrasher-corp/gocryptotrader/exchanges/okx.(*Okx).wsFunnelConnectionData()
```

Because we started a new wsFunnelConnectionData for each re-connect.

This bug might apply to other exchanges.

* Okx: Fix websocket waitgroup going negative

Move the waitgroup additions to the actual places that use them

* Okx: Add nolint for revive

* Okx: Move wg Adds to outside goros

There is a risk of a race condition if we let the goros Add themselves.

* Okx: Simplify websocket reading

This fixes the issue that the WsRead and Multiplexer were intrinsically
linked to the websocket, even though they need to survive both
disconnects and Disable/Enables.

Messages are now handled in a goro, which means they might not be
sequential, but there's a very high chance that messages of the same
codepath will be handled sequentially. So orderbook, ticked and order
messages should be sequential

* Okx: Switch to blocking processing of ws msgs

* Okx: Remove nolint from Setup

Actioning a review comment: @gloriousCode prefers to avoid having to nolint this in favour of
a func call return.

* Okx: Remove redundant Wg use inside WsReadData

* Okx: Fix WsMultiplexer Re-Run() shutdown
2023-07-17 13:21:28 +10:00
Ryan O'Hara-Reid
da38b4bdf7 go.mod: bump go version to 1.20 from 1.17 (#1266)
* go.mod: bump to version 1.20

* go fix yourself

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-07-12 10:49:23 +10:00
Bea
aa61e13cab Okx: Log auth websocket connection errors (#1257) 2023-07-07 09:58:05 +10:00
Ryan O'Hara-Reid
81a8b4a575 common: remove SimpleTimeFormat const for time package layout const DateTime (#1246)
* switch over to package defined const for time layout

* bump appveyor playa

* bumperino to latest while setting patherino

* whoooops

* bump VS version set GOROOT

* puge build cache

* Revert "puge build cache"

This reverts commit 315bb578afc19529457f435e52af2172f5143bc5.

* bumperino to test

* purge setting of golang directory for version and allow default

* purge cache state when file change

* whoops

* thrasher: nits

* don't need to flusherino the cacherino

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-07-06 11:17:43 +10:00
Adrian Gallagher
1388b172b4 credentials: Fix issue with external package usage (#1250)
* credentials: Fix issue with external package usage

* Add shazberterino's suggestion

* credentials: Revert and expand coverage
2023-07-05 09:24:21 +10:00
Adrian Gallagher
5af9b6573d Kraken: Fix auth request regression (#1251) 2023-07-04 10:32:54 +10:00
Scott
fcc5ad4551 exchanges/qa: Add exchange wrapper testing suite (#1159)
* 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
2023-07-03 11:09:43 +10:00
Ryan O'Hara-Reid
ef605a3c19 okx: Add fee fields for USDC pairs (#1244)
* okx: Add USDC quoted maker/taker fees

* thrasher: nits

* fix spelling

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-06-29 17:19:05 +10:00
TaltaM
db7441c723 dispatch: channel reuse fix (#1237)
* Add test for dispatch channel reuse

* Dispatcher - make chans bidirectional

* No need to to keep the type assertion separate from the Get()

* Unexport Pipe's channel and add getter
2023-06-21 12:33:40 +10:00
Gareth Kirwan
97804a79da Orders: Fix ClientOrderID not updated in merge (#1235) 2023-06-20 09:56:58 +10:00
Ryan O'Hara-Reid
17cefe6956 okx: GetDefaultConfig fix & ticker field improvements (#1227)
* okx: updaterooo (cherry pick)

* okx: add in target currency handling in spot market orders

* okx:don't adjust order.Submit variables.

* spell checker

* okx_wrapper: updateTradablePairs true bool

* thrasher: nits

* purge default env vars

* point to CI env var

* print out environment

* lol

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-06-19 15:58:58 +10:00
Ryan O'Hara-Reid
981a08af83 bybit: assortment of updates (#1192)
* bybit: cherry-pickable

* bybit: implement fee fetching v5

* bybit: update to use nullable type

* bybit: fix some tests

* bybit: spell check fix

* remove redunant asset dec, and rm output

* rm comment code

* linter: fixerinos woooo

* bybit: constrict rate limit on public spot to v5

* exchanges/bybit/limits: update (CHERRY PICK ME)

* glorious: nIIIIIIIIIIIIIIITS

* glorious: nits continued

* updated comment

* update even more

* RM LINE!

* glorious: nits

* Update exchanges/sharedtestvalues/sharedtestvalues.go

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

* fix

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2023-06-16 12:27:34 +10:00
Scott
698b6716ea okx: REST orderbook depth fix (#1228)
* orderbook depth fix

* more data, more power

* fx splln misteaks
2023-06-15 10:19:44 +10:00
Gareth Kirwan
1f89048ddb Okx: Fix Instrument unmarshal (#1225)
* Okx: Fix Instrument unmarshal

This fixes: `json: invalid use of ,string struct tag, trying to unmarshal "" into float64`
when TwapSz or other fields are empty, which happened briefly today.

As a DriveBy it also simplifies the exposed Instrument type to native
types only.

* Okx: Add missing InstrumentFamily to Instrument

* Okx: Add Instrument Unmarshal tests

DriveBy: Removes stray newline in type conversions

* Okx: Fix empty line upsetting linter
2023-06-13 15:27:01 +10:00
Scott
c8537c47a2 OKx: Fix websocket subscriptions and casing (#1221)
* FIX UPPER CASE ASSET PROBLEM

* JUDAS

* FIX SUB APPENDING

* linter got me

* ran, tested, linted, fixed

* comment
2023-06-09 11:35:06 +10:00
TaltaM
a024ad53ae websocket: Check for slice size to avoid panic when classifying empty binary message (#1219)
* Check for slice size to avoid panic when classifying empty resp

* Simplify according to suggestion
2023-06-09 09:24:33 +10:00
Gareth Kirwan
bb449c2085 Binance: Fix WorkingTime breaking executionReport (#1218)
This new field was added in the 2022-12-05 updates.
It's not always in an execution report, but only if isWorking=true
2023-06-06 11:26:13 +10:00
Ryan O'Hara-Reid
d086c45b0a Bitfinex: filter security asset type from spot trading pairs (#1191)
* bitfinex: filter security pairs from spot trading

* asset: add securities type

* bitfinex: remove print

* linter: fix

* gomod tidy

* glorious: nits

* bitfinex: just some orderbook fun and added a pass through for bitfinex funding rate when rate == 0

* bitfinex: move update function from testmain to localised test

* test: fix up

* glorious:nits

* bitfinex; fix casing test

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-06-05 11:53:07 +10:00
Gareth Kirwan
86a540173d websocket: Fix redundant connection monitor error upon disconnect (#1210)
When an existing ws disconnects the connection manager goro will call Connect.
This prevents Connect trying to start another connection manager if it's
already running
2023-06-05 11:51:43 +10:00
Samuael A
3eac6d12bd exchanges: Update GateIO exchange to V4 (#1058)
* Adding Public Endpoints and test functions

* Adding public endpoints and test functions

* Adding private spot endpoints

* Adding private endpoints and corresponding tests for margin

* Adding Margin Private endpoints

* Adding cross margin and flash swap endpoints

* Adding futures private endpoints

* Adding futures private endpoints and corresponding tests

* Adding Options and SubAccount endpoints and their unit tests

* Adding Wrapper functions

* Complete wrapper functions and corresponding unit test functions

* Fixing wrapper issues and adding websocket functions

* Update of Spot websocket and adding futures websocket handlers

* completed futures WS push data endpoints

* Completed Options websocket endpoints

* Adding websocket support for delivery futures and slight update on endpoint funcs

* Added Delivery websocket support and fix linter issues

* Update on Unit tests

* fix slight currency format error

* Fix slight endpoint tempos

* Update on conditional statements and unit tests issues

* fixing slight tempos

* Slight model and websocket data push method change

* Fix unit test tempos and updating models

* Fix on code structures and update on unit tests

* Slight code fix

* Remove print statements

* Update on tradable pairs fetch eps

* Fix websocket tempos

* Adding types to websocket routine manager

* Fix slight issues

* Slight fixes

* Updating wrapper funcs and models

* Slight update

* Update on test

* Update on tradable pairs

* update conditional statements

* Fixing slight issues

* Updating unit tests

* Minor fixes depending review comments

* Remove redundant method declaration

* Adding missing intervals

* Updating fetch tradable pairs

* update tradable pairs issues

* Addressing small tempos

* Slight fix on ticker

* Minor Fixes

* Minor review comment fixes

* Unit test and minor code updates

* Slight code updates

* Minor updates depending review comments

* Fixes

* Updating incoming message matcher

* Fix missing merge issue

* Fix minor wrapper issues

* Updating ratelimit and other issues

* Updating endpoint models and adding missing eps

* Update on code structure and models

* Minor codespell fixes

* Minor update on models

* fix unit test panic

* Minor race fix

* Fix issues in generating signature and unit tests

* Minor update on wrapper and unit tests

* Minor fix on wrapper

* Mini linter issues fix

* Minor fix

* endpoint fixes and slight update

* Minor fixes

* Updating exchange functions and unit tests

* Unit test and wrapper updates

* Remove options candlestick support

* Minor unit test and wrapper fix

* Unit test update

* minor fix on unit test and wrapper

* endpoints constants name change

* Add minor wrapper issues

* endpoint constants update

* endpoint url updates

* Updating subscriptions

* fixing dual mode endpoint methods

* minor fix

* rm small tempo

* Update on websocket orderbook handling

* Orderbook and currency pair update

* fix linter and test issues

* minor helper function update

* Fix wrapper coverage and wrapper issues

* delete unused variables

* Minor fix on ReadData() call

* separating websocket handlers

* separating websocket handlers

* Minor fix on enabled pair

* minor fix

* check instrument availability in spot

* create a separate subscriber for sake of multiple websocket connection

* linter fix

* minor websocket and gateio endpoints fix

* fix nil pointer exception

* minor fixes

* spelling fix decerializes -> deserializes

* fix Bitfinex unit test issues

* minor unknown currency pair labling fix

* minor currency pair handling fix

* slight update on GetDepositAddress wrapper unit test

* setting max request job to 200

* fixing numerical and timestamp type convert

* fix value overflow error

* change method of parsing orderbook price

* unifying timestamp conversion types to gateioTime

---------

Co-authored-by: Samuael Adnew <samuaelad@Samuaels-MacBook-Air.local>
2023-05-30 14:03:53 +10:00
Gareth Kirwan
d4e7736bf7 Okx: Fix ping handler (#1203)
Ping handler for okx is not the RFC compat version gorilla would
support. Even if it was, I think the UseGorillaHandler is
broken/misconceived because it does not send keepalive pings, it responds to them.

This also increases the delay to 27, in keeping with the 30 second
timeout documented.

I think this issue was hidden by the noisy default subs.
When just using funding-rates, it showed straight away.
2023-05-18 13:52:06 +10:00
Gareth Kirwan
234287307d Okx: Fix GetFundingRateHistory limit (#1204)
Fix limit of 100 rejected
Allow a limit of 0 for using the default value of limit (currently 100).
2023-05-18 12:17:52 +10:00
Gareth Kirwan
4095bc9133 Okx: Fix websocket fundingRate sub not sending instId (#1200)
instId is a required API field
2023-05-16 17:34:28 +10:00
Adrian Gallagher
b2eb030578 OKX: Update to new savings module (#1195)
* OKX: Update to new savings module

* Update exchanges/okx/okx_types.go

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

---------

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-05-16 14:55:07 +10:00
Gareth Kirwan
6464a8a7e0 Binance: Fix exchange order limits not populating (#1187)
* Binance: Fix Exchange Order Limits not populating

The order of the filters cannot be trusted. New filters have been added
after the 2nd filter, breaking all filter passing afterwards.

This adds a basic test that the data is being populated, but more could
be done on testing.

We should have stricter typing on the filters, perhaps by unmarshalling into
json.RawMessage initially and then into typed stuct fields based on the
filterType. Finally we should spot both missing and unhandled filters, at least in
tests.

* Binance: Add TODO for unhandled filterTypes
2023-05-12 17:20:01 +10:00
Ryan O'Hara-Reid
8309ddf80c orders: Add AdjustBaseAmount (#1181)
* orders: Add AdjustBaseAmount method that alerts if non-fatal change occurs exchange side, adjust BTCM

* glorious: nits

* glorious: nits

* thrasher: nits

* Update exchanges/btcmarkets/btcmarkets_wrapper.go

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

* Update exchanges/btcmarkets/btcmarkets_wrapper.go

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

* thrasher: nits and whoopsie

* orders_test: fix

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2023-05-12 14:06:04 +10:00
Ryan O'Hara-Reid
db8735ec99 log: Add structured logging (#1171)
* basic implementation

* log: deprecate duplicate function, add tests and refine calls.

* linter: fixes

* linter: update struct

* linter and new type

* log tests: update to not lint issue

* linter: stop complaining please

* glorious: nits

* log: rm comment code

* glorious: nits

* glorious: nits

* glorious: nits

* glorious: nits missed

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-10 17:52:53 +10:00
Gareth Kirwan
6e1cbfc31e OKX: Support exchange order limits (#1186)
* OKX: Support exchange order limits

Adds support for PriceStepIncrementSize and MinAmount limits

* OKX: Test UpdateOrderExecutionLimits on all assets

* OKX: Added asset types for order limit tests
2023-05-09 10:59:09 +10:00
Gareth Kirwan
970f65ba72 OKX: Fix balance using funding account (#1175)
It looks like this was an oversight.
No other exchange uses the funding account for balance and it wouldn't
make sense.
Again, this aims to be minimally invasive and backwards compatible, so
GetBalance is left alone to preserve compat.
2023-05-09 10:49:23 +10:00
Ryan O'Hara-Reid
616b45ae14 exmo: refactor UpdateTickers function (#1180)
* exmo: filter pairs that are not currently enabled by last update time

* stop filtering, add tests to qualify all deployable can be retrieved

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-09 10:17:15 +10:00
Ryan O'Hara-Reid
2d2d115ac9 hitbtc: optimise fetching tradable pairs and tickers (#1184)
* hitbtc: fix and optimise tradable pairs and tickers fetching

* Update exchanges/hitbtc/hitbtc_test.go

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

* Update exchanges/hitbtc/hitbtc_test.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: Adrian Gallagher <adrian.gallagher@thrasher.io>
2023-05-09 10:09:24 +10:00
Ryan O'Hara-Reid
22fd3562b2 kraken: when fetching tradable pairs filter by status (#1183)
* kraken: when fetching tradable pairs filter by status

* linter/nits: fixed

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-08 17:31:58 +10:00
Ryan O'Hara-Reid
8a6916353f OKX: Fix GetAvailableTransferChains bug (#1177)
* okx: fix get cryptocurrency deposit address for chain bug

* Update exchanges/okx/okx_wrapper.go

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

* Update exchanges/okx/okx_wrapper.go

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

* Revert "Update exchanges/okx/okx_wrapper.go"

This reverts commit 4345f57ce0e984f562ec576aeebc09407a1d2544.

* okx: temp filter for available transfer chain

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-05-08 16:09:13 +10:00
Ryan O'Hara-Reid
31efa4f35e poloniex: filter non-liquid and unused assets (#1185)
* poloniex: filter non-liquid and unused assets

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-08 15:41:49 +10:00
Ryan O'Hara-Reid
f6fbe77f8c BTSE: Filter no liquidity pairs (#1182)
* BTSE: Filter no liquidity pairs

* thrasher: update commentary

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-05 10:55:00 +10:00
Ryan O'Hara-Reid
f8d567eec2 OKX: Fix GetActiveOrders bug and remove redundant json.Unmarshal call (#1176)
* Fix GetActiveOrders bug and remove redundant json.unmarshal call.

* @thrasher- eagle eye nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-01 13:47:49 +10:00
Gareth Kirwan
229f965192 OKX: Fix authenticated websocket blocking during login (#1174)
The channels for the ws multiplexer weren't made;
so any interaction with it would block.
Tests passed because they invasively setup the multiplexer.

There are quite a few architectural risks with this implementation
pattern, such as leaking an uncancellable goro in a for-select loop.
Ideally WsConnect should take a cancellable context and any selects
should watch for ctx.Done()

That's a very invasive and pervasive change though, so this fix is as minimal and
atomic as possible.
Will consider opening a PR for cancellable context or improving this
multiplexer pattern.
2023-05-01 10:40:53 +10:00
Ryan O'Hara-Reid
b20cf75d13 sharedtestvalues: Add helper functions and implement throughout exchange tests (#1163)
* exchanges/sharedtestvalues: implement new functions to handle test skipping and announcements for standardising.

* exchanges: fin test impl.

* linter: fixes

* exchange_template: fix test

* allocate so it doesn't make a panic at the disco

* glorious: nits

* glorious: nits

* Update exchanges/sharedtestvalues/sharedtestvalues.go

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

* Update exchanges/sharedtestvalues/sharedtestvalues.go

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

* glorious: nits

* linter: fix

* linter: shhhh

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-04-28 13:05:42 +10:00