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 paddings #98

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e25d873
pause logic
zachanon Aug 1, 2022
8d7a46a
frame
zachanon Aug 2, 2022
17e1af2
resume logic, untested
zachanon Aug 2, 2022
96dc897
Merge pull request #2 from Bonfida/main
zachanon Aug 14, 2022
cbc2fb2
unchecked
zachanon Aug 14, 2022
ccda443
Merge pull request #3 from jet-lab/unchecked-slab
zachanon Aug 14, 2022
276abd8
Merge branch 'Bonfida:main' into main
zachanon Aug 16, 2022
3d184dd
Merge branch 'Bonfida:main' into main
zachanon Aug 23, 2022
952a9a8
Merge branch 'main' of github.com:jet-lab/agnostic-orderbook into pau…
zachanon Aug 23, 2022
9c97363
pub use
zachanon Aug 23, 2022
4ea13bb
better bool type handling
zachanon Aug 23, 2022
db55e5f
price in order summary
zachanon Aug 23, 2022
7069c91
Merge branch 'pause-matching' of github.com:jet-lab/agnostic-orderboo…
zachanon Aug 23, 2022
93b1a9b
Revert "price in order summary"
zachanon Aug 23, 2022
4d3412e
hopefully no more infinite loop
zachanon Aug 23, 2022
d1cac50
Functionality for orderbook match pausing
zachanon Aug 23, 2022
b419632
make push event public
zachanon Sep 8, 2022
ab71e06
Expose `push_back` method
zachanon Sep 8, 2022
82006bd
make public
zachanon Sep 8, 2022
04a4364
Expose the `push_back` method and related types #5
zachanon Sep 8, 2022
1405412
pub
zachanon Oct 19, 2022
bf0ea9e
Merge pull request #9 from jet-lab/make-orderbook-public
zachanon Oct 19, 2022
2fb8ce6
when matching is disabled, the order summary returns the posted amoun…
dnut Oct 20, 2022
15c4729
Merge pull request #10 from jet-lab/paused-order-summary-posted-amounts
zachanon Oct 21, 2022
bb0d2c2
pause logic
zachanon Aug 1, 2022
87957af
frame
zachanon Aug 2, 2022
9482752
resume logic, untested
zachanon Aug 2, 2022
0e477ec
price in order summary
zachanon Aug 23, 2022
8e9e68e
unchecked
zachanon Aug 14, 2022
da41193
pub use
zachanon Aug 23, 2022
7866d0f
better bool type handling
zachanon Aug 23, 2022
93e9c1f
Revert "price in order summary"
zachanon Aug 23, 2022
756ea2d
hopefully no more infinite loop
zachanon Aug 23, 2022
fc3ade6
make push event public
zachanon Sep 8, 2022
1efd26a
make public
zachanon Sep 8, 2022
f0127f6
pub
zachanon Oct 19, 2022
9d15bca
when matching is disabled, the order summary returns the posted amoun…
dnut Oct 20, 2022
82b6aa1
Merge branch 'bonfida-updates'
zachanon Nov 15, 2022
3d861c1
cancel event
zachanon Nov 15, 2022
d97b6e1
cannot return callback, made fields public
zachanon Nov 15, 2022
231c24e
Merge pull request #13 from jet-lab/order-cancel-event
zachanon Nov 15, 2022
9267b4a
Merge github.com:Bonfida/agnostic-orderbook into merge-latest
zachanon Feb 17, 2023
b7a7986
fill event uses price information
zachanon Feb 17, 2023
2cc3731
struct not aligned properly
Jun 18, 2024
053ef62
struct not aligned properly
Jun 18, 2024
916416f
version upgrade
Jun 20, 2024
7e7472b
version upgrade
Jun 20, 2024
9c7f43b
add anchor serialize and deserialize
Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
when matching is disabled, the order summary returns the posted amoun…
…ts instead of the max amounts
  • Loading branch information
dnut committed Oct 20, 2022
commit 2fb8ce6878e47f62e5714ddd78905bb2745b8bf5
17 changes: 11 additions & 6 deletions program/src/state/orderbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,17 @@ where
fp32_div(max_quote_qty, limit_price).unwrap_or(u64::MAX),
max_base_qty,
);
let quote_qty_to_post = match side {
Side::Bid => fp32_mul_ceil(base_qty_to_post, limit_price),
Side::Ask => fp32_mul_floor(base_qty_to_post, limit_price),
}
.ok_or(AoError::NumericalOverflow)?;

if base_qty_to_post < min_base_order_size || !post_allowed {
return Ok(OrderSummary {
posted_order_id: None,
total_base_qty: max_base_qty,
total_quote_qty: max_quote_qty,
total_base_qty: base_qty_to_post,
total_quote_qty: quote_qty_to_post,
total_base_qty_posted: base_qty_to_post,
});
}
Expand Down Expand Up @@ -399,8 +404,8 @@ where
} else {
return Ok(OrderSummary {
posted_order_id: None,
total_base_qty: max_base_qty,
total_quote_qty: max_quote_qty,
total_base_qty: base_qty_to_post,
total_quote_qty: quote_qty_to_post,
total_base_qty_posted: 0,
});
}
Expand All @@ -411,8 +416,8 @@ where
*self.get_tree(side).get_callback_info_mut(k) = callback_info;
Ok(OrderSummary {
posted_order_id: Some(new_leaf_order_id),
total_base_qty: max_base_qty,
total_quote_qty: max_quote_qty,
total_base_qty: base_qty_to_post,
total_quote_qty: quote_qty_to_post,
total_base_qty_posted: base_qty_to_post,
})
}
Expand Down