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

feat: Integrate Bitget for Rate Fetching & Median Calculation Across Multiple Providers #425

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sundayonah
Copy link
Collaborator

@sundayonah sundayonah commented Feb 13, 2025

Description

This PR integrates Bitget as a source for fetching rates for all supported currencies (e.g., NGN, KES, GHS). It enhances the rate calculation system by retrieving data from multiple providers (Quidax, Binance, and Bitget) and computing the median rate for improved accuracy and reliability.

References

Closes #423
Bitget API Documentation

Testing

  • Fetching exchange rates from Bitget, Binance, and Quidax.
  • Median calculation logic across multiple price sources.
  • Handling API failures and missing data scenarios.
  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

@sundayonah sundayonah marked this pull request as draft February 13, 2025 11:22
@sundayonah sundayonah marked this pull request as ready for review February 14, 2025 04:34
@sundayonah sundayonah marked this pull request as draft February 14, 2025 04:43
@sundayonah sundayonah marked this pull request as ready for review February 14, 2025 08:25
Comment on lines +147 to +148
Build().POST("/api/v2/p2p/adv/search").
Retry().Set(3, 5*time.Second).
Copy link
Contributor

Choose a reason for hiding this comment

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

which documentation are you using for Bitget?

Copy link
Collaborator Author

@sundayonah sundayonah Feb 20, 2025

Choose a reason for hiding this comment

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

I thought I had already mentioned this earlier, but the Bitget endpoint you provided in the user story https://www.bitget.com/api-doc/common/p2p/Get-P2P-Order-List isn’t working

I’m getting the following error message:

This site can’t be reached
www.bitget.com’s DNS address could not be found. Diagnosing the problem.
DNS_PROBE_POSSIBLE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines +144 to +146
res, err := fastshot.NewClient(BitgetAPIURL).
Config().SetTimeout(30*time.Second).
Header().Add("Content-Type", "application/json").
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't some extra auth headers required?

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.

Add Bitget as a Source for Rates and Refactor External Market Logic
2 participants