You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the above function and downcasting the value to u64 can cause an overflow and returning the same order id each time a limit order is placed. Therefore, I suggest to either make the order id type u128, or make the gen_order_id function return a u64 id to match the order id type when placing, cancelling, etc orders.
Best!
The text was updated successfully, but these errors were encountered:
Sorry for the late reply, but these are two different fields. client_order_id is assigned by you and you can make it whatever you want (sequence number and timestamp are common). order_id is assigned by the program and it's not possible in all cases to know it before you submit your order. Hope this helps!
Hello!
To generate order ids, we can utilize the built-in
gen_order_id
utility function:openbook-v2/programs/openbook-v2/src/state/market.rs
Line 188 in b954445
But the returned
order_id
type is u128, and when placing a new limit order, it is taking au64
as order id type param:openbook-v2/lib/client/src/client.rs
Line 388 in b954445
Using the above function and downcasting the value to u64 can cause an overflow and returning the same order id each time a limit order is placed. Therefore, I suggest to either make the order id type u128, or make the
gen_order_id
function return a u64 id to match the order id type when placing, cancelling, etc orders.Best!
The text was updated successfully, but these errors were encountered: