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

exchanges/order: Added TimeInForce type and values #1382

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

samuael
Copy link
Contributor

@samuael samuael commented Oct 29, 2023

ሰላም፣ ወንድሞች

PR Description

This PR adds a type TimeInForce(TIF) to represent common Time In Force values. It affects some exchanges and packages that were using the ImmediateOrCancel and FillOrKill values. Units that were affected by the change are tested. Additionally, new unit tests are added for newly added functions.

Exchanges that are directly affected by the change are Binance, Bitrex, BTCMarket, CoinbasePro, Huobi, Kraken, Poloniex

Packages affected: Orders, Engine, cmd/exchange_wrapper_standards

Fixes # (issue)

Type of change

Please delete options that are not relevant and add an x in [] as the 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 on 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

@gloriousCode gloriousCode requested a review from a team October 29, 2023 21:13
@gloriousCode gloriousCode added the review me This pull request is ready for review label Oct 29, 2023
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

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

Really cool update. Thanks big boss.

exchanges/order/orders.go Show resolved Hide resolved
exchanges/order/orders.go Outdated Show resolved Hide resolved
exchanges/order/order_types.go Outdated Show resolved Hide resolved
exchanges/bittrex/bittrex_types.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. 🦸

exchanges/order/order_types.go Show resolved Hide resolved
exchanges/order/order_types.go Outdated Show resolved Hide resolved
exchanges/order/order_types.go Outdated Show resolved Hide resolved
exchanges/order/orders.go Outdated Show resolved Hide resolved
exchanges/order/orders.go Show resolved Hide resolved
exchanges/order/order_test.go Show resolved Hide resolved
@gloriousCode gloriousCode added reconstructing Based on PR feedback, this is currently being reworked and is not to be merged and removed review me This pull request is ready for review labels Nov 13, 2023
@samuael
Copy link
Contributor Author

samuael commented Nov 15, 2023

Sorry for the delayed update on this PR.
I think I have added all the required updates.

Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

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

Thanks for the update, not much left over.

exchanges/order/order_types.go Show resolved Hide resolved
exchanges/order/orders.go Show resolved Hide resolved
exchanges/order/order_types.go Outdated Show resolved Hide resolved
@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 labels Dec 5, 2023
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Things are looking good. Just need to test all endpoints associated with these changes.

@samuael
Copy link
Contributor Author

samuael commented Dec 6, 2023

The endpoints I can run are only those that are public. The change I made, TimeInForce is mostly used by the authenticated, order-related endpoints.

I am open to hear any other alternative of running the authenticated tests you may suggest

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

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

Project coverage is 37.73%. Comparing base (d679a76) to head (3aa605a).
Report is 3 commits behind head on master.

❗ Current head 3aa605a differs from pull request most recent head b453062. Consider uploading reports for the commit b453062 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1382      +/-   ##
==========================================
+ Coverage   35.89%   37.73%   +1.84%     
==========================================
  Files         411      411              
  Lines      177595   147714   -29881     
==========================================
- Hits        63752    55746    -8006     
+ Misses     106058    84191   -21867     
+ Partials     7785     7777       -8     
Files Coverage Δ
engine/order_manager.go 67.21% <100.00%> (+1.73%) ⬆️
exchanges/binance/binance.go 48.32% <100.00%> (+3.12%) ⬆️
exchanges/btcmarkets/btcmarkets.go 25.21% <100.00%> (+1.07%) ⬆️
exchanges/coinbasepro/coinbasepro.go 41.08% <100.00%> (+2.63%) ⬆️
exchanges/kraken/kraken.go 56.40% <100.00%> (+1.18%) ⬆️
exchanges/order/orders.go 90.40% <100.00%> (-0.33%) ⬇️
exchanges/poloniex/poloniex_wrapper.go 42.89% <100.00%> (+4.30%) ⬆️
exchanges/huobi/huobi_wrapper.go 41.81% <0.00%> (+2.54%) ⬆️
exchanges/binance/binance_wrapper.go 41.12% <33.33%> (+2.89%) ⬆️
exchanges/coinbasepro/coinbasepro_wrapper.go 39.77% <60.00%> (+3.34%) ⬆️
... and 2 more

... and 376 files with indirect coverage changes

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.

There are some linter and build issues that need to be sorted, but this is a nice clean update. Thanks Sam!

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.

None yet

3 participants