Skip to content

FEATURE: [okx] Support updating the local cache of symbols when calling QueryMarkets #2007

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

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

anywhy
Copy link
Contributor

@anywhy anywhy commented Apr 27, 2025

No description provided.

Copy link

codecov bot commented Apr 27, 2025

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Project coverage is 22.79%. Comparing base (3428d44) to head (75a13f3).
Report is 79 commits behind head on main.

Files with missing lines Patch % Lines
pkg/exchange/okex/exchange.go 0.00% 18 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2007      +/-   ##
==========================================
- Coverage   22.95%   22.79%   -0.17%     
==========================================
  Files         671      673       +2     
  Lines       51990    52323     +333     
==========================================
- Hits        11935    11926       -9     
- Misses      39173    39524     +351     
+ Partials      882      873       -9     
Files with missing lines Coverage Δ
pkg/exchange/okex/exchange.go 15.76% <0.00%> (-0.30%) ⬇️

... and 14 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1cae3a2...75a13f3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -16,7 +16,7 @@ func toGlobalSymbol(symbol string) string {
}

//go:generate go run gensymbols.go
func toLocalSymbol(symbol string, instType ...okexapi.InstrumentType) string {
func ToLocalSymbol(symbol string, instType ...okexapi.InstrumentType) string {
Copy link
Owner

Choose a reason for hiding this comment

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

please avoid export converter function since it's only used in the okx package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it — if we don’t export the converter method, we won’t be able to call OKX-specific functions like SetAccountLeverage inside the strategy, since we need to convert from the global symbol to the local symbol first.
So, could we maybe add this kind of special function directly to the Exchange instead?

Copy link
Owner

Choose a reason for hiding this comment

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

yes, you can add public methods on Exchange, and in your strategy, you cast the exchange interface into *okx.Exchange to use these methods

@anywhy anywhy force-pushed the okx_query_markets branch 4 times, most recently from 8797756 to 3c58fbf Compare April 29, 2025 02:12
@anywhy anywhy force-pushed the okx_query_markets branch from 3c58fbf to 75a13f3 Compare April 29, 2025 02:28
@c9s c9s merged commit 1048d2a into c9s:main Apr 29, 2025
3 of 5 checks passed
@anywhy anywhy deleted the okx_query_markets branch August 1, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants