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/dex router #212

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

Feat/dex router #212

wants to merge 14 commits into from

Conversation

anihamde
Copy link
Contributor

@anihamde anihamde commented Nov 5, 2024

This PR adds a script to route limit orders to on-chain liquidity

scripts/dex-router/src/index.ts Outdated Show resolved Hide resolved
scripts/dex-router/src/index.ts Outdated Show resolved Hide resolved
).filter((acc) => acc !== null);

return addressLookupTableAccountInfos.map((accountInfo, index) => {
const addressLookupTableAddress = keys[index];
Copy link
Collaborator

Choose a reason for hiding this comment

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

the order might not be right if we filtered out a null account. we should do the filtering here and probbably also log it or even throw an error if the lookup table doesn't exist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed on the indexing. but probably not throw an error since the tx should be valid without it. will throw a warning

scripts/dex-router/src/router/jupiter.ts Outdated Show resolved Hide resolved
scripts/dex-router/src/index.ts Outdated Show resolved Hide resolved
scripts/dex-router/src/index.ts Show resolved Hide resolved

const {
tokenLedgerInstruction,
computeBudgetInstructions,
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't you want to actually use them for now?

scripts/dex-router/src/router/jupiter.ts Outdated Show resolved Hide resolved
scripts/dex-router/src/router/jupiter.ts Show resolved Hide resolved

export class JupiterRouter implements Router {
private chainId: string;
private connection: Connection;
Copy link
Collaborator

Choose a reason for hiding this comment

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

not used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i designed the interface this way bc for other routers we may need to pass in a connection. for now i can remove it

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.

2 participants