Skip to content

exchanges: Update exchange templates #1777

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

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

Conversation

samuael
Copy link
Collaborator

@samuael samuael commented Jan 16, 2025

Selam(🕊️) be with you, team!

This PR includes minor updates to the exchange templates used for instantiating new exchanges.

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 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

samuael and others added 30 commits October 29, 2023 21:28
@thrasher-
Copy link
Collaborator

  1. Test deduplication should be the default approach for exchanges, image provided as an example diff image

samuael added 19 commits May 1, 2025 23:10
Copy link

codecov bot commented May 27, 2025

Codecov Report

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

Project coverage is 39.38%. Comparing base (b18cc1c) to head (1b5dd75).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
cmd/exchange_template/exchange_template.go 0.00% 8 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1777      +/-   ##
==========================================
+ Coverage   39.25%   39.38%   +0.13%     
==========================================
  Files         426      427       +1     
  Lines      176193   175228     -965     
==========================================
- Hits        69158    69018     -140     
+ Misses      99454    98688     -766     
+ Partials     7581     7522      -59     
Files with missing lines Coverage Δ
cmd/exchange_template/exchange_template.go 47.00% <0.00%> (ø)

... and 19 files with indirect coverage changes

🚀 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.

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.

Thanks for updating this! Will get @cranktakular to add on to this as well given his two most recent exchange implementations

WebsocketCapabilities: protocol.Features{
TickerFetching: true,
OrderbookFetching: true,
TickerFetching: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two true assignments need indenting fixes

@@ -303,6 +303,20 @@ go run documentation.go

This will generate a readme file for the exchange which can be found in the new exchange's folder
Copy link
Collaborator

Choose a reason for hiding this comment

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

One request for this file would be to remove a lot of the FTX code suggestions which are no longer relevant and could just provide general statements whilst also referring to existing implementations as a reference point

@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 blocked labels May 29, 2025
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.

One thing from me

// UpdateOrderExecutionLimits updates order execution limits
func ({{.Variable}} *{{.CapitalName}}) UpdateOrderExecutionLimits(_ context.Context, _ asset.Item) error {
return common.ErrNotYetImplemented
}

// SetLeverage sets the account's initial leverage for the asset type and pair
func ({{.Variable}} *{{.CapitalName}}) SetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ float64, _ order.Side) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please do a check for these wrapper functions whether they are exchange.Base methods. We can remove them as methods and these will need to be forcefully applied to all exchanges for standardisation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium priority review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants