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

fix(bonsai-core): Orderbook Grouping and fix in depth calculations #1474

Merged
merged 6 commits into from
Jan 29, 2025

Conversation

jaredvu
Copy link
Contributor

@jaredvu jaredvu commented Jan 28, 2025

  • Updated so now we sort Asks by ascending and bids by descending from one function. No other orderbook function should reverse this and in conclusion, should handle asks vs bids differently.
  • Fixed pop vs shift: previously saved the popped or shifted element instead of the next array item
  • Handle grouping calculations

@jaredvu jaredvu requested a review from a team as a code owner January 28, 2025 02:13
Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 11:27pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 11:27pm

src/bonsai/selectors/markets.ts Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
@@ -182,7 +180,7 @@ interface BonsaiHelpersShape {
fills: BasicSelector<SubaccountFill[]>;
};
orderbook: {
data: BasicSelector<OrderbookProcessedData | undefined>;
Copy link
Contributor

Choose a reason for hiding this comment

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

alternative: store grouping in the state somewhere and then these can be normal selectors

src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
src/bonsai/calculators/orderbook.ts Outdated Show resolved Hide resolved
@jaredvu jaredvu merged commit 96a52be into main Jan 29, 2025
8 of 9 checks passed
@jaredvu jaredvu deleted the jv/bonsai-orderbook-2 branch January 29, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants