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/wrappers: shift bespoke fetch ticker, orderbook and accountinfo #1440

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

Conversation

shazbert
Copy link
Collaborator

@shazbert shazbert commented Jan 4, 2024

PR Description

This PR stops potential error obfuscation. The problem is ongoing in batch operations. So you may have a misconfigured pair which will not be present in memory, the entire batch is loaded but that error forces an update slowing everything down, which will occur over and over again.

  • Moves FetchAccountInfo,FetchOrderbook,FetchTicker to exchange.go as base methods.

Fixes # (issue)

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

@shazbert shazbert requested a review from a team January 4, 2024 03:40
@shazbert shazbert self-assigned this Jan 4, 2024
@shazbert shazbert added review me This pull request is ready for review and removed blocked labels Jan 4, 2024
@shazbert shazbert removed the review me This pull request is ready for review label Jan 17, 2024
@shazbert shazbert added review me This pull request is ready for review and removed rebase/merge of master required labels Jan 29, 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.

I'm on board with the simplification. There are a few tests that aren't needed that call the newly moved Base functions eg Binanceus TestFetchAccountInfo

engine/helpers.go Outdated Show resolved Hide resolved
exchanges/exchange.go Show resolved Hide resolved
@gloriousCode
Copy link
Collaborator

Tests are showing issue in retrieving the orderbook and ticker. Something I can replicate:

--- PASS: TestAllExchangeWrappers/bitstamp_wrapper_tests/PRIORITY_GROUP/UpdateTickers-spot-ETH-TEST-DELIM-usdt (0.00s)

  exchange_wrapper_standards_test.go:248: Bitstamp Func 'FetchTicker' Error: 'no ticker found bitstamp ETH-TEST-DELIM-usdt spot'. Inputs: [context.Background ETH-TEST-DELIM-usdt spot].
            --- FAIL: TestAllExchangeWrappers/bitstamp_wrapper_tests/SECONDARY_GROUP/FetchTicker-spot-ETH-TEST-DELIM-usdt (0.00s)

@shazbert shazbert requested a review from gloriousCode May 1, 2024 03:38
@shazbert shazbert added review me This pull request is ready for review medium priority and removed reconstructing Based on PR feedback, this is currently being reworked and is not to be merged labels May 1, 2024
@shazbert shazbert added rebase/merge of master required and removed review me This pull request is ready for review labels Oct 9, 2024
@shazbert shazbert added review me This pull request is ready for review and removed in progress labels Jan 14, 2025
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.

Your face is a bespoke ticker
tACK! Nice culling 💀

Comment on lines +647 to +648
ticker.ErrNoTickerFound, // Is thrown when no ticker is found
orderbook.ErrCannotFindOrderbook, // Is thrown when no orderbook is found
Copy link
Collaborator

@gloriousCode gloriousCode Jan 15, 2025

Choose a reason for hiding this comment

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

If these errors are to ever be returned in other functions, I feel its a problem to be finding these errors as acceptable. I'll accept this for now even though my stomach feels funny

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe in future we can set up a lookup for specific methods as well that have acceptable errors attached to them?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've thought about that also, something for another time 🌈

@gloriousCode gloriousCode added the gcrc GloriousCode Review Complete label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gcrc GloriousCode Review Complete review me This pull request is ready for review
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants