Conversation
|
Thanks for the review @liviuc685, applied all your feedbacks. Sorry I couldn't make cargo to actually run so my vscode isn't really picking things up. |
| pub fn validate_adrena_pool(account: &Option<AccountInfo>) -> Result<()> { | ||
| let Some(account) = account else { | ||
| warn!("No adrena pool account provided"); | ||
| return err!(ScopeError::ExpectedPriceAccount); | ||
| }; | ||
|
|
||
| let adrena_pool = zero_copy_deserialize::<adrena::state::Pool>(account)?; | ||
|
|
||
| if adrena_pool.initialized != 1 { | ||
| warn!("Adrena pool account isn't initialized"); | ||
| return err!(ScopeError::PriceNotValid); | ||
| } | ||
|
|
||
| Ok(()) | ||
| } |
There was a problem hiding this comment.
Add a check of the ownership of the account here please.
To make review of mapping update easier, you could log some info on the pool like the name.
| return err!(ScopeError::ExpectedPriceAccount); | ||
| }; | ||
|
|
||
| let adrena_pool = zero_copy_deserialize::<adrena::state::Pool>(account)?; |
There was a problem hiding this comment.
do you have a list of the adrena pool account IDs and the token they correspond to?
There was a problem hiding this comment.
AFAIK, there is only ALP 4bQRutgDJs6vuh6ZcWaPVXiQaBzbHketjbCDjL4oRN34
There was a problem hiding this comment.
Hello all accounts can be viewed here: https://app.adrena.xyz/monitoring?view=full
We have only one pool: 4bQRutgDJs6vuh6ZcWaPVXiQaBzbHketjbCDjL4oRN34
| }, | ||
| last_updated_slot: estimate_slot_update_from_ts( | ||
| clock, | ||
| adrena_pool.last_aum_and_lp_token_price_usd_update, |
There was a problem hiding this comment.
just to double check, last_aum_and_lp_token_price_usd_update is in seconds, right? estimate_slot_update_from_ts expects the timestamp to be in seconds
There was a problem hiding this comment.
Thelast_aum_and_lp_token_price_usd_update is in second yes
No description provided.