gocryptotrader icon indicating copy to clipboard operation
gocryptotrader copied to clipboard

gateio/kucoin: assortment of fixes

Open shazbert opened this issue 1 year ago • 2 comments

PR Description

Gateio:

  • fix unmarshal bug and update fields
  • Improves wrapper function for fetching open contracts. The prior one fetched data per contract.
  • Adds missing details and handling for order details
  • When fetching balances, continue if specific error has been found and warn client of error details.
  • Purge generating random string for client order ID when it is not needed for wrapper, this can be set from caller.
  • Fix bug on outbound order submit through wrapper

Kucoin:

  • Fix bug in get active orders where nothing was being processed if you didn't pass in currency pairs
  • Adds missing details and handling for order details
  • Fetch all settlement balances
  • Add handling for long/short order sides when submitting order
  • Remove leverage check as this should be set by caller.

Currency:

  • Add helper method to currency pairs to return a match either base or quote.

Order:

  • Add settlement currency field
  • Adds execution note field (Can RM this field if you guys don't want it, it was a carry over from GATEIO field ClientOrderID: futuresOrders[x].Text,)

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How has this been tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and also consider improving test coverage whilst working on a certain feature or package.

  • [ ] go test ./... -race
  • [ ] golangci-lint run
  • [ ] Test X

Checklist

  • [ ] My code follows the style guidelines of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally and on Github Actions/AppVeyor with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

shazbert avatar Nov 23 '23 00:11 shazbert

Problem with market deployment.

shazbert avatar Nov 24 '23 05:11 shazbert

Codecov Report

Attention: Patch coverage is 22.97735% with 238 lines in your changes are missing coverage. Please review.

Project coverage is 35.86%. Comparing base (954aa02) to head (f06454b). Report is 4 commits behind head on master.

:exclamation: Current head f06454b differs from pull request most recent head 571a7e8. Consider uploading reports for the commit 571a7e8 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1404      +/-   ##
==========================================
- Coverage   35.87%   35.86%   -0.01%     
==========================================
  Files         411      411              
  Lines      177444   177548     +104     
==========================================
+ Hits        63651    63683      +32     
- Misses     106029   106085      +56     
- Partials     7764     7780      +16     
Files Coverage Δ
currency/pairs.go 98.10% <100.00%> (+0.17%) :arrow_up:
exchanges/gateio/gateio_types.go 65.71% <ø> (ø)
exchanges/kucoin/kucoin.go 14.29% <50.00%> (-0.17%) :arrow_down:
exchanges/gateio/gateio.go 14.18% <0.00%> (+0.13%) :arrow_up:
exchanges/kucoin/kucoin_wrapper.go 34.23% <0.00%> (-0.68%) :arrow_down:
exchanges/gateio/gateio_wrapper.go 39.11% <23.86%> (+0.49%) :arrow_up:

... and 17 files with indirect coverage changes

codecov[bot] avatar Feb 05 '24 02:02 codecov[bot]

Happy with changes, just need exchange_wrapper_standards addressing: https://github.com/thrasher-corp/gocryptotrader/actions/runs/8074480255/job/22059833368?pr=1404#step:9:292 For Kucoin, the &order.Submit needs leverage there since you now require it to be sent For gateio, GetActiveOrders, is more confusing to me since a pair should be sent. Anyway, those just need fixing up

gloriousCode avatar Feb 28 '24 04:02 gloriousCode