Skip to content

Write scaffolded code for solana bitget solver - #5106

Open
AryanGodara wants to merge 4 commits into
mainfrom
aryan/be-252-bitget-scaffold
Open

AryanGodara wants to merge 4 commits into
mainfrom
aryan/be-252-bitget-scaffold

Conversation

@AryanGodara

@AryanGodara AryanGodara commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Description

Wire in the config, the CLI subcommand and the Dex variant for the new Bitget Solana solver. The swap adapter comes in the next PR, so up to this PR bitget answers every order with no solution.

Changes

  • dex::Error: Jupiter's error enum moves up to the dex module, so the solve loop and Quote no longer name Jupiter's type.
  • Make the config generic over the engine's [dex] table, loaded per subcommand.
  • Add the Bitget config with endpoint, api-key, api-secret and slippage-bps. The struct has no Debug, so the secret can't reach the logs.
  • Dex::Bitget with a stub swap that returns NotFound, and a bitget subcommand.
  • Add an example config for the solver.

How to test

  • CI (this PR is a no-op at runtime).

Closes BE-252

Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
@AryanGodara AryanGodara self-assigned this Oct 15, 2026
@linear-code

linear-code Bot commented Oct 15, 2026

Copy link
Copy Markdown

BE-252

…caffold

Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
@jmg-duarte jmg-duarte changed the title Write scaffoled code for solana bitget solver Write scaffolded code for solana bitget solver Oct 15, 2026
pub struct Bitget;

impl Bitget {
// TODO(BE-253): quote the order and build the swap.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is done in next PR

Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
@AryanGodara
AryanGodara marked this pull request as ready for review October 16, 2026 16:10
@AryanGodara
AryanGodara requested a review from a team as a code owner October 16, 2026 16:10
@claude

claude Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @AryanGodara's task in 1m 49s —— View job


Review: Bitget solver scaffold

Reviewed the full diff against origin/main. This is a clean, well-structured scaffold — config made generic over the [dex] table, Error hoisted from jupiter to the dex module, Dex::Bitget stub, CLI subcommand, and run.rs de-duplicated so the serving path is shared. Test coverage for the new config (parse + required-credentials) is a nice touch, and omitting Debug on BitgetConfig to keep the secret out of logs is the right call.

No blocking issues. One non-blocking note posted inline:

  • config.rs:94 — the endpoint trailing-slash requirement is enforced only by a comment; a missing slash will silently resolve to the wrong URL once Url::join lands. Worth normalizing/validating in the constructor in the follow-up (BE-253).

Everything else (the dex.rs:11 TODO) is already acknowledged as next-PR work. LGTM. ✅
· aryan/be-252-bitget-scaffold

Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
@AryanGodara
AryanGodara force-pushed the aryan/be-252-bitget-scaffold branch from 75aef89 to da27e6f Compare October 16, 2026 16:11
pub struct BitgetConfig {
/// Base URL of the Bitget swap API. `swap` is joined onto it, so it needs
/// the trailing slash.
pub endpoint: Url,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking / for the next PR: correctness here relies entirely on a prose comment ("needs the trailing slash"). Because Url::join("swap") replaces the last path segment when the base lacks a trailing slash, a deploy config of .../swapx/pro (no slash) would silently resolve to .../swapx/swap rather than .../swapx/pro/swap — a wrong endpoint with no error. Worth validating/normalizing the trailing slash in the Bitget constructor when the swap adapter lands (BE-253), rather than trusting operators to read the comment.

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.

1 participant