Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

currency/exchanges: Add bespoke exchange translator and pair matching helper #1556

Merged
merged 18 commits into from
Aug 16, 2024

Conversation

shazbert
Copy link
Collaborator

@shazbert shazbert commented May 29, 2024

PR Description

  • Adds translator helpers for specific currency matching operations that are bespoke to each exchange. This can be overridden client side and implemented ad-hoc but a hardcoded pass when needed can be introduced as is done with Kukoin, bybit & GateIO.

Thanks.

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 with my changes
  • Any dependent changes have been merged and published in downstream modules

@thrasher- thrasher- added the review me This pull request is ready for review label May 29, 2024
@shazbert shazbert self-assigned this Jun 5, 2024
Copy link
Collaborator

@gloriousCode gloriousCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool concept

exchanges/exchange_types.go Outdated Show resolved Hide resolved
currency/translation.go Outdated Show resolved Hide resolved
currency/translation.go Show resolved Hide resolved
currency/translation.go Show resolved Hide resolved
currency/translation_test.go Outdated Show resolved Hide resolved
currency/translation_test.go Outdated Show resolved Hide resolved
@gloriousCode gloriousCode added reconstructing Based on PR feedback, this is currently being reworked and is not to be merged rebase/merge of master required and removed review me This pull request is ready for review labels Jun 13, 2024
@shazbert shazbert added review me This pull request is ready for review and removed reconstructing Based on PR feedback, this is currently being reworked and is not to be merged rebase/merge of master required labels Jun 14, 2024
@shazbert shazbert requested a review from gloriousCode June 14, 2024 02:04
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 92.40506% with 6 lines in your changes missing coverage. Please review.

Project coverage is 36.36%. Comparing base (90fee94) to head (59d6192).
Report is 19 commits behind head on master.

Files Patch % Lines
currency/translation.go 91.42% 2 Missing and 1 partial ⚠️
exchanges/okx/okx_wrapper.go 62.50% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1556      +/-   ##
==========================================
+ Coverage   36.29%   36.36%   +0.06%     
==========================================
  Files         420      422       +2     
  Lines      183150   183117      -33     
==========================================
+ Hits        66482    66592     +110     
+ Misses     108605   108477     -128     
+ Partials     8063     8048      -15     
Files Coverage Δ
currency/code_types.go 0.00% <ø> (ø)
exchanges/bybit/bybit_wrapper.go 43.20% <100.00%> (+2.54%) ⬆️
exchanges/gateio/gateio_wrapper.go 39.68% <100.00%> (+0.09%) ⬆️
exchanges/kucoin/kucoin_wrapper.go 34.79% <100.00%> (-0.23%) ⬇️
exchanges/okx/okx.go 20.10% <100.00%> (+0.08%) ⬆️
exchanges/okx/okx_types.go 40.44% <ø> (ø)
currency/translation.go 92.68% <91.42%> (-7.32%) ⬇️
exchanges/okx/okx_wrapper.go 30.89% <62.50%> (+0.02%) ⬆️

... and 43 files with indirect coverage changes

@shazbert shazbert requested a review from gloriousCode August 15, 2024 00:27
Copy link
Collaborator

@gloriousCode gloriousCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACKeroo

Copy link
Collaborator

@thrasher- thrasher- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some consistency issues with mix and matching between assert and Go's native tester

Also with this change, we could potentially rid the need for Kraken's asset translator

currency/translation_test.go Outdated Show resolved Hide resolved
currency/translation_test.go Outdated Show resolved Hide resolved
@shazbert shazbert requested a review from thrasher- August 16, 2024 06:11
@thrasher- thrasher- changed the title currency: translation and matching pairs currency/exchanges: Add bespoke exchange currency translator and pair matching helper Aug 16, 2024
@thrasher- thrasher- changed the title currency/exchanges: Add bespoke exchange currency translator and pair matching helper currency/exchanges: Add bespoke exchange translator and pair matching helper Aug 16, 2024
Copy link
Collaborator

@thrasher- thrasher- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice stuff!

@thrasher- thrasher- merged commit facf291 into thrasher-corp:master Aug 16, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants