Skip to content

Commit

Permalink
Comments on why there is no hint for global deposit and withdraw (#165)
Browse files Browse the repository at this point in the history
* comments on why there is no hint for global deposit and withdraw

* fmt
  • Loading branch information
brittcyr authored Oct 9, 2024
1 parent 8c7943d commit e6ba7d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion programs/manifest/src/program/processor/global_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ use super::invoke;
#[derive(BorshDeserialize, BorshSerialize)]
pub struct GlobalDepositParams {
pub amount_atoms: u64,
// TODO: Use trader_index_hint. Should not be very impactful, but for consistency.
// No trader index hint because global account is small so there is not much
// benefit from hinted indices, unlike the market which can get large. Also,
// seats are not permanent like on a market due to eviction, so it is more
// likely that a client could send a bad request. Just look it up for them.
}

impl GlobalDepositParams {
Expand Down
4 changes: 4 additions & 0 deletions programs/manifest/src/program/processor/global_withdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ use crate::{
#[derive(BorshDeserialize, BorshSerialize)]
pub struct GlobalWithdrawParams {
pub amount_atoms: u64,
// No trader index hint because global account is small so there is not much
// benefit from hinted indices, unlike the market which can get large. Also,
// seats are not permanent like on a market due to eviction, so it is more
// likely that a client could send a bad request. Just look it up for them.
}

impl GlobalWithdrawParams {
Expand Down

0 comments on commit e6ba7d9

Please sign in to comment.