-
Notifications
You must be signed in to change notification settings - Fork 157
bigz/init-lp-pool #1565
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
base: master
Are you sure you want to change the base?
bigz/init-lp-pool #1565
Conversation
* add get_swap_amount, get_swap_fees, get_weight * update accounts * add back ts * rebase * add constituent swap fees
init constituent
* add initializeLpPool test * add check for constituent target weights
Nour/add mapping datum
…t-weights add crank ix
|
||
let num_constituents = constituent_target_base.len(); | ||
for datum in constituent_target_base.iter() { | ||
msg!("weight datum: {:?}", datum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to do an audit of all the msg to figure out which ones we want vs arent useful
constituent.constituent_derivative_index | ||
); | ||
if constituent.constituent_index != lp_pool.usdc_consituent_index | ||
&& constituent.constituent_derivative_index != lp_pool.usdc_consituent_index as i16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if usdc_consituent_index is 0, will constituent.constituent_derivative_index != lp_pool.usdc_consituent_inde cause issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt cause issues -- this is meant to pick up USDC and other stables. is there a corner case you're thinking of that isnt handled?
in_constituent.sync_token_balance(ctx.accounts.constituent_in_token_account.amount); | ||
out_constituent.sync_token_balance(ctx.accounts.constituent_out_token_account.amount); | ||
|
||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should think of any invariants to enforce on this call. anything moving token balance is good to have extra invariants around
ctx.accounts.spot_market_vault.reload()?; | ||
spot_market.validate_max_token_deposits_and_borrows(false)?; | ||
|
||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the deposit + token amount same before and after
pub state: Box<Account<'info, State>>, | ||
#[account( | ||
mut, | ||
constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this eventually be permissionless to allow more lp swaps?
* grid search * grid search swap test
* low hanging fruit comments * remove pda checks and store lp pool on zero copy accounts * parameterize depeg threshold * make description in lp pool event * update idl for event change
* add swap fee unit tests * remove linear inventory fee component
* fixing the main settle test and settle function * all current tests pass * update msg occurrences
* refactor settle pnl to modularize and add tests * more cargo tests
* use oracle staleness threshold for staleness * add spot market vault invariant
No description provided.