From f25137835b132908734f368545f78608b3084e91 Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:06:17 -0400 Subject: [PATCH 01/50] program: init lp pool --- programs/drift/src/state/lp_pool.rs | 150 ++++++++++++++++++++++++ programs/drift/src/state/mod.rs | 1 + programs/drift/src/state/spot_market.rs | 2 +- 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 programs/drift/src/state/lp_pool.rs diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs new file mode 100644 index 000000000..015ac37fe --- /dev/null +++ b/programs/drift/src/state/lp_pool.rs @@ -0,0 +1,150 @@ +use crate::error::{DriftResult, ErrorCode}; +use crate::state::oracle::OracleSource; +use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; +use anchor_lang::prelude::*; +use crate::math::safe_math::SafeMath; +use crate::math::casting::Cast; + +pub struct LPPool { + /// name of vault, TODO: check type + size + pub name: [u8; 32], + /// address of the vault. + pub pubkey: Pubkey, + // vault token mint + pub mint: Pubkey, + /// LPPool's token account + pub token_vault: Pubkey, + + /// token_supply? to simplify NAV calculation, or load from mint account + /// token_total_supply: u64 + + /// The current number of VaultConstituents in the vault, each constituent is pda(LPPool.address, constituent_index) + pub constituents: u16, + /// which constituent is the quote, receives revenue pool distributions. (maybe this should just be implied idx 0) + /// pub quote_constituent_index: u16, + + /// Max AUM. Prohibit minting new DLP beyond this + /// pub max_aum: u64, + + /// AUM of the vault in USD, updated lazily + pub last_aum: u64, + /// timestamp of last AUM update + pub last_aum_ts: u64, + + /// timestamp of last vAMM revenue rebalance + pub last_revenue_rebalance_ts: u64, +} + +#[zero_copy(unsafe)] +#[derive(Default, Eq, PartialEq, Debug)] +#[repr(C)] +pub struct BLPosition { + /// The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow + /// interest of corresponding market. + /// precision: SPOT_BALANCE_PRECISION + pub scaled_balance: u64, + /// The cumulative deposits/borrows a user has made into a market + /// precision: token mint precision + pub cumulative_deposits: i64, + /// The market index of the corresponding spot market + pub market_index: u16, + /// Whether the position is deposit or borrow + pub balance_type: SpotBalanceType, + pub padding: [u8; 4], +} + +impl SpotBalance for BLPosition { + fn market_index(&self) -> u16 { + self.market_index + } + + fn balance_type(&self) -> &SpotBalanceType { + &self.balance_type + } + + fn balance(&self) -> u128 { + self.scaled_balance as u128 + } + + fn increase_balance(&mut self, delta: u128) -> DriftResult { + self.scaled_balance = self.scaled_balance.safe_add(delta.cast()?)?; + Ok(()) + } + + fn decrease_balance(&mut self, delta: u128) -> DriftResult { + self.scaled_balance = self.scaled_balance.safe_sub(delta.cast()?)?; + Ok(()) + } + + fn update_balance_type(&mut self, balance_type: SpotBalanceType) -> DriftResult { + self.balance_type = balance_type; + Ok(()) + } +} + +pub struct Constituent { + /// address of the constituent + pub pubkey: Pubkey, + /// idx in LPPool.constituents + pub constituent_index: u16, + + /// how to store actual DLP spot balances: + /// option 1) token account for the constituent (use this to isolate user deposits) - does not allow borrow/lend + /// pub token_account: Pubkey, + /// option 2) spot market balance (use this to deposit constituent balance into spot market and be exposed to borrow/lend interest) + /// pub scaled_balance: u64, + /// pub balance_type: BalanceType. + + /// oracle used to price the constituent + pub oracle: Pubkey, + pub oracle_source: OracleSource, + /// max deviation from target_weight allowed for the constituent + /// precision: PERCENTAGE_PRECISION + pub max_weight_deviation: u64, + /// min fee charged on swaps to this constituent + /// precision: PERCENTAGE_PRECISION + pub swap_fee_min: u64, + /// max premium to be applied to swap_fee_min when the constituent is at max deviation from target_weight + /// precision: PERCENTAGE_PRECISION + pub max_fee_premium: u64, + /// underlying drift spot market index + pub spot_market_index: u16, + /// oracle price at last update + /// precision: PRICE_PRECISION_I64 + pub last_oracle_price: i64, + /// timestamp of last oracle price update: + pub last_oracle_price_ts: u64, + + /// spot borrow-lend balance for constituent + pub spot_balance: BLPosition, // should be in constituent base asset +} + +// pub struct PerpConstituent { +// } + +pub struct WeightDatum { + pub data: u64, + pub last_slot: u64, +} + +pub struct AmmConstituentMapping { + // rows in the matrix, (perp markets) + pub num_rows: u16, + // columns in the matrix (VaultConstituents, spot markets) + pub num_cols: u16, + // flattened matrix elements, PERCENTAGE_PRECISION. Keep at the end of the account to allow expansion with new constituents. + // Apr 8: z: can make data vec instead to store the age of each entry + pub data: Vec, +} + +pub struct ConstituentTargetWeights { + // rows in the matrix (VaultConstituents) + pub num_rows: u16, + // columns in the matrix (0th is the weight, 1st is the last time the weight was updated) + pub num_cols: u16, + // ts of the oldest weight in data, for swaps to reference without traversing matrix + // Apr 8: z: can make data vec instead to store the age of each entry + pub oldest_weight_ts: u64, + // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async + pub data: Vec, +} diff --git a/programs/drift/src/state/mod.rs b/programs/drift/src/state/mod.rs index 078770668..daadb46ce 100644 --- a/programs/drift/src/state/mod.rs +++ b/programs/drift/src/state/mod.rs @@ -5,6 +5,7 @@ pub mod fulfillment_params; pub mod high_leverage_mode_config; pub mod insurance_fund_stake; pub mod load_ref; +pub mod lp_pool; pub mod margin_calculation; pub mod oracle; pub mod oracle_map; diff --git a/programs/drift/src/state/spot_market.rs b/programs/drift/src/state/spot_market.rs index 450f7fd26..9aff8b799 100644 --- a/programs/drift/src/state/spot_market.rs +++ b/programs/drift/src/state/spot_market.rs @@ -56,7 +56,7 @@ pub struct SpotMarket { /// Covers bankruptcies for borrows with this markets token and perps settling in this markets token pub insurance_fund: InsuranceFund, /// The total spot fees collected for this market - /// precision: QUOTE_PRECISION + /// precision: QUOTE_PRECISIONPoolBalance pub total_spot_fee: u128, /// The sum of the scaled balances for deposits across users and pool balances /// To convert to the deposit token amount, multiply by the cumulative deposit interest From be58c576e8ad31f55435f6c24aea9d58c4dd319b Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:06:29 -0400 Subject: [PATCH 02/50] cargo fmt -- --- programs/drift/src/state/lp_pool.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 015ac37fe..63acbe871 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,9 +1,9 @@ use crate::error::{DriftResult, ErrorCode}; +use crate::math::casting::Cast; +use crate::math::safe_math::SafeMath; use crate::state::oracle::OracleSource; use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; use anchor_lang::prelude::*; -use crate::math::safe_math::SafeMath; -use crate::math::casting::Cast; pub struct LPPool { /// name of vault, TODO: check type + size From 2cf149d9f77925cf53ab583a601268519b804422 Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:11:49 -0400 Subject: [PATCH 03/50] add total fee fields --- programs/drift/src/state/lp_pool.rs | 8 ++++++++ programs/drift/src/state/spot_market.rs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 63acbe871..2a77c8f03 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -28,11 +28,19 @@ pub struct LPPool { /// AUM of the vault in USD, updated lazily pub last_aum: u64, + + /// timestamp of last AUM slot + pub last_aum_slot: u64, /// timestamp of last AUM update pub last_aum_ts: u64, /// timestamp of last vAMM revenue rebalance pub last_revenue_rebalance_ts: u64, + + /// all revenue settles recieved + pub total_fees_received: u128, + /// all revenues paid out + pub total_fees_paid: u128, } #[zero_copy(unsafe)] diff --git a/programs/drift/src/state/spot_market.rs b/programs/drift/src/state/spot_market.rs index 9aff8b799..450f7fd26 100644 --- a/programs/drift/src/state/spot_market.rs +++ b/programs/drift/src/state/spot_market.rs @@ -56,7 +56,7 @@ pub struct SpotMarket { /// Covers bankruptcies for borrows with this markets token and perps settling in this markets token pub insurance_fund: InsuranceFund, /// The total spot fees collected for this market - /// precision: QUOTE_PRECISIONPoolBalance + /// precision: QUOTE_PRECISION pub total_spot_fee: u128, /// The sum of the scaled balances for deposits across users and pool balances /// To convert to the deposit token amount, multiply by the cumulative deposit interest From b2cf992b59bda2f16cd1fe4171992326c6e2123c Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Wed, 9 Apr 2025 17:38:46 -0400 Subject: [PATCH 04/50] add update_target_weights math --- programs/drift/src/state/lp_pool.rs | 66 +++++++- programs/drift/src/state/lp_pool/tests.rs | 197 ++++++++++++++++++++++ 2 files changed, 261 insertions(+), 2 deletions(-) create mode 100644 programs/drift/src/state/lp_pool/tests.rs diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 2a77c8f03..8ff661bb0 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,10 +1,14 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; +use crate::math::constants::PERCENTAGE_PRECISION_U64; use crate::math::safe_math::SafeMath; use crate::state::oracle::OracleSource; use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; use anchor_lang::prelude::*; +#[cfg(test)] +mod tests; + pub struct LPPool { /// name of vault, TODO: check type + size pub name: [u8; 32], @@ -141,7 +145,6 @@ pub struct AmmConstituentMapping { // columns in the matrix (VaultConstituents, spot markets) pub num_cols: u16, // flattened matrix elements, PERCENTAGE_PRECISION. Keep at the end of the account to allow expansion with new constituents. - // Apr 8: z: can make data vec instead to store the age of each entry pub data: Vec, } @@ -151,8 +154,67 @@ pub struct ConstituentTargetWeights { // columns in the matrix (0th is the weight, 1st is the last time the weight was updated) pub num_cols: u16, // ts of the oldest weight in data, for swaps to reference without traversing matrix - // Apr 8: z: can make data vec instead to store the age of each entry pub oldest_weight_ts: u64, // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async pub data: Vec, } + +impl Default for ConstituentTargetWeights { + fn default() -> Self { + ConstituentTargetWeights { + num_rows: 0, + num_cols: 0, + oldest_weight_ts: 0, + data: Vec::with_capacity(0), + } + } +} + +impl ConstituentTargetWeights { + /// Update target weights based on amm_inventory and mapping + pub fn update_target_weights( + &mut self, + mapping: &AmmConstituentMapping, + amm_inventory: &[u64], // length = mapping.num_rows + constituents: &[Constituent], + prices: &[u64], // same order as constituents + aum: u64, + slot: u64, + ) -> DriftResult<()> { + // assert_ne!(aum, 0); + assert_eq!(constituents.len(), mapping.num_cols as usize); + assert_eq!(amm_inventory.len(), mapping.num_rows as usize); + assert_eq!(prices.len(), constituents.len()); + + self.data.clear(); + self.num_rows = constituents.len() as u16; + self.num_cols = 2; + self.oldest_weight_ts = slot; + + for (constituent_index, constituent) in constituents.iter().enumerate() { + let mut target_amount = 0u128; + + for (row_index, &inventory) in amm_inventory.iter().enumerate() { + let idx = row_index * mapping.num_cols as usize + constituent_index; + let weight = mapping.data[idx].data as u128; // PERCENTAGE_PRECISION + + target_amount += inventory as u128 * weight / PERCENTAGE_PRECISION_U64 as u128; + } + + let price = prices[constituent_index] as u128; + let target_weight = target_amount + .saturating_mul(price) + .saturating_div(aum.max(1) as u128); + + // PERCENTAGE_PRECISION capped + let weight_datum = (target_weight as u64).min(PERCENTAGE_PRECISION_U64); + + self.data.push(WeightDatum { + data: weight_datum, + last_slot: slot, + }); + } + + Ok(()) + } +} diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs new file mode 100644 index 000000000..afb15022f --- /dev/null +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -0,0 +1,197 @@ +#[cfg(test)] +mod tests { + use super::*; + use crate::state::lp_pool::*; + use crate::state::oracle::OracleSource; + use crate::state::spot_market::SpotBalanceType; + use anchor_lang::prelude::Pubkey; + + const PERCENTAGE_PRECISION_U64: u64 = 1_000_000; + + fn weight_datum(data: u64, last_slot: u64) -> WeightDatum { + WeightDatum { data, last_slot } + } + + fn dummy_constituent(index: u16) -> Constituent { + Constituent { + pubkey: Pubkey::default(), + constituent_index: index, + oracle: Pubkey::default(), + oracle_source: OracleSource::Pyth, + max_weight_deviation: 0, + swap_fee_min: 0, + max_fee_premium: 0, + spot_market_index: index, + last_oracle_price: 0, + last_oracle_price_ts: 0, + spot_balance: BLPosition { + scaled_balance: 0, + cumulative_deposits: 0, + market_index: index, + balance_type: SpotBalanceType::Deposit, + padding: [0; 4], + }, + } + } + + #[test] + fn test_single_zero_weight() { + let mapping = AmmConstituentMapping { + num_rows: 1, + num_cols: 1, + data: vec![weight_datum(0, 0)], + }; + + let amm_inventory = vec![1_000_000]; + let prices = vec![1_000_000]; + let constituents = vec![dummy_constituent(0)]; + let aum = 1_000_000; + let now_ts = 1000; + + let mut target = ConstituentTargetWeights::default(); + target + .update_target_weights( + &mapping, + &amm_inventory, + &constituents, + &prices, + aum, + now_ts, + ) + .unwrap(); + + assert_eq!(target.data.len(), 1); + assert_eq!(target.data[0].data, 0); + assert_eq!(target.data[0].last_slot, now_ts); + } + + #[test] + fn test_single_full_weight() { + let mapping = AmmConstituentMapping { + num_rows: 1, + num_cols: 1, + data: vec![weight_datum(PERCENTAGE_PRECISION_U64, 0)], + }; + + let amm_inventory = vec![1_000_000]; + let prices = vec![1_000_000]; + let constituents = vec![dummy_constituent(0)]; + let aum = 1_000_000; + let now_ts = 1234; + + let mut target = ConstituentTargetWeights::default(); + target + .update_target_weights( + &mapping, + &amm_inventory, + &constituents, + &prices, + aum, + now_ts, + ) + .unwrap(); + + assert_eq!(target.data.len(), 1); + assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_U64); + assert_eq!(target.data[0].last_slot, now_ts); + } + + #[test] + fn test_multiple_constituents_partial_weights() { + let mapping = AmmConstituentMapping { + num_rows: 1, + num_cols: 2, + data: vec![ + weight_datum(PERCENTAGE_PRECISION_U64 / 2, 0), + weight_datum(PERCENTAGE_PRECISION_U64 / 2, 0), + ], + }; + + let amm_inventory = vec![1_000_000]; + let prices = vec![1_000_000, 1_000_000]; + let constituents = vec![dummy_constituent(0), dummy_constituent(1)]; + let aum = 1_000_000; + let now_ts = 999; + + let mut target = ConstituentTargetWeights::default(); + target + .update_target_weights( + &mapping, + &amm_inventory, + &constituents, + &prices, + aum, + now_ts, + ) + .unwrap(); + + assert_eq!(target.data.len(), 2); + + for datum in &target.data { + assert_eq!(datum.data, PERCENTAGE_PRECISION_U64 / 2); + assert_eq!(datum.last_slot, now_ts); + } + } + + #[test] + fn test_zero_aum_safe() { + let mapping = AmmConstituentMapping { + num_rows: 1, + num_cols: 1, + data: vec![weight_datum(PERCENTAGE_PRECISION_U64, 0)], + }; + + let amm_inventory = vec![1_000_000]; + let prices = vec![1_000_000]; + let constituents = vec![dummy_constituent(0)]; + let aum = 0; + let now_ts = 111; + + let mut target = ConstituentTargetWeights::default(); + target + .update_target_weights( + &mapping, + &amm_inventory, + &constituents, + &prices, + aum, + now_ts, + ) + .unwrap(); + + assert_eq!(target.data.len(), 1); + assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_U64); // todo how to handle? + assert_eq!(target.data[0].last_slot, now_ts); + } + + #[test] + fn test_overflow_protection() { + let mapping = AmmConstituentMapping { + num_rows: 1, + num_cols: 1, + data: vec![weight_datum(u64::MAX, 0)], + }; + + let amm_inventory = vec![u64::MAX]; + let prices = vec![u64::MAX]; + let constituents = vec![dummy_constituent(0)]; + let aum = 1; + let now_ts = 222; + + let mut target = ConstituentTargetWeights::default(); + target + .update_target_weights( + &mapping, + &amm_inventory, + &constituents, + &prices, + aum, + now_ts, + ) + .unwrap(); + + assert_eq!(target.data.len(), 1); + assert!(target.data[0].data <= PERCENTAGE_PRECISION_U64); + assert_eq!(target.data[0].last_slot, now_ts); + } +} From a405a56a30aacc1d2bc84fed451eb22da3af77e8 Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Fri, 18 Apr 2025 10:10:04 -0400 Subject: [PATCH 05/50] program: use sparse matrix for constituent map and update tests --- programs/drift/src/state/lp_pool.rs | 31 +++++++++++------- programs/drift/src/state/lp_pool/tests.rs | 39 ++++++++++------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 8ff661bb0..61551c1e8 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -134,18 +134,24 @@ pub struct Constituent { // pub struct PerpConstituent { // } +pub struct AmmConstituentDatum { + pub perp_market_index: u16, + pub constituent_index: u16, + /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market + pub data: u64, + pub last_slot: u64, +} + pub struct WeightDatum { + pub constituent_index: u16, + /// PERCENTAGE_PRECISION. The weights of the target weight matrix pub data: u64, pub last_slot: u64, } pub struct AmmConstituentMapping { - // rows in the matrix, (perp markets) - pub num_rows: u16, - // columns in the matrix (VaultConstituents, spot markets) - pub num_cols: u16, // flattened matrix elements, PERCENTAGE_PRECISION. Keep at the end of the account to allow expansion with new constituents. - pub data: Vec, + pub data: Vec, } pub struct ConstituentTargetWeights { @@ -175,15 +181,13 @@ impl ConstituentTargetWeights { pub fn update_target_weights( &mut self, mapping: &AmmConstituentMapping, - amm_inventory: &[u64], // length = mapping.num_rows + amm_inventory: &[(u16, u64)], // length = mapping.num_rows constituents: &[Constituent], prices: &[u64], // same order as constituents aum: u64, slot: u64, ) -> DriftResult<()> { // assert_ne!(aum, 0); - assert_eq!(constituents.len(), mapping.num_cols as usize); - assert_eq!(amm_inventory.len(), mapping.num_rows as usize); assert_eq!(prices.len(), constituents.len()); self.data.clear(); @@ -194,11 +198,13 @@ impl ConstituentTargetWeights { for (constituent_index, constituent) in constituents.iter().enumerate() { let mut target_amount = 0u128; - for (row_index, &inventory) in amm_inventory.iter().enumerate() { - let idx = row_index * mapping.num_cols as usize + constituent_index; + for (perp_market_index, inventory) in amm_inventory.iter() { + let idx = mapping.data + .iter() + .position(|d| &d.perp_market_index == perp_market_index) + .expect("missing mapping for this market index"); let weight = mapping.data[idx].data as u128; // PERCENTAGE_PRECISION - - target_amount += inventory as u128 * weight / PERCENTAGE_PRECISION_U64 as u128; + target_amount += (*inventory) as u128 * weight / PERCENTAGE_PRECISION_U64 as u128; } let price = prices[constituent_index] as u128; @@ -210,6 +216,7 @@ impl ConstituentTargetWeights { let weight_datum = (target_weight as u64).min(PERCENTAGE_PRECISION_U64); self.data.push(WeightDatum { + constituent_index: constituent_index as u16, data: weight_datum, last_slot: slot, }); diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index afb15022f..28652071f 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -8,8 +8,11 @@ mod tests { const PERCENTAGE_PRECISION_U64: u64 = 1_000_000; - fn weight_datum(data: u64, last_slot: u64) -> WeightDatum { - WeightDatum { data, last_slot } + fn weight_datum(constituent_index: u16, data: u64, last_slot: u64) -> WeightDatum { + WeightDatum { constituent_index, data, last_slot } + } + fn amm_const_datum(perp_market_index: u16, constituent_index: u16, data: u64, last_slot: u64) -> AmmConstituentDatum { + AmmConstituentDatum { perp_market_index, constituent_index, data, last_slot } } fn dummy_constituent(index: u16) -> Constituent { @@ -37,12 +40,10 @@ mod tests { #[test] fn test_single_zero_weight() { let mapping = AmmConstituentMapping { - num_rows: 1, - num_cols: 1, - data: vec![weight_datum(0, 0)], + data: vec![amm_const_datum(0, 1, 0, 0)], }; - let amm_inventory = vec![1_000_000]; + let amm_inventory: Vec<(u16, u64)> = vec![(0, 1_000_000)]; let prices = vec![1_000_000]; let constituents = vec![dummy_constituent(0)]; let aum = 1_000_000; @@ -68,12 +69,10 @@ mod tests { #[test] fn test_single_full_weight() { let mapping = AmmConstituentMapping { - num_rows: 1, - num_cols: 1, - data: vec![weight_datum(PERCENTAGE_PRECISION_U64, 0)], + data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_U64, 0)], }; - let amm_inventory = vec![1_000_000]; + let amm_inventory = vec![(0, 1_000_000)]; let prices = vec![1_000_000]; let constituents = vec![dummy_constituent(0)]; let aum = 1_000_000; @@ -99,15 +98,13 @@ mod tests { #[test] fn test_multiple_constituents_partial_weights() { let mapping = AmmConstituentMapping { - num_rows: 1, - num_cols: 2, data: vec![ - weight_datum(PERCENTAGE_PRECISION_U64 / 2, 0), - weight_datum(PERCENTAGE_PRECISION_U64 / 2, 0), + amm_const_datum(0, 1, PERCENTAGE_PRECISION_U64 / 2, 0), + amm_const_datum(0, 2, PERCENTAGE_PRECISION_U64 / 2, 0), ], }; - let amm_inventory = vec![1_000_000]; + let amm_inventory = vec![(0, 1_000_000)]; let prices = vec![1_000_000, 1_000_000]; let constituents = vec![dummy_constituent(0), dummy_constituent(1)]; let aum = 1_000_000; @@ -136,12 +133,10 @@ mod tests { #[test] fn test_zero_aum_safe() { let mapping = AmmConstituentMapping { - num_rows: 1, - num_cols: 1, - data: vec![weight_datum(PERCENTAGE_PRECISION_U64, 0)], + data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_U64, 0)], }; - let amm_inventory = vec![1_000_000]; + let amm_inventory = vec![(0, 1_000_000)]; let prices = vec![1_000_000]; let constituents = vec![dummy_constituent(0)]; let aum = 0; @@ -167,12 +162,10 @@ mod tests { #[test] fn test_overflow_protection() { let mapping = AmmConstituentMapping { - num_rows: 1, - num_cols: 1, - data: vec![weight_datum(u64::MAX, 0)], + data: vec![amm_const_datum(0, 1, u64::MAX, 0)], }; - let amm_inventory = vec![u64::MAX]; + let amm_inventory = vec![(0, u64::MAX)]; let prices = vec![u64::MAX]; let constituents = vec![dummy_constituent(0)]; let aum = 1; From 34b044cb8d34cf1d6b378730291afbf41ef6b5fd Mon Sep 17 00:00:00 2001 From: wphan Date: Fri, 18 Apr 2025 12:19:28 -0700 Subject: [PATCH 06/50] zero copy accounts, init ix (#1578) --- .gitignore | 3 +- Cargo.lock | 14 + programs/drift/Cargo.toml | 2 +- programs/drift/src/instructions/admin.rs | 125 +- programs/drift/src/lib.rs | 12 + programs/drift/src/state/lp_pool.rs | 78 +- programs/drift/src/state/lp_pool/tests.rs | 7 +- sdk/package.json | 1 + sdk/src/addresses/pda.ts | 21 + sdk/src/adminClient.ts | 86 +- sdk/src/idl/drift.json | 424 ++++++ sdk/yarn.lock | 1617 ++++++++++++++++++++- tests/lpPool.ts | 108 ++ 13 files changed, 2429 insertions(+), 69 deletions(-) create mode 100644 tests/lpPool.ts diff --git a/.gitignore b/.gitignore index 64ae0190a..99f04bbec 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ sdk/src/**/*.js.map .DS_STORE .vscode migrations -/**/*.env \ No newline at end of file +/**/*.env +vendor diff --git a/Cargo.lock b/Cargo.lock index 156ae6c31..f187d71ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,6 +214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ "anchor-lang", + "mpl-token-metadata", "solana-program", "spl-associated-token-account", "spl-token 4.0.0", @@ -1471,6 +1472,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mpl-token-metadata" +version = "3.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8ee05284d79b367ae8966d558e1a305a781fc80c9df51f37775169117ba64f" +dependencies = [ + "borsh 0.9.3", + "num-derive 0.3.3", + "num-traits", + "solana-program", + "thiserror", +] + [[package]] name = "num" version = "0.4.0" diff --git a/programs/drift/Cargo.toml b/programs/drift/Cargo.toml index c3dee3ff1..d80fa8c42 100644 --- a/programs/drift/Cargo.toml +++ b/programs/drift/Cargo.toml @@ -20,7 +20,7 @@ drift-rs=[] [dependencies] anchor-lang = "0.29.0" solana-program = "1.16" -anchor-spl = "0.29.0" +anchor-spl = { version = "0.29.0", features = ["metadata"] } pyth-client = "0.2.2" pyth-lazer-solana-contract = { git = "https://github.com/drift-labs/pyth-crosschain", rev = "d790d1cb4da873a949cf33ff70349b7614b232eb", features = ["no-entrypoint"]} pythnet-sdk = { git = "https://github.com/drift-labs/pyth-crosschain", rev = "3e8a24ecd0bcf22b787313e2020f4186bb22c729"} diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 85dde7d9a..f37141380 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -2,7 +2,15 @@ use std::convert::identity; use std::mem::size_of; use crate::msg; +use crate::signer::get_signer_seeds; +use crate::state::lp_pool::LPPool; use anchor_lang::prelude::*; +use anchor_spl::{ + metadata::{ + create_metadata_accounts_v3, mpl_token_metadata::types::DataV2, CreateMetadataAccountsV3, + Metadata, + }, +}; use anchor_spl::token::Token; use anchor_spl::token_2022::Token2022; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; @@ -4359,6 +4367,67 @@ pub fn handle_initialize_high_leverage_mode_config( Ok(()) } +pub fn handle_initialize_lp_pool( + ctx: Context, + name: [u8; 32], + token_name: String, + token_symbol: String, + token_uri: String, + _token_decimals: u8, + max_aum: u64, +) -> Result<()> { + let mut lp_pool = ctx.accounts.lp_pool.load_init()?; + let state = &mut ctx.accounts.state; + + *lp_pool = LPPool { + name, + pubkey: ctx.accounts.lp_pool.key(), + mint: ctx.accounts.mint.key(), + // token_vault: ctx.accounts.token_vault.key(), + constituents: 0, + max_aum, + last_aum: 0, + last_aum_slot: 0, + last_aum_ts: 0, + last_revenue_rebalance_ts: 0, + total_fees_received: 0, + total_fees_paid: 0, + padding: [0; 6], + }; + + let signature_seeds = get_signer_seeds(&state.signer_nonce); + let signers = &[&signature_seeds[..]]; + + create_metadata_accounts_v3( + CpiContext::new_with_signer( + ctx.accounts.token_metadata_program.to_account_info(), + CreateMetadataAccountsV3 { + metadata: ctx.accounts.metadata_account.to_account_info(), + mint: ctx.accounts.mint.to_account_info(), + mint_authority: ctx.accounts.lp_pool.to_account_info(), + update_authority: ctx.accounts.lp_pool.to_account_info(), + payer: ctx.accounts.admin.to_account_info(), + system_program: ctx.accounts.system_program.to_account_info(), + rent: ctx.accounts.rent.to_account_info(), + }, + signers, + ), + DataV2 { + name: token_name, + symbol: token_symbol, + uri: token_uri, + seller_fee_basis_points: 0, + creators: None, + collection: None, + uses: None, + }, + false, // Is mutable + true, // Update authority is signer + None, // Collection details + )?; + + Ok(()) +} pub fn handle_update_high_leverage_mode_config( ctx: Context, max_users: u32, @@ -4394,8 +4463,8 @@ pub fn handle_update_protected_maker_mode_config( ) -> Result<()> { let mut config = load_mut!(ctx.accounts.protected_maker_mode_config)?; - if current_users.is_some() { - config.current_users = current_users.unwrap(); + if let Some(users) = current_users { + config.current_users = users; } config.max_users = max_users; config.reduce_only = reduce_only as u8; @@ -5130,3 +5199,55 @@ pub struct UpdateProtectedMakerModeConfig<'info> { )] pub state: Box>, } + +#[derive(Accounts)] +#[instruction( + name: [u8; 32], + token_decimals: u8, +)] +pub struct InitializeLpPool<'info> { + #[account(mut)] + pub admin: Signer<'info>, + #[account( + init, + seeds = [b"lp_pool", name.as_ref()], + space = LPPool::SIZE, + bump, + payer = admin + )] + pub lp_pool: AccountLoader<'info, LPPool>, + #[account( + init, + seeds = [b"mint", lp_pool.key().as_ref()], + bump, + payer = admin, + mint::decimals = token_decimals, + mint::authority = lp_pool.key(), + mint::freeze_authority = lp_pool.key(), + )] + pub mint: InterfaceAccount<'info, Mint>, + // #[account( + // token::authority = lp_pool.key(), + // token::mint = mint.key() + // )] + // pub token_vault: InterfaceAccount<'info, TokenAccount>, + #[account( + mut, + seeds = [b"metadata", token_metadata_program.key().as_ref(), mint.key().as_ref()], + bump, + seeds::program = token_metadata_program.key(), + )] + /// CHECK: Validate address by deriving pda + pub metadata_account: UncheckedAccount<'info>, + + #[account( + has_one = admin + )] + pub state: Box>, + + pub token_program: Program<'info, Token>, + pub token_metadata_program: Program<'info, Metadata>, + + pub rent: Sysvar<'info, Rent>, + pub system_program: Program<'info, System>, +} diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 48fe8552c..1010dac77 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1663,6 +1663,18 @@ pub mod drift { handle_initialize_high_leverage_mode_config(ctx, max_users) } + pub fn initialize_lp_pool( + ctx: Context, + name: [u8; 32], + token_name: String, + token_symbol: String, + token_uri: String, + token_decimals: u8, + max_aum: u64, + ) -> Result<()> { + handle_initialize_lp_pool(ctx, name, token_name, token_symbol, token_uri, token_decimals, max_aum) + } + pub fn update_high_leverage_mode_config( ctx: Context, max_users: u32, diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 61551c1e8..adcf2c19f 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -5,50 +5,61 @@ use crate::math::safe_math::SafeMath; use crate::state::oracle::OracleSource; use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; use anchor_lang::prelude::*; +use borsh::{BorshDeserialize, BorshSerialize}; +use crate::state::traits::Size; #[cfg(test)] mod tests; +#[account(zero_copy)] +#[derive(Default, Debug)] +#[repr(C)] pub struct LPPool { /// name of vault, TODO: check type + size - pub name: [u8; 32], + pub name: [u8; 32], // 32 /// address of the vault. - pub pubkey: Pubkey, + pub pubkey: Pubkey, // 32, 64 // vault token mint - pub mint: Pubkey, + pub mint: Pubkey, // 32, 96 /// LPPool's token account - pub token_vault: Pubkey, + // pub token_vault: Pubkey, // 32, 128 /// token_supply? to simplify NAV calculation, or load from mint account /// token_total_supply: u64 /// The current number of VaultConstituents in the vault, each constituent is pda(LPPool.address, constituent_index) - pub constituents: u16, /// which constituent is the quote, receives revenue pool distributions. (maybe this should just be implied idx 0) /// pub quote_constituent_index: u16, - /// Max AUM. Prohibit minting new DLP beyond this - /// pub max_aum: u64, + /// QUOTE_PRECISION: Max AUM, Prohibit minting new DLP beyond this + pub max_aum: u64, // 8, 136 - /// AUM of the vault in USD, updated lazily - pub last_aum: u64, + /// QUOTE_PRECISION: AUM of the vault in USD, updated lazily + pub last_aum: u64, // 8, 144 /// timestamp of last AUM slot - pub last_aum_slot: u64, + pub last_aum_slot: u64, // 8, 152 /// timestamp of last AUM update - pub last_aum_ts: u64, + pub last_aum_ts: u64, // 8, 160 /// timestamp of last vAMM revenue rebalance - pub last_revenue_rebalance_ts: u64, + pub last_revenue_rebalance_ts: u64, // 8, 168 /// all revenue settles recieved - pub total_fees_received: u128, + pub total_fees_received: u128, // 16, 176 /// all revenues paid out - pub total_fees_paid: u128, + pub total_fees_paid: u128, // 16, 192 + + pub constituents: u16, // 2, 194 + pub padding: [u8; 6], +} + +impl Size for LPPool { + const SIZE: usize = 1743; } #[zero_copy(unsafe)] -#[derive(Default, Eq, PartialEq, Debug)] +#[derive(Default, Eq, PartialEq, Debug, BorshDeserialize, BorshSerialize)] #[repr(C)] pub struct BLPosition { /// The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow @@ -94,22 +105,15 @@ impl SpotBalance for BLPosition { } } +#[account(zero_copy(unsafe))] +#[derive(Default, Debug, BorshDeserialize, BorshSerialize)] +#[repr(C)] pub struct Constituent { /// address of the constituent pub pubkey: Pubkey, /// idx in LPPool.constituents pub constituent_index: u16, - /// how to store actual DLP spot balances: - /// option 1) token account for the constituent (use this to isolate user deposits) - does not allow borrow/lend - /// pub token_account: Pubkey, - /// option 2) spot market balance (use this to deposit constituent balance into spot market and be exposed to borrow/lend interest) - /// pub scaled_balance: u64, - /// pub balance_type: BalanceType. - - /// oracle used to price the constituent - pub oracle: Pubkey, - pub oracle_source: OracleSource, /// max deviation from target_weight allowed for the constituent /// precision: PERCENTAGE_PRECISION pub max_weight_deviation: u64, @@ -129,38 +133,51 @@ pub struct Constituent { /// spot borrow-lend balance for constituent pub spot_balance: BLPosition, // should be in constituent base asset + pub padding: [u8; 16], } // pub struct PerpConstituent { // } +#[zero_copy] +#[derive(Debug, BorshDeserialize, BorshSerialize)] +#[repr(C)] pub struct AmmConstituentDatum { pub perp_market_index: u16, pub constituent_index: u16, - /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market + pub padding: [u8; 4], + /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market pub data: u64, pub last_slot: u64, } +#[zero_copy] +#[derive(Debug, BorshDeserialize, BorshSerialize)] +#[repr(C)] pub struct WeightDatum { pub constituent_index: u16, - /// PERCENTAGE_PRECISION. The weights of the target weight matrix + pub padding: [u8; 6], + /// PERCENTAGE_PRECISION. The weights of the target weight matrix pub data: u64, pub last_slot: u64, } +#[account] +#[derive(Debug)] +#[repr(C)] pub struct AmmConstituentMapping { // flattened matrix elements, PERCENTAGE_PRECISION. Keep at the end of the account to allow expansion with new constituents. pub data: Vec, } +#[account] +#[derive(Debug)] +#[repr(C)] pub struct ConstituentTargetWeights { // rows in the matrix (VaultConstituents) pub num_rows: u16, // columns in the matrix (0th is the weight, 1st is the last time the weight was updated) pub num_cols: u16, - // ts of the oldest weight in data, for swaps to reference without traversing matrix - pub oldest_weight_ts: u64, // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async pub data: Vec, } @@ -170,7 +187,6 @@ impl Default for ConstituentTargetWeights { ConstituentTargetWeights { num_rows: 0, num_cols: 0, - oldest_weight_ts: 0, data: Vec::with_capacity(0), } } @@ -193,7 +209,6 @@ impl ConstituentTargetWeights { self.data.clear(); self.num_rows = constituents.len() as u16; self.num_cols = 2; - self.oldest_weight_ts = slot; for (constituent_index, constituent) in constituents.iter().enumerate() { let mut target_amount = 0u128; @@ -217,6 +232,7 @@ impl ConstituentTargetWeights { self.data.push(WeightDatum { constituent_index: constituent_index as u16, + padding: [0; 6], data: weight_datum, last_slot: slot, }); diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 28652071f..16b04fe1e 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -9,18 +9,16 @@ mod tests { const PERCENTAGE_PRECISION_U64: u64 = 1_000_000; fn weight_datum(constituent_index: u16, data: u64, last_slot: u64) -> WeightDatum { - WeightDatum { constituent_index, data, last_slot } + WeightDatum { constituent_index, padding: [0; 6], data, last_slot } } fn amm_const_datum(perp_market_index: u16, constituent_index: u16, data: u64, last_slot: u64) -> AmmConstituentDatum { - AmmConstituentDatum { perp_market_index, constituent_index, data, last_slot } + AmmConstituentDatum { perp_market_index, constituent_index, padding: [0; 4], data, last_slot } } fn dummy_constituent(index: u16) -> Constituent { Constituent { pubkey: Pubkey::default(), constituent_index: index, - oracle: Pubkey::default(), - oracle_source: OracleSource::Pyth, max_weight_deviation: 0, swap_fee_min: 0, max_fee_premium: 0, @@ -34,6 +32,7 @@ mod tests { balance_type: SpotBalanceType::Deposit, padding: [0; 4], }, + padding: [0; 16], } } diff --git a/sdk/package.json b/sdk/package.json index 2366daeef..77ec906a1 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -40,6 +40,7 @@ "@coral-xyz/anchor-30": "npm:@coral-xyz/anchor@0.30.1", "@ellipsis-labs/phoenix-sdk": "1.4.5", "@grpc/grpc-js": "1.12.6", + "@metaplex-foundation/js": "0.20.1", "@openbook-dex/openbook-v2": "0.2.10", "@project-serum/serum": "0.13.65", "@pythnetwork/client": "2.5.3", diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index de50923df..c65ba2e66 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -379,3 +379,24 @@ export function getProtectedMakerModeConfigPublicKey( programId )[0]; } + +export function getLpPoolPublicKey( + programId: PublicKey, + name: string +): PublicKey { + return PublicKey.findProgramAddressSync([ + Buffer.from(anchor.utils.bytes.utf8.encode('lp_pool')), + Buffer.from(name) + ], programId)[0]; +} + +export function getLpPoolMintPublicKey( + programId: PublicKey, + lpPoolPublicKey: PublicKey +): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from('mint'), lpPoolPublicKey.toBuffer()], + programId + )[0]; +} + diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 95e2d5b96..95cbb9822 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -36,9 +36,11 @@ import { getPythLazerOraclePublicKey, getProtectedMakerModeConfigPublicKey, getFuelOverflowAccountPublicKey, + getLpPoolMintPublicKey, + getLpPoolPublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; -import { TOKEN_PROGRAM_ID } from '@solana/spl-token'; +import { createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from '@solana/spl-token'; import { DriftClient } from './driftClient'; import { PEG_PRECISION, @@ -55,6 +57,9 @@ import { DRIFT_ORACLE_RECEIVER_ID } from './config'; import { getFeedIdUint8Array } from './util/pythOracleUtils'; import { FUEL_RESET_LOG_ACCOUNT } from './constants/txConstants'; +import { Metaplex } from '@metaplex-foundation/js'; + + const OPENBOOK_PROGRAM_ID = new PublicKey( 'opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb' ); @@ -4179,4 +4184,83 @@ export class AdminClient extends DriftClient { } ); } + + public async initializeLpPool( + name: string, + tokenName: string, + tokenSymbol: string, + tokenUri: string, + tokenDecimals: number, + maxAum: BN + ): Promise { + const ixs = await this.getInitializeLpPoolIx( + name, + tokenName, + tokenSymbol, + tokenUri, + tokenDecimals, + maxAum + ); + const tx = await this.buildTransaction(ixs); + const { txSig } = await this.sendTransaction(tx); + return txSig; + } + + public async getInitializeLpPoolIx( + name: string, + tokenName: string, + tokenSymbol: string, + tokenUri: string, + tokenDecimals: number, + maxAum: BN + ): Promise { + console.log(this.connection.rpcEndpoint) + const metaplex = new Metaplex(this.connection, {cluster: 'custom'}); + + const lpPool = getLpPoolPublicKey(this.program.programId, name); + + const mint = getLpPoolMintPublicKey(this.program.programId, lpPool); + + const lpPoolAta = getAssociatedTokenAddressSync( + mint, + lpPool, + true + ); + const createAtaIx = createAssociatedTokenAccountInstruction( + this.wallet.publicKey, + lpPoolAta, + lpPool, + mint + ); + + const state = await this.getStatePublicKey(); + + return [ + this.program.instruction.initializeLpPool( + Buffer.from(name), + tokenName, + tokenSymbol, + tokenUri, + tokenDecimals, + maxAum, + { + accounts: { + admin: this.wallet.publicKey, + lpPool, + mint, + // tokenVault: lpPoolAta, + metadataAccount: metaplex.nfts().pdas().metadata({ + mint, + }), + state, + tokenProgram: TOKEN_PROGRAM_ID, + tokenMetadataProgram: metaplex.programs().getTokenMetadata().address, + rent: SYSVAR_RENT_PUBKEY, + systemProgram: SystemProgram.programId, + }, + } + ), + createAtaIx, + ]; + } } diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index fd28bc5f0..8b4b3a69c 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -6961,6 +6961,87 @@ } ] }, + { + "name": "initializeLpPool", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "lpPool", + "isMut": true, + "isSigner": false + }, + { + "name": "mint", + "isMut": true, + "isSigner": false + }, + { + "name": "metadataAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "name", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "tokenName", + "type": "string" + }, + { + "name": "tokenSymbol", + "type": "string" + }, + { + "name": "tokenUri", + "type": "string" + }, + { + "name": "tokenDecimals", + "type": "u8" + }, + { + "name": "maxAum", + "type": "u64" + } + ] + }, { "name": "updateHighLeverageModeConfig", "accounts": [ @@ -7388,6 +7469,231 @@ ] } }, + { + "name": "LPPool", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "docs": [ + "name of vault, TODO: check type + size" + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "pubkey", + "docs": [ + "address of the vault." + ], + "type": "publicKey" + }, + { + "name": "mint", + "type": "publicKey" + }, + { + "name": "maxAum", + "docs": [ + "LPPool's token account", + "token_supply? to simplify NAV calculation, or load from mint account", + "token_total_supply: u64", + "The current number of VaultConstituents in the vault, each constituent is pda(LPPool.address, constituent_index)", + "which constituent is the quote, receives revenue pool distributions. (maybe this should just be implied idx 0)", + "pub quote_constituent_index: u16,", + "QUOTE_PRECISION: Max AUM, Prohibit minting new DLP beyond this" + ], + "type": "u64" + }, + { + "name": "lastAum", + "docs": [ + "QUOTE_PRECISION: AUM of the vault in USD, updated lazily" + ], + "type": "u64" + }, + { + "name": "lastAumSlot", + "docs": [ + "timestamp of last AUM slot" + ], + "type": "u64" + }, + { + "name": "lastAumTs", + "docs": [ + "timestamp of last AUM update" + ], + "type": "u64" + }, + { + "name": "lastRevenueRebalanceTs", + "docs": [ + "timestamp of last vAMM revenue rebalance" + ], + "type": "u64" + }, + { + "name": "totalFeesReceived", + "docs": [ + "all revenue settles recieved" + ], + "type": "u128" + }, + { + "name": "totalFeesPaid", + "docs": [ + "all revenues paid out" + ], + "type": "u128" + }, + { + "name": "constituents", + "type": "u16" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 6 + ] + } + } + ] + } + }, + { + "name": "Constituent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pubkey", + "docs": [ + "address of the constituent" + ], + "type": "publicKey" + }, + { + "name": "constituentIndex", + "docs": [ + "idx in LPPool.constituents" + ], + "type": "u16" + }, + { + "name": "maxWeightDeviation", + "docs": [ + "max deviation from target_weight allowed for the constituent", + "precision: PERCENTAGE_PRECISION" + ], + "type": "u64" + }, + { + "name": "swapFeeMin", + "docs": [ + "min fee charged on swaps to this constituent", + "precision: PERCENTAGE_PRECISION" + ], + "type": "u64" + }, + { + "name": "maxFeePremium", + "docs": [ + "max premium to be applied to swap_fee_min when the constituent is at max deviation from target_weight", + "precision: PERCENTAGE_PRECISION" + ], + "type": "u64" + }, + { + "name": "spotMarketIndex", + "docs": [ + "underlying drift spot market index" + ], + "type": "u16" + }, + { + "name": "lastOraclePrice", + "docs": [ + "oracle price at last update", + "precision: PRICE_PRECISION_I64" + ], + "type": "i64" + }, + { + "name": "lastOraclePriceTs", + "docs": [ + "timestamp of last oracle price update:" + ], + "type": "u64" + }, + { + "name": "spotBalance", + "docs": [ + "spot borrow-lend balance for constituent" + ], + "type": { + "defined": "BLPosition" + } + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 16 + ] + } + } + ] + } + }, + { + "name": "AmmConstituentMapping", + "type": { + "kind": "struct", + "fields": [ + { + "name": "data", + "type": { + "vec": { + "defined": "AmmConstituentDatum" + } + } + } + ] + } + }, + { + "name": "ConstituentTargetWeights", + "type": { + "kind": "struct", + "fields": [ + { + "name": "numRows", + "type": "u16" + }, + { + "name": "numCols", + "type": "u16" + }, + { + "name": "data", + "type": { + "vec": { + "defined": "WeightDatum" + } + } + } + ] + } + }, { "name": "PrelaunchOracle", "type": { @@ -9251,6 +9557,124 @@ ] } }, + { + "name": "BLPosition", + "type": { + "kind": "struct", + "fields": [ + { + "name": "scaledBalance", + "docs": [ + "The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow", + "interest of corresponding market.", + "precision: SPOT_BALANCE_PRECISION" + ], + "type": "u64" + }, + { + "name": "cumulativeDeposits", + "docs": [ + "The cumulative deposits/borrows a user has made into a market", + "precision: token mint precision" + ], + "type": "i64" + }, + { + "name": "marketIndex", + "docs": [ + "The market index of the corresponding spot market" + ], + "type": "u16" + }, + { + "name": "balanceType", + "docs": [ + "Whether the position is deposit or borrow" + ], + "type": { + "defined": "SpotBalanceType" + } + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, + { + "name": "AmmConstituentDatum", + "type": { + "kind": "struct", + "fields": [ + { + "name": "perpMarketIndex", + "type": "u16" + }, + { + "name": "constituentIndex", + "type": "u16" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + }, + { + "name": "data", + "docs": [ + "PERCENTAGE_PRECISION. The weight this constituent has on the perp market" + ], + "type": "u64" + }, + { + "name": "lastSlot", + "type": "u64" + } + ] + } + }, + { + "name": "WeightDatum", + "type": { + "kind": "struct", + "fields": [ + { + "name": "constituentIndex", + "type": "u16" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 6 + ] + } + }, + { + "name": "data", + "docs": [ + "PERCENTAGE_PRECISION. The weights of the target weight matrix" + ], + "type": "u64" + }, + { + "name": "lastSlot", + "type": "u64" + } + ] + } + }, { "name": "MarketIdentifier", "type": { diff --git a/sdk/yarn.lock b/sdk/yarn.lock index 3d446cd83..ccf932af2 100644 --- a/sdk/yarn.lock +++ b/sdk/yarn.lock @@ -138,6 +138,341 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@ethereumjs/rlp@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" + integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== + +"@ethereumjs/util@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.1.0.tgz#299df97fb6b034e0577ce9f94c7d9d1004409ed4" + integrity sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA== + dependencies: + "@ethereumjs/rlp" "^4.0.1" + ethereum-cryptography "^2.0.0" + micro-ftch "^0.3.1" + +"@ethersproject/abi@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.8.0.tgz#e79bb51940ac35fe6f3262d7fe2cdb25ad5f07d9" + integrity sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q== + dependencies: + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + +"@ethersproject/abstract-provider@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz#7581f9be601afa1d02b95d26b9d9840926a35b0c" + integrity sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/networks" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/web" "^5.8.0" + +"@ethersproject/abstract-signer@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz#8d7417e95e4094c1797a9762e6789c7356db0754" + integrity sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA== + dependencies: + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + +"@ethersproject/address@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.8.0.tgz#3007a2c352eee566ad745dca1dbbebdb50a6a983" + integrity sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/rlp" "^5.8.0" + +"@ethersproject/base64@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.8.0.tgz#61c669c648f6e6aad002c228465d52ac93ee83eb" + integrity sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ== + dependencies: + "@ethersproject/bytes" "^5.8.0" + +"@ethersproject/basex@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.8.0.tgz#1d279a90c4be84d1c1139114a1f844869e57d03a" + integrity sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + +"@ethersproject/bignumber@^5.7.0", "@ethersproject/bignumber@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.8.0.tgz#c381d178f9eeb370923d389284efa19f69efa5d7" + integrity sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@^5.7.0", "@ethersproject/bytes@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.8.0.tgz#9074820e1cac7507a34372cadeb035461463be34" + integrity sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A== + dependencies: + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/constants@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.8.0.tgz#12f31c2f4317b113a4c19de94e50933648c90704" + integrity sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg== + dependencies: + "@ethersproject/bignumber" "^5.8.0" + +"@ethersproject/contracts@^5.7.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.8.0.tgz#243a38a2e4aa3e757215ea64e276f8a8c9d8ed73" + integrity sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ== + dependencies: + "@ethersproject/abi" "^5.8.0" + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + +"@ethersproject/hash@^5.7.0", "@ethersproject/hash@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.8.0.tgz#b8893d4629b7f8462a90102572f8cd65a0192b4c" + integrity sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA== + dependencies: + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/base64" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + +"@ethersproject/hdnode@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.8.0.tgz#a51ae2a50bcd48ef6fd108c64cbae5e6ff34a761" + integrity sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA== + dependencies: + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/basex" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/pbkdf2" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/sha2" "^5.8.0" + "@ethersproject/signing-key" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/wordlists" "^5.8.0" + +"@ethersproject/json-wallets@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.8.0.tgz#d18de0a4cf0f185f232eb3c17d5e0744d97eb8c9" + integrity sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w== + dependencies: + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/hdnode" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/pbkdf2" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/random" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.8.0.tgz#d2123a379567faf2d75d2aaea074ffd4df349e6a" + integrity sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng== + dependencies: + "@ethersproject/bytes" "^5.8.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.8.0.tgz#f0232968a4f87d29623a0481690a2732662713d6" + integrity sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA== + +"@ethersproject/networks@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.8.0.tgz#8b4517a3139380cba9fb00b63ffad0a979671fde" + integrity sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg== + dependencies: + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/pbkdf2@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.8.0.tgz#cd2621130e5dd51f6a0172e63a6e4a0c0a0ec37e" + integrity sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/sha2" "^5.8.0" + +"@ethersproject/properties@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.8.0.tgz#405a8affb6311a49a91dabd96aeeae24f477020e" + integrity sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw== + dependencies: + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/providers@^5.7.2": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.8.0.tgz#6c2ae354f7f96ee150439f7de06236928bc04cb4" + integrity sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw== + dependencies: + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/base64" "^5.8.0" + "@ethersproject/basex" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/networks" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/random" "^5.8.0" + "@ethersproject/rlp" "^5.8.0" + "@ethersproject/sha2" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/web" "^5.8.0" + bech32 "1.1.4" + ws "8.18.0" + +"@ethersproject/random@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.8.0.tgz#1bced04d49449f37c6437c701735a1a022f0057a" + integrity sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/rlp@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.8.0.tgz#5a0d49f61bc53e051532a5179472779141451de5" + integrity sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/sha2@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.8.0.tgz#8954a613bb78dac9b46829c0a95de561ef74e5e1" + integrity sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@^5.7.0", "@ethersproject/signing-key@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.8.0.tgz#9797e02c717b68239c6349394ea85febf8893119" + integrity sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + bn.js "^5.2.1" + elliptic "6.6.1" + hash.js "1.1.7" + +"@ethersproject/strings@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.8.0.tgz#ad79fafbf0bd272d9765603215ac74fd7953908f" + integrity sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + +"@ethersproject/transactions@^5.7.0", "@ethersproject/transactions@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.8.0.tgz#1e518822403abc99def5a043d1c6f6fe0007e46b" + integrity sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg== + dependencies: + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/constants" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/rlp" "^5.8.0" + "@ethersproject/signing-key" "^5.8.0" + +"@ethersproject/wallet@^5.7.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.8.0.tgz#49c300d10872e6986d953e8310dc33d440da8127" + integrity sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA== + dependencies: + "@ethersproject/abstract-provider" "^5.8.0" + "@ethersproject/abstract-signer" "^5.8.0" + "@ethersproject/address" "^5.8.0" + "@ethersproject/bignumber" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/hdnode" "^5.8.0" + "@ethersproject/json-wallets" "^5.8.0" + "@ethersproject/keccak256" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/random" "^5.8.0" + "@ethersproject/signing-key" "^5.8.0" + "@ethersproject/transactions" "^5.8.0" + "@ethersproject/wordlists" "^5.8.0" + +"@ethersproject/web@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.8.0.tgz#3e54badc0013b7a801463a7008a87988efce8a37" + integrity sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw== + dependencies: + "@ethersproject/base64" "^5.8.0" + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + +"@ethersproject/wordlists@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.8.0.tgz#7a5654ee8d1bb1f4dbe43f91d217356d650ad821" + integrity sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg== + dependencies: + "@ethersproject/bytes" "^5.8.0" + "@ethersproject/hash" "^5.8.0" + "@ethersproject/logger" "^5.8.0" + "@ethersproject/properties" "^5.8.0" + "@ethersproject/strings" "^5.8.0" + "@grpc/grpc-js@1.12.6", "@grpc/grpc-js@^1.8.0", "@grpc/grpc-js@^1.8.13": version "1.12.6" resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.12.6.tgz#a3586ffdfb6a1f5cd5b4866dec9074c4a1e65472" @@ -156,6 +491,56 @@ protobufjs "^7.2.5" yargs "^17.7.2" +"@irys/arweave@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@irys/arweave/-/arweave-0.0.2.tgz#c0e73eb8c15e323342d33ea92701d4036fd22ae3" + integrity sha512-ddE5h4qXbl0xfGlxrtBIwzflaxZUDlDs43TuT0u1OMfyobHul4AA1VEX72Rpzw2bOh4vzoytSqA1jCM7x9YtHg== + dependencies: + asn1.js "^5.4.1" + async-retry "^1.3.3" + axios "^1.4.0" + base64-js "^1.5.1" + bignumber.js "^9.1.1" + +"@irys/query@^0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@irys/query/-/query-0.0.1.tgz#c0aa3eff9eef585d2b3d8d9e358b1c5942015414" + integrity sha512-7TCyR+Qn+F54IQQx5PlERgqNwgIQik8hY55iZl/silTHhCo1MI2pvx5BozqPUVCc8/KqRsc2nZd8Bc29XGUjRQ== + dependencies: + async-retry "^1.3.3" + axios "^1.4.0" + +"@irys/sdk@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@irys/sdk/-/sdk-0.0.2.tgz#36e86d44143ce6f7576fd3fe53800fe842697de8" + integrity sha512-un/e/CmTpgT042gDwCN3AtISrR9OYGMY6V+442pFmSWKrwrsDoIXZ8VlLiYKnrtTm+yquGhjfYy0LDqGWq41pA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/contracts" "^5.7.0" + "@ethersproject/providers" "^5.7.2" + "@ethersproject/wallet" "^5.7.0" + "@irys/query" "^0.0.1" + "@near-js/crypto" "^0.0.3" + "@near-js/keystores-browser" "^0.0.3" + "@near-js/providers" "^0.0.4" + "@near-js/transactions" "^0.1.0" + "@solana/web3.js" "^1.36.0" + "@supercharge/promise-pool" "^3.0.0" + algosdk "^1.13.1" + aptos "=1.8.5" + arbundles "^0.10.0" + async-retry "^1.3.3" + axios "^1.4.0" + base64url "^3.0.1" + bignumber.js "^9.0.1" + bs58 "5.0.0" + commander "^8.2.0" + csv "5.5.3" + inquirer "^8.2.0" + js-sha256 "^0.9.0" + mime-types "^2.1.34" + near-seed-phrase "^0.2.0" + "@isaacs/ttlcache@^1.4.1": version "1.4.1" resolved "https://registry.yarnpkg.com/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz#21fb23db34e9b6220c6ba023a0118a2dd3461ea2" @@ -210,7 +595,17 @@ resolved "https://registry.yarnpkg.com/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c" integrity sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw== -"@metaplex-foundation/beet-solana@^0.3.0": +"@metaplex-foundation/beet-solana@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.4.0.tgz#52891e78674aaa54e0031f1bca5bfbc40de12e8d" + integrity sha512-B1L94N3ZGMo53b0uOSoznbuM5GBNJ8LwSeznxBxJ+OThvfHQ4B5oMUqb+0zdLRfkKGS7Q6tpHK9P+QK0j3w2cQ== + dependencies: + "@metaplex-foundation/beet" ">=0.1.0" + "@solana/web3.js" "^1.56.2" + bs58 "^5.0.0" + debug "^4.3.4" + +"@metaplex-foundation/beet-solana@^0.3.0", "@metaplex-foundation/beet-solana@^0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.3.1.tgz#4b37cda5c7f32ffd2bdd8b3164edc05c6463ab35" integrity sha512-tgyEl6dvtLln8XX81JyBvWjIiEcjTkUwZbrM5dIobTmoqMuGewSyk9CClno8qsMsFdB5T3jC91Rjeqmu/6xk2g== @@ -220,6 +615,25 @@ bs58 "^5.0.0" debug "^4.3.4" +"@metaplex-foundation/beet-solana@^0.4.0": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.4.1.tgz#255747aa7feee1c20202146a752c057feca1948f" + integrity sha512-/6o32FNUtwK8tjhotrvU/vorP7umBuRFvBZrC6XCk51aKidBHe5LPVPA5AjGPbV3oftMfRuXPNd9yAGeEqeCDQ== + dependencies: + "@metaplex-foundation/beet" ">=0.1.0" + "@solana/web3.js" "^1.56.2" + bs58 "^5.0.0" + debug "^4.3.4" + +"@metaplex-foundation/beet@0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.7.1.tgz#0975314211643f87b5f6f3e584fa31abcf4c612c" + integrity sha512-hNCEnS2WyCiYyko82rwuISsBY3KYpe828ubsd2ckeqZr7tl0WVLivGkoyA/qdiaaHEBGdGl71OpfWa2rqL3DiA== + dependencies: + ansicolors "^0.3.2" + bn.js "^5.2.0" + debug "^4.3.3" + "@metaplex-foundation/beet@>=0.1.0", "@metaplex-foundation/beet@^0.7.1": version "0.7.2" resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.7.2.tgz#fa4726e4cfd4fb6fed6cddc9b5213c1c2a2d0b77" @@ -239,6 +653,123 @@ bn.js "^5.2.0" debug "^4.3.3" +"@metaplex-foundation/beet@^0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.6.1.tgz#6331bdde0648bf2cae6f9e482f8e3552db05d69f" + integrity sha512-OYgnijLFzw0cdUlRKH5POp0unQECPOW9muJ2X3QIVyak5G6I6l/rKo72sICgPLIFKdmsi2jmnkuLY7wp14iXdw== + dependencies: + ansicolors "^0.3.2" + bn.js "^5.2.0" + debug "^4.3.3" + +"@metaplex-foundation/cusper@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/cusper/-/cusper-0.0.2.tgz#dc2032a452d6c269e25f016aa4dd63600e2af975" + integrity sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA== + +"@metaplex-foundation/js@0.20.1": + version "0.20.1" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/js/-/js-0.20.1.tgz#654974dfdb163435f9583478256e5917e2187a7b" + integrity sha512-aqiLoEiToXdfI5pS+17/GN/dIO2D31gLoVQvEKDQi9XcnOPVhfJerXDmwgKbhp79OGoYxtlvVw+b2suacoUzGQ== + dependencies: + "@irys/sdk" "^0.0.2" + "@metaplex-foundation/beet" "0.7.1" + "@metaplex-foundation/mpl-auction-house" "^2.3.0" + "@metaplex-foundation/mpl-bubblegum" "^0.6.2" + "@metaplex-foundation/mpl-candy-guard" "^0.3.0" + "@metaplex-foundation/mpl-candy-machine" "^5.0.0" + "@metaplex-foundation/mpl-candy-machine-core" "^0.1.2" + "@metaplex-foundation/mpl-token-metadata" "^2.11.0" + "@noble/ed25519" "^1.7.1" + "@noble/hashes" "^1.1.3" + "@solana/spl-account-compression" "^0.1.8" + "@solana/spl-token" "^0.3.5" + "@solana/web3.js" "^1.63.1" + bignumber.js "^9.0.2" + bn.js "^5.2.1" + bs58 "^5.0.0" + buffer "^6.0.3" + debug "^4.3.4" + eventemitter3 "^4.0.7" + lodash.clonedeep "^4.5.0" + lodash.isequal "^4.5.0" + merkletreejs "^0.3.11" + mime "^3.0.0" + node-fetch "^2.6.7" + +"@metaplex-foundation/mpl-auction-house@^2.3.0": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-auction-house/-/mpl-auction-house-2.5.1.tgz#ea0e21e594b0db5e73f88688eb2e7c9b748b378b" + integrity sha512-O+IAdYVaoOvgACB8pm+1lF5BNEjl0COkqny2Ho8KQZwka6aC/vHbZ239yRwAMtJhf5992BPFdT4oifjyE0O+Mw== + dependencies: + "@metaplex-foundation/beet" "^0.6.1" + "@metaplex-foundation/beet-solana" "^0.3.1" + "@metaplex-foundation/cusper" "^0.0.2" + "@solana/spl-token" "^0.3.5" + "@solana/web3.js" "^1.56.2" + bn.js "^5.2.0" + +"@metaplex-foundation/mpl-bubblegum@^0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-bubblegum/-/mpl-bubblegum-0.6.2.tgz#e1b098ccef10899b0d759a03e3d4b1ae7bdc9f0c" + integrity sha512-4tF7/FFSNtpozuIGD7gMKcqK2D49eVXZ144xiowC5H1iBeu009/oj2m8Tj6n4DpYFKWJ2JQhhhk0a2q7x0Begw== + dependencies: + "@metaplex-foundation/beet" "0.7.1" + "@metaplex-foundation/beet-solana" "0.4.0" + "@metaplex-foundation/cusper" "^0.0.2" + "@metaplex-foundation/mpl-token-metadata" "^2.5.2" + "@solana/spl-account-compression" "^0.1.4" + "@solana/spl-token" "^0.1.8" + "@solana/web3.js" "^1.50.1" + bn.js "^5.2.0" + js-sha3 "^0.8.0" + +"@metaplex-foundation/mpl-candy-guard@^0.3.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-candy-guard/-/mpl-candy-guard-0.3.2.tgz#426e89793676b42e9bbb5e523303fba36ccd5281" + integrity sha512-QWXzPDz+6OR3957LtfW6/rcGvFWS/0AeHJa/BUO2VEVQxN769dupsKGtrsS8o5RzXCeap3wrCtDSNxN3dnWu4Q== + dependencies: + "@metaplex-foundation/beet" "^0.4.0" + "@metaplex-foundation/beet-solana" "^0.3.0" + "@metaplex-foundation/cusper" "^0.0.2" + "@solana/web3.js" "^1.66.2" + bn.js "^5.2.0" + +"@metaplex-foundation/mpl-candy-machine-core@^0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-candy-machine-core/-/mpl-candy-machine-core-0.1.2.tgz#07e19558d0ef120fac1d8612ae4de90d52cd4d1f" + integrity sha512-jjDkRvMR+iykt7guQ7qVnOHTZedql0lq3xqWDMaenAUCH3Xrf2zKATThhJppIVNX1/YtgBOO3lGqhaFbaI4pCw== + dependencies: + "@metaplex-foundation/beet" "^0.4.0" + "@metaplex-foundation/beet-solana" "^0.3.0" + "@metaplex-foundation/cusper" "^0.0.2" + "@solana/web3.js" "^1.56.2" + bn.js "^5.2.0" + +"@metaplex-foundation/mpl-candy-machine@^5.0.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-candy-machine/-/mpl-candy-machine-5.1.0.tgz#9469914b312ac36b7cf608123508f3f3f5080010" + integrity sha512-pjHpUpWVOCDxK3l6dXxfmJKNQmbjBqnm5ElOl1mJAygnzO8NIPQvrP89y6xSNyo8qZsJyt4ZMYUyD0TdbtKZXQ== + dependencies: + "@metaplex-foundation/beet" "^0.7.1" + "@metaplex-foundation/beet-solana" "^0.4.0" + "@metaplex-foundation/cusper" "^0.0.2" + "@solana/spl-token" "^0.3.6" + "@solana/web3.js" "^1.66.2" + +"@metaplex-foundation/mpl-token-metadata@^2.11.0", "@metaplex-foundation/mpl-token-metadata@^2.5.2": + version "2.13.0" + resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-token-metadata/-/mpl-token-metadata-2.13.0.tgz#ea498190ad4ed1d4c0b8218a72d03bd17a883d11" + integrity sha512-Fl/8I0L9rv4bKTV/RAl5YIbJe9SnQPInKvLz+xR1fEc4/VQkuCn3RPgypfUMEKWmCznzaw4sApDxy6CFS4qmJw== + dependencies: + "@metaplex-foundation/beet" "^0.7.1" + "@metaplex-foundation/beet-solana" "^0.4.0" + "@metaplex-foundation/cusper" "^0.0.2" + "@solana/spl-token" "^0.3.6" + "@solana/web3.js" "^1.66.2" + bn.js "^5.2.0" + debug "^4.3.4" + "@metaplex-foundation/rustbin@^0.3.0", "@metaplex-foundation/rustbin@^0.3.1": version "0.3.5" resolved "https://registry.yarnpkg.com/@metaplex-foundation/rustbin/-/rustbin-0.3.5.tgz#56d028afd96c2b56ad3bbea22ff454adde900e8c" @@ -265,6 +796,149 @@ snake-case "^3.0.4" spok "^1.4.3" +"@near-js/crypto@0.0.3", "@near-js/crypto@^0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.3.tgz#4a33e526ab5fa75b703427067985694a279ff8bd" + integrity sha512-3WC2A1a1cH8Cqrx+0iDjp1ASEEhxN/KHEMENYb0KZH6Hp5bXIY7Akt4quC7JlgJS5ESvEiLa40tS5h0zAhBWGw== + dependencies: + "@near-js/types" "0.0.3" + bn.js "5.2.1" + borsh "^0.7.0" + tweetnacl "^1.0.1" + +"@near-js/crypto@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.4.tgz#7bb991da25f06096de51466c6331cb185314fad8" + integrity sha512-2mSIVv6mZway1rQvmkktrXAFoUvy7POjrHNH3LekKZCMCs7qMM/23Hz2+APgxZPqoV2kjarSNOEYJjxO7zQ/rQ== + dependencies: + "@near-js/types" "0.0.4" + bn.js "5.2.1" + borsh "^0.7.0" + tweetnacl "^1.0.1" + +"@near-js/keystores-browser@^0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.3.tgz#110b847cd9c358076c2401e9462cc1140e12a908" + integrity sha512-Ve/JQ1SBxdNk3B49lElJ8Y54AoBY+yOStLvdnUIpe2FBOczzwDCkcnPcMDV0NMwVlHpEnOWICWHbRbAkI5Vs+A== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/keystores" "0.0.3" + +"@near-js/keystores@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.3.tgz#eb1e8e06936da166b5ed8dab3123eaa1bf7a8dab" + integrity sha512-mnwLYUt4Td8u1I4QE1FBx2d9hMt3ofiriE93FfOluJ4XiqRqVFakFYiHg6pExg5iEkej/sXugBUFeQ4QizUnew== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/types" "0.0.3" + +"@near-js/keystores@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.4.tgz#da03069497bb14741a4d97f7ad4746baf9a09ea7" + integrity sha512-+vKafmDpQGrz5py1liot2hYSjPGXwihveeN+BL11aJlLqZnWBgYJUWCXG+uyGjGXZORuy2hzkKK6Hi+lbKOfVA== + dependencies: + "@near-js/crypto" "0.0.4" + "@near-js/types" "0.0.4" + +"@near-js/providers@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-0.0.4.tgz#90f84d765ff90370599d027f47c098a3e7e745d0" + integrity sha512-g/2pJTYmsIlTW4mGqeRlqDN9pZeN+1E2/wfoMIf3p++boBVxVlaSebtQgawXAf2lkfhb9RqXz5pHqewXIkTBSw== + dependencies: + "@near-js/transactions" "0.1.0" + "@near-js/types" "0.0.3" + "@near-js/utils" "0.0.3" + bn.js "5.2.1" + borsh "^0.7.0" + http-errors "^1.7.2" + optionalDependencies: + node-fetch "^2.6.1" + +"@near-js/signers@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.0.3.tgz#bfc8386613295fc6b51982cf65c79bdc9307aa5e" + integrity sha512-u1R+DDIua5PY1PDFnpVYqdMgQ7c4dyeZsfqMjE7CtgzdqupgTYCXzJjBubqMlAyAx843PoXmLt6CSSKcMm0WUA== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/keystores" "0.0.3" + js-sha256 "^0.9.0" + +"@near-js/signers@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.0.4.tgz#a1904ccc718d6f87b05cd2e168f33bde0cfb269a" + integrity sha512-xCglo3U/WIGsz/izPGFMegS5Q3PxOHYB8a1E7RtVhNm5QdqTlQldLCm/BuMg2G/u1l1ZZ0wdvkqRTG9joauf3Q== + dependencies: + "@near-js/crypto" "0.0.4" + "@near-js/keystores" "0.0.4" + js-sha256 "^0.9.0" + +"@near-js/transactions@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-0.1.0.tgz#a03f529da6bb2eaf9dd0590093f2d0763b8ae72a" + integrity sha512-OrrDFqhX0rtH+6MV3U3iS+zmzcPQI+L4GJi9na4Uf8FgpaVPF0mtSmVrpUrS5CC3LwWCzcYF833xGYbXOV4Kfg== + dependencies: + "@near-js/crypto" "0.0.3" + "@near-js/signers" "0.0.3" + "@near-js/types" "0.0.3" + "@near-js/utils" "0.0.3" + bn.js "5.2.1" + borsh "^0.7.0" + js-sha256 "^0.9.0" + +"@near-js/transactions@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-0.1.1.tgz#3d4c9d8e3cf2543642d660c0c0b126f0a97d5d43" + integrity sha512-Fk83oLLFK7nz4thawpdv9bGyMVQ2i48iUtZEVYhuuuqevl17tSXMlhle9Me1ZbNyguJG/cWPdNybe1UMKpyGxA== + dependencies: + "@near-js/crypto" "0.0.4" + "@near-js/signers" "0.0.4" + "@near-js/types" "0.0.4" + "@near-js/utils" "0.0.4" + bn.js "5.2.1" + borsh "^0.7.0" + js-sha256 "^0.9.0" + +"@near-js/types@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.0.3.tgz#d504222469f4d50a6299c522fb6905ba10905bd6" + integrity sha512-gC3iGUT+r2JjVsE31YharT+voat79ToMUMLCGozHjp/R/UW1M2z4hdpqTUoeWUBGBJuVc810gNTneHGx0jvzwQ== + dependencies: + bn.js "5.2.1" + +"@near-js/types@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.0.4.tgz#d941689df41c850aeeeaeb9d498418acec515404" + integrity sha512-8TTMbLMnmyG06R5YKWuS/qFG1tOA3/9lX4NgBqQPsvaWmDsa+D+QwOkrEHDegped0ZHQwcjAXjKML1S1TyGYKg== + dependencies: + bn.js "5.2.1" + +"@near-js/utils@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-0.0.3.tgz#5e631f3dbdb7f0c6985bcbef08644db83b519978" + integrity sha512-J72n/EL0VfLRRb4xNUF4rmVrdzMkcmkwJOhBZSTWz3PAZ8LqNeU9ZConPfMvEr6lwdaD33ZuVv70DN6IIjPr1A== + dependencies: + "@near-js/types" "0.0.3" + bn.js "5.2.1" + depd "^2.0.0" + mustache "^4.0.0" + +"@near-js/utils@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-0.0.4.tgz#1a387f81974ebbfa4521c92590232be97e3335dd" + integrity sha512-mPUEPJbTCMicGitjEGvQqOe8AS7O4KkRCxqd0xuE/X6gXF1jz1pYMZn4lNUeUz2C84YnVSGLAM0o9zcN6Y4hiA== + dependencies: + "@near-js/types" "0.0.4" + bn.js "5.2.1" + depd "^2.0.0" + mustache "^4.0.0" + +"@noble/curves@1.4.2", "@noble/curves@~1.4.0": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" + integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/curves@^1.0.0", "@noble/curves@^1.4.0", "@noble/curves@^1.4.2": version "1.8.1" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.8.1.tgz#19bc3970e205c99e4bdb1c64a4785706bce497ff" @@ -272,16 +946,41 @@ dependencies: "@noble/hashes" "1.7.1" +"@noble/ed25519@^1.6.1": + version "1.7.5" + resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.5.tgz#94df8bdb9fec9c4644a56007eecb57b0e9fbd0d7" + integrity sha512-xuS0nwRMQBvSxDa7UxMb61xTiH3MxTgUfhyPUALVIe0FlOAz4sjELwyDRyUvqeEYfRSG9qNjFIycqLZppg4RSA== + "@noble/ed25519@^1.7.1": version "1.7.3" resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123" integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== +"@noble/hashes@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" + integrity sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A== + +"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@noble/hashes@1.7.1", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.1.tgz#5738f6d765710921e7a751e00c20ae091ed8db0f" integrity sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ== +"@noble/hashes@^1.1.3": + version "1.7.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.2.tgz#d53c65a21658fb02f3303e7ee3ba89d6754c64b4" + integrity sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ== + +"@noble/hashes@~1.1.1": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.5.tgz#1a0377f3b9020efe2fae03290bd2a12140c95c11" + integrity sha512-LTMZiiLc+V4v1Yi16TD6aX2gmtKszNye0pQgbaLqkvhIqP7nVsSaJsWloGQjJfJ8offaoP5GtX3yY5swbcJxxQ== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -449,6 +1148,48 @@ bs58 "^5.0.0" jito-ts "^3.0.1" +"@randlabs/communication-bridge@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@randlabs/communication-bridge/-/communication-bridge-1.0.1.tgz#d1ecfc29157afcbb0ca2d73122d67905eecb5bf3" + integrity sha512-CzS0U8IFfXNK7QaJFE4pjbxDGfPjbXBEsEaCn9FN15F+ouSAEUQkva3Gl66hrkBZOGexKFEWMwUHIDKpZ2hfVg== + +"@randlabs/myalgo-connect@^1.1.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@randlabs/myalgo-connect/-/myalgo-connect-1.4.2.tgz#ce3ad97b3889ea21da75852187511d3f6be0fa05" + integrity sha512-K9hEyUi7G8tqOp7kWIALJLVbGCByhilcy6123WfcorxWwiE1sbQupPyIU5f3YdQK6wMjBsyTWiLW52ZBMp7sXA== + dependencies: + "@randlabs/communication-bridge" "1.0.1" + +"@scure/base@~1.1.0", "@scure/base@~1.1.6": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.9.tgz#e5e142fbbfe251091f9c5f1dd4c834ac04c3dbd1" + integrity sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg== + +"@scure/bip32@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.4.0.tgz#4e1f1e196abedcef395b33b9674a042524e20d67" + integrity sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg== + dependencies: + "@noble/curves" "~1.4.0" + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + +"@scure/bip39@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.0.tgz#92f11d095bae025f166bef3defcc5bf4945d419a" + integrity sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w== + dependencies: + "@noble/hashes" "~1.1.1" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.3.0.tgz#0f258c16823ddd00739461ac31398b4e7d6a18c3" + integrity sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ== + dependencies: + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + "@sinclair/typebox@^0.24.1": version "0.24.51" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" @@ -584,6 +1325,18 @@ "@solana/codecs-strings" "2.0.0-rc.1" "@solana/errors" "2.0.0-rc.1" +"@solana/spl-account-compression@^0.1.4", "@solana/spl-account-compression@^0.1.8": + version "0.1.10" + resolved "https://registry.yarnpkg.com/@solana/spl-account-compression/-/spl-account-compression-0.1.10.tgz#b3135ce89349d6090832b3b1d89095badd57e969" + integrity sha512-IQAOJrVOUo6LCgeWW9lHuXo6JDbi4g3/RkQtvY0SyalvSWk9BIkHHe4IkAzaQw8q/BxEVBIjz8e9bNYWIAESNw== + dependencies: + "@metaplex-foundation/beet" "^0.7.1" + "@metaplex-foundation/beet-solana" "^0.4.0" + bn.js "^5.2.1" + borsh "^0.7.0" + js-sha3 "^0.8.0" + typescript-collections "^1.3.3" + "@solana/spl-token-group@^0.0.7": version "0.0.7" resolved "https://registry.yarnpkg.com/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz#83c00f0cd0bda33115468cd28b89d94f8ec1fee4" @@ -607,7 +1360,7 @@ "@solana/buffer-layout-utils" "^0.2.0" buffer "^6.0.3" -"@solana/spl-token@^0.1.6": +"@solana/spl-token@^0.1.6", "@solana/spl-token@^0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ== @@ -619,7 +1372,7 @@ buffer-layout "^1.2.0" dotenv "10.0.0" -"@solana/spl-token@^0.3.7": +"@solana/spl-token@^0.3.5", "@solana/spl-token@^0.3.6", "@solana/spl-token@^0.3.7": version "0.3.11" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.11.tgz#cdc10f9472b29b39c8983c92592cadd06627fb9a" integrity sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ== @@ -661,7 +1414,7 @@ rpc-websockets "^8.0.1" superstruct "^1.0.4" -"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.77.3", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.98.0": +"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.50.1", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.63.1", "@solana/web3.js@^1.66.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.77.3", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.98.0": version "1.98.0" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.98.0.tgz#21ecfe8198c10831df6f0cfde7f68370d0405917" integrity sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA== @@ -703,6 +1456,11 @@ rpc-websockets "^7.5.1" superstruct "^0.14.2" +"@supercharge/promise-pool@^3.0.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@supercharge/promise-pool/-/promise-pool-3.2.0.tgz#a6ab4afdf798e453a6bb51c4ae340852e1266af8" + integrity sha512-pj0cAALblTZBPtMltWOlZTQSLT07jIaFNeM8TWoJD1cQMgDB9mcMlVMoetiB35OzNJpqQ2b+QEtwiR9f20mADg== + "@swc/helpers@^0.5.11": version "0.5.15" resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.15.tgz#79efab344c5819ecf83a43f3f9f811fc84b516d7" @@ -842,6 +1600,11 @@ dependencies: undici-types "~6.20.0" +"@types/node@11.11.6": + version "11.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" + integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== + "@types/node@^12.12.54": version "12.20.55" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" @@ -989,6 +1752,11 @@ acorn@^8.11.0, acorn@^8.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + agentkeepalive@^4.2.1, agentkeepalive@^4.3.0, agentkeepalive@^4.5.0: version "4.6.0" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.6.0.tgz#35f73e94b3f40bf65f105219c623ad19c136ea6a" @@ -1016,6 +1784,27 @@ ajv@^8.0.1: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" +algo-msgpack-with-bigint@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/algo-msgpack-with-bigint/-/algo-msgpack-with-bigint-2.1.1.tgz#38bb717220525b3ff42232eefdcd9efb9ad405d6" + integrity sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ== + +algosdk@^1.13.1: + version "1.24.1" + resolved "https://registry.yarnpkg.com/algosdk/-/algosdk-1.24.1.tgz#afc4102457ae0c38a32de6b84f4d713aedfc9e89" + integrity sha512-9moZxdqeJ6GdE4N6fA/GlUP4LrbLZMYcYkt141J4Ss68OfEgH9qW0wBuZ3ZOKEx/xjc5bg7mLP2Gjg7nwrkmww== + dependencies: + algo-msgpack-with-bigint "^2.1.1" + buffer "^6.0.2" + cross-fetch "^3.1.5" + hi-base32 "^0.5.1" + js-sha256 "^0.9.0" + js-sha3 "^0.8.0" + js-sha512 "^0.8.0" + json-bigint "^1.0.0" + tweetnacl "^1.0.3" + vlq "^2.0.4" + anchor-bankrun@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/anchor-bankrun/-/anchor-bankrun-0.3.0.tgz#3789fcecbc201a2334cff228b99cc0da8ef0167e" @@ -1026,6 +1815,13 @@ ansi-colors@^4.1.1, ansi-colors@^4.1.3: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -1063,6 +1859,41 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +aptos@=1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/aptos/-/aptos-1.8.5.tgz#a17ac721066914785902b03cf1e7304495f6cd9d" + integrity sha512-iQxliWesNHjGQ5YYXCyss9eg4+bDGQWqAZa73vprqGQ9tungK0cRjUI2fmnp63Ed6UG6rurHrL+b0ckbZAOZZQ== + dependencies: + "@noble/hashes" "1.1.3" + "@scure/bip39" "1.1.0" + axios "0.27.2" + form-data "4.0.0" + tweetnacl "1.0.3" + +arbundles@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/arbundles/-/arbundles-0.10.1.tgz#1f542d9edf185a8a272994aef501a8ee12aaaa46" + integrity sha512-QYFepxessLCirvRkQK9iQmjxjHz+s50lMNGRwZwpyPWLohuf6ISyj1gkFXJHlMT+rNSrsHxb532glHnKbjwu3A== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/providers" "^5.7.2" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wallet" "^5.7.0" + "@irys/arweave" "^0.0.2" + "@noble/ed25519" "^1.6.1" + base64url "^3.0.1" + bs58 "^4.0.1" + keccak "^3.0.2" + secp256k1 "^5.0.0" + optionalDependencies: + "@randlabs/myalgo-connect" "^1.1.2" + algosdk "^1.13.1" + arweave-stream-tx "^1.1.0" + multistream "^4.1.0" + tmp-promise "^3.0.2" + arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -1085,6 +1916,23 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +arweave-stream-tx@^1.1.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/arweave-stream-tx/-/arweave-stream-tx-1.2.2.tgz#2d5c66554301baacd02586a152fbb198b422112f" + integrity sha512-bNt9rj0hbAEzoUZEF2s6WJbIz8nasZlZpxIw03Xm8fzb9gRiiZlZGW3lxQLjfc9Z0VRUWDzwtqoYeEoB/JDToQ== + dependencies: + exponential-backoff "^3.1.0" + +asn1.js@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" + integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + safer-buffer "^2.1.0" + assert@^2.0.0, assert@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" @@ -1106,6 +1954,13 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async-retry@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== + dependencies: + retry "0.13.1" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1118,7 +1973,15 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios@^1.8.3: +axios@0.27.2: + version "0.27.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" + integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== + dependencies: + follow-redirects "^1.14.9" + form-data "^4.0.0" + +axios@^1.4.0, axios@^1.8.3: version "1.8.4" resolved "https://registry.yarnpkg.com/axios/-/axios-1.8.4.tgz#78990bb4bc63d2cae072952d374835950a82f447" integrity sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw== @@ -1154,6 +2017,16 @@ base64-js@^1.3.1, base64-js@^1.5.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +base64url@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" + integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + big.js@^6.2.1, big.js@^6.2.2: version "6.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.2.2.tgz#be3bb9ac834558b53b099deef2a1d06ac6368e1a" @@ -1166,6 +2039,11 @@ bigint-buffer@^1.1.5: dependencies: bindings "^1.3.0" +bignumber.js@^9.0.0, bignumber.js@^9.0.2, bignumber.js@^9.1.1: + version "9.2.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.2.1.tgz#3ad0854ad933560a25bbc7c93bc3b7ea6edcad85" + integrity sha512-+NzaKgOUvInq9TIUZ1+DRspzf/HApkCwD4btfuasFTdrfnOxqx853TgDpMolp+uv4RpRp7bPcEU2zKr9+fRmyw== + bignumber.js@^9.0.1: version "9.1.2" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" @@ -1183,11 +2061,48 @@ bindings@^1.3.0: dependencies: file-uri-to-path "1.0.0" -bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bip39-light@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/bip39-light/-/bip39-light-1.0.7.tgz#06a72f251b89389a136d3f177f29b03342adc5ba" + integrity sha512-WDTmLRQUsiioBdTs9BmSEmkJza+8xfJmptsNJjxnoq3EydSa/ZBXT6rm66KoT3PJIRYMnhSKNR7S9YL1l7R40Q== + dependencies: + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + +bip39@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" + integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + +bl@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + +bn.js@4.11.6: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== + +bn.js@5.2.1, bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== +bn.js@^4.0.0, bn.js@^4.11.9: + version "4.12.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.1.tgz#215741fe3c9dba2d7e12c001d0cfdbae43975ba7" + integrity sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg== + borsh@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" @@ -1219,11 +2134,23 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + browser-stdout@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== +bs58@5.0.0, bs58@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279" + integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ== + dependencies: + base-x "^4.0.0" + bs58@^4.0.0, bs58@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" @@ -1231,13 +2158,6 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" -bs58@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279" - integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ== - dependencies: - base-x "^4.0.0" - bs58@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/bs58/-/bs58-6.0.0.tgz#a2cda0130558535dd281a2f8697df79caaf425d8" @@ -1250,7 +2170,12 @@ buffer-layout@^1.2.0, buffer-layout@^1.2.2: resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== -buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3, buffer@~6.0.3: +buffer-reverse@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-reverse/-/buffer-reverse-1.0.1.tgz#49283c8efa6f901bc01fa3304d06027971ae2f60" + integrity sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg== + +buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.2, buffer@^6.0.3, buffer@~6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== @@ -1258,6 +2183,14 @@ buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + bufferutil@^4.0.1: version "4.0.9" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.9.tgz#6e81739ad48a95cad45a279588e13e95e24a800a" @@ -1328,7 +2261,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@~4.1.2: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@~4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1341,6 +2274,11 @@ chalk@^5.3.0: resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + check-error@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" @@ -1368,6 +2306,31 @@ ci-info@^3.2.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== +cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.6.tgz#8fe672437d01cd6c4561af5334e0cc50ff1955f7" + integrity sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw== + dependencies: + inherits "^2.0.4" + safe-buffer "^5.2.1" + +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-spinners@^2.5.0: + version "2.9.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" + integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== + +cli-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" + integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== + cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -1391,6 +2354,11 @@ clone@2.x: resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -1432,11 +2400,39 @@ commander@^2.20.3: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^8.2.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@1.1.7, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -1463,6 +2459,36 @@ crypto-hash@^1.3.0: resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== +crypto-js@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" + integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== + +csv-generate@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/csv-generate/-/csv-generate-3.4.3.tgz#bc42d943b45aea52afa896874291da4b9108ffff" + integrity sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw== + +csv-parse@^4.16.3: + version "4.16.3" + resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.16.3.tgz#7ca624d517212ebc520a36873c3478fa66efbaf7" + integrity sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg== + +csv-stringify@^5.6.5: + version "5.6.5" + resolved "https://registry.yarnpkg.com/csv-stringify/-/csv-stringify-5.6.5.tgz#c6d74badda4b49a79bf4e72f91cce1e33b94de00" + integrity sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A== + +csv@5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/csv/-/csv-5.5.3.tgz#cd26c1e45eae00ce6a9b7b27dcb94955ec95207d" + integrity sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g== + dependencies: + csv-generate "^3.4.3" + csv-parse "^4.16.3" + csv-stringify "^5.6.5" + stream-transform "^2.1.3" + debug@^4.0.1, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5: version "4.4.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" @@ -1492,6 +2518,13 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + define-data-property@^1.0.1, define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" @@ -1520,6 +2553,16 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== +depd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== + diff-sequences@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" @@ -1576,6 +2619,19 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" +elliptic@6.6.1, elliptic@^6.5.7: + version "6.6.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" + integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -1787,6 +2843,31 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +ethereum-bloom-filters@^1.0.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz#8294f074c1a6cbd32c39d2cc77ce86ff14797dab" + integrity sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA== + dependencies: + "@noble/hashes" "^1.4.0" + +ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" + integrity sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg== + dependencies: + "@noble/curves" "1.4.2" + "@noble/hashes" "1.4.0" + "@scure/bip32" "1.4.0" + "@scure/bip39" "1.3.0" + +ethjs-unit@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + integrity sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw== + dependencies: + bn.js "4.11.6" + number-to-bn "1.7.0" + eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -1808,6 +2889,20 @@ expect@^28.0.0: jest-message-util "^28.1.3" jest-util "^28.1.3" +exponential-backoff@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.2.tgz#a8f26adb96bf78e8cd8ad1037928d5e5c0679d91" + integrity sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA== + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + eyes@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" @@ -1861,6 +2956,13 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +figures@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" + integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -1923,7 +3025,7 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== -follow-redirects@^1.15.6: +follow-redirects@^1.14.9, follow-redirects@^1.15.6: version "1.15.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== @@ -1935,6 +3037,15 @@ for-each@^0.3.3: dependencies: is-callable "^1.2.7" +form-data@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c" @@ -2087,6 +3198,23 @@ has-tostringtag@^1.0.2: dependencies: has-symbols "^1.0.3" +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + hasown@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" @@ -2099,6 +3227,31 @@ he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +hi-base32@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/hi-base32/-/hi-base32-0.5.1.tgz#1279f2ddae2673219ea5870c2121d2a33132857e" + integrity sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +http-errors@^1.7.2: + version "1.8.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" + integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.1" + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -2106,6 +3259,13 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + iconv-lite@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" @@ -2113,7 +3273,7 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -ieee754@^1.2.1: +ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -2149,11 +3309,32 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inquirer@^8.2.0: + version "8.2.6" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.6.tgz#733b74888195d8d400a67ac332011b5fae5ea562" + integrity sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg== + dependencies: + ansi-escapes "^4.2.1" + chalk "^4.1.1" + cli-cursor "^3.1.0" + cli-width "^3.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.21" + mute-stream "0.0.8" + ora "^5.4.1" + run-async "^2.4.0" + rxjs "^7.5.5" + string-width "^4.1.0" + strip-ansi "^6.0.0" + through "^2.3.6" + wrap-ansi "^6.0.1" + is-arguments@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.2.0.tgz#ad58c6aecf563b78ef2bf04df540da8f5d7d8e1b" @@ -2201,6 +3382,16 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-nan@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" @@ -2345,6 +3536,16 @@ js-sha256@^0.9.0: resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== +js-sha3@0.8.0, js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-sha512@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha512/-/js-sha512-0.8.0.tgz#dd22db8d02756faccf19f218e3ed61ec8249f7d4" + integrity sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -2365,6 +3566,13 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +json-bigint@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" + integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== + dependencies: + bignumber.js "^9.0.0" + json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -2400,6 +3608,15 @@ just-extend@^6.2.0: resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-6.2.0.tgz#b816abfb3d67ee860482e7401564672558163947" integrity sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw== +keccak@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + keyv@^4.5.3: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" @@ -2427,11 +3644,21 @@ lodash.camelcase@^4.3.0: resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -2442,7 +3669,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@4.17.21: +lodash@4.17.21, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2489,11 +3716,36 @@ math-intrinsics@^1.1.0: resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== +merkletreejs@^0.3.11: + version "0.3.11" + resolved "https://registry.yarnpkg.com/merkletreejs/-/merkletreejs-0.3.11.tgz#e0de05c3ca1fd368de05a12cb8efb954ef6fc04f" + integrity sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ== + dependencies: + bignumber.js "^9.0.1" + buffer-reverse "^1.0.1" + crypto-js "^4.2.0" + treeify "^1.1.0" + web3-utils "^1.3.4" + +micro-ftch@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" + integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== + micromatch@^4.0.4, micromatch@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" @@ -2507,13 +3759,33 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12: +mime-types@^2.1.12, mime-types@^2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" +mime@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" + integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -2528,6 +3800,11 @@ minimatch@^5.0.1, minimatch@^5.1.6: dependencies: brace-expansion "^2.0.1" +mixme@^0.5.1: + version "0.5.10" + resolved "https://registry.yarnpkg.com/mixme/-/mixme-0.5.10.tgz#d653b2984b75d9018828f1ea333e51717ead5f51" + integrity sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q== + mocha@10.7.3: version "10.7.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" @@ -2559,6 +3836,24 @@ ms@^2.0.0, ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +multistream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/multistream/-/multistream-4.1.0.tgz#7bf00dfd119556fbc153cff3de4c6d477909f5a8" + integrity sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw== + dependencies: + once "^1.4.0" + readable-stream "^3.6.0" + +mustache@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" + integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== + +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + nanoid@3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" @@ -2569,6 +3864,25 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +near-hd-key@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/near-hd-key/-/near-hd-key-1.2.1.tgz#f508ff15436cf8a439b543220f3cc72188a46756" + integrity sha512-SIrthcL5Wc0sps+2e1xGj3zceEa68TgNZDLuCx0daxmfTP7sFTB3/mtE2pYhlFsCxWoMn+JfID5E1NlzvvbRJg== + dependencies: + bip39 "3.0.2" + create-hmac "1.1.7" + tweetnacl "1.0.3" + +near-seed-phrase@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/near-seed-phrase/-/near-seed-phrase-0.2.1.tgz#7d5b54d5e836d295f10b0bdfdae9086443651d20" + integrity sha512-feMuums+kVL3LSuPcP4ld07xHCb2mu6z48SGfP3W+8tl1Qm5xIcjiQzY2IDPBvFgajRDxWSb8GzsRHoInazByw== + dependencies: + bip39-light "^1.0.7" + bs58 "^4.0.1" + near-hd-key "^1.2.1" + tweetnacl "^1.0.2" + nise@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/nise/-/nise-6.1.1.tgz#78ea93cc49be122e44cb7c8fdf597b0e8778b64a" @@ -2588,6 +3902,16 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + node-cache@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/node-cache/-/node-cache-5.1.2.tgz#f264dc2ccad0a780e76253a694e9fd0ed19c398d" @@ -2595,14 +3919,14 @@ node-cache@5.1.2: dependencies: clone "2.x" -node-fetch@^2.6.7, node-fetch@^2.7.0: +node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" -node-gyp-build@^4.3.0: +node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: version "4.8.4" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.4.tgz#8a70ee85464ae52327772a90d66c6077a900cfc8" integrity sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ== @@ -2612,6 +3936,14 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +number-to-bn@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + integrity sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig== + dependencies: + bn.js "4.11.6" + strip-hex-prefix "1.0.0" + object-is@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" @@ -2644,13 +3976,20 @@ object.assign@^4.1.4: has-symbols "^1.1.0" object-keys "^1.1.1" -once@^1.3.0: +once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + optionator@^0.9.1: version "0.9.4" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" @@ -2663,6 +4002,26 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.5" +ora@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -2719,6 +4078,17 @@ pathval@^1.1.1: resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== +pbkdf2@^3.0.9: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + picocolors@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" @@ -2804,7 +4174,7 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -randombytes@^2.1.0: +randombytes@^2.0.1, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -2816,6 +4186,15 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== +readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -2848,6 +4227,19 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + +retry@0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + reusify@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" @@ -2860,6 +4252,14 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + rpc-websockets@7.5.1: version "7.5.1" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.1.tgz#e0a05d525a97e7efc31a0617f093a13a2e10c401" @@ -2913,6 +4313,11 @@ rpc-websockets@^9.0.2: bufferutil "^4.0.1" utf-8-validate "^5.0.2" +run-async@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -2920,7 +4325,14 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@^5.0.1, safe-buffer@^5.1.0: +rxjs@^7.5.5: + version "7.8.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.2.tgz#955bc473ed8af11a002a2be52071bf475638607b" + integrity sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA== + dependencies: + tslib "^2.1.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -2934,11 +4346,25 @@ safe-regex-test@^1.1.0: es-errors "^1.3.0" is-regex "^1.2.1" -"safer-buffer@>= 2.1.2 < 3.0.0": +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +scrypt-js@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-5.0.1.tgz#dc2c86187d48ff2da756f0f7e96417ee03c414b1" + integrity sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA== + dependencies: + elliptic "^6.5.7" + node-addon-api "^5.0.0" + node-gyp-build "^4.2.0" + semver@^7.2.1, semver@^7.3.5, semver@^7.3.7: version "7.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" @@ -2963,6 +4389,19 @@ set-function-length@^1.2.2: gopd "^1.0.1" has-property-descriptors "^1.0.2" +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -2975,6 +4414,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + sinon@18.0.1: version "18.0.1" resolved "https://registry.yarnpkg.com/sinon/-/sinon-18.0.1.tgz#464334cdfea2cddc5eda9a4ea7e2e3f0c7a91c5e" @@ -3068,6 +4512,18 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" +"statuses@>= 1.5.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== + +stream-transform@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/stream-transform/-/stream-transform-2.1.3.tgz#a1c3ecd72ddbf500aa8d342b0b9df38f5aa598e3" + integrity sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ== + dependencies: + mixme "^0.5.1" + strict-event-emitter-types@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-event-emitter-types/-/strict-event-emitter-types-2.0.0.tgz#05e15549cb4da1694478a53543e4e2f4abcf277f" @@ -3082,6 +4538,13 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -3089,6 +4552,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -3156,11 +4626,30 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -"through@>=2.2.7 <3": +"through@>=2.2.7 <3", through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== +tmp-promise@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-3.0.3.tgz#60a1a1cc98c988674fcbfd23b6e3367bdeac4ce7" + integrity sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ== + dependencies: + tmp "^0.2.0" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmp@^0.2.0: + version "0.2.3" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" + integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -3168,6 +4657,11 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + toml@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" @@ -3183,6 +4677,11 @@ traverse-chain@~0.1.0: resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" integrity sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg== +treeify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/treeify/-/treeify-1.1.0.tgz#4e31c6a463accd0943879f30667c4fdaff411bb8" + integrity sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A== + ts-node@10.9.2: version "10.9.2" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" @@ -3207,7 +4706,7 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.8.0: +tslib@^2.0.3, tslib@^2.1.0, tslib@^2.8.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -3224,7 +4723,7 @@ tweetnacl-util@0.15.1: resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== -tweetnacl@1.0.3: +tweetnacl@1.0.3, tweetnacl@^1.0.1, tweetnacl@^1.0.2, tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== @@ -3251,6 +4750,16 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +typescript-collections@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/typescript-collections/-/typescript-collections-1.3.3.tgz#62d50d93c018c094d425eabee649f00ec5cc0fea" + integrity sha512-7sI4e/bZijOzyURng88oOFZCISQPTHozfE2sUu5AviFYk5QV7fYGb6YiDl+vKjF/pICA354JImBImL9XJWUvdQ== + typescript@4.9.5: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" @@ -3280,6 +4789,16 @@ utf-8-validate@^5.0.2: dependencies: node-gyp-build "^4.3.0" +utf8@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + util@^0.12.5: version "0.12.5" resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" @@ -3306,6 +4825,32 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== +vlq@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/vlq/-/vlq-2.0.4.tgz#6057b85729245b9829e3cc7755f95b228d4fe041" + integrity sha512-aodjPa2wPQFkra1G8CzJBTHXhgk3EVSwxSWXNPr1fgdFLUb8kvLV1iEb6rFgasIsjP82HWI6dsb5Io26DDnasA== + +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + +web3-utils@^1.3.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.4.tgz#0daee7d6841641655d8b3726baf33b08eda1cbec" + integrity sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A== + dependencies: + "@ethereumjs/util" "^8.1.0" + bn.js "^5.2.1" + ethereum-bloom-filters "^1.0.6" + ethereum-cryptography "^2.1.2" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + utf8 "3.0.0" + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -3348,6 +4893,15 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== +wrap-ansi@^6.0.1: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -3362,6 +4916,11 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +ws@8.18.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + ws@^7.5.10: version "7.5.10" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" diff --git a/tests/lpPool.ts b/tests/lpPool.ts new file mode 100644 index 000000000..05831696e --- /dev/null +++ b/tests/lpPool.ts @@ -0,0 +1,108 @@ +import * as anchor from '@coral-xyz/anchor'; +import { assert } from 'chai'; + +import { Program } from '@coral-xyz/anchor'; + +import { AccountInfo, Keypair, PublicKey } from '@solana/web3.js'; + +import { + BN, + TestClient, + QUOTE_PRECISION, + UserStatsAccount, + parseLogs, + getLpPoolPublicKey, +} from '../sdk/src'; + +import { + initializeQuoteSpotMarket, + mockUSDCMint, + mockUserUSDCAccount, + printTxLogs, +} from './testHelpers'; +import { startAnchor } from 'solana-bankrun'; +import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; +import { BankrunContextWrapper } from '../sdk/src/bankrun/bankrunConnection'; +import dotenv from 'dotenv'; +dotenv.config(); + +describe('LP Pool', () => { + const program = anchor.workspace.Drift as Program; + let bankrunContextWrapper: BankrunContextWrapper; + let bulkAccountLoader: TestBulkAccountLoader; + + let adminClient: TestClient; + let usdcMint; + const usdcAmount = new BN(100 * 10 ** 6); + + const lpPoolName = 'test pool 1'; + const tokenName = 'test pool token'; + const tokenSymbol = 'DLP-1'; + const tokenUri = 'https://token.token.token.gov'; + const tokenDecimals = 6; + const lpPoolKey = getLpPoolPublicKey(program.programId, lpPoolName); + + before(async () => { + const context = await startAnchor('', [], []); + + // @ts-ignore + bankrunContextWrapper = new BankrunContextWrapper(context); + + bulkAccountLoader = new TestBulkAccountLoader( + bankrunContextWrapper.connection, + 'processed', + 1 + ); + + usdcMint = await mockUSDCMint(bankrunContextWrapper); + + const keypair = new Keypair(); + await bankrunContextWrapper.fundKeypair(keypair, 10 ** 9); + + usdcMint = await mockUSDCMint(bankrunContextWrapper); + + adminClient = new TestClient({ + connection: bankrunContextWrapper.connection.toConnection(), + wallet: bankrunContextWrapper.provider.wallet, + programID: program.programId, + opts: { + commitment: 'confirmed', + }, + activeSubAccountId: 0, + subAccountIds: [], + perpMarketIndexes: [], + spotMarketIndexes: [0], + oracleInfos: [], + accountSubscription: { + type: 'polling', + accountLoader: bulkAccountLoader, + }, + }); + await adminClient.initialize(usdcMint.publicKey, true); + await adminClient.subscribe(); + await initializeQuoteSpotMarket(adminClient, usdcMint.publicKey); + + + const tx = await adminClient.initializeLpPool( + lpPoolName, + tokenName, + tokenSymbol, + tokenUri, + tokenDecimals, + new BN(100_000_000).mul(QUOTE_PRECISION) + ) + await printTxLogs(bankrunContextWrapper.connection.toConnection(), tx); + }); + + after(async () => { + await adminClient.unsubscribe(); + }); + + it('can create a new LP Pool', async () => { + // check LpPool created + const lpPool = await adminClient.program.account.lpPool.fetch(lpPoolKey); + console.log(lpPool); + + // check mint created with correct token params + }); +}); \ No newline at end of file From 5d3fd5e2ab826c94f1792c51dca53d43f8591a6d Mon Sep 17 00:00:00 2001 From: wphan Date: Mon, 21 Apr 2025 12:45:18 -0700 Subject: [PATCH 07/50] update accounts (#1580) --- programs/drift/src/instructions/admin.rs | 10 ++-- programs/drift/src/lib.rs | 10 +++- programs/drift/src/state/lp_pool.rs | 59 +++++++++++------------ programs/drift/src/state/lp_pool/tests.rs | 52 ++++++++++++-------- 4 files changed, 75 insertions(+), 56 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index f37141380..c0073b8c9 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -5,11 +5,9 @@ use crate::msg; use crate::signer::get_signer_seeds; use crate::state::lp_pool::LPPool; use anchor_lang::prelude::*; -use anchor_spl::{ - metadata::{ - create_metadata_accounts_v3, mpl_token_metadata::types::DataV2, CreateMetadataAccountsV3, - Metadata, - }, +use anchor_spl::metadata::{ + create_metadata_accounts_v3, mpl_token_metadata::types::DataV2, CreateMetadataAccountsV3, + Metadata, }; use anchor_spl::token::Token; use anchor_spl::token_2022::Token2022; @@ -4424,7 +4422,7 @@ pub fn handle_initialize_lp_pool( false, // Is mutable true, // Update authority is signer None, // Collection details - )?; + )?; Ok(()) } diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 1010dac77..042b00570 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1672,7 +1672,15 @@ pub mod drift { token_decimals: u8, max_aum: u64, ) -> Result<()> { - handle_initialize_lp_pool(ctx, name, token_name, token_symbol, token_uri, token_decimals, max_aum) + handle_initialize_lp_pool( + ctx, + name, + token_name, + token_symbol, + token_uri, + token_decimals, + max_aum, + ) } pub fn update_high_leverage_mode_config( diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index adcf2c19f..8420ff1cf 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,12 +1,12 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::PERCENTAGE_PRECISION_U64; +use crate::math::constants::{PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64}; use crate::math::safe_math::SafeMath; use crate::state::oracle::OracleSource; use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; +use crate::state::traits::Size; use anchor_lang::prelude::*; use borsh::{BorshDeserialize, BorshSerialize}; -use crate::state::traits::Size; #[cfg(test)] mod tests; @@ -51,7 +51,7 @@ pub struct LPPool { pub total_fees_paid: u128, // 16, 192 pub constituents: u16, // 2, 194 - pub padding: [u8; 6], + pub padding: [u8; 6], } impl Size for LPPool { @@ -111,6 +111,8 @@ impl SpotBalance for BLPosition { pub struct Constituent { /// address of the constituent pub pubkey: Pubkey, + /// underlying drift spot market index + pub spot_market_index: u16, /// idx in LPPool.constituents pub constituent_index: u16, @@ -123,13 +125,6 @@ pub struct Constituent { /// max premium to be applied to swap_fee_min when the constituent is at max deviation from target_weight /// precision: PERCENTAGE_PRECISION pub max_fee_premium: u64, - /// underlying drift spot market index - pub spot_market_index: u16, - /// oracle price at last update - /// precision: PRICE_PRECISION_I64 - pub last_oracle_price: i64, - /// timestamp of last oracle price update: - pub last_oracle_price_ts: u64, /// spot borrow-lend balance for constituent pub spot_balance: BLPosition, // should be in constituent base asset @@ -147,7 +142,7 @@ pub struct AmmConstituentDatum { pub constituent_index: u16, pub padding: [u8; 4], /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market - pub data: u64, + pub data: i64, pub last_slot: u64, } @@ -158,7 +153,7 @@ pub struct WeightDatum { pub constituent_index: u16, pub padding: [u8; 6], /// PERCENTAGE_PRECISION. The weights of the target weight matrix - pub data: u64, + pub data: i64, pub last_slot: u64, } @@ -166,7 +161,8 @@ pub struct WeightDatum { #[derive(Debug)] #[repr(C)] pub struct AmmConstituentMapping { - // flattened matrix elements, PERCENTAGE_PRECISION. Keep at the end of the account to allow expansion with new constituents. + // PERCENTAGE_PRECISION. Each datum represents the target weight for a single (AMM, Constituent) pair. + // An AMM may be partially backed by multiple Constituents pub data: Vec, } @@ -174,10 +170,6 @@ pub struct AmmConstituentMapping { #[derive(Debug)] #[repr(C)] pub struct ConstituentTargetWeights { - // rows in the matrix (VaultConstituents) - pub num_rows: u16, - // columns in the matrix (0th is the weight, 1st is the last time the weight was updated) - pub num_cols: u16, // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async pub data: Vec, } @@ -185,8 +177,6 @@ pub struct ConstituentTargetWeights { impl Default for ConstituentTargetWeights { fn default() -> Self { ConstituentTargetWeights { - num_rows: 0, - num_cols: 0, data: Vec::with_capacity(0), } } @@ -197,7 +187,7 @@ impl ConstituentTargetWeights { pub fn update_target_weights( &mut self, mapping: &AmmConstituentMapping, - amm_inventory: &[(u16, u64)], // length = mapping.num_rows + amm_inventory: &[(u16, i64)], constituents: &[Constituent], prices: &[u64], // same order as constituents aum: u64, @@ -207,37 +197,46 @@ impl ConstituentTargetWeights { assert_eq!(prices.len(), constituents.len()); self.data.clear(); - self.num_rows = constituents.len() as u16; - self.num_cols = 2; for (constituent_index, constituent) in constituents.iter().enumerate() { - let mut target_amount = 0u128; + let mut target_amount = 0i128; for (perp_market_index, inventory) in amm_inventory.iter() { - let idx = mapping.data + let idx = mapping + .data .iter() .position(|d| &d.perp_market_index == perp_market_index) .expect("missing mapping for this market index"); - let weight = mapping.data[idx].data as u128; // PERCENTAGE_PRECISION - target_amount += (*inventory) as u128 * weight / PERCENTAGE_PRECISION_U64 as u128; + let weight = mapping.data[idx].data; // PERCENTAGE_PRECISION + target_amount += + (*inventory as i128) * weight as i128 / PERCENTAGE_PRECISION_I64 as i128; } - let price = prices[constituent_index] as u128; + let price = prices[constituent_index] as i128; let target_weight = target_amount .saturating_mul(price) - .saturating_div(aum.max(1) as u128); + .saturating_div(aum.max(1) as i128); // PERCENTAGE_PRECISION capped - let weight_datum = (target_weight as u64).min(PERCENTAGE_PRECISION_U64); + let weight_datum = (target_weight).min(PERCENTAGE_PRECISION_I128); self.data.push(WeightDatum { constituent_index: constituent_index as u16, padding: [0; 6], - data: weight_datum, + data: weight_datum as i64, last_slot: slot, }); } Ok(()) } + + pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { + let weight_datum = self + .data + .iter() + .find(|d| d.constituent_index == constituent_index) + .expect("missing target weight for this constituent"); + Ok(weight_datum.data) + } } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 16b04fe1e..b433f68bb 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -6,13 +6,29 @@ mod tests { use crate::state::spot_market::SpotBalanceType; use anchor_lang::prelude::Pubkey; - const PERCENTAGE_PRECISION_U64: u64 = 1_000_000; - - fn weight_datum(constituent_index: u16, data: u64, last_slot: u64) -> WeightDatum { - WeightDatum { constituent_index, padding: [0; 6], data, last_slot } + const PERCENTAGE_PRECISION_I64: i64 = 1_000_000; + + fn weight_datum(constituent_index: u16, data: i64, last_slot: u64) -> WeightDatum { + WeightDatum { + constituent_index, + padding: [0; 6], + data, + last_slot, + } } - fn amm_const_datum(perp_market_index: u16, constituent_index: u16, data: u64, last_slot: u64) -> AmmConstituentDatum { - AmmConstituentDatum { perp_market_index, constituent_index, padding: [0; 4], data, last_slot } + fn amm_const_datum( + perp_market_index: u16, + constituent_index: u16, + data: i64, + last_slot: u64, + ) -> AmmConstituentDatum { + AmmConstituentDatum { + perp_market_index, + constituent_index, + padding: [0; 4], + data, + last_slot, + } } fn dummy_constituent(index: u16) -> Constituent { @@ -23,8 +39,6 @@ mod tests { swap_fee_min: 0, max_fee_premium: 0, spot_market_index: index, - last_oracle_price: 0, - last_oracle_price_ts: 0, spot_balance: BLPosition { scaled_balance: 0, cumulative_deposits: 0, @@ -42,7 +56,7 @@ mod tests { data: vec![amm_const_datum(0, 1, 0, 0)], }; - let amm_inventory: Vec<(u16, u64)> = vec![(0, 1_000_000)]; + let amm_inventory: Vec<(u16, i64)> = vec![(0, 1_000_000)]; let prices = vec![1_000_000]; let constituents = vec![dummy_constituent(0)]; let aum = 1_000_000; @@ -68,7 +82,7 @@ mod tests { #[test] fn test_single_full_weight() { let mapping = AmmConstituentMapping { - data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_U64, 0)], + data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0)], }; let amm_inventory = vec![(0, 1_000_000)]; @@ -90,7 +104,7 @@ mod tests { .unwrap(); assert_eq!(target.data.len(), 1); - assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_U64); + assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_I64); assert_eq!(target.data[0].last_slot, now_ts); } @@ -98,8 +112,8 @@ mod tests { fn test_multiple_constituents_partial_weights() { let mapping = AmmConstituentMapping { data: vec![ - amm_const_datum(0, 1, PERCENTAGE_PRECISION_U64 / 2, 0), - amm_const_datum(0, 2, PERCENTAGE_PRECISION_U64 / 2, 0), + amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64 / 2, 0), + amm_const_datum(0, 2, PERCENTAGE_PRECISION_I64 / 2, 0), ], }; @@ -124,7 +138,7 @@ mod tests { assert_eq!(target.data.len(), 2); for datum in &target.data { - assert_eq!(datum.data, PERCENTAGE_PRECISION_U64 / 2); + assert_eq!(datum.data, PERCENTAGE_PRECISION_I64 / 2); assert_eq!(datum.last_slot, now_ts); } } @@ -132,7 +146,7 @@ mod tests { #[test] fn test_zero_aum_safe() { let mapping = AmmConstituentMapping { - data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_U64, 0)], + data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0)], }; let amm_inventory = vec![(0, 1_000_000)]; @@ -154,17 +168,17 @@ mod tests { .unwrap(); assert_eq!(target.data.len(), 1); - assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_U64); // todo how to handle? + assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_I64); // todo how to handle? assert_eq!(target.data[0].last_slot, now_ts); } #[test] fn test_overflow_protection() { let mapping = AmmConstituentMapping { - data: vec![amm_const_datum(0, 1, u64::MAX, 0)], + data: vec![amm_const_datum(0, 1, i64::MAX, 0)], }; - let amm_inventory = vec![(0, u64::MAX)]; + let amm_inventory = vec![(0, i64::MAX)]; let prices = vec![u64::MAX]; let constituents = vec![dummy_constituent(0)]; let aum = 1; @@ -183,7 +197,7 @@ mod tests { .unwrap(); assert_eq!(target.data.len(), 1); - assert!(target.data[0].data <= PERCENTAGE_PRECISION_U64); + assert!(target.data[0].data <= PERCENTAGE_PRECISION_I64); assert_eq!(target.data[0].last_slot, now_ts); } } From 982645382cd78ca04a7f5a7bd12e0fe4d95649d0 Mon Sep 17 00:00:00 2001 From: moosecat Date: Mon, 21 Apr 2025 15:05:34 -0700 Subject: [PATCH 08/50] zero copy + permissionless crank ixs (#1581) --- programs/drift/src/instructions/admin.rs | 2 +- programs/drift/src/instructions/lp_pool.rs | 85 +++++++++++ programs/drift/src/instructions/mod.rs | 2 + programs/drift/src/state/lp_pool.rs | 112 +++++++++------ programs/drift/src/state/lp_pool/tests.rs | 39 ++++- programs/drift/src/state/mod.rs | 1 + programs/drift/src/state/zero_copy.rs | 159 +++++++++++++++++++++ 7 files changed, 352 insertions(+), 48 deletions(-) create mode 100644 programs/drift/src/instructions/lp_pool.rs create mode 100644 programs/drift/src/state/zero_copy.rs diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index c0073b8c9..5f4fe330b 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4390,7 +4390,7 @@ pub fn handle_initialize_lp_pool( last_revenue_rebalance_ts: 0, total_fees_received: 0, total_fees_paid: 0, - padding: [0; 6], + _padding: [0; 6], }; let signature_seeds = get_signer_seeds(&state.signer_nonce); diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs new file mode 100644 index 000000000..ea7b9afae --- /dev/null +++ b/programs/drift/src/instructions/lp_pool.rs @@ -0,0 +1,85 @@ +use anchor_lang::{ + prelude::{Account, AccountInfo, AccountLoader, Context, Pubkey, Signer, SolanaSysvar}, + Accounts, Result, +}; + +use crate::state::{ + lp_pool::{ + AmmConstituentDatum, AmmConstituentMappingFixed, ConstituentTargetWeightsFixed, LPPool, + WeightDatum, + }, + perp_market_map::MarketSet, + state::State, + zero_copy::{AccountZeroCopy, AccountZeroCopyMut, ZeroCopyLoader}, +}; +use solana_program::sysvar::clock::Clock; + +use super::optional_accounts::{load_maps, AccountMaps}; + +pub fn handle_update_dlp_target_weights<'info, 'c: 'info>( + ctx: Context<'_, 'info, 'c, 'info, UpdateDlpTargetWeights<'info>>, + constituent_indexes: Vec, +) -> Result<()> { + let state = &ctx.accounts.state; + let lp_pool = &ctx.accounts.lp_pool.load()?; + let slot = Clock::get()?.slot; + + let amm_constituent_mapping: AccountZeroCopy< + 'info, + AmmConstituentDatum, + AmmConstituentMappingFixed, + > = ctx.accounts.amm_constituent_mapping.load_zc()?; + + let mut target_weights: AccountZeroCopyMut<'info, WeightDatum, ConstituentTargetWeightsFixed> = + ctx.accounts.constituent_target_weights.load_zc_mut()?; + + let AccountMaps { + perp_market_map, + spot_market_map, + mut oracle_map, + } = load_maps( + &mut ctx.remaining_accounts.iter().peekable(), + &MarketSet::new(), + &MarketSet::new(), + slot, + Some(state.oracle_guard_rails), + )?; + + let mut amm_inventories: Vec<(u16, i64)> = vec![]; + let mut oracle_prices: Vec = vec![]; + for (i, datum) in amm_constituent_mapping.iter().enumerate() { + let perp_market = perp_market_map.get_ref(&datum.perp_market_index)?; + let amm_inventory = perp_market.amm.get_protocol_owned_position()?; + amm_inventories.push((datum.perp_market_index, amm_inventory)); + + let oracle_data = oracle_map.get_price_data_and_guard_rails(&( + perp_market.amm.oracle, + perp_market.amm.oracle_source, + ))?; + + oracle_prices.push(oracle_data.0.price); + } + + target_weights.update_target_weights( + &amm_constituent_mapping, + amm_inventories.as_slice(), + constituent_indexes.as_slice(), + &oracle_prices.as_slice(), + lp_pool.last_aum, + slot, + )?; + + Ok(()) +} + +#[derive(Accounts)] +pub struct UpdateDlpTargetWeights<'info> { + pub state: Box>, + #[account(mut)] + pub keeper: Signer<'info>, + /// CHECK: checked in AmmConstituentMappingZeroCopy checks + pub amm_constituent_mapping: AccountInfo<'info>, + /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks + pub constituent_target_weights: AccountInfo<'info>, + pub lp_pool: AccountLoader<'info, LPPool>, +} diff --git a/programs/drift/src/instructions/mod.rs b/programs/drift/src/instructions/mod.rs index 0caa84f73..bc6c550c5 100644 --- a/programs/drift/src/instructions/mod.rs +++ b/programs/drift/src/instructions/mod.rs @@ -2,6 +2,7 @@ pub use admin::*; pub use constraints::*; pub use if_staker::*; pub use keeper::*; +pub use lp_pool::*; pub use pyth_lazer_oracle::*; pub use pyth_pull_oracle::*; pub use user::*; @@ -10,6 +11,7 @@ mod admin; mod constraints; mod if_staker; mod keeper; +mod lp_pool; pub mod optional_accounts; mod pyth_lazer_oracle; mod pyth_pull_oracle; diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 8420ff1cf..ab1cbcbc3 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,17 +1,20 @@ -use crate::error::{DriftResult, ErrorCode}; +use crate::error::DriftResult; use crate::math::casting::Cast; use crate::math::constants::{PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64}; use crate::math::safe_math::SafeMath; -use crate::state::oracle::OracleSource; -use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; +use crate::state::spot_market::{SpotBalance, SpotBalanceType}; use crate::state::traits::Size; use anchor_lang::prelude::*; +use anchor_lang::Discriminator; use borsh::{BorshDeserialize, BorshSerialize}; +use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen}; +use crate::impl_zero_copy_loader; + #[cfg(test)] mod tests; -#[account(zero_copy)] +#[account(zero_copy(unsafe))] #[derive(Default, Debug)] #[repr(C)] pub struct LPPool { @@ -40,7 +43,7 @@ pub struct LPPool { /// timestamp of last AUM slot pub last_aum_slot: u64, // 8, 152 /// timestamp of last AUM update - pub last_aum_ts: u64, // 8, 160 + pub last_aum_ts: u64, // 8, 160`` /// timestamp of last vAMM revenue rebalance pub last_revenue_rebalance_ts: u64, // 8, 168 @@ -51,7 +54,7 @@ pub struct LPPool { pub total_fees_paid: u128, // 16, 192 pub constituents: u16, // 2, 194 - pub padding: [u8; 6], + pub _padding: [u8; 6], } impl Size for LPPool { @@ -131,9 +134,6 @@ pub struct Constituent { pub padding: [u8; 16], } -// pub struct PerpConstituent { -// } - #[zero_copy] #[derive(Debug, BorshDeserialize, BorshSerialize)] #[repr(C)] @@ -146,6 +146,34 @@ pub struct AmmConstituentDatum { pub last_slot: u64, } +#[zero_copy] +pub struct AmmConstituentMappingFixed { + pub len: u32, +} + +impl HasLen for AmmConstituentMappingFixed { + fn len(&self) -> u32 { + self.len + } +} + +#[account] +#[derive(Debug)] +#[repr(C)] +pub struct AmmConstituentMapping { + // PERCENTAGE_PRECISION. Each datum represents the target weight for a single (AMM, Constituent) pair. + // An AMM may be partially backed by multiple Constituents + pub data: Vec, +} + +impl_zero_copy_loader!( + AmmConstituentMapping, + crate::id, + AmmConstituentMappingFixed, + AmmConstituentDatum, + AmmConstituentMapping::discriminator() +); + #[zero_copy] #[derive(Debug, BorshDeserialize, BorshSerialize)] #[repr(C)] @@ -157,13 +185,18 @@ pub struct WeightDatum { pub last_slot: u64, } -#[account] +#[zero_copy] #[derive(Debug)] #[repr(C)] -pub struct AmmConstituentMapping { - // PERCENTAGE_PRECISION. Each datum represents the target weight for a single (AMM, Constituent) pair. - // An AMM may be partially backed by multiple Constituents - pub data: Vec, +pub struct ConstituentTargetWeightsFixed { + /// total elements in the flattened `data` vec + pub len: u32, +} + +impl HasLen for ConstituentTargetWeightsFixed { + fn len(&self) -> u32 { + self.len + } } #[account] @@ -174,6 +207,14 @@ pub struct ConstituentTargetWeights { pub data: Vec, } +impl_zero_copy_loader!( + ConstituentTargetWeights, + crate::id, + ConstituentTargetWeightsFixed, + WeightDatum, + ConstituentTargetWeights::discriminator() +); + impl Default for ConstituentTargetWeights { fn default() -> Self { ConstituentTargetWeights { @@ -182,37 +223,32 @@ impl Default for ConstituentTargetWeights { } } -impl ConstituentTargetWeights { +impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { /// Update target weights based on amm_inventory and mapping pub fn update_target_weights( &mut self, - mapping: &AmmConstituentMapping, - amm_inventory: &[(u16, i64)], - constituents: &[Constituent], - prices: &[u64], // same order as constituents + mapping: &AccountZeroCopy<'a, AmmConstituentDatum, AmmConstituentMappingFixed>, + // (perp market index, inventory, price) + amm_inventory: &[(u16, i64)], // length = mapping.num_rows + constituents_indexes: &[u16], + prices: &[i64], // length = mapping.num_rows aum: u64, slot: u64, ) -> DriftResult<()> { - // assert_ne!(aum, 0); - assert_eq!(prices.len(), constituents.len()); - - self.data.clear(); - - for (constituent_index, constituent) in constituents.iter().enumerate() { + for (i, constituent_index) in constituents_indexes.iter().enumerate() { let mut target_amount = 0i128; for (perp_market_index, inventory) in amm_inventory.iter() { let idx = mapping - .data .iter() .position(|d| &d.perp_market_index == perp_market_index) .expect("missing mapping for this market index"); - let weight = mapping.data[idx].data; // PERCENTAGE_PRECISION + let weight = mapping.get(idx).data; // PERCENTAGE_PRECISION target_amount += (*inventory as i128) * weight as i128 / PERCENTAGE_PRECISION_I64 as i128; } - let price = prices[constituent_index] as i128; + let price = prices[i] as i128; let target_weight = target_amount .saturating_mul(price) .saturating_div(aum.max(1) as i128); @@ -220,23 +256,13 @@ impl ConstituentTargetWeights { // PERCENTAGE_PRECISION capped let weight_datum = (target_weight).min(PERCENTAGE_PRECISION_I128); - self.data.push(WeightDatum { - constituent_index: constituent_index as u16, - padding: [0; 6], - data: weight_datum as i64, - last_slot: slot, - }); + let cell = self.get_mut(*constituent_index as u32); + cell.constituent_index = *constituent_index; + cell.padding = [0; 6]; + cell.data = weight_datum as i64; + cell.last_slot = slot; } Ok(()) } - - pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { - let weight_datum = self - .data - .iter() - .find(|d| d.constituent_index == constituent_index) - .expect("missing target weight for this constituent"); - Ok(weight_datum.data) - } } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index b433f68bb..ad8bb8f12 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -4,10 +4,41 @@ mod tests { use crate::state::lp_pool::*; use crate::state::oracle::OracleSource; use crate::state::spot_market::SpotBalanceType; + use crate::state::zero_copy::ZeroCopyLoader; use anchor_lang::prelude::Pubkey; const PERCENTAGE_PRECISION_I64: i64 = 1_000_000; + fn constituent_target_weights_zc( + ) -> AccountZeroCopyMut { + let disc = ConstituentTargetWeights::discriminator(); + let fixed = ConstituentTargetWeightsFixed { len: 1 }; + let mut buf = Vec::new(); + buf.extend_from_slice(&disc); + buf.extend_from_slice(bytemuck::bytes_of(&fixed)); + buf.resize(buf.len() + std::mem::size_of::() * 1, 0); + + // 2) wrap in AccountInfo + let mut lamports = 0u64; + let pubkey = Pubkey::default(); + let owner = crate::ID; + let mut ai = AccountInfo::new( + &pubkey, + false, + true, + &mut lamports, + &mut buf, + &owner, + false, + 0, + ); + + // 3) call your loader + let mut zc: AccountZeroCopyMut = + ai.load_zc_mut().unwrap(); + zc + } + fn weight_datum(constituent_index: u16, data: i64, last_slot: u64) -> WeightDatum { WeightDatum { constituent_index, @@ -62,7 +93,7 @@ mod tests { let aum = 1_000_000; let now_ts = 1000; - let mut target = ConstituentTargetWeights::default(); + let mut target = constituent_target_weights_zc(); target .update_target_weights( &mapping, @@ -91,7 +122,7 @@ mod tests { let aum = 1_000_000; let now_ts = 1234; - let mut target = ConstituentTargetWeights::default(); + let mut target = constituent_target_weights_zc(); target .update_target_weights( &mapping, @@ -123,7 +154,7 @@ mod tests { let aum = 1_000_000; let now_ts = 999; - let mut target = ConstituentTargetWeights::default(); + let mut target = constituent_target_weights_zc(); target .update_target_weights( &mapping, @@ -180,7 +211,7 @@ mod tests { let amm_inventory = vec![(0, i64::MAX)]; let prices = vec![u64::MAX]; - let constituents = vec![dummy_constituent(0)]; + let constituents = vec![0]; let aum = 1; let now_ts = 222; diff --git a/programs/drift/src/state/mod.rs b/programs/drift/src/state/mod.rs index daadb46ce..07ef0306a 100644 --- a/programs/drift/src/state/mod.rs +++ b/programs/drift/src/state/mod.rs @@ -25,3 +25,4 @@ pub mod state; pub mod traits; pub mod user; pub mod user_map; +pub mod zero_copy; diff --git a/programs/drift/src/state/zero_copy.rs b/programs/drift/src/state/zero_copy.rs new file mode 100644 index 000000000..0c5ab29b1 --- /dev/null +++ b/programs/drift/src/state/zero_copy.rs @@ -0,0 +1,159 @@ +use crate::error::ErrorCode; +use crate::math::safe_unwrap::SafeUnwrap; +use anchor_lang::prelude::{AccountInfo, Pubkey}; +use bytemuck::{from_bytes, from_bytes_mut}; +use bytemuck::{Pod, Zeroable}; +use std::cell::{Ref, RefMut}; +use std::marker::PhantomData; + +use crate::error::DriftResult; +use crate::msg; +use crate::validate; + +pub trait HasLen { + fn len(&self) -> u32; +} + +pub struct AccountZeroCopy<'a, T, F> { + pub fixed: Ref<'a, F>, + pub data: Ref<'a, [u8]>, + _marker: PhantomData, +} + +impl<'a, T, F> AccountZeroCopy<'a, T, F> +where + T: Pod + Zeroable + Clone + Copy, + F: Pod + HasLen, +{ + pub fn len(&self) -> u32 { + self.fixed.len() + } + + pub fn get(&self, index: usize) -> &T { + let size = std::mem::size_of::(); + let start = index * size; + bytemuck::from_bytes(&self.data[start..start + size]) + } + + pub fn iter(&self) -> impl Iterator + '_ { + (0..self.len()).map(move |i| self.get(i as usize)) + } +} + +pub struct AccountZeroCopyMut<'a, T, F> { + pub fixed: RefMut<'a, F>, + pub data: RefMut<'a, [u8]>, + pub _marker: PhantomData, +} + +impl<'a, T, F> AccountZeroCopyMut<'a, T, F> +where + T: Pod + Zeroable + Clone + Copy, + F: Pod + HasLen, +{ + pub fn len(&self) -> u32 { + self.fixed.len() + } + + pub fn get_mut(&mut self, index: u32) -> &mut T { + let size = std::mem::size_of::(); + let start = index as usize * size; + bytemuck::from_bytes_mut(&mut self.data[start..start + size]) + } +} + +pub trait ZeroCopyLoader<'a, T, F> { + fn load_zc(&'a self) -> DriftResult>; + fn load_zc_mut(&'a self) -> DriftResult>; +} + +pub fn load_generic<'a, F, T>( + acct: &'a AccountInfo<'a>, + expected_disc: [u8; 8], + program_id: Pubkey, +) -> DriftResult> +where + F: Pod + HasLen, + T: Pod, +{ + validate!( + acct.owner == &program_id, + ErrorCode::DefaultError, + "invalid owner", + )?; + + let data = acct.try_borrow_data().safe_unwrap()?; + let (disc, rest) = Ref::map_split(data, |d| d.split_at(8)); + + validate!( + *disc == expected_disc, + ErrorCode::DefaultError, + "invalid discriminator", + )?; + + let hdr_size = std::mem::size_of::(); + let (hdr_bytes, body) = Ref::map_split(rest, |d| d.split_at(hdr_size)); + let fixed = Ref::map(hdr_bytes, |b| from_bytes::(b)); + Ok(AccountZeroCopy { + fixed, + data: body, + _marker: PhantomData, + }) +} + +pub fn load_generic_mut<'a, F, T>( + acct: &'a AccountInfo<'a>, + expected_disc: [u8; 8], + program_id: Pubkey, +) -> DriftResult> +where + F: Pod + HasLen, + T: Pod, +{ + validate!( + acct.owner == &program_id, + ErrorCode::DefaultError, + "invalid owner", + )?; + + let data = acct.try_borrow_mut_data().safe_unwrap()?; + let (disc, rest) = RefMut::map_split(data, |d| d.split_at_mut(8)); + + validate!( + *disc == expected_disc, + ErrorCode::DefaultError, + "invalid discriminator", + )?; + + let hdr_size = std::mem::size_of::(); + let (hdr_bytes, body) = RefMut::map_split(rest, |d| d.split_at_mut(hdr_size)); + let fixed = RefMut::map(hdr_bytes, |b| from_bytes_mut::(b)); + Ok(AccountZeroCopyMut { + fixed, + data: body, + _marker: PhantomData, + }) +} + +#[macro_export] +macro_rules! impl_zero_copy_loader { + ($Acc:ty, $ID:path, $Fixed:ty, $Elem:ty, $Disc:expr) => { + impl<'a> crate::state::zero_copy::ZeroCopyLoader<'a, $Elem, $Fixed> for AccountInfo<'a> { + fn load_zc( + self: &'a Self, + ) -> crate::error::DriftResult< + crate::state::zero_copy::AccountZeroCopy<'a, $Elem, $Fixed>, + > { + crate::state::zero_copy::load_generic::<$Fixed, $Elem>(self, $Disc, $ID()) + } + + fn load_zc_mut( + self: &'a Self, + ) -> crate::error::DriftResult< + crate::state::zero_copy::AccountZeroCopyMut<'a, $Elem, $Fixed>, + > { + crate::state::zero_copy::load_generic_mut::<$Fixed, $Elem>(self, $Disc, $ID()) + } + } + }; +} From b7e0cab7cbe354c84bf4994bbbb85abf8ada3dc3 Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Mon, 21 Apr 2025 19:19:27 -0400 Subject: [PATCH 09/50] program: support negative target weights for borrow-lend --- programs/drift/src/instructions/lp_pool.rs | 3 +- programs/drift/src/state/lp_pool.rs | 58 +++++++++++++++++----- programs/drift/src/state/lp_pool/tests.rs | 9 +++- 3 files changed, 54 insertions(+), 16 deletions(-) diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index ea7b9afae..bbaeb2543 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -6,7 +6,7 @@ use anchor_lang::{ use crate::state::{ lp_pool::{ AmmConstituentDatum, AmmConstituentMappingFixed, ConstituentTargetWeightsFixed, LPPool, - WeightDatum, + WeightDatum, WeightValidationFlags, }, perp_market_map::MarketSet, state::State, @@ -67,6 +67,7 @@ pub fn handle_update_dlp_target_weights<'info, 'c: 'info>( &oracle_prices.as_slice(), lp_pool.last_aum, slot, + WeightValidationFlags::NONE, )?; Ok(()) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index ab1cbcbc3..6961f1e06 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,15 +1,15 @@ -use crate::error::DriftResult; +use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; use crate::math::constants::{PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64}; use crate::math::safe_math::SafeMath; -use crate::state::spot_market::{SpotBalance, SpotBalanceType}; -use crate::state::traits::Size; use anchor_lang::prelude::*; use anchor_lang::Discriminator; use borsh::{BorshDeserialize, BorshSerialize}; use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen}; use crate::impl_zero_copy_loader; +use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; +use crate::state::traits::Size; #[cfg(test)] mod tests; @@ -223,8 +223,16 @@ impl Default for ConstituentTargetWeights { } } +#[derive(Clone, Copy, BorshSerialize, BorshDeserialize, PartialEq, Debug, Eq)] +pub enum WeightValidationFlags { + NONE = 0b0000_0000, + EnforceTotalWeight100 = 0b0000_0001, + NoNegativeWeights = 0b0000_0010, + NoOverweight = 0b0000_0100, +} + +/// Update target weights based on amm_inventory and mapping impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { - /// Update target weights based on amm_inventory and mapping pub fn update_target_weights( &mut self, mapping: &AccountZeroCopy<'a, AmmConstituentDatum, AmmConstituentMappingFixed>, @@ -234,7 +242,9 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { prices: &[i64], // length = mapping.num_rows aum: u64, slot: u64, + validation_flags: WeightValidationFlags, ) -> DriftResult<()> { + let mut total_weight: i128 = 0; for (i, constituent_index) in constituents_indexes.iter().enumerate() { let mut target_amount = 0i128; @@ -244,25 +254,47 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { .position(|d| &d.perp_market_index == perp_market_index) .expect("missing mapping for this market index"); let weight = mapping.get(idx).data; // PERCENTAGE_PRECISION - target_amount += - (*inventory as i128) * weight as i128 / PERCENTAGE_PRECISION_I64 as i128; + + target_amount += (*inventory as i128) + .saturating_mul(weight) + .saturating_div(PERCENTAGE_PRECISION_I64 as i128); } let price = prices[i] as i128; - let target_weight = target_amount - .saturating_mul(price) - .saturating_div(aum.max(1) as i128); - - // PERCENTAGE_PRECISION capped - let weight_datum = (target_weight).min(PERCENTAGE_PRECISION_I128); + let target_weight = if aum > 0 { + target_amount + .saturating_mul(price) + .saturating_div(aum as i128) + } else { + 0 + }; + + if (validation_flags as u8 & (WeightValidationFlags::NoNegativeWeights as u8) != 0) + && target_weight < 0 + { + return Err(ErrorCode::DefaultError); + } + if (validation_flags as u8 & (WeightValidationFlags::NoOverweight as u8) != 0) + && target_weight > PERCENTAGE_PRECISION_I64 as i128 + { + return Err(ErrorCode::DefaultError); + } let cell = self.get_mut(*constituent_index as u32); cell.constituent_index = *constituent_index; cell.padding = [0; 6]; - cell.data = weight_datum as i64; + cell.data = target_weight as i64; cell.last_slot = slot; } + if (validation_flags as u8) & WeightValidationFlags::EnforceTotalWeight100 as u8 != 0 { + let deviation = (total_weight - PERCENTAGE_PRECISION_I64 as i128).abs(); + let tolerance = 1; + if deviation > tolerance { + return Err(ErrorCode::DefaultError); + } + } + Ok(()) } } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index ad8bb8f12..bbacb84ba 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -102,6 +102,7 @@ mod tests { &prices, aum, now_ts, + WeightValidationFlags::NONE, ) .unwrap(); @@ -131,6 +132,7 @@ mod tests { &prices, aum, now_ts, + WeightValidationFlags::NONE, ) .unwrap(); @@ -163,6 +165,7 @@ mod tests { &prices, aum, now_ts, + WeightValidationFlags::NONE, ) .unwrap(); @@ -181,7 +184,7 @@ mod tests { }; let amm_inventory = vec![(0, 1_000_000)]; - let prices = vec![1_000_000]; + let prices = vec![142_000_000]; let constituents = vec![dummy_constituent(0)]; let aum = 0; let now_ts = 111; @@ -195,11 +198,12 @@ mod tests { &prices, aum, now_ts, + WeightValidationFlags::NONE, ) .unwrap(); assert_eq!(target.data.len(), 1); - assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_I64); // todo how to handle? + assert_eq!(target.data[0].data, 0); // no target assert_eq!(target.data[0].last_slot, now_ts); } @@ -224,6 +228,7 @@ mod tests { &prices, aum, now_ts, + WeightValidationFlags::NONE, ) .unwrap(); From 57b4ec291e6a0bc2f4e8c3cf6d40b2c7099c407e Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 22 Apr 2025 13:53:02 -0700 Subject: [PATCH 10/50] fix tests to work with zero copy --- programs/drift/src/instructions/lp_pool.rs | 2 +- programs/drift/src/state/lp_pool.rs | 41 ++- programs/drift/src/state/lp_pool/tests.rs | 344 ++++++++++++++------- programs/drift/src/state/zero_copy.rs | 24 +- 4 files changed, 282 insertions(+), 129 deletions(-) diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index bbaeb2543..f0837bcea 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -47,7 +47,7 @@ pub fn handle_update_dlp_target_weights<'info, 'c: 'info>( let mut amm_inventories: Vec<(u16, i64)> = vec![]; let mut oracle_prices: Vec = vec![]; - for (i, datum) in amm_constituent_mapping.iter().enumerate() { + for (_, datum) in amm_constituent_mapping.iter().enumerate() { let perp_market = perp_market_map.get_ref(&datum.perp_market_index)?; let amm_inventory = perp_market.amm.get_protocol_owned_position()?; amm_inventories.push((datum.perp_market_index, amm_inventory)); diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 6961f1e06..f286a488b 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,14 +1,14 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::{PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64}; +use crate::math::constants::PERCENTAGE_PRECISION_I64; use crate::math::safe_math::SafeMath; use anchor_lang::prelude::*; use anchor_lang::Discriminator; use borsh::{BorshDeserialize, BorshSerialize}; -use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen}; +use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen, ToZeroCopy, ZeroCopyLoader}; use crate::impl_zero_copy_loader; -use crate::state::spot_market::{SpotBalance, SpotBalanceType, SpotMarket}; +use crate::state::spot_market::{SpotBalance, SpotBalanceType}; use crate::state::traits::Size; #[cfg(test)] @@ -147,8 +147,11 @@ pub struct AmmConstituentDatum { } #[zero_copy] +#[derive(Debug, Default)] +#[repr(C)] pub struct AmmConstituentMappingFixed { pub len: u32, + pub _pad: [u8; 4], } impl HasLen for AmmConstituentMappingFixed { @@ -186,11 +189,12 @@ pub struct WeightDatum { } #[zero_copy] -#[derive(Debug)] +#[derive(Debug, Default)] #[repr(C)] pub struct ConstituentTargetWeightsFixed { /// total elements in the flattened `data` vec pub len: u32, + pub _pad: [u8; 4], } impl HasLen for ConstituentTargetWeightsFixed { @@ -253,10 +257,10 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { .iter() .position(|d| &d.perp_market_index == perp_market_index) .expect("missing mapping for this market index"); - let weight = mapping.get(idx).data; // PERCENTAGE_PRECISION + let weight = mapping.get(idx as u32).data; // PERCENTAGE_PRECISION target_amount += (*inventory as i128) - .saturating_mul(weight) + .saturating_mul(weight as i128) .saturating_div(PERCENTAGE_PRECISION_I64 as i128); } @@ -280,7 +284,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { return Err(ErrorCode::DefaultError); } - let cell = self.get_mut(*constituent_index as u32); + let cell = self.get_mut(i as u32); cell.constituent_index = *constituent_index; cell.padding = [0; 6]; cell.data = target_weight as i64; @@ -298,3 +302,26 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { Ok(()) } } + +impl<'a> AccountZeroCopyMut<'a, AmmConstituentDatum, AmmConstituentMappingFixed> { + pub fn add_amm_constituent_datum(&mut self, datum: AmmConstituentDatum) -> DriftResult<()> { + let len = self.len(); + + let mut open_slot_index: Option = None; + for i in 0..len { + let cell = self.get(i as u32); + if cell.constituent_index == datum.constituent_index { + return Err(ErrorCode::DefaultError); + } + if cell.last_slot == 0 && open_slot_index.is_none() { + open_slot_index = Some(i); + } + } + let open_slot = open_slot_index.ok_or_else(|| ErrorCode::DefaultError.into())?; + + let cell = self.get_mut(open_slot); + *cell = datum; + + Ok(()) + } +} diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index bbacb84ba..2fb5c9a62 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -1,52 +1,10 @@ #[cfg(test)] mod tests { - use super::*; use crate::state::lp_pool::*; - use crate::state::oracle::OracleSource; - use crate::state::spot_market::SpotBalanceType; - use crate::state::zero_copy::ZeroCopyLoader; - use anchor_lang::prelude::Pubkey; + use std::{cell::RefCell, marker::PhantomData, vec}; const PERCENTAGE_PRECISION_I64: i64 = 1_000_000; - fn constituent_target_weights_zc( - ) -> AccountZeroCopyMut { - let disc = ConstituentTargetWeights::discriminator(); - let fixed = ConstituentTargetWeightsFixed { len: 1 }; - let mut buf = Vec::new(); - buf.extend_from_slice(&disc); - buf.extend_from_slice(bytemuck::bytes_of(&fixed)); - buf.resize(buf.len() + std::mem::size_of::() * 1, 0); - - // 2) wrap in AccountInfo - let mut lamports = 0u64; - let pubkey = Pubkey::default(); - let owner = crate::ID; - let mut ai = AccountInfo::new( - &pubkey, - false, - true, - &mut lamports, - &mut buf, - &owner, - false, - 0, - ); - - // 3) call your loader - let mut zc: AccountZeroCopyMut = - ai.load_zc_mut().unwrap(); - zc - } - - fn weight_datum(constituent_index: u16, data: i64, last_slot: u64) -> WeightDatum { - WeightDatum { - constituent_index, - padding: [0; 6], - data, - last_slot, - } - } fn amm_const_datum( perp_market_index: u16, constituent_index: u16, @@ -62,43 +20,57 @@ mod tests { } } - fn dummy_constituent(index: u16) -> Constituent { - Constituent { - pubkey: Pubkey::default(), - constituent_index: index, - max_weight_deviation: 0, - swap_fee_min: 0, - max_fee_premium: 0, - spot_market_index: index, - spot_balance: BLPosition { - scaled_balance: 0, - cumulative_deposits: 0, - market_index: index, - balance_type: SpotBalanceType::Deposit, - padding: [0; 4], - }, - padding: [0; 16], - } - } - #[test] fn test_single_zero_weight() { - let mapping = AmmConstituentMapping { - data: vec![amm_const_datum(0, 1, 0, 0)], + let amm_datum = amm_const_datum(0, 1, 0, 0); + let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { + len: 1, + ..AmmConstituentMappingFixed::default() + }); + let mapping_data = RefCell::new([0u8; 24]); + { + let mut mapping_zc_mut = + AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { + fixed: mapping_fixed.borrow_mut(), + data: mapping_data.borrow_mut(), + _marker: PhantomData::, + }; + mapping_zc_mut.add_amm_constituent_datum(amm_datum).unwrap(); + } + + let mapping_zc = { + let fixed_ref = mapping_fixed.borrow(); + let data_ref = mapping_data.borrow(); + AccountZeroCopy { + fixed: fixed_ref, + data: data_ref, + _marker: PhantomData::, + } }; let amm_inventory: Vec<(u16, i64)> = vec![(0, 1_000_000)]; let prices = vec![1_000_000]; - let constituents = vec![dummy_constituent(0)]; + let constituent_indexes = vec![1]; let aum = 1_000_000; let now_ts = 1000; - let mut target = constituent_target_weights_zc(); - target + let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + len: 1, + ..ConstituentTargetWeightsFixed::default() + }); + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = + AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; + + target_zc_mut .update_target_weights( - &mapping, + &mapping_zc, &amm_inventory, - &constituents, + &constituent_indexes, &prices, aum, now_ts, @@ -106,29 +78,62 @@ mod tests { ) .unwrap(); - assert_eq!(target.data.len(), 1); - assert_eq!(target.data[0].data, 0); - assert_eq!(target.data[0].last_slot, now_ts); + assert_eq!(target_zc_mut.len(), 1); + assert_eq!(target_zc_mut.get(0).data, 0); + assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } #[test] fn test_single_full_weight() { - let mapping = AmmConstituentMapping { - data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0)], + let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0); + let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { + len: 1, + ..AmmConstituentMappingFixed::default() + }); + let mapping_data = RefCell::new([0u8; 24]); + { + let mut mapping_zc_mut = + AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { + fixed: mapping_fixed.borrow_mut(), + data: mapping_data.borrow_mut(), + _marker: PhantomData::, + }; + mapping_zc_mut.add_amm_constituent_datum(amm_datum).unwrap(); + } + + let mapping_zc = { + let fixed_ref = mapping_fixed.borrow(); + let data_ref = mapping_data.borrow(); + AccountZeroCopy { + fixed: fixed_ref, + data: data_ref, + _marker: PhantomData::, + } }; let amm_inventory = vec![(0, 1_000_000)]; let prices = vec![1_000_000]; - let constituents = vec![dummy_constituent(0)]; + let constituent_indexes = [1u16]; let aum = 1_000_000; let now_ts = 1234; - let mut target = constituent_target_weights_zc(); - target + let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + len: 1, + ..ConstituentTargetWeightsFixed::default() + }); + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = + AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; + + target_zc_mut .update_target_weights( - &mapping, + &mapping_zc, &amm_inventory, - &constituents, + &constituent_indexes, &prices, aum, now_ts, @@ -136,32 +141,71 @@ mod tests { ) .unwrap(); - assert_eq!(target.data.len(), 1); - assert_eq!(target.data[0].data, PERCENTAGE_PRECISION_I64); - assert_eq!(target.data[0].last_slot, now_ts); + assert_eq!(target_zc_mut.len(), 1); + assert_eq!(target_zc_mut.get(0).data, PERCENTAGE_PRECISION_I64); + assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } #[test] fn test_multiple_constituents_partial_weights() { - let mapping = AmmConstituentMapping { - data: vec![ - amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64 / 2, 0), - amm_const_datum(0, 2, PERCENTAGE_PRECISION_I64 / 2, 0), - ], + let amm_mapping_data = vec![ + amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64 / 2, 111), + amm_const_datum(0, 2, PERCENTAGE_PRECISION_I64 / 2, 111), + ]; + + let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { + len: amm_mapping_data.len() as u32, + ..AmmConstituentMappingFixed::default() + }); + let mapping_data = RefCell::new([0u8; 48]); + + { + let mut mapping_zc_mut = + AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { + fixed: mapping_fixed.borrow_mut(), + data: mapping_data.borrow_mut(), + _marker: PhantomData::, + }; + for amm_datum in &amm_mapping_data { + mapping_zc_mut + .add_amm_constituent_datum(*amm_datum) + .unwrap(); + } + } + + let mapping_zc = { + let fixed_ref = mapping_fixed.borrow(); + let data_ref = mapping_data.borrow(); + AccountZeroCopy { + fixed: fixed_ref, + data: data_ref, + _marker: PhantomData::, + } }; let amm_inventory = vec![(0, 1_000_000)]; let prices = vec![1_000_000, 1_000_000]; - let constituents = vec![dummy_constituent(0), dummy_constituent(1)]; + let constituent_indexes = vec![1, 2]; let aum = 1_000_000; let now_ts = 999; - let mut target = constituent_target_weights_zc(); - target + let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + len: amm_mapping_data.len() as u32, + ..ConstituentTargetWeightsFixed::default() + }); + let target_data = RefCell::new([0u8; 48]); + let mut target_zc_mut = + AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; + + target_zc_mut .update_target_weights( - &mapping, + &mapping_zc, &amm_inventory, - &constituents, + &constituent_indexes, &prices, aum, now_ts, @@ -169,32 +213,65 @@ mod tests { ) .unwrap(); - assert_eq!(target.data.len(), 2); + assert_eq!(target_zc_mut.len(), 2); - for datum in &target.data { - assert_eq!(datum.data, PERCENTAGE_PRECISION_I64 / 2); - assert_eq!(datum.last_slot, now_ts); + for i in 0..target_zc_mut.len() { + assert_eq!(target_zc_mut.get(i).data, PERCENTAGE_PRECISION_I64 / 2); + assert_eq!(target_zc_mut.get(i).last_slot, now_ts); } } #[test] fn test_zero_aum_safe() { - let mapping = AmmConstituentMapping { - data: vec![amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0)], + let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0); + let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { + len: 1, + ..AmmConstituentMappingFixed::default() + }); + let mapping_data = RefCell::new([0u8; 24]); + { + let mut mapping_zc_mut = + AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { + fixed: mapping_fixed.borrow_mut(), + data: mapping_data.borrow_mut(), + _marker: PhantomData::, + }; + mapping_zc_mut.add_amm_constituent_datum(amm_datum).unwrap(); + } + + let mapping_zc = { + let fixed_ref = mapping_fixed.borrow(); + let data_ref = mapping_data.borrow(); + AccountZeroCopy { + fixed: fixed_ref, + data: data_ref, + _marker: PhantomData::, + } }; let amm_inventory = vec![(0, 1_000_000)]; let prices = vec![142_000_000]; - let constituents = vec![dummy_constituent(0)]; + let constituent_indexes = vec![1u16]; let aum = 0; let now_ts = 111; - let mut target = ConstituentTargetWeights::default(); - target + let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + len: 1, + ..ConstituentTargetWeightsFixed::default() + }); + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = + AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; + + target_zc_mut .update_target_weights( - &mapping, + &mapping_zc, &amm_inventory, - &constituents, + &constituent_indexes, &prices, aum, now_ts, @@ -202,29 +279,62 @@ mod tests { ) .unwrap(); - assert_eq!(target.data.len(), 1); - assert_eq!(target.data[0].data, 0); // no target - assert_eq!(target.data[0].last_slot, now_ts); + assert_eq!(target_zc_mut.len(), 1); + assert_eq!(target_zc_mut.get(0).data, 0); // no target + assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } #[test] fn test_overflow_protection() { - let mapping = AmmConstituentMapping { - data: vec![amm_const_datum(0, 1, i64::MAX, 0)], + let amm_datum = amm_const_datum(0, 1, i64::MAX, 0); + let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { + len: 1, + ..AmmConstituentMappingFixed::default() + }); + let mapping_data = RefCell::new([0u8; 24]); + { + let mut mapping_zc_mut = + AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { + fixed: mapping_fixed.borrow_mut(), + data: mapping_data.borrow_mut(), + _marker: PhantomData::, + }; + mapping_zc_mut.add_amm_constituent_datum(amm_datum).unwrap(); + } + + let mapping_zc = { + let fixed_ref = mapping_fixed.borrow(); + let data_ref = mapping_data.borrow(); + AccountZeroCopy { + fixed: fixed_ref, + data: data_ref, + _marker: PhantomData::, + } }; let amm_inventory = vec![(0, i64::MAX)]; - let prices = vec![u64::MAX]; - let constituents = vec![0]; + let prices = vec![i64::MAX]; + let constituent_indexes = vec![1u16]; let aum = 1; let now_ts = 222; - let mut target = ConstituentTargetWeights::default(); - target + let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + len: 1, + ..ConstituentTargetWeightsFixed::default() + }); + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = + AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; + + target_zc_mut .update_target_weights( - &mapping, + &mapping_zc, &amm_inventory, - &constituents, + &constituent_indexes, &prices, aum, now_ts, @@ -232,8 +342,8 @@ mod tests { ) .unwrap(); - assert_eq!(target.data.len(), 1); - assert!(target.data[0].data <= PERCENTAGE_PRECISION_I64); - assert_eq!(target.data[0].last_slot, now_ts); + assert_eq!(target_zc_mut.len(), 1); + assert!(target_zc_mut.get(0).data <= PERCENTAGE_PRECISION_I64); + assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } } diff --git a/programs/drift/src/state/zero_copy.rs b/programs/drift/src/state/zero_copy.rs index 0c5ab29b1..c9ee1f907 100644 --- a/programs/drift/src/state/zero_copy.rs +++ b/programs/drift/src/state/zero_copy.rs @@ -17,7 +17,7 @@ pub trait HasLen { pub struct AccountZeroCopy<'a, T, F> { pub fixed: Ref<'a, F>, pub data: Ref<'a, [u8]>, - _marker: PhantomData, + pub _marker: PhantomData, } impl<'a, T, F> AccountZeroCopy<'a, T, F> @@ -29,14 +29,14 @@ where self.fixed.len() } - pub fn get(&self, index: usize) -> &T { + pub fn get(&self, index: u32) -> &T { let size = std::mem::size_of::(); - let start = index * size; + let start = index as usize * size; bytemuck::from_bytes(&self.data[start..start + size]) } pub fn iter(&self) -> impl Iterator + '_ { - (0..self.len()).map(move |i| self.get(i as usize)) + (0..self.len()).map(move |i| self.get(i)) } } @@ -60,6 +60,16 @@ where let start = index as usize * size; bytemuck::from_bytes_mut(&mut self.data[start..start + size]) } + + pub fn get(&self, index: u32) -> &T { + let size = std::mem::size_of::(); + let start = index as usize * size; + bytemuck::from_bytes(&self.data[start..start + size]) + } + + pub fn iter(&self) -> impl Iterator + '_ { + (0..self.len()).map(move |i| self.get(i)) + } } pub trait ZeroCopyLoader<'a, T, F> { @@ -135,6 +145,12 @@ where }) } +/// Anything that you can pull a zero‑copy view of `Elem`+`Fixed` out of. +pub trait ToZeroCopy<'info, Elem, Fixed> { + fn to_zc(&self) -> DriftResult>; + fn to_zc_mut(&self) -> DriftResult>; +} + #[macro_export] macro_rules! impl_zero_copy_loader { ($Acc:ty, $ID:path, $Fixed:ty, $Elem:ty, $Disc:expr) => { From 81dd06e9d50b996f2767632c657d9e4ab27aae9f Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 22 Apr 2025 14:28:13 -0700 Subject: [PATCH 11/50] few comment changes --- programs/drift/src/state/lp_pool.rs | 4 ++-- programs/drift/src/state/lp_pool/tests.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index f286a488b..0d75e085a 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -241,9 +241,9 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { &mut self, mapping: &AccountZeroCopy<'a, AmmConstituentDatum, AmmConstituentMappingFixed>, // (perp market index, inventory, price) - amm_inventory: &[(u16, i64)], // length = mapping.num_rows + amm_inventory: &[(u16, i64)], constituents_indexes: &[u16], - prices: &[i64], // length = mapping.num_rows + prices: &[i64], aum: u64, slot: u64, validation_flags: WeightValidationFlags, diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 2fb5c9a62..33eea1a09 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -157,6 +157,8 @@ mod tests { len: amm_mapping_data.len() as u32, ..AmmConstituentMappingFixed::default() }); + + // 48 = size_of::() * amm_mapping_data.len() let mapping_data = RefCell::new([0u8; 48]); { From 73b32d5e1726856b8c287e23789c9d306fd35b01 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 22 Apr 2025 14:47:02 -0700 Subject: [PATCH 12/50] remove discriminator from impl macro --- programs/drift/src/state/lp_pool.rs | 6 ++---- programs/drift/src/state/zero_copy.rs | 14 +++++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 0d75e085a..09b945982 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -173,8 +173,7 @@ impl_zero_copy_loader!( AmmConstituentMapping, crate::id, AmmConstituentMappingFixed, - AmmConstituentDatum, - AmmConstituentMapping::discriminator() + AmmConstituentDatum ); #[zero_copy] @@ -215,8 +214,7 @@ impl_zero_copy_loader!( ConstituentTargetWeights, crate::id, ConstituentTargetWeightsFixed, - WeightDatum, - ConstituentTargetWeights::discriminator() + WeightDatum ); impl Default for ConstituentTargetWeights { diff --git a/programs/drift/src/state/zero_copy.rs b/programs/drift/src/state/zero_copy.rs index c9ee1f907..2bcc77dc7 100644 --- a/programs/drift/src/state/zero_copy.rs +++ b/programs/drift/src/state/zero_copy.rs @@ -153,14 +153,18 @@ pub trait ToZeroCopy<'info, Elem, Fixed> { #[macro_export] macro_rules! impl_zero_copy_loader { - ($Acc:ty, $ID:path, $Fixed:ty, $Elem:ty, $Disc:expr) => { + ($Acc:ty, $ID:path, $Fixed:ty, $Elem:ty) => { impl<'a> crate::state::zero_copy::ZeroCopyLoader<'a, $Elem, $Fixed> for AccountInfo<'a> { fn load_zc( self: &'a Self, ) -> crate::error::DriftResult< crate::state::zero_copy::AccountZeroCopy<'a, $Elem, $Fixed>, > { - crate::state::zero_copy::load_generic::<$Fixed, $Elem>(self, $Disc, $ID()) + crate::state::zero_copy::load_generic::<$Fixed, $Elem>( + self, + <$Acc as anchor_lang::Discriminator>::discriminator(), + $ID(), + ) } fn load_zc_mut( @@ -168,7 +172,11 @@ macro_rules! impl_zero_copy_loader { ) -> crate::error::DriftResult< crate::state::zero_copy::AccountZeroCopyMut<'a, $Elem, $Fixed>, > { - crate::state::zero_copy::load_generic_mut::<$Fixed, $Elem>(self, $Disc, $ID()) + crate::state::zero_copy::load_generic_mut::<$Fixed, $Elem>( + self, + <$Acc as anchor_lang::Discriminator>::discriminator(), + $ID(), + ) } } }; From afdfe7b5f0dc09699c21e5ff673c7b3a2a7946d6 Mon Sep 17 00:00:00 2001 From: wphan Date: Wed, 23 Apr 2025 12:58:23 -0700 Subject: [PATCH 13/50] add get_swap_amount, get_swap_fees, get_weight (#1579) * add get_swap_amount, get_swap_fees, get_weight * update accounts * add back ts * rebase * add constituent swap fees --- programs/drift/src/error.rs | 2 + programs/drift/src/state/lp_pool.rs | 264 +++++++++++++++++++++- programs/drift/src/state/lp_pool/tests.rs | 56 ++++- sdk/src/addresses/pda.ts | 9 +- sdk/src/adminClient.ts | 19 +- 5 files changed, 324 insertions(+), 26 deletions(-) diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index 5b6ac6952..99d82468d 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -633,6 +633,8 @@ pub enum ErrorCode { InvalidTransferPerpPosition, #[msg("Invalid SignedMsgUserOrders resize")] InvalidSignedMsgUserOrdersResize, + #[msg("Invalid Constituent")] + InvalidConstituent, } #[macro_export] diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 09b945982..73aa4132a 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,15 +1,19 @@ +use std::ops::Neg; + use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::PERCENTAGE_PRECISION_I64; +use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION_U64}; use crate::math::safe_math::SafeMath; use anchor_lang::prelude::*; -use anchor_lang::Discriminator; +use anchor_spl::token::Mint; use borsh::{BorshDeserialize, BorshSerialize}; +use super::oracle_map::OracleMap; +use super::spot_market::SpotMarket; use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen, ToZeroCopy, ZeroCopyLoader}; -use crate::impl_zero_copy_loader; use crate::state::spot_market::{SpotBalance, SpotBalanceType}; use crate::state::traits::Size; +use crate::{impl_zero_copy_loader, validate}; #[cfg(test)] mod tests; @@ -43,7 +47,7 @@ pub struct LPPool { /// timestamp of last AUM slot pub last_aum_slot: u64, // 8, 152 /// timestamp of last AUM update - pub last_aum_ts: u64, // 8, 160`` + pub last_aum_ts: u64, // 8, 160 /// timestamp of last vAMM revenue rebalance pub last_revenue_rebalance_ts: u64, // 8, 168 @@ -61,6 +65,159 @@ impl Size for LPPool { const SIZE: usize = 1743; } +impl LPPool { + pub fn get_nav(&self, mint: &Mint) -> Result { + match mint.supply { + 0 => Ok(0), + supply => { + // TODO: assuming mint decimals = quote decimals = 6 + self.last_aum + .checked_div(supply) + .ok_or(ErrorCode::MathError.into()) + } + } + } + + /// get the swap price between two (non-LP token) constituents + /// returns swap price in PRICE_PRECISION + pub fn get_swap_price( + &self, + oracle_map: &mut OracleMap, + in_spot_market: &SpotMarket, + out_spot_market: &SpotMarket, + in_amount: u64, + ) -> DriftResult { + let in_price = oracle_map + .get_price_data(&(in_spot_market.oracle, in_spot_market.oracle_source)) + .expect("failed to get price data") + .price + .cast::() + .expect("failed to cast price"); + + let out_price = oracle_map + .get_price_data(&(out_spot_market.oracle, out_spot_market.oracle_source)) + .expect("failed to get price data") + .price + .cast::() + .expect("failed to cast price"); + + let (prec_diff_numerator, prec_diff_denominator) = + if out_spot_market.decimals > in_spot_market.decimals { + ( + 10_u64.pow(out_spot_market.decimals as u32 - in_spot_market.decimals as u32), + 1, + ) + } else { + ( + 1, + 10_u64.pow(in_spot_market.decimals as u32 - out_spot_market.decimals as u32), + ) + }; + + let swap_price = in_amount + .safe_mul(in_price)? + .safe_mul(prec_diff_numerator)? + .safe_div(out_price.safe_mul(prec_diff_denominator)?)?; + + Ok(swap_price) + } + + /// + /// Returns the (out_amount, in_fee, out_fee) in the respective token units + pub fn get_swap_amount( + &self, + oracle_map: &mut OracleMap, + in_constituent: &Constituent, + out_constituent: &Constituent, + in_spot_market: &SpotMarket, + out_spot_market: &SpotMarket, + in_token_balance: u64, + out_token_balance: u64, + in_target_weight: i64, + out_target_weight: i64, + in_amount: u64, + swap_price: u64, + ) -> DriftResult<(u64, u64, i64, i64)> { + let out_amount = in_amount + .safe_mul(swap_price)? + .safe_div(PRICE_PRECISION_U64)?; + let (in_fee, out_fee) = self.get_swap_fees( + oracle_map, + in_constituent, + out_constituent, + in_spot_market, + out_spot_market, + in_token_balance, + out_token_balance, + in_amount, + out_amount, + in_target_weight, + out_target_weight, + )?; + + // TODO: additional spot quoter logic can go here + // TODO: emit swap event + + Ok((in_amount, out_amount, in_fee, out_fee)) + } + + /// returns (in_fee, out_fee) in PERCENTAGE_PRECISION + pub fn get_swap_fees( + &self, + oracle_map: &mut OracleMap, // might not need oracle_map depending on how accounts are passed in + in_constituent: &Constituent, + out_constituent: &Constituent, + in_spot_market: &SpotMarket, + out_spot_market: &SpotMarket, + in_token_balance: u64, + out_token_balance: u64, + in_amount: u64, + out_amount: u64, + in_target_weight: i64, + out_target_weight: i64, + ) -> DriftResult<(i64, i64)> { + let in_price = oracle_map + .get_price_data(&(in_spot_market.oracle, in_spot_market.oracle_source)) + .expect("failed to get price data") + .price; + let in_weight_after = in_constituent.get_weight( + in_price, + in_token_balance, + in_amount.cast::()?, + self.last_aum, + )?; + let in_weight_delta = in_weight_after.safe_sub(in_target_weight)?; + msg!( + "in_weight_after: {}, in_target_weight: {}, in_weight_delta: {}", + in_weight_after, + in_target_weight, + in_weight_delta + ); + let in_fee = in_constituent.get_fee_to_charge(in_weight_after, in_target_weight)?; + + let out_price = oracle_map + .get_price_data(&(out_spot_market.oracle, out_spot_market.oracle_source)) + .expect("failed to get price data") + .price; + let out_weight_after = out_constituent.get_weight( + out_price, + out_token_balance, + out_amount.cast::()?.neg(), + self.last_aum, + )?; + let out_weight_delta = out_weight_after.safe_sub(out_target_weight)?; + msg!( + "out_weight_after: {}, out_target_weight: {}, out_weight_delta: {}", + out_weight_after, + out_target_weight, + out_weight_delta + ); + let out_fee = out_constituent.get_fee_to_charge(out_weight_after, out_target_weight)?; + + Ok((in_fee, out_fee)) + } +} + #[zero_copy(unsafe)] #[derive(Default, Eq, PartialEq, Debug, BorshDeserialize, BorshSerialize)] #[repr(C)] @@ -119,21 +276,89 @@ pub struct Constituent { /// idx in LPPool.constituents pub constituent_index: u16, + pub decimals: u8, + /// max deviation from target_weight allowed for the constituent /// precision: PERCENTAGE_PRECISION - pub max_weight_deviation: u64, - /// min fee charged on swaps to this constituent + pub max_weight_deviation: i64, + /// min fee charged on swaps to/from this constituent /// precision: PERCENTAGE_PRECISION - pub swap_fee_min: u64, - /// max premium to be applied to swap_fee_min when the constituent is at max deviation from target_weight + pub swap_fee_min: i64, + /// max fee charged on swaps to/from this constituent /// precision: PERCENTAGE_PRECISION - pub max_fee_premium: u64, + pub swap_fee_max: i64, /// spot borrow-lend balance for constituent pub spot_balance: BLPosition, // should be in constituent base asset pub padding: [u8; 16], } +impl Constituent { + /// Returns the full balance of the Constituent, the total of the amount in Constituent's token + /// account and in Drift Borrow-Lend. + pub fn get_full_balance(&self, token_balance: u64) -> DriftResult { + match self.spot_balance.balance_type() { + SpotBalanceType::Deposit => token_balance + .cast::()? + .safe_add(self.spot_balance.balance().cast::()?), + SpotBalanceType::Borrow => token_balance + .cast::()? + .safe_sub(self.spot_balance.balance().cast::()?), + } + } + + /// Current weight of this constituent = price * token_balance / lp_pool_aum + /// Note: lp_pool_aum is from LPPool.last_aum, which is a lagged value updated via crank + pub fn get_weight( + &self, + price: i64, + token_balance: u64, + token_amount_delta: i64, + lp_pool_aum: u64, + ) -> DriftResult { + let balance = self.get_full_balance(token_balance)?.cast::()?; + let token_precision = 10_i128.pow(self.decimals as u32); + + let value_usd = balance + .safe_add(token_amount_delta.cast::()?)? + .safe_mul(price.cast::()?)?; + + value_usd + .safe_mul(PERCENTAGE_PRECISION_I64.cast::()?)? + .safe_div(lp_pool_aum.cast::()?.safe_mul(token_precision)?)? + .cast::() + } + + /// Returns the fee to charge for a swap to/from this constituent + /// The fee is a linear interpolation between the swap_fee_min and swap_fee_max based on the post-swap deviation from the target weight + /// precision: PERCENTAGE_PRECISION + pub fn get_fee_to_charge(&self, post_swap_weight: i64, target_weight: i64) -> DriftResult { + let min_weight = target_weight.safe_sub(self.max_weight_deviation as i64)?; + let max_weight = target_weight.safe_add(self.max_weight_deviation as i64)?; + let (slope_numerator, slope_denominator) = if post_swap_weight > target_weight { + let num = self.swap_fee_max.safe_sub(self.swap_fee_min)?; + let denom = max_weight.safe_sub(target_weight)?; + (num, denom) + } else { + let num = self.swap_fee_min.safe_sub(self.swap_fee_max)?; + let denom = target_weight.safe_sub(min_weight)?; + (num, denom) + }; + + let b = self + .swap_fee_min + .safe_mul(slope_denominator)? + .safe_sub(target_weight.safe_mul(slope_numerator)?)?; + Ok(post_swap_weight + .safe_mul(slope_numerator)? + .safe_add(b)? + .safe_div(slope_denominator)?) + } +} + +// pub struct PerpConstituent { +// } + #[zero_copy] #[derive(Debug, BorshDeserialize, BorshSerialize)] #[repr(C)] @@ -233,6 +458,27 @@ pub enum WeightValidationFlags { NoOverweight = 0b0000_0100, } +impl<'a> AccountZeroCopy<'a, WeightDatum, ConstituentTargetWeightsFixed> { + pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { + validate!( + constituent_index < self.len() as u16, + ErrorCode::InvalidConstituent, + "Invalid constituent_index = {}, ConstituentTargetWeights len = {}", + constituent_index, + self.len() + )?; + let datum = self.get(constituent_index as u32); + validate!( + datum.constituent_index == constituent_index, + ErrorCode::InvalidConstituent, + "Invalid constituent_index = {}, ConstituentTargetWeights len = {}", + datum.constituent_index, + self.len() + )?; + Ok(datum.data) + } +} + /// Update target weights based on amm_inventory and mapping impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { pub fn update_target_weights( diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 33eea1a09..6039eb8f9 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -1,10 +1,9 @@ #[cfg(test)] mod tests { + use crate::math::constants::PERCENTAGE_PRECISION_I64; use crate::state::lp_pool::*; use std::{cell::RefCell, marker::PhantomData, vec}; - const PERCENTAGE_PRECISION_I64: i64 = 1_000_000; - fn amm_const_datum( perp_market_index: u16, constituent_index: u16, @@ -348,4 +347,57 @@ mod tests { assert!(target_zc_mut.get(0).data <= PERCENTAGE_PRECISION_I64); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } + + #[test] + fn test_constituent_fee_to_charge() { + let mut constituent = Constituent::default(); + constituent.swap_fee_min = PERCENTAGE_PRECISION_I64 / 10000; // 1 bps + constituent.swap_fee_max = PERCENTAGE_PRECISION_I64 / 1000; // 10 bps; + constituent.max_weight_deviation = PERCENTAGE_PRECISION_I64 / 10; // max 10% deviation from target + + // target weight is 50%, push the Constituent to 40% (max below target) + let fee = constituent + .get_fee_to_charge( + PERCENTAGE_PRECISION_I64 * 40 / 100, + PERCENTAGE_PRECISION_I64 / 2, + ) + .unwrap(); + assert_eq!(fee, PERCENTAGE_PRECISION_I64 / 1000); // 10 bps + + // target weight is 50%, push the Constituent to 60% (max above target) + let fee = constituent + .get_fee_to_charge( + PERCENTAGE_PRECISION_I64 * 60 / 100, + PERCENTAGE_PRECISION_I64 / 2, + ) + .unwrap(); + assert_eq!(fee, PERCENTAGE_PRECISION_I64 / 1000); // 10 bps + + // target weight is 50%, push the Constituent to 45% (half to min target) + let fee = constituent + .get_fee_to_charge( + PERCENTAGE_PRECISION_I64 * 45 / 100, + PERCENTAGE_PRECISION_I64 / 2, + ) + .unwrap(); + assert_eq!(fee, PERCENTAGE_PRECISION_I64 * 55 / 100000); // 5.5 bps + + // target weight is 50%, push the Constituent to 55% (half to max target) + let fee = constituent + .get_fee_to_charge( + PERCENTAGE_PRECISION_I64 * 55 / 100, + PERCENTAGE_PRECISION_I64 / 2, + ) + .unwrap(); + assert_eq!(fee, PERCENTAGE_PRECISION_I64 * 55 / 100000); // 5.5 bps + + // target weight is 50%, push the Constituent to 50% (target) + let fee = constituent + .get_fee_to_charge( + PERCENTAGE_PRECISION_I64 * 50 / 100, + PERCENTAGE_PRECISION_I64 / 2, + ) + .unwrap(); + assert_eq!(fee, PERCENTAGE_PRECISION_I64 / 10000); // 1 bps (min fee) + } } diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index c65ba2e66..a48a89a7d 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -384,10 +384,10 @@ export function getLpPoolPublicKey( programId: PublicKey, name: string ): PublicKey { - return PublicKey.findProgramAddressSync([ - Buffer.from(anchor.utils.bytes.utf8.encode('lp_pool')), - Buffer.from(name) - ], programId)[0]; + return PublicKey.findProgramAddressSync( + [Buffer.from(anchor.utils.bytes.utf8.encode('lp_pool')), Buffer.from(name)], + programId + )[0]; } export function getLpPoolMintPublicKey( @@ -399,4 +399,3 @@ export function getLpPoolMintPublicKey( programId )[0]; } - diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 95cbb9822..271eaf6ff 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -40,7 +40,11 @@ import { getLpPoolPublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; -import { createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from '@solana/spl-token'; +import { + createAssociatedTokenAccountInstruction, + getAssociatedTokenAddressSync, + TOKEN_PROGRAM_ID, +} from '@solana/spl-token'; import { DriftClient } from './driftClient'; import { PEG_PRECISION, @@ -59,7 +63,6 @@ import { FUEL_RESET_LOG_ACCOUNT } from './constants/txConstants'; import { Metaplex } from '@metaplex-foundation/js'; - const OPENBOOK_PROGRAM_ID = new PublicKey( 'opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb' ); @@ -4214,18 +4217,13 @@ export class AdminClient extends DriftClient { tokenDecimals: number, maxAum: BN ): Promise { - console.log(this.connection.rpcEndpoint) - const metaplex = new Metaplex(this.connection, {cluster: 'custom'}); + const metaplex = new Metaplex(this.connection, { cluster: 'custom' }); const lpPool = getLpPoolPublicKey(this.program.programId, name); const mint = getLpPoolMintPublicKey(this.program.programId, lpPool); - const lpPoolAta = getAssociatedTokenAddressSync( - mint, - lpPool, - true - ); + const lpPoolAta = getAssociatedTokenAddressSync(mint, lpPool, true); const createAtaIx = createAssociatedTokenAccountInstruction( this.wallet.publicKey, lpPoolAta, @@ -4254,7 +4252,8 @@ export class AdminClient extends DriftClient { }), state, tokenProgram: TOKEN_PROGRAM_ID, - tokenMetadataProgram: metaplex.programs().getTokenMetadata().address, + tokenMetadataProgram: metaplex.programs().getTokenMetadata() + .address, rent: SYSVAR_RENT_PUBKEY, systemProgram: SystemProgram.programId, }, From 9383688bb9020110cf1edbf18fe9d06023437577 Mon Sep 17 00:00:00 2001 From: wphan Date: Wed, 23 Apr 2025 13:18:44 -0700 Subject: [PATCH 14/50] fix swap fee calc (#1582) --- programs/drift/src/state/lp_pool.rs | 91 ++++++++++------------------- 1 file changed, 32 insertions(+), 59 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 73aa4132a..8d7919873 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -2,7 +2,7 @@ use std::ops::Neg; use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION_U64}; +use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64, PRICE_PRECISION_U64}; use crate::math::safe_math::SafeMath; use anchor_lang::prelude::*; use anchor_spl::token::Mint; @@ -123,7 +123,7 @@ impl LPPool { } /// - /// Returns the (out_amount, in_fee, out_fee) in the respective token units + /// Returns the (out_amount, in_fee, out_fee) in the respective token units. Amounts are gross fees. pub fn get_swap_amount( &self, oracle_map: &mut OracleMap, @@ -136,22 +136,30 @@ impl LPPool { in_target_weight: i64, out_target_weight: i64, in_amount: u64, - swap_price: u64, ) -> DriftResult<(u64, u64, i64, i64)> { - let out_amount = in_amount - .safe_mul(swap_price)? - .safe_div(PRICE_PRECISION_U64)?; - let (in_fee, out_fee) = self.get_swap_fees( + let swap_price = + self.get_swap_price(oracle_map, in_spot_market, out_spot_market, in_amount)?; + + let in_fee = self.get_swap_fees( oracle_map, in_constituent, - out_constituent, in_spot_market, - out_spot_market, in_token_balance, - out_token_balance, in_amount, - out_amount, in_target_weight, + )?; + let out_amount = in_amount + .cast::()? + .safe_sub(in_fee)? + .safe_mul(swap_price.cast::()?)? + .safe_div(PRICE_PRECISION_I64)? + .cast::()?; + let out_fee = self.get_swap_fees( + oracle_map, + out_constituent, + out_spot_market, + out_token_balance, + out_amount, out_target_weight, )?; @@ -161,60 +169,25 @@ impl LPPool { Ok((in_amount, out_amount, in_fee, out_fee)) } - /// returns (in_fee, out_fee) in PERCENTAGE_PRECISION + /// returns fee in PERCENTAGE_PRECISION pub fn get_swap_fees( &self, oracle_map: &mut OracleMap, // might not need oracle_map depending on how accounts are passed in - in_constituent: &Constituent, - out_constituent: &Constituent, - in_spot_market: &SpotMarket, - out_spot_market: &SpotMarket, - in_token_balance: u64, - out_token_balance: u64, - in_amount: u64, - out_amount: u64, - in_target_weight: i64, - out_target_weight: i64, - ) -> DriftResult<(i64, i64)> { - let in_price = oracle_map - .get_price_data(&(in_spot_market.oracle, in_spot_market.oracle_source)) - .expect("failed to get price data") - .price; - let in_weight_after = in_constituent.get_weight( - in_price, - in_token_balance, - in_amount.cast::()?, - self.last_aum, - )?; - let in_weight_delta = in_weight_after.safe_sub(in_target_weight)?; - msg!( - "in_weight_after: {}, in_target_weight: {}, in_weight_delta: {}", - in_weight_after, - in_target_weight, - in_weight_delta - ); - let in_fee = in_constituent.get_fee_to_charge(in_weight_after, in_target_weight)?; - - let out_price = oracle_map - .get_price_data(&(out_spot_market.oracle, out_spot_market.oracle_source)) + constituent: &Constituent, + spot_market: &SpotMarket, + token_balance: u64, + amount: u64, + target_weight: i64, + ) -> DriftResult { + let price = oracle_map + .get_price_data(&(spot_market.oracle, spot_market.oracle_source)) .expect("failed to get price data") .price; - let out_weight_after = out_constituent.get_weight( - out_price, - out_token_balance, - out_amount.cast::()?.neg(), - self.last_aum, - )?; - let out_weight_delta = out_weight_after.safe_sub(out_target_weight)?; - msg!( - "out_weight_after: {}, out_target_weight: {}, out_weight_delta: {}", - out_weight_after, - out_target_weight, - out_weight_delta - ); - let out_fee = out_constituent.get_fee_to_charge(out_weight_after, out_target_weight)?; + let weight_after = + constituent.get_weight(price, token_balance, amount.cast::()?, self.last_aum)?; + let fee = constituent.get_fee_to_charge(weight_after, target_weight)?; - Ok((in_fee, out_fee)) + Ok(fee) } } From 007bace8d68bae3389d001f72fdfadf29ffb9826 Mon Sep 17 00:00:00 2001 From: moosecat Date: Wed, 23 Apr 2025 15:34:51 -0700 Subject: [PATCH 15/50] add init amm mapping to lp context (#1583) --- programs/drift/src/instructions/admin.rs | 17 +++- programs/drift/src/state/lp_pool.rs | 19 +++- sdk/src/addresses/pda.ts | 10 ++ sdk/src/adminClient.ts | 14 ++- sdk/src/idl/drift.json | 111 ++++++++++++++++------- tests/lpPool.ts | 13 ++- 6 files changed, 146 insertions(+), 38 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 5f4fe330b..cd164d30a 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -3,7 +3,7 @@ use std::mem::size_of; use crate::msg; use crate::signer::get_signer_seeds; -use crate::state::lp_pool::LPPool; +use crate::state::lp_pool::{AmmConstituentDatum, AmmConstituentMapping, LPPool, AMM_MAP_PDA_SEED}; use anchor_lang::prelude::*; use anchor_spl::metadata::{ create_metadata_accounts_v3, mpl_token_metadata::types::DataV2, CreateMetadataAccountsV3, @@ -4424,6 +4424,12 @@ pub fn handle_initialize_lp_pool( None, // Collection details )?; + let amm_constituent_mapping = &mut ctx.accounts.amm_constituent_mapping; + amm_constituent_mapping + .data + .resize_with(0 as usize, AmmConstituentDatum::default); + amm_constituent_mapping.validate()?; + Ok(()) } pub fn handle_update_high_leverage_mode_config( @@ -5238,6 +5244,15 @@ pub struct InitializeLpPool<'info> { /// CHECK: Validate address by deriving pda pub metadata_account: UncheckedAccount<'info>, + #[account( + init, + seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + space = AmmConstituentMapping::space(0 as usize), + payer = admin, + )] + pub amm_constituent_mapping: Box>, + #[account( has_one = admin )] diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 8d7919873..45e723d7a 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -15,6 +15,8 @@ use crate::state::spot_market::{SpotBalance, SpotBalanceType}; use crate::state::traits::Size; use crate::{impl_zero_copy_loader, validate}; +pub const AMM_MAP_PDA_SEED: &str = "AMM_MAP"; + #[cfg(test)] mod tests; @@ -333,7 +335,7 @@ impl Constituent { // } #[zero_copy] -#[derive(Debug, BorshDeserialize, BorshSerialize)] +#[derive(Debug, Default, BorshDeserialize, BorshSerialize)] #[repr(C)] pub struct AmmConstituentDatum { pub perp_market_index: u16, @@ -367,6 +369,21 @@ pub struct AmmConstituentMapping { pub data: Vec, } +impl AmmConstituentMapping { + pub fn space(num_init_constituent_slots: usize) -> usize { + 8 + 8 + 4 + num_init_constituent_slots * 24 + } + + pub fn validate(&self) -> DriftResult<()> { + validate!( + self.data.len() >= 1 && self.data.len() <= 128, + ErrorCode::DefaultError, + "Number of constituents len must be between 1 and 128" + )?; + Ok(()) + } +} + impl_zero_copy_loader!( AmmConstituentMapping, crate::id, diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index a48a89a7d..abeca11b9 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -399,3 +399,13 @@ export function getLpPoolMintPublicKey( programId )[0]; } + +export function getAmmConstituentMappingPublicKey( + programId: PublicKey, + lpPoolPublicKey: PublicKey +): PublicKey { + return PublicKey.findProgramAddressSync([ + Buffer.from(anchor.utils.bytes.utf8.encode('AMM_MAP')), + lpPoolPublicKey.toBuffer(), + ], programId)[0]; +} diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 271eaf6ff..f13e0da94 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -38,6 +38,7 @@ import { getFuelOverflowAccountPublicKey, getLpPoolMintPublicKey, getLpPoolPublicKey, + getAmmConstituentMappingPublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; import { @@ -4223,7 +4224,17 @@ export class AdminClient extends DriftClient { const mint = getLpPoolMintPublicKey(this.program.programId, lpPool); - const lpPoolAta = getAssociatedTokenAddressSync(mint, lpPool, true); + const ammConstituentMapping = getAmmConstituentMappingPublicKey( + this.program.programId, + lpPool + ); + + const lpPoolAta = getAssociatedTokenAddressSync( + mint, + lpPool, + true + ); + const createAtaIx = createAssociatedTokenAccountInstruction( this.wallet.publicKey, lpPoolAta, @@ -4246,6 +4257,7 @@ export class AdminClient extends DriftClient { admin: this.wallet.publicKey, lpPool, mint, + ammConstituentMapping, // tokenVault: lpPoolAta, metadataAccount: metaplex.nfts().pdas().metadata({ mint, diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 8b4b3a69c..eb9da4a06 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -6984,6 +6984,11 @@ "isMut": true, "isSigner": false }, + { + "name": "ammConstituentMapping", + "isMut": true, + "isSigner": false + }, { "name": "state", "isMut": false, @@ -7580,6 +7585,13 @@ ], "type": "publicKey" }, + { + "name": "spotMarketIndex", + "docs": [ + "underlying drift spot market index" + ], + "type": "u16" + }, { "name": "constituentIndex", "docs": [ @@ -7611,28 +7623,6 @@ ], "type": "u64" }, - { - "name": "spotMarketIndex", - "docs": [ - "underlying drift spot market index" - ], - "type": "u16" - }, - { - "name": "lastOraclePrice", - "docs": [ - "oracle price at last update", - "precision: PRICE_PRECISION_I64" - ], - "type": "i64" - }, - { - "name": "lastOraclePriceTs", - "docs": [ - "timestamp of last oracle price update:" - ], - "type": "u64" - }, { "name": "spotBalance", "docs": [ @@ -7675,14 +7665,6 @@ "type": { "kind": "struct", "fields": [ - { - "name": "numRows", - "type": "u16" - }, - { - "name": "numCols", - "type": "u16" - }, { "name": "data", "type": { @@ -9634,7 +9616,7 @@ "docs": [ "PERCENTAGE_PRECISION. The weight this constituent has on the perp market" ], - "type": "u64" + "type": "i64" }, { "name": "lastSlot", @@ -9643,6 +9625,27 @@ ] } }, + { + "name": "AmmConstituentMappingFixed", + "type": { + "kind": "struct", + "fields": [ + { + "name": "len", + "type": "u32" + }, + { + "name": "pad", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, { "name": "WeightDatum", "type": { @@ -9666,7 +9669,7 @@ "docs": [ "PERCENTAGE_PRECISION. The weights of the target weight matrix" ], - "type": "u64" + "type": "i64" }, { "name": "lastSlot", @@ -9675,6 +9678,30 @@ ] } }, + { + "name": "ConstituentTargetWeightsFixed", + "type": { + "kind": "struct", + "fields": [ + { + "name": "len", + "docs": [ + "total elements in the flattened `data` vec" + ], + "type": "u32" + }, + { + "name": "pad", + "type": { + "array": [ + "u8", + 4 + ] + } + } + ] + } + }, { "name": "MarketIdentifier", "type": { @@ -12052,6 +12079,26 @@ ] } }, + { + "name": "WeightValidationFlags", + "type": { + "kind": "enum", + "variants": [ + { + "name": "NONE" + }, + { + "name": "EnforceTotalWeight100" + }, + { + "name": "NoNegativeWeights" + }, + { + "name": "NoOverweight" + } + ] + } + }, { "name": "MarginCalculationMode", "type": { diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 05831696e..05463242f 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -12,6 +12,7 @@ import { UserStatsAccount, parseLogs, getLpPoolPublicKey, + getAmmConstituentMappingPublicKey, } from '../sdk/src'; import { @@ -83,14 +84,14 @@ describe('LP Pool', () => { await initializeQuoteSpotMarket(adminClient, usdcMint.publicKey); - const tx = await adminClient.initializeLpPool( + const tx = await adminClient.initializeLpPool( lpPoolName, tokenName, tokenSymbol, tokenUri, tokenDecimals, new BN(100_000_000).mul(QUOTE_PRECISION) - ) + ); await printTxLogs(bankrunContextWrapper.connection.toConnection(), tx); }); @@ -103,6 +104,12 @@ describe('LP Pool', () => { const lpPool = await adminClient.program.account.lpPool.fetch(lpPoolKey); console.log(lpPool); - // check mint created with correct token params + // Check amm constituent map exists and has length 0 + const ammConstituentMapPublicKey = await getAmmConstituentMappingPublicKey( + program.programId, + lpPoolKey + ); + const ammConstituentMap = await adminClient.program.account.ammConstituentMap.fetch(ammConstituentMapPublicKey); + console.log(ammConstituentMap); }); }); \ No newline at end of file From 10d070e6e0e6363b7ea27eeaf9d5f9c10b0e4365 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Wed, 23 Apr 2025 17:28:22 -0700 Subject: [PATCH 16/50] init constituent --- programs/drift/src/error.rs | 2 + programs/drift/src/instructions/admin.rs | 86 ++++++++++++++++++++++- programs/drift/src/state/lp_pool.rs | 47 +++++++------ programs/drift/src/state/lp_pool/tests.rs | 10 +-- sdk/src/addresses/pda.ts | 39 ++++++++-- sdk/src/adminClient.ts | 11 +-- tests/lpPool.ts | 10 +-- 7 files changed, 167 insertions(+), 38 deletions(-) diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index 99d82468d..8cd95ad9d 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -635,6 +635,8 @@ pub enum ErrorCode { InvalidSignedMsgUserOrdersResize, #[msg("Invalid Constituent")] InvalidConstituent, + #[msg("Misatch amm mapping and constituent target weights")] + MismatchAmmConstituentMappingAndConstituentTargetWeights, } #[macro_export] diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index cd164d30a..424c26aee 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -3,7 +3,10 @@ use std::mem::size_of; use crate::msg; use crate::signer::get_signer_seeds; -use crate::state::lp_pool::{AmmConstituentDatum, AmmConstituentMapping, LPPool, AMM_MAP_PDA_SEED}; +use crate::state::lp_pool::{ + AmmConstituentDatum, AmmConstituentMapping, Constituent, ConstituentTargetWeights, LPPool, + WeightDatum, AMM_MAP_PDA_SEED, CONSITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, +}; use anchor_lang::prelude::*; use anchor_spl::metadata::{ create_metadata_accounts_v3, mpl_token_metadata::types::DataV2, CreateMetadataAccountsV3, @@ -4430,6 +4433,12 @@ pub fn handle_initialize_lp_pool( .resize_with(0 as usize, AmmConstituentDatum::default); amm_constituent_mapping.validate()?; + let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; + constituent_target_weights + .data + .resize_with(0 as usize, WeightDatum::default); + constituent_target_weights.validate()?; + Ok(()) } pub fn handle_update_high_leverage_mode_config( @@ -4478,6 +4487,33 @@ pub fn handle_update_protected_maker_mode_config( Ok(()) } +pub fn handle_initialize_constituent<'info>( + ctx: Context, + spot_market_index: u16, + decimals: u8, + max_weight_deviation: i64, + swap_fee_min: i64, + swap_fee_max: i64, +) -> Result<()> { + let mut constituent = ctx.accounts.constituent.load_init()?; + + let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; + let current_len = constituent_target_weights.data.len(); + + constituent_target_weights + .data + .resize_with((current_len + 1) as usize, WeightDatum::default); + constituent_target_weights.validate()?; + + constituent.spot_market_index = spot_market_index; + constituent.decimals = decimals; + constituent.max_weight_deviation = max_weight_deviation; + constituent.swap_fee_min = swap_fee_min; + constituent.swap_fee_max = swap_fee_max; + + Ok(()) +} + #[derive(Accounts)] pub struct Initialize<'info> { #[account(mut)] @@ -5253,6 +5289,15 @@ pub struct InitializeLpPool<'info> { )] pub amm_constituent_mapping: Box>, + #[account( + init, + seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + space = ConstituentTargetWeights::space(0 as usize), + payer = admin, + )] + pub constituent_target_weights: Box>, + #[account( has_one = admin )] @@ -5264,3 +5309,42 @@ pub struct InitializeLpPool<'info> { pub rent: Sysvar<'info, Rent>, pub system_program: Program<'info, System>, } + +#[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], + spot_market_index: u16, +)] +pub struct InitializeConstituent<'info> { + #[account(mut)] + pub admin: Signer<'info>, + + #[account( + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, + + #[account( + mut, + seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + realloc = ConstituentTargetWeights::space(constituent_target_weights.data.len() + 1 as usize), + realloc::payer = admin, + realloc::zero = false, + )] + pub constituent_target_weights: Box>, + + #[account( + init, + seeds = [CONSITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), spot_market_index.to_le_bytes().as_ref()], + bump, + space = Constituent::SIZE, + payer = admin, + )] + pub constituent: AccountLoader<'info, Constituent>, + + #[account(mut)] + pub payer: Signer<'info>, + pub system_program: Program<'info, System>, +} diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 45e723d7a..3add22c94 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,8 +1,6 @@ -use std::ops::Neg; - use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64, PRICE_PRECISION_U64}; +use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64}; use crate::math::safe_math::SafeMath; use anchor_lang::prelude::*; use anchor_spl::token::Mint; @@ -10,12 +8,14 @@ use borsh::{BorshDeserialize, BorshSerialize}; use super::oracle_map::OracleMap; use super::spot_market::SpotMarket; -use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen, ToZeroCopy, ZeroCopyLoader}; +use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen}; use crate::state::spot_market::{SpotBalance, SpotBalanceType}; use crate::state::traits::Size; use crate::{impl_zero_copy_loader, validate}; pub const AMM_MAP_PDA_SEED: &str = "AMM_MAP"; +pub const CONSITUENT_PDA_SEED: &str = "CONSTITUENT"; +pub const CONSTITUENT_TARGET_WEIGHT_PDA_SEED: &str = "CONSTITUENT_TARGET_WEIGHTS"; #[cfg(test)] mod tests; @@ -268,6 +268,10 @@ pub struct Constituent { pub padding: [u8; 16], } +impl Size for Constituent { + const SIZE: usize = 108; +} + impl Constituent { /// Returns the full balance of the Constituent, the total of the amount in Constituent's token /// account and in Drift Borrow-Lend. @@ -370,13 +374,13 @@ pub struct AmmConstituentMapping { } impl AmmConstituentMapping { - pub fn space(num_init_constituent_slots: usize) -> usize { - 8 + 8 + 4 + num_init_constituent_slots * 24 + pub fn space(num_constituents: usize) -> usize { + 8 + 8 + 4 + num_constituents * 24 } pub fn validate(&self) -> DriftResult<()> { validate!( - self.data.len() >= 1 && self.data.len() <= 128, + self.data.len() >= 0 && self.data.len() <= 128, ErrorCode::DefaultError, "Number of constituents len must be between 1 and 128" )?; @@ -392,12 +396,9 @@ impl_zero_copy_loader!( ); #[zero_copy] -#[derive(Debug, BorshDeserialize, BorshSerialize)] +#[derive(Debug, Default, BorshDeserialize, BorshSerialize)] #[repr(C)] pub struct WeightDatum { - pub constituent_index: u16, - pub padding: [u8; 6], - /// PERCENTAGE_PRECISION. The weights of the target weight matrix pub data: i64, pub last_slot: u64, } @@ -425,6 +426,21 @@ pub struct ConstituentTargetWeights { pub data: Vec, } +impl ConstituentTargetWeights { + pub fn space(num_constituents: usize) -> usize { + 8 + 8 + 4 + num_constituents * 16 + } + + pub fn validate(&self) -> DriftResult<()> { + validate!( + self.data.len() >= 0 && self.data.len() <= 128, + ErrorCode::DefaultError, + "Number of constituents len must be between 1 and 128" + )?; + Ok(()) + } +} + impl_zero_copy_loader!( ConstituentTargetWeights, crate::id, @@ -458,13 +474,6 @@ impl<'a> AccountZeroCopy<'a, WeightDatum, ConstituentTargetWeightsFixed> { self.len() )?; let datum = self.get(constituent_index as u32); - validate!( - datum.constituent_index == constituent_index, - ErrorCode::InvalidConstituent, - "Invalid constituent_index = {}, ConstituentTargetWeights len = {}", - datum.constituent_index, - self.len() - )?; Ok(datum.data) } } @@ -519,8 +528,6 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { } let cell = self.get_mut(i as u32); - cell.constituent_index = *constituent_index; - cell.padding = [0; 6]; cell.data = target_weight as i64; cell.last_slot = slot; } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 6039eb8f9..bcbce3f99 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -57,7 +57,7 @@ mod tests { len: 1, ..ConstituentTargetWeightsFixed::default() }); - let target_data = RefCell::new([0u8; 24]); + let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { fixed: target_fixed.borrow_mut(), @@ -120,7 +120,7 @@ mod tests { len: 1, ..ConstituentTargetWeightsFixed::default() }); - let target_data = RefCell::new([0u8; 24]); + let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { fixed: target_fixed.borrow_mut(), @@ -194,7 +194,7 @@ mod tests { len: amm_mapping_data.len() as u32, ..ConstituentTargetWeightsFixed::default() }); - let target_data = RefCell::new([0u8; 48]); + let target_data = RefCell::new([0u8; 32]); let mut target_zc_mut = AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { fixed: target_fixed.borrow_mut(), @@ -260,7 +260,7 @@ mod tests { len: 1, ..ConstituentTargetWeightsFixed::default() }); - let target_data = RefCell::new([0u8; 24]); + let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { fixed: target_fixed.borrow_mut(), @@ -323,7 +323,7 @@ mod tests { len: 1, ..ConstituentTargetWeightsFixed::default() }); - let target_data = RefCell::new([0u8; 24]); + let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { fixed: target_fixed.borrow_mut(), diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index abeca11b9..7a2a9e628 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -404,8 +404,39 @@ export function getAmmConstituentMappingPublicKey( programId: PublicKey, lpPoolPublicKey: PublicKey ): PublicKey { - return PublicKey.findProgramAddressSync([ - Buffer.from(anchor.utils.bytes.utf8.encode('AMM_MAP')), - lpPoolPublicKey.toBuffer(), - ], programId)[0]; + return PublicKey.findProgramAddressSync( + [ + Buffer.from(anchor.utils.bytes.utf8.encode('AMM_MAP')), + lpPoolPublicKey.toBuffer(), + ], + programId + )[0]; +} + +export function getConstituentTargetWeightsPublicKey( + programId: PublicKey, + lpPoolPublicKey: PublicKey +): PublicKey { + return PublicKey.findProgramAddressSync( + [ + Buffer.from(anchor.utils.bytes.utf8.encode('CONSTITUENT_TARGET_WEIGHTS')), + lpPoolPublicKey.toBuffer(), + ], + programId + )[0]; +} + +export function getConstituentPublicKey( + programId: PublicKey, + lpPoolPublicKey: PublicKey, + spotMarketIndex: number +): PublicKey { + return PublicKey.findProgramAddressSync( + [ + Buffer.from(anchor.utils.bytes.utf8.encode('CONSTITUENT')), + lpPoolPublicKey.toBuffer(), + new anchor.BN(spotMarketIndex).toArrayLike(Buffer, 'le', 2), + ], + programId + )[0]; } diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index f13e0da94..ce75c36b9 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -39,6 +39,7 @@ import { getLpPoolMintPublicKey, getLpPoolPublicKey, getAmmConstituentMappingPublicKey, + getConstituentTargetWeightsPublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; import { @@ -4229,12 +4230,13 @@ export class AdminClient extends DriftClient { lpPool ); - const lpPoolAta = getAssociatedTokenAddressSync( - mint, - lpPool, - true + const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + this.program.programId, + lpPool ); + const lpPoolAta = getAssociatedTokenAddressSync(mint, lpPool, true); + const createAtaIx = createAssociatedTokenAccountInstruction( this.wallet.publicKey, lpPoolAta, @@ -4258,6 +4260,7 @@ export class AdminClient extends DriftClient { lpPool, mint, ammConstituentMapping, + constituentTargetWeights, // tokenVault: lpPoolAta, metadataAccount: metaplex.nfts().pdas().metadata({ mint, diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 05463242f..d78d34b7d 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -83,8 +83,7 @@ describe('LP Pool', () => { await adminClient.subscribe(); await initializeQuoteSpotMarket(adminClient, usdcMint.publicKey); - - const tx = await adminClient.initializeLpPool( + const tx = await adminClient.initializeLpPool( lpPoolName, tokenName, tokenSymbol, @@ -109,7 +108,10 @@ describe('LP Pool', () => { program.programId, lpPoolKey ); - const ammConstituentMap = await adminClient.program.account.ammConstituentMap.fetch(ammConstituentMapPublicKey); + const ammConstituentMap = + await adminClient.program.account.ammConstituentMap.fetch( + ammConstituentMapPublicKey + ); console.log(ammConstituentMap); }); -}); \ No newline at end of file +}); From 1d7fd00c33ff3c4f230be258099ff203be384566 Mon Sep 17 00:00:00 2001 From: wphan Date: Wed, 23 Apr 2025 18:47:18 -0700 Subject: [PATCH 17/50] add initializeLpPool test (#1585) * add initializeLpPool test * add check for constituent target weights --- Cargo.lock | 15 +- package.json | 5 +- programs/drift/Cargo.toml | 3 +- programs/drift/src/instructions/admin.rs | 186 ++- sdk/package.json | 1 - sdk/src/addresses/pda.ts | 17 +- sdk/src/adminClient.ts | 49 +- sdk/src/idl/drift.json | 53 +- sdk/yarn.lock | 1617 +--------------------- test-scripts/single-anchor-test.sh | 2 +- tests/fixtures/token_2022.so | Bin 0 -> 1382016 bytes tests/lpPool.ts | 86 +- yarn.lock | 89 +- 13 files changed, 361 insertions(+), 1762 deletions(-) create mode 100755 tests/fixtures/token_2022.so diff --git a/Cargo.lock b/Cargo.lock index f187d71ff..2051dcf9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,7 +214,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" dependencies = [ "anchor-lang", - "mpl-token-metadata", "solana-program", "spl-associated-token-account", "spl-token 4.0.0", @@ -984,6 +983,7 @@ dependencies = [ "serum_dex", "solana-program", "solana-security-txt", + "spl-token-metadata-interface", "static_assertions", "switchboard", "switchboard-on-demand", @@ -1472,19 +1472,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "mpl-token-metadata" -version = "3.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba8ee05284d79b367ae8966d558e1a305a781fc80c9df51f37775169117ba64f" -dependencies = [ - "borsh 0.9.3", - "num-derive 0.3.3", - "num-traits", - "solana-program", - "thiserror", -] - [[package]] name = "num" version = "0.4.0" diff --git a/package.json b/package.json index bae7e67b0..65a25c4fc 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "@project-serum/common": "0.0.1-beta.3", "@project-serum/serum": "0.13.65", "@pythnetwork/client": "2.21.0", - "@solana/spl-token": "0.3.7", + "@solana/spl-token": "0.4.13", "@solana/web3.js": "1.73.2", + "@solana/spl-token-metadata": "0.1.6", "@types/bn.js": "5.1.6", "@types/chai": "5.0.0", "@types/mocha": "8.2.3", @@ -53,4 +54,4 @@ "engines": { "node": ">=12" } -} \ No newline at end of file +} diff --git a/programs/drift/Cargo.toml b/programs/drift/Cargo.toml index d80fa8c42..1549d76ec 100644 --- a/programs/drift/Cargo.toml +++ b/programs/drift/Cargo.toml @@ -20,7 +20,8 @@ drift-rs=[] [dependencies] anchor-lang = "0.29.0" solana-program = "1.16" -anchor-spl = { version = "0.29.0", features = ["metadata"] } +anchor-spl = { version = "0.29.0", features = [] } +spl-token-metadata-interface = "0.2.0" pyth-client = "0.2.2" pyth-lazer-solana-contract = { git = "https://github.com/drift-labs/pyth-crosschain", rev = "d790d1cb4da873a949cf33ff70349b7614b232eb", features = ["no-entrypoint"]} pythnet-sdk = { git = "https://github.com/drift-labs/pyth-crosschain", rev = "3e8a24ecd0bcf22b787313e2020f4186bb22c729"} diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 424c26aee..7d56ab234 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -8,17 +8,24 @@ use crate::state::lp_pool::{ WeightDatum, AMM_MAP_PDA_SEED, CONSITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, }; use anchor_lang::prelude::*; -use anchor_spl::metadata::{ - create_metadata_accounts_v3, mpl_token_metadata::types::DataV2, CreateMetadataAccountsV3, - Metadata, -}; use anchor_spl::token::Token; +use anchor_spl::token_2022::spl_token_2022::{ + extension::{metadata_pointer::instruction as mp_ix, ExtensionType}, + instruction as token2022_ix, + state::Mint as Mint2022, + ID as TOKEN_2022_ID, +}; use anchor_spl::token_2022::Token2022; +use anchor_spl::token_interface::spl_token_2022::extension::{ + BaseStateWithExtensions, StateWithExtensions, +}; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use phoenix::quantities::WrapperU64; use pyth_solana_receiver_sdk::cpi::accounts::InitPriceUpdate; use pyth_solana_receiver_sdk::program::PythSolanaReceiver; use serum_dex::state::ToAlignedBytes; +use spl_token_metadata_interface::instruction::initialize as initialize_metadata_ix; +use spl_token_metadata_interface::state::TokenMetadata; use crate::controller::token::close_vault; use crate::error::ErrorCode; @@ -4374,17 +4381,20 @@ pub fn handle_initialize_lp_pool( token_name: String, token_symbol: String, token_uri: String, - _token_decimals: u8, + token_decimals: u8, max_aum: u64, ) -> Result<()> { let mut lp_pool = ctx.accounts.lp_pool.load_init()?; let state = &mut ctx.accounts.state; + let mint = ctx.accounts.mint.key(); + let mint_authority = ctx.accounts.lp_pool.key(); + let lp_pool_seeds = &[b"lp_pool" as &[u8], name.as_ref(), &[ctx.bumps.lp_pool]]; + let mint_authority_signer = &[&lp_pool_seeds[..]]; *lp_pool = LPPool { name, pubkey: ctx.accounts.lp_pool.key(), - mint: ctx.accounts.mint.key(), - // token_vault: ctx.accounts.token_vault.key(), + mint, constituents: 0, max_aum, last_aum: 0, @@ -4396,35 +4406,111 @@ pub fn handle_initialize_lp_pool( _padding: [0; 6], }; - let signature_seeds = get_signer_seeds(&state.signer_nonce); - let signers = &[&signature_seeds[..]]; - - create_metadata_accounts_v3( - CpiContext::new_with_signer( - ctx.accounts.token_metadata_program.to_account_info(), - CreateMetadataAccountsV3 { - metadata: ctx.accounts.metadata_account.to_account_info(), - mint: ctx.accounts.mint.to_account_info(), - mint_authority: ctx.accounts.lp_pool.to_account_info(), - update_authority: ctx.accounts.lp_pool.to_account_info(), - payer: ctx.accounts.admin.to_account_info(), - system_program: ctx.accounts.system_program.to_account_info(), - rent: ctx.accounts.rent.to_account_info(), - }, - signers, + drop(lp_pool); + + // 1) allocate space for mint account + let space = + ExtensionType::try_calculate_account_len::(&[ExtensionType::MetadataPointer])?; + let lamports = Rent::get()?.minimum_balance(space); + + anchor_lang::solana_program::program::invoke( + &anchor_lang::solana_program::system_instruction::create_account( + &ctx.accounts.admin.key(), + &mint, + lamports, + space as u64, + &TOKEN_2022_ID, ), - DataV2 { - name: token_name, - symbol: token_symbol, - uri: token_uri, - seller_fee_basis_points: 0, - creators: None, - collection: None, - uses: None, - }, - false, // Is mutable - true, // Update authority is signer - None, // Collection details + &[ + ctx.accounts.admin.to_account_info(), + ctx.accounts.mint.to_account_info(), + ctx.accounts.token_program.to_account_info(), + ctx.accounts.system_program.to_account_info(), + ], + )?; + + // 2) init metadata pointer extension + let ix = mp_ix::initialize( + &TOKEN_2022_ID, + &mint, + Some(ctx.accounts.admin.key()), + Some(mint), // self reference since metadata is on the mint + )?; + anchor_lang::solana_program::program::invoke( + &ix, + &[ + ctx.accounts.mint.to_account_info(), + ctx.accounts.admin.to_account_info(), + ], + // signers, + )?; + + // 3) init mint account + let ix = token2022_ix::initialize_mint2( + &TOKEN_2022_ID, + &mint, + &mint_authority, + None, // no freeze auth + token_decimals, + )?; + anchor_lang::solana_program::program::invoke_signed( + &ix, + &[ + ctx.accounts.mint.to_account_info(), + ctx.accounts.lp_pool.to_account_info(), + ctx.accounts.token_program.to_account_info(), + ], + mint_authority_signer, + )?; + + // 4) ensure mint account has enough rent for metadata extension + let metadata = TokenMetadata { + name: token_name, + symbol: token_symbol, + uri: token_uri, + ..Default::default() + }; + let mint_data = ctx.accounts.mint.try_borrow_data()?; + let mint_unpacked = StateWithExtensions::::unpack(&mint_data)?; + let new_account_len = mint_unpacked + .try_get_new_account_len::(&metadata)?; + let new_rent_exempt_minimum = Rent::get()?.minimum_balance(new_account_len); + let additional_rent = new_rent_exempt_minimum.saturating_sub(ctx.accounts.mint.lamports()); + drop(mint_data); + + anchor_lang::solana_program::program::invoke( + &anchor_lang::solana_program::system_instruction::transfer( + ctx.accounts.admin.key, + &mint, + additional_rent, + ), + &[ + ctx.accounts.admin.to_account_info(), + ctx.accounts.mint.to_account_info(), + ctx.accounts.system_program.to_account_info(), + ], + )?; + + // 5) write metadata info + let ix = initialize_metadata_ix( + &TOKEN_2022_ID, + &mint, + &ctx.accounts.admin.key(), + &mint, + &mint_authority, + metadata.name, + metadata.symbol, + metadata.uri, + ); + + anchor_lang::solana_program::program::invoke_signed( + &ix, + &[ + ctx.accounts.mint.to_account_info(), + ctx.accounts.admin.to_account_info(), + ctx.accounts.lp_pool.to_account_info(), + ], + mint_authority_signer, )?; let amm_constituent_mapping = &mut ctx.accounts.amm_constituent_mapping; @@ -5256,29 +5342,10 @@ pub struct InitializeLpPool<'info> { payer = admin )] pub lp_pool: AccountLoader<'info, LPPool>, - #[account( - init, - seeds = [b"mint", lp_pool.key().as_ref()], - bump, - payer = admin, - mint::decimals = token_decimals, - mint::authority = lp_pool.key(), - mint::freeze_authority = lp_pool.key(), - )] - pub mint: InterfaceAccount<'info, Mint>, - // #[account( - // token::authority = lp_pool.key(), - // token::mint = mint.key() - // )] - // pub token_vault: InterfaceAccount<'info, TokenAccount>, - #[account( - mut, - seeds = [b"metadata", token_metadata_program.key().as_ref(), mint.key().as_ref()], - bump, - seeds::program = token_metadata_program.key(), - )] - /// CHECK: Validate address by deriving pda - pub metadata_account: UncheckedAccount<'info>, + + #[account(mut)] + /// CHECK: account created in ix + pub mint: Signer<'info>, #[account( init, @@ -5303,8 +5370,7 @@ pub struct InitializeLpPool<'info> { )] pub state: Box>, - pub token_program: Program<'info, Token>, - pub token_metadata_program: Program<'info, Metadata>, + pub token_program: Program<'info, Token2022>, pub rent: Sysvar<'info, Rent>, pub system_program: Program<'info, System>, diff --git a/sdk/package.json b/sdk/package.json index 77ec906a1..2366daeef 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -40,7 +40,6 @@ "@coral-xyz/anchor-30": "npm:@coral-xyz/anchor@0.30.1", "@ellipsis-labs/phoenix-sdk": "1.4.5", "@grpc/grpc-js": "1.12.6", - "@metaplex-foundation/js": "0.20.1", "@openbook-dex/openbook-v2": "0.2.10", "@project-serum/serum": "0.13.65", "@pythnetwork/client": "2.5.3", diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index 7a2a9e628..b8cab80f5 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -382,20 +382,13 @@ export function getProtectedMakerModeConfigPublicKey( export function getLpPoolPublicKey( programId: PublicKey, - name: string -): PublicKey { - return PublicKey.findProgramAddressSync( - [Buffer.from(anchor.utils.bytes.utf8.encode('lp_pool')), Buffer.from(name)], - programId - )[0]; -} - -export function getLpPoolMintPublicKey( - programId: PublicKey, - lpPoolPublicKey: PublicKey + nameBuffer: number[] ): PublicKey { return PublicKey.findProgramAddressSync( - [Buffer.from('mint'), lpPoolPublicKey.toBuffer()], + [ + Buffer.from(anchor.utils.bytes.utf8.encode('lp_pool')), + Buffer.from(nameBuffer), + ], programId )[0]; } diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index ce75c36b9..49e660c13 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -1,4 +1,5 @@ import { + Keypair, PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, @@ -36,7 +37,6 @@ import { getPythLazerOraclePublicKey, getProtectedMakerModeConfigPublicKey, getFuelOverflowAccountPublicKey, - getLpPoolMintPublicKey, getLpPoolPublicKey, getAmmConstituentMappingPublicKey, getConstituentTargetWeightsPublicKey, @@ -46,6 +46,7 @@ import { createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID, + TOKEN_2022_PROGRAM_ID, } from '@solana/spl-token'; import { DriftClient } from './driftClient'; import { @@ -63,8 +64,6 @@ import { DRIFT_ORACLE_RECEIVER_ID } from './config'; import { getFeedIdUint8Array } from './util/pythOracleUtils'; import { FUEL_RESET_LOG_ACCOUNT } from './constants/txConstants'; -import { Metaplex } from '@metaplex-foundation/js'; - const OPENBOOK_PROGRAM_ID = new PublicKey( 'opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb' ); @@ -4196,7 +4195,8 @@ export class AdminClient extends DriftClient { tokenSymbol: string, tokenUri: string, tokenDecimals: number, - maxAum: BN + maxAum: BN, + mint: Keypair ): Promise { const ixs = await this.getInitializeLpPoolIx( name, @@ -4204,10 +4204,11 @@ export class AdminClient extends DriftClient { tokenSymbol, tokenUri, tokenDecimals, - maxAum + maxAum, + mint ); const tx = await this.buildTransaction(ixs); - const { txSig } = await this.sendTransaction(tx); + const { txSig } = await this.sendTransaction(tx, [mint]); return txSig; } @@ -4217,38 +4218,37 @@ export class AdminClient extends DriftClient { tokenSymbol: string, tokenUri: string, tokenDecimals: number, - maxAum: BN + maxAum: BN, + mint: Keypair ): Promise { - const metaplex = new Metaplex(this.connection, { cluster: 'custom' }); - - const lpPool = getLpPoolPublicKey(this.program.programId, name); - - const mint = getLpPoolMintPublicKey(this.program.programId, lpPool); - + const lpPool = getLpPoolPublicKey(this.program.programId, encodeName(name)); const ammConstituentMapping = getAmmConstituentMappingPublicKey( this.program.programId, lpPool ); - const constituentTargetWeights = getConstituentTargetWeightsPublicKey( this.program.programId, lpPool ); - - const lpPoolAta = getAssociatedTokenAddressSync(mint, lpPool, true); - + const lpPoolAta = getAssociatedTokenAddressSync( + mint.publicKey, + lpPool, + true, + TOKEN_2022_PROGRAM_ID + ); const createAtaIx = createAssociatedTokenAccountInstruction( this.wallet.publicKey, lpPoolAta, lpPool, - mint + mint.publicKey, + TOKEN_2022_PROGRAM_ID ); const state = await this.getStatePublicKey(); return [ this.program.instruction.initializeLpPool( - Buffer.from(name), + encodeName(name), tokenName, tokenSymbol, tokenUri, @@ -4258,20 +4258,15 @@ export class AdminClient extends DriftClient { accounts: { admin: this.wallet.publicKey, lpPool, - mint, ammConstituentMapping, constituentTargetWeights, - // tokenVault: lpPoolAta, - metadataAccount: metaplex.nfts().pdas().metadata({ - mint, - }), + mint: mint.publicKey, state, - tokenProgram: TOKEN_PROGRAM_ID, - tokenMetadataProgram: metaplex.programs().getTokenMetadata() - .address, + tokenProgram: TOKEN_2022_PROGRAM_ID, rent: SYSVAR_RENT_PUBKEY, systemProgram: SystemProgram.programId, }, + signers: [mint], } ), createAtaIx, diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index eb9da4a06..adcf9db9e 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -6977,15 +6977,15 @@ { "name": "mint", "isMut": true, - "isSigner": false + "isSigner": true }, { - "name": "metadataAccount", + "name": "ammConstituentMapping", "isMut": true, "isSigner": false }, { - "name": "ammConstituentMapping", + "name": "constituentTargetWeights", "isMut": true, "isSigner": false }, @@ -6999,11 +6999,6 @@ "isMut": false, "isSigner": false }, - { - "name": "tokenMetadataProgram", - "isMut": false, - "isSigner": false - }, { "name": "rent", "isMut": false, @@ -7599,29 +7594,33 @@ ], "type": "u16" }, + { + "name": "decimals", + "type": "u8" + }, { "name": "maxWeightDeviation", "docs": [ "max deviation from target_weight allowed for the constituent", "precision: PERCENTAGE_PRECISION" ], - "type": "u64" + "type": "i64" }, { "name": "swapFeeMin", "docs": [ - "min fee charged on swaps to this constituent", + "min fee charged on swaps to/from this constituent", "precision: PERCENTAGE_PRECISION" ], - "type": "u64" + "type": "i64" }, { - "name": "maxFeePremium", + "name": "swapFeeMax", "docs": [ - "max premium to be applied to swap_fee_min when the constituent is at max deviation from target_weight", + "max fee charged on swaps to/from this constituent", "precision: PERCENTAGE_PRECISION" ], - "type": "u64" + "type": "i64" }, { "name": "spotBalance", @@ -9651,24 +9650,8 @@ "type": { "kind": "struct", "fields": [ - { - "name": "constituentIndex", - "type": "u16" - }, - { - "name": "padding", - "type": { - "array": [ - "u8", - 6 - ] - } - }, { "name": "data", - "docs": [ - "PERCENTAGE_PRECISION. The weights of the target weight matrix" - ], "type": "i64" }, { @@ -15532,6 +15515,16 @@ "code": 6313, "name": "InvalidSignedMsgUserOrdersResize", "msg": "Invalid SignedMsgUserOrders resize" + }, + { + "code": 6314, + "name": "InvalidConstituent", + "msg": "Invalid Constituent" + }, + { + "code": 6315, + "name": "MismatchAmmConstituentMappingAndConstituentTargetWeights", + "msg": "Misatch amm mapping and constituent target weights" } ], "metadata": { diff --git a/sdk/yarn.lock b/sdk/yarn.lock index ccf932af2..3d446cd83 100644 --- a/sdk/yarn.lock +++ b/sdk/yarn.lock @@ -138,341 +138,6 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@ethereumjs/rlp@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" - integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== - -"@ethereumjs/util@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.1.0.tgz#299df97fb6b034e0577ce9f94c7d9d1004409ed4" - integrity sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA== - dependencies: - "@ethereumjs/rlp" "^4.0.1" - ethereum-cryptography "^2.0.0" - micro-ftch "^0.3.1" - -"@ethersproject/abi@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.8.0.tgz#e79bb51940ac35fe6f3262d7fe2cdb25ad5f07d9" - integrity sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q== - dependencies: - "@ethersproject/address" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/hash" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - -"@ethersproject/abstract-provider@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz#7581f9be601afa1d02b95d26b9d9840926a35b0c" - integrity sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg== - dependencies: - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/networks" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - "@ethersproject/web" "^5.8.0" - -"@ethersproject/abstract-signer@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz#8d7417e95e4094c1797a9762e6789c7356db0754" - integrity sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA== - dependencies: - "@ethersproject/abstract-provider" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - -"@ethersproject/address@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.8.0.tgz#3007a2c352eee566ad745dca1dbbebdb50a6a983" - integrity sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA== - dependencies: - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/rlp" "^5.8.0" - -"@ethersproject/base64@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.8.0.tgz#61c669c648f6e6aad002c228465d52ac93ee83eb" - integrity sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ== - dependencies: - "@ethersproject/bytes" "^5.8.0" - -"@ethersproject/basex@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.8.0.tgz#1d279a90c4be84d1c1139114a1f844869e57d03a" - integrity sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - -"@ethersproject/bignumber@^5.7.0", "@ethersproject/bignumber@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.8.0.tgz#c381d178f9eeb370923d389284efa19f69efa5d7" - integrity sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - bn.js "^5.2.1" - -"@ethersproject/bytes@^5.7.0", "@ethersproject/bytes@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.8.0.tgz#9074820e1cac7507a34372cadeb035461463be34" - integrity sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A== - dependencies: - "@ethersproject/logger" "^5.8.0" - -"@ethersproject/constants@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.8.0.tgz#12f31c2f4317b113a4c19de94e50933648c90704" - integrity sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg== - dependencies: - "@ethersproject/bignumber" "^5.8.0" - -"@ethersproject/contracts@^5.7.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.8.0.tgz#243a38a2e4aa3e757215ea64e276f8a8c9d8ed73" - integrity sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ== - dependencies: - "@ethersproject/abi" "^5.8.0" - "@ethersproject/abstract-provider" "^5.8.0" - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/address" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - -"@ethersproject/hash@^5.7.0", "@ethersproject/hash@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.8.0.tgz#b8893d4629b7f8462a90102572f8cd65a0192b4c" - integrity sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA== - dependencies: - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/address" "^5.8.0" - "@ethersproject/base64" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - -"@ethersproject/hdnode@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.8.0.tgz#a51ae2a50bcd48ef6fd108c64cbae5e6ff34a761" - integrity sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA== - dependencies: - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/basex" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/pbkdf2" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/sha2" "^5.8.0" - "@ethersproject/signing-key" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - "@ethersproject/wordlists" "^5.8.0" - -"@ethersproject/json-wallets@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.8.0.tgz#d18de0a4cf0f185f232eb3c17d5e0744d97eb8c9" - integrity sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w== - dependencies: - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/address" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/hdnode" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/pbkdf2" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/random" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/keccak256@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.8.0.tgz#d2123a379567faf2d75d2aaea074ffd4df349e6a" - integrity sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng== - dependencies: - "@ethersproject/bytes" "^5.8.0" - js-sha3 "0.8.0" - -"@ethersproject/logger@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.8.0.tgz#f0232968a4f87d29623a0481690a2732662713d6" - integrity sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA== - -"@ethersproject/networks@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.8.0.tgz#8b4517a3139380cba9fb00b63ffad0a979671fde" - integrity sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg== - dependencies: - "@ethersproject/logger" "^5.8.0" - -"@ethersproject/pbkdf2@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.8.0.tgz#cd2621130e5dd51f6a0172e63a6e4a0c0a0ec37e" - integrity sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/sha2" "^5.8.0" - -"@ethersproject/properties@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.8.0.tgz#405a8affb6311a49a91dabd96aeeae24f477020e" - integrity sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw== - dependencies: - "@ethersproject/logger" "^5.8.0" - -"@ethersproject/providers@^5.7.2": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.8.0.tgz#6c2ae354f7f96ee150439f7de06236928bc04cb4" - integrity sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw== - dependencies: - "@ethersproject/abstract-provider" "^5.8.0" - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/address" "^5.8.0" - "@ethersproject/base64" "^5.8.0" - "@ethersproject/basex" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/hash" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/networks" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/random" "^5.8.0" - "@ethersproject/rlp" "^5.8.0" - "@ethersproject/sha2" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - "@ethersproject/web" "^5.8.0" - bech32 "1.1.4" - ws "8.18.0" - -"@ethersproject/random@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.8.0.tgz#1bced04d49449f37c6437c701735a1a022f0057a" - integrity sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - -"@ethersproject/rlp@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.8.0.tgz#5a0d49f61bc53e051532a5179472779141451de5" - integrity sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - -"@ethersproject/sha2@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.8.0.tgz#8954a613bb78dac9b46829c0a95de561ef74e5e1" - integrity sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - hash.js "1.1.7" - -"@ethersproject/signing-key@^5.7.0", "@ethersproject/signing-key@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.8.0.tgz#9797e02c717b68239c6349394ea85febf8893119" - integrity sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - bn.js "^5.2.1" - elliptic "6.6.1" - hash.js "1.1.7" - -"@ethersproject/strings@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.8.0.tgz#ad79fafbf0bd272d9765603215ac74fd7953908f" - integrity sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - -"@ethersproject/transactions@^5.7.0", "@ethersproject/transactions@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.8.0.tgz#1e518822403abc99def5a043d1c6f6fe0007e46b" - integrity sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg== - dependencies: - "@ethersproject/address" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/constants" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/rlp" "^5.8.0" - "@ethersproject/signing-key" "^5.8.0" - -"@ethersproject/wallet@^5.7.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.8.0.tgz#49c300d10872e6986d953e8310dc33d440da8127" - integrity sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA== - dependencies: - "@ethersproject/abstract-provider" "^5.8.0" - "@ethersproject/abstract-signer" "^5.8.0" - "@ethersproject/address" "^5.8.0" - "@ethersproject/bignumber" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/hash" "^5.8.0" - "@ethersproject/hdnode" "^5.8.0" - "@ethersproject/json-wallets" "^5.8.0" - "@ethersproject/keccak256" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/random" "^5.8.0" - "@ethersproject/signing-key" "^5.8.0" - "@ethersproject/transactions" "^5.8.0" - "@ethersproject/wordlists" "^5.8.0" - -"@ethersproject/web@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.8.0.tgz#3e54badc0013b7a801463a7008a87988efce8a37" - integrity sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw== - dependencies: - "@ethersproject/base64" "^5.8.0" - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - -"@ethersproject/wordlists@^5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.8.0.tgz#7a5654ee8d1bb1f4dbe43f91d217356d650ad821" - integrity sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg== - dependencies: - "@ethersproject/bytes" "^5.8.0" - "@ethersproject/hash" "^5.8.0" - "@ethersproject/logger" "^5.8.0" - "@ethersproject/properties" "^5.8.0" - "@ethersproject/strings" "^5.8.0" - "@grpc/grpc-js@1.12.6", "@grpc/grpc-js@^1.8.0", "@grpc/grpc-js@^1.8.13": version "1.12.6" resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.12.6.tgz#a3586ffdfb6a1f5cd5b4866dec9074c4a1e65472" @@ -491,56 +156,6 @@ protobufjs "^7.2.5" yargs "^17.7.2" -"@irys/arweave@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@irys/arweave/-/arweave-0.0.2.tgz#c0e73eb8c15e323342d33ea92701d4036fd22ae3" - integrity sha512-ddE5h4qXbl0xfGlxrtBIwzflaxZUDlDs43TuT0u1OMfyobHul4AA1VEX72Rpzw2bOh4vzoytSqA1jCM7x9YtHg== - dependencies: - asn1.js "^5.4.1" - async-retry "^1.3.3" - axios "^1.4.0" - base64-js "^1.5.1" - bignumber.js "^9.1.1" - -"@irys/query@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@irys/query/-/query-0.0.1.tgz#c0aa3eff9eef585d2b3d8d9e358b1c5942015414" - integrity sha512-7TCyR+Qn+F54IQQx5PlERgqNwgIQik8hY55iZl/silTHhCo1MI2pvx5BozqPUVCc8/KqRsc2nZd8Bc29XGUjRQ== - dependencies: - async-retry "^1.3.3" - axios "^1.4.0" - -"@irys/sdk@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@irys/sdk/-/sdk-0.0.2.tgz#36e86d44143ce6f7576fd3fe53800fe842697de8" - integrity sha512-un/e/CmTpgT042gDwCN3AtISrR9OYGMY6V+442pFmSWKrwrsDoIXZ8VlLiYKnrtTm+yquGhjfYy0LDqGWq41pA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/contracts" "^5.7.0" - "@ethersproject/providers" "^5.7.2" - "@ethersproject/wallet" "^5.7.0" - "@irys/query" "^0.0.1" - "@near-js/crypto" "^0.0.3" - "@near-js/keystores-browser" "^0.0.3" - "@near-js/providers" "^0.0.4" - "@near-js/transactions" "^0.1.0" - "@solana/web3.js" "^1.36.0" - "@supercharge/promise-pool" "^3.0.0" - algosdk "^1.13.1" - aptos "=1.8.5" - arbundles "^0.10.0" - async-retry "^1.3.3" - axios "^1.4.0" - base64url "^3.0.1" - bignumber.js "^9.0.1" - bs58 "5.0.0" - commander "^8.2.0" - csv "5.5.3" - inquirer "^8.2.0" - js-sha256 "^0.9.0" - mime-types "^2.1.34" - near-seed-phrase "^0.2.0" - "@isaacs/ttlcache@^1.4.1": version "1.4.1" resolved "https://registry.yarnpkg.com/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz#21fb23db34e9b6220c6ba023a0118a2dd3461ea2" @@ -595,17 +210,7 @@ resolved "https://registry.yarnpkg.com/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c" integrity sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw== -"@metaplex-foundation/beet-solana@0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.4.0.tgz#52891e78674aaa54e0031f1bca5bfbc40de12e8d" - integrity sha512-B1L94N3ZGMo53b0uOSoznbuM5GBNJ8LwSeznxBxJ+OThvfHQ4B5oMUqb+0zdLRfkKGS7Q6tpHK9P+QK0j3w2cQ== - dependencies: - "@metaplex-foundation/beet" ">=0.1.0" - "@solana/web3.js" "^1.56.2" - bs58 "^5.0.0" - debug "^4.3.4" - -"@metaplex-foundation/beet-solana@^0.3.0", "@metaplex-foundation/beet-solana@^0.3.1": +"@metaplex-foundation/beet-solana@^0.3.0": version "0.3.1" resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.3.1.tgz#4b37cda5c7f32ffd2bdd8b3164edc05c6463ab35" integrity sha512-tgyEl6dvtLln8XX81JyBvWjIiEcjTkUwZbrM5dIobTmoqMuGewSyk9CClno8qsMsFdB5T3jC91Rjeqmu/6xk2g== @@ -615,25 +220,6 @@ bs58 "^5.0.0" debug "^4.3.4" -"@metaplex-foundation/beet-solana@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.4.1.tgz#255747aa7feee1c20202146a752c057feca1948f" - integrity sha512-/6o32FNUtwK8tjhotrvU/vorP7umBuRFvBZrC6XCk51aKidBHe5LPVPA5AjGPbV3oftMfRuXPNd9yAGeEqeCDQ== - dependencies: - "@metaplex-foundation/beet" ">=0.1.0" - "@solana/web3.js" "^1.56.2" - bs58 "^5.0.0" - debug "^4.3.4" - -"@metaplex-foundation/beet@0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.7.1.tgz#0975314211643f87b5f6f3e584fa31abcf4c612c" - integrity sha512-hNCEnS2WyCiYyko82rwuISsBY3KYpe828ubsd2ckeqZr7tl0WVLivGkoyA/qdiaaHEBGdGl71OpfWa2rqL3DiA== - dependencies: - ansicolors "^0.3.2" - bn.js "^5.2.0" - debug "^4.3.3" - "@metaplex-foundation/beet@>=0.1.0", "@metaplex-foundation/beet@^0.7.1": version "0.7.2" resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.7.2.tgz#fa4726e4cfd4fb6fed6cddc9b5213c1c2a2d0b77" @@ -653,123 +239,6 @@ bn.js "^5.2.0" debug "^4.3.3" -"@metaplex-foundation/beet@^0.6.1": - version "0.6.1" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.6.1.tgz#6331bdde0648bf2cae6f9e482f8e3552db05d69f" - integrity sha512-OYgnijLFzw0cdUlRKH5POp0unQECPOW9muJ2X3QIVyak5G6I6l/rKo72sICgPLIFKdmsi2jmnkuLY7wp14iXdw== - dependencies: - ansicolors "^0.3.2" - bn.js "^5.2.0" - debug "^4.3.3" - -"@metaplex-foundation/cusper@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/cusper/-/cusper-0.0.2.tgz#dc2032a452d6c269e25f016aa4dd63600e2af975" - integrity sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA== - -"@metaplex-foundation/js@0.20.1": - version "0.20.1" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/js/-/js-0.20.1.tgz#654974dfdb163435f9583478256e5917e2187a7b" - integrity sha512-aqiLoEiToXdfI5pS+17/GN/dIO2D31gLoVQvEKDQi9XcnOPVhfJerXDmwgKbhp79OGoYxtlvVw+b2suacoUzGQ== - dependencies: - "@irys/sdk" "^0.0.2" - "@metaplex-foundation/beet" "0.7.1" - "@metaplex-foundation/mpl-auction-house" "^2.3.0" - "@metaplex-foundation/mpl-bubblegum" "^0.6.2" - "@metaplex-foundation/mpl-candy-guard" "^0.3.0" - "@metaplex-foundation/mpl-candy-machine" "^5.0.0" - "@metaplex-foundation/mpl-candy-machine-core" "^0.1.2" - "@metaplex-foundation/mpl-token-metadata" "^2.11.0" - "@noble/ed25519" "^1.7.1" - "@noble/hashes" "^1.1.3" - "@solana/spl-account-compression" "^0.1.8" - "@solana/spl-token" "^0.3.5" - "@solana/web3.js" "^1.63.1" - bignumber.js "^9.0.2" - bn.js "^5.2.1" - bs58 "^5.0.0" - buffer "^6.0.3" - debug "^4.3.4" - eventemitter3 "^4.0.7" - lodash.clonedeep "^4.5.0" - lodash.isequal "^4.5.0" - merkletreejs "^0.3.11" - mime "^3.0.0" - node-fetch "^2.6.7" - -"@metaplex-foundation/mpl-auction-house@^2.3.0": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-auction-house/-/mpl-auction-house-2.5.1.tgz#ea0e21e594b0db5e73f88688eb2e7c9b748b378b" - integrity sha512-O+IAdYVaoOvgACB8pm+1lF5BNEjl0COkqny2Ho8KQZwka6aC/vHbZ239yRwAMtJhf5992BPFdT4oifjyE0O+Mw== - dependencies: - "@metaplex-foundation/beet" "^0.6.1" - "@metaplex-foundation/beet-solana" "^0.3.1" - "@metaplex-foundation/cusper" "^0.0.2" - "@solana/spl-token" "^0.3.5" - "@solana/web3.js" "^1.56.2" - bn.js "^5.2.0" - -"@metaplex-foundation/mpl-bubblegum@^0.6.2": - version "0.6.2" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-bubblegum/-/mpl-bubblegum-0.6.2.tgz#e1b098ccef10899b0d759a03e3d4b1ae7bdc9f0c" - integrity sha512-4tF7/FFSNtpozuIGD7gMKcqK2D49eVXZ144xiowC5H1iBeu009/oj2m8Tj6n4DpYFKWJ2JQhhhk0a2q7x0Begw== - dependencies: - "@metaplex-foundation/beet" "0.7.1" - "@metaplex-foundation/beet-solana" "0.4.0" - "@metaplex-foundation/cusper" "^0.0.2" - "@metaplex-foundation/mpl-token-metadata" "^2.5.2" - "@solana/spl-account-compression" "^0.1.4" - "@solana/spl-token" "^0.1.8" - "@solana/web3.js" "^1.50.1" - bn.js "^5.2.0" - js-sha3 "^0.8.0" - -"@metaplex-foundation/mpl-candy-guard@^0.3.0": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-candy-guard/-/mpl-candy-guard-0.3.2.tgz#426e89793676b42e9bbb5e523303fba36ccd5281" - integrity sha512-QWXzPDz+6OR3957LtfW6/rcGvFWS/0AeHJa/BUO2VEVQxN769dupsKGtrsS8o5RzXCeap3wrCtDSNxN3dnWu4Q== - dependencies: - "@metaplex-foundation/beet" "^0.4.0" - "@metaplex-foundation/beet-solana" "^0.3.0" - "@metaplex-foundation/cusper" "^0.0.2" - "@solana/web3.js" "^1.66.2" - bn.js "^5.2.0" - -"@metaplex-foundation/mpl-candy-machine-core@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-candy-machine-core/-/mpl-candy-machine-core-0.1.2.tgz#07e19558d0ef120fac1d8612ae4de90d52cd4d1f" - integrity sha512-jjDkRvMR+iykt7guQ7qVnOHTZedql0lq3xqWDMaenAUCH3Xrf2zKATThhJppIVNX1/YtgBOO3lGqhaFbaI4pCw== - dependencies: - "@metaplex-foundation/beet" "^0.4.0" - "@metaplex-foundation/beet-solana" "^0.3.0" - "@metaplex-foundation/cusper" "^0.0.2" - "@solana/web3.js" "^1.56.2" - bn.js "^5.2.0" - -"@metaplex-foundation/mpl-candy-machine@^5.0.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-candy-machine/-/mpl-candy-machine-5.1.0.tgz#9469914b312ac36b7cf608123508f3f3f5080010" - integrity sha512-pjHpUpWVOCDxK3l6dXxfmJKNQmbjBqnm5ElOl1mJAygnzO8NIPQvrP89y6xSNyo8qZsJyt4ZMYUyD0TdbtKZXQ== - dependencies: - "@metaplex-foundation/beet" "^0.7.1" - "@metaplex-foundation/beet-solana" "^0.4.0" - "@metaplex-foundation/cusper" "^0.0.2" - "@solana/spl-token" "^0.3.6" - "@solana/web3.js" "^1.66.2" - -"@metaplex-foundation/mpl-token-metadata@^2.11.0", "@metaplex-foundation/mpl-token-metadata@^2.5.2": - version "2.13.0" - resolved "https://registry.yarnpkg.com/@metaplex-foundation/mpl-token-metadata/-/mpl-token-metadata-2.13.0.tgz#ea498190ad4ed1d4c0b8218a72d03bd17a883d11" - integrity sha512-Fl/8I0L9rv4bKTV/RAl5YIbJe9SnQPInKvLz+xR1fEc4/VQkuCn3RPgypfUMEKWmCznzaw4sApDxy6CFS4qmJw== - dependencies: - "@metaplex-foundation/beet" "^0.7.1" - "@metaplex-foundation/beet-solana" "^0.4.0" - "@metaplex-foundation/cusper" "^0.0.2" - "@solana/spl-token" "^0.3.6" - "@solana/web3.js" "^1.66.2" - bn.js "^5.2.0" - debug "^4.3.4" - "@metaplex-foundation/rustbin@^0.3.0", "@metaplex-foundation/rustbin@^0.3.1": version "0.3.5" resolved "https://registry.yarnpkg.com/@metaplex-foundation/rustbin/-/rustbin-0.3.5.tgz#56d028afd96c2b56ad3bbea22ff454adde900e8c" @@ -796,149 +265,6 @@ snake-case "^3.0.4" spok "^1.4.3" -"@near-js/crypto@0.0.3", "@near-js/crypto@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.3.tgz#4a33e526ab5fa75b703427067985694a279ff8bd" - integrity sha512-3WC2A1a1cH8Cqrx+0iDjp1ASEEhxN/KHEMENYb0KZH6Hp5bXIY7Akt4quC7JlgJS5ESvEiLa40tS5h0zAhBWGw== - dependencies: - "@near-js/types" "0.0.3" - bn.js "5.2.1" - borsh "^0.7.0" - tweetnacl "^1.0.1" - -"@near-js/crypto@0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-0.0.4.tgz#7bb991da25f06096de51466c6331cb185314fad8" - integrity sha512-2mSIVv6mZway1rQvmkktrXAFoUvy7POjrHNH3LekKZCMCs7qMM/23Hz2+APgxZPqoV2kjarSNOEYJjxO7zQ/rQ== - dependencies: - "@near-js/types" "0.0.4" - bn.js "5.2.1" - borsh "^0.7.0" - tweetnacl "^1.0.1" - -"@near-js/keystores-browser@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.3.tgz#110b847cd9c358076c2401e9462cc1140e12a908" - integrity sha512-Ve/JQ1SBxdNk3B49lElJ8Y54AoBY+yOStLvdnUIpe2FBOczzwDCkcnPcMDV0NMwVlHpEnOWICWHbRbAkI5Vs+A== - dependencies: - "@near-js/crypto" "0.0.3" - "@near-js/keystores" "0.0.3" - -"@near-js/keystores@0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.3.tgz#eb1e8e06936da166b5ed8dab3123eaa1bf7a8dab" - integrity sha512-mnwLYUt4Td8u1I4QE1FBx2d9hMt3ofiriE93FfOluJ4XiqRqVFakFYiHg6pExg5iEkej/sXugBUFeQ4QizUnew== - dependencies: - "@near-js/crypto" "0.0.3" - "@near-js/types" "0.0.3" - -"@near-js/keystores@0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.4.tgz#da03069497bb14741a4d97f7ad4746baf9a09ea7" - integrity sha512-+vKafmDpQGrz5py1liot2hYSjPGXwihveeN+BL11aJlLqZnWBgYJUWCXG+uyGjGXZORuy2hzkKK6Hi+lbKOfVA== - dependencies: - "@near-js/crypto" "0.0.4" - "@near-js/types" "0.0.4" - -"@near-js/providers@^0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-0.0.4.tgz#90f84d765ff90370599d027f47c098a3e7e745d0" - integrity sha512-g/2pJTYmsIlTW4mGqeRlqDN9pZeN+1E2/wfoMIf3p++boBVxVlaSebtQgawXAf2lkfhb9RqXz5pHqewXIkTBSw== - dependencies: - "@near-js/transactions" "0.1.0" - "@near-js/types" "0.0.3" - "@near-js/utils" "0.0.3" - bn.js "5.2.1" - borsh "^0.7.0" - http-errors "^1.7.2" - optionalDependencies: - node-fetch "^2.6.1" - -"@near-js/signers@0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.0.3.tgz#bfc8386613295fc6b51982cf65c79bdc9307aa5e" - integrity sha512-u1R+DDIua5PY1PDFnpVYqdMgQ7c4dyeZsfqMjE7CtgzdqupgTYCXzJjBubqMlAyAx843PoXmLt6CSSKcMm0WUA== - dependencies: - "@near-js/crypto" "0.0.3" - "@near-js/keystores" "0.0.3" - js-sha256 "^0.9.0" - -"@near-js/signers@0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.0.4.tgz#a1904ccc718d6f87b05cd2e168f33bde0cfb269a" - integrity sha512-xCglo3U/WIGsz/izPGFMegS5Q3PxOHYB8a1E7RtVhNm5QdqTlQldLCm/BuMg2G/u1l1ZZ0wdvkqRTG9joauf3Q== - dependencies: - "@near-js/crypto" "0.0.4" - "@near-js/keystores" "0.0.4" - js-sha256 "^0.9.0" - -"@near-js/transactions@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-0.1.0.tgz#a03f529da6bb2eaf9dd0590093f2d0763b8ae72a" - integrity sha512-OrrDFqhX0rtH+6MV3U3iS+zmzcPQI+L4GJi9na4Uf8FgpaVPF0mtSmVrpUrS5CC3LwWCzcYF833xGYbXOV4Kfg== - dependencies: - "@near-js/crypto" "0.0.3" - "@near-js/signers" "0.0.3" - "@near-js/types" "0.0.3" - "@near-js/utils" "0.0.3" - bn.js "5.2.1" - borsh "^0.7.0" - js-sha256 "^0.9.0" - -"@near-js/transactions@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-0.1.1.tgz#3d4c9d8e3cf2543642d660c0c0b126f0a97d5d43" - integrity sha512-Fk83oLLFK7nz4thawpdv9bGyMVQ2i48iUtZEVYhuuuqevl17tSXMlhle9Me1ZbNyguJG/cWPdNybe1UMKpyGxA== - dependencies: - "@near-js/crypto" "0.0.4" - "@near-js/signers" "0.0.4" - "@near-js/types" "0.0.4" - "@near-js/utils" "0.0.4" - bn.js "5.2.1" - borsh "^0.7.0" - js-sha256 "^0.9.0" - -"@near-js/types@0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.0.3.tgz#d504222469f4d50a6299c522fb6905ba10905bd6" - integrity sha512-gC3iGUT+r2JjVsE31YharT+voat79ToMUMLCGozHjp/R/UW1M2z4hdpqTUoeWUBGBJuVc810gNTneHGx0jvzwQ== - dependencies: - bn.js "5.2.1" - -"@near-js/types@0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.0.4.tgz#d941689df41c850aeeeaeb9d498418acec515404" - integrity sha512-8TTMbLMnmyG06R5YKWuS/qFG1tOA3/9lX4NgBqQPsvaWmDsa+D+QwOkrEHDegped0ZHQwcjAXjKML1S1TyGYKg== - dependencies: - bn.js "5.2.1" - -"@near-js/utils@0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-0.0.3.tgz#5e631f3dbdb7f0c6985bcbef08644db83b519978" - integrity sha512-J72n/EL0VfLRRb4xNUF4rmVrdzMkcmkwJOhBZSTWz3PAZ8LqNeU9ZConPfMvEr6lwdaD33ZuVv70DN6IIjPr1A== - dependencies: - "@near-js/types" "0.0.3" - bn.js "5.2.1" - depd "^2.0.0" - mustache "^4.0.0" - -"@near-js/utils@0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-0.0.4.tgz#1a387f81974ebbfa4521c92590232be97e3335dd" - integrity sha512-mPUEPJbTCMicGitjEGvQqOe8AS7O4KkRCxqd0xuE/X6gXF1jz1pYMZn4lNUeUz2C84YnVSGLAM0o9zcN6Y4hiA== - dependencies: - "@near-js/types" "0.0.4" - bn.js "5.2.1" - depd "^2.0.0" - mustache "^4.0.0" - -"@noble/curves@1.4.2", "@noble/curves@~1.4.0": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" - integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== - dependencies: - "@noble/hashes" "1.4.0" - "@noble/curves@^1.0.0", "@noble/curves@^1.4.0", "@noble/curves@^1.4.2": version "1.8.1" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.8.1.tgz#19bc3970e205c99e4bdb1c64a4785706bce497ff" @@ -946,41 +272,16 @@ dependencies: "@noble/hashes" "1.7.1" -"@noble/ed25519@^1.6.1": - version "1.7.5" - resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.5.tgz#94df8bdb9fec9c4644a56007eecb57b0e9fbd0d7" - integrity sha512-xuS0nwRMQBvSxDa7UxMb61xTiH3MxTgUfhyPUALVIe0FlOAz4sjELwyDRyUvqeEYfRSG9qNjFIycqLZppg4RSA== - "@noble/ed25519@^1.7.1": version "1.7.3" resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123" integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== -"@noble/hashes@1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" - integrity sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A== - -"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" - integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== - "@noble/hashes@1.7.1", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.1.tgz#5738f6d765710921e7a751e00c20ae091ed8db0f" integrity sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ== -"@noble/hashes@^1.1.3": - version "1.7.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.2.tgz#d53c65a21658fb02f3303e7ee3ba89d6754c64b4" - integrity sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ== - -"@noble/hashes@~1.1.1": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.5.tgz#1a0377f3b9020efe2fae03290bd2a12140c95c11" - integrity sha512-LTMZiiLc+V4v1Yi16TD6aX2gmtKszNye0pQgbaLqkvhIqP7nVsSaJsWloGQjJfJ8offaoP5GtX3yY5swbcJxxQ== - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1148,48 +449,6 @@ bs58 "^5.0.0" jito-ts "^3.0.1" -"@randlabs/communication-bridge@1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@randlabs/communication-bridge/-/communication-bridge-1.0.1.tgz#d1ecfc29157afcbb0ca2d73122d67905eecb5bf3" - integrity sha512-CzS0U8IFfXNK7QaJFE4pjbxDGfPjbXBEsEaCn9FN15F+ouSAEUQkva3Gl66hrkBZOGexKFEWMwUHIDKpZ2hfVg== - -"@randlabs/myalgo-connect@^1.1.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@randlabs/myalgo-connect/-/myalgo-connect-1.4.2.tgz#ce3ad97b3889ea21da75852187511d3f6be0fa05" - integrity sha512-K9hEyUi7G8tqOp7kWIALJLVbGCByhilcy6123WfcorxWwiE1sbQupPyIU5f3YdQK6wMjBsyTWiLW52ZBMp7sXA== - dependencies: - "@randlabs/communication-bridge" "1.0.1" - -"@scure/base@~1.1.0", "@scure/base@~1.1.6": - version "1.1.9" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.9.tgz#e5e142fbbfe251091f9c5f1dd4c834ac04c3dbd1" - integrity sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg== - -"@scure/bip32@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.4.0.tgz#4e1f1e196abedcef395b33b9674a042524e20d67" - integrity sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg== - dependencies: - "@noble/curves" "~1.4.0" - "@noble/hashes" "~1.4.0" - "@scure/base" "~1.1.6" - -"@scure/bip39@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.0.tgz#92f11d095bae025f166bef3defcc5bf4945d419a" - integrity sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w== - dependencies: - "@noble/hashes" "~1.1.1" - "@scure/base" "~1.1.0" - -"@scure/bip39@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.3.0.tgz#0f258c16823ddd00739461ac31398b4e7d6a18c3" - integrity sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ== - dependencies: - "@noble/hashes" "~1.4.0" - "@scure/base" "~1.1.6" - "@sinclair/typebox@^0.24.1": version "0.24.51" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" @@ -1325,18 +584,6 @@ "@solana/codecs-strings" "2.0.0-rc.1" "@solana/errors" "2.0.0-rc.1" -"@solana/spl-account-compression@^0.1.4", "@solana/spl-account-compression@^0.1.8": - version "0.1.10" - resolved "https://registry.yarnpkg.com/@solana/spl-account-compression/-/spl-account-compression-0.1.10.tgz#b3135ce89349d6090832b3b1d89095badd57e969" - integrity sha512-IQAOJrVOUo6LCgeWW9lHuXo6JDbi4g3/RkQtvY0SyalvSWk9BIkHHe4IkAzaQw8q/BxEVBIjz8e9bNYWIAESNw== - dependencies: - "@metaplex-foundation/beet" "^0.7.1" - "@metaplex-foundation/beet-solana" "^0.4.0" - bn.js "^5.2.1" - borsh "^0.7.0" - js-sha3 "^0.8.0" - typescript-collections "^1.3.3" - "@solana/spl-token-group@^0.0.7": version "0.0.7" resolved "https://registry.yarnpkg.com/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz#83c00f0cd0bda33115468cd28b89d94f8ec1fee4" @@ -1360,7 +607,7 @@ "@solana/buffer-layout-utils" "^0.2.0" buffer "^6.0.3" -"@solana/spl-token@^0.1.6", "@solana/spl-token@^0.1.8": +"@solana/spl-token@^0.1.6": version "0.1.8" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ== @@ -1372,7 +619,7 @@ buffer-layout "^1.2.0" dotenv "10.0.0" -"@solana/spl-token@^0.3.5", "@solana/spl-token@^0.3.6", "@solana/spl-token@^0.3.7": +"@solana/spl-token@^0.3.7": version "0.3.11" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.11.tgz#cdc10f9472b29b39c8983c92592cadd06627fb9a" integrity sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ== @@ -1414,7 +661,7 @@ rpc-websockets "^8.0.1" superstruct "^1.0.4" -"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.50.1", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.63.1", "@solana/web3.js@^1.66.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.77.3", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.98.0": +"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.77.3", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.98.0": version "1.98.0" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.98.0.tgz#21ecfe8198c10831df6f0cfde7f68370d0405917" integrity sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA== @@ -1456,11 +703,6 @@ rpc-websockets "^7.5.1" superstruct "^0.14.2" -"@supercharge/promise-pool@^3.0.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@supercharge/promise-pool/-/promise-pool-3.2.0.tgz#a6ab4afdf798e453a6bb51c4ae340852e1266af8" - integrity sha512-pj0cAALblTZBPtMltWOlZTQSLT07jIaFNeM8TWoJD1cQMgDB9mcMlVMoetiB35OzNJpqQ2b+QEtwiR9f20mADg== - "@swc/helpers@^0.5.11": version "0.5.15" resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.15.tgz#79efab344c5819ecf83a43f3f9f811fc84b516d7" @@ -1600,11 +842,6 @@ dependencies: undici-types "~6.20.0" -"@types/node@11.11.6": - version "11.11.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" - integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== - "@types/node@^12.12.54": version "12.20.55" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" @@ -1752,11 +989,6 @@ acorn@^8.11.0, acorn@^8.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== -aes-js@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== - agentkeepalive@^4.2.1, agentkeepalive@^4.3.0, agentkeepalive@^4.5.0: version "4.6.0" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.6.0.tgz#35f73e94b3f40bf65f105219c623ad19c136ea6a" @@ -1784,27 +1016,6 @@ ajv@^8.0.1: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" -algo-msgpack-with-bigint@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/algo-msgpack-with-bigint/-/algo-msgpack-with-bigint-2.1.1.tgz#38bb717220525b3ff42232eefdcd9efb9ad405d6" - integrity sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ== - -algosdk@^1.13.1: - version "1.24.1" - resolved "https://registry.yarnpkg.com/algosdk/-/algosdk-1.24.1.tgz#afc4102457ae0c38a32de6b84f4d713aedfc9e89" - integrity sha512-9moZxdqeJ6GdE4N6fA/GlUP4LrbLZMYcYkt141J4Ss68OfEgH9qW0wBuZ3ZOKEx/xjc5bg7mLP2Gjg7nwrkmww== - dependencies: - algo-msgpack-with-bigint "^2.1.1" - buffer "^6.0.2" - cross-fetch "^3.1.5" - hi-base32 "^0.5.1" - js-sha256 "^0.9.0" - js-sha3 "^0.8.0" - js-sha512 "^0.8.0" - json-bigint "^1.0.0" - tweetnacl "^1.0.3" - vlq "^2.0.4" - anchor-bankrun@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/anchor-bankrun/-/anchor-bankrun-0.3.0.tgz#3789fcecbc201a2334cff228b99cc0da8ef0167e" @@ -1815,13 +1026,6 @@ ansi-colors@^4.1.1, ansi-colors@^4.1.3: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -1859,41 +1063,6 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -aptos@=1.8.5: - version "1.8.5" - resolved "https://registry.yarnpkg.com/aptos/-/aptos-1.8.5.tgz#a17ac721066914785902b03cf1e7304495f6cd9d" - integrity sha512-iQxliWesNHjGQ5YYXCyss9eg4+bDGQWqAZa73vprqGQ9tungK0cRjUI2fmnp63Ed6UG6rurHrL+b0ckbZAOZZQ== - dependencies: - "@noble/hashes" "1.1.3" - "@scure/bip39" "1.1.0" - axios "0.27.2" - form-data "4.0.0" - tweetnacl "1.0.3" - -arbundles@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/arbundles/-/arbundles-0.10.1.tgz#1f542d9edf185a8a272994aef501a8ee12aaaa46" - integrity sha512-QYFepxessLCirvRkQK9iQmjxjHz+s50lMNGRwZwpyPWLohuf6ISyj1gkFXJHlMT+rNSrsHxb532glHnKbjwu3A== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/providers" "^5.7.2" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wallet" "^5.7.0" - "@irys/arweave" "^0.0.2" - "@noble/ed25519" "^1.6.1" - base64url "^3.0.1" - bs58 "^4.0.1" - keccak "^3.0.2" - secp256k1 "^5.0.0" - optionalDependencies: - "@randlabs/myalgo-connect" "^1.1.2" - algosdk "^1.13.1" - arweave-stream-tx "^1.1.0" - multistream "^4.1.0" - tmp-promise "^3.0.2" - arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -1916,23 +1085,6 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -arweave-stream-tx@^1.1.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/arweave-stream-tx/-/arweave-stream-tx-1.2.2.tgz#2d5c66554301baacd02586a152fbb198b422112f" - integrity sha512-bNt9rj0hbAEzoUZEF2s6WJbIz8nasZlZpxIw03Xm8fzb9gRiiZlZGW3lxQLjfc9Z0VRUWDzwtqoYeEoB/JDToQ== - dependencies: - exponential-backoff "^3.1.0" - -asn1.js@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" - assert@^2.0.0, assert@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" @@ -1954,13 +1106,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-retry@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" - integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== - dependencies: - retry "0.13.1" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1973,15 +1118,7 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios@0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - -axios@^1.4.0, axios@^1.8.3: +axios@^1.8.3: version "1.8.4" resolved "https://registry.yarnpkg.com/axios/-/axios-1.8.4.tgz#78990bb4bc63d2cae072952d374835950a82f447" integrity sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw== @@ -2017,16 +1154,6 @@ base64-js@^1.3.1, base64-js@^1.5.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -base64url@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" - integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== - -bech32@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" - integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== - big.js@^6.2.1, big.js@^6.2.2: version "6.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.2.2.tgz#be3bb9ac834558b53b099deef2a1d06ac6368e1a" @@ -2039,11 +1166,6 @@ bigint-buffer@^1.1.5: dependencies: bindings "^1.3.0" -bignumber.js@^9.0.0, bignumber.js@^9.0.2, bignumber.js@^9.1.1: - version "9.2.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.2.1.tgz#3ad0854ad933560a25bbc7c93bc3b7ea6edcad85" - integrity sha512-+NzaKgOUvInq9TIUZ1+DRspzf/HApkCwD4btfuasFTdrfnOxqx853TgDpMolp+uv4RpRp7bPcEU2zKr9+fRmyw== - bignumber.js@^9.0.1: version "9.1.2" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" @@ -2061,48 +1183,11 @@ bindings@^1.3.0: dependencies: file-uri-to-path "1.0.0" -bip39-light@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/bip39-light/-/bip39-light-1.0.7.tgz#06a72f251b89389a136d3f177f29b03342adc5ba" - integrity sha512-WDTmLRQUsiioBdTs9BmSEmkJza+8xfJmptsNJjxnoq3EydSa/ZBXT6rm66KoT3PJIRYMnhSKNR7S9YL1l7R40Q== - dependencies: - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - -bip39@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" - integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - -bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -bn.js@4.11.6: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== - -bn.js@5.2.1, bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -bn.js@^4.0.0, bn.js@^4.11.9: - version "4.12.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.1.tgz#215741fe3c9dba2d7e12c001d0cfdbae43975ba7" - integrity sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg== - borsh@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" @@ -2134,23 +1219,11 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== - browser-stdout@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -bs58@5.0.0, bs58@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279" - integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ== - dependencies: - base-x "^4.0.0" - bs58@^4.0.0, bs58@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" @@ -2158,6 +1231,13 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" +bs58@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279" + integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ== + dependencies: + base-x "^4.0.0" + bs58@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/bs58/-/bs58-6.0.0.tgz#a2cda0130558535dd281a2f8697df79caaf425d8" @@ -2170,12 +1250,7 @@ buffer-layout@^1.2.0, buffer-layout@^1.2.2: resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== -buffer-reverse@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-reverse/-/buffer-reverse-1.0.1.tgz#49283c8efa6f901bc01fa3304d06027971ae2f60" - integrity sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg== - -buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.2, buffer@^6.0.3, buffer@~6.0.3: +buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3, buffer@~6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== @@ -2183,14 +1258,6 @@ buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.2, buffer@^6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - bufferutil@^4.0.1: version "4.0.9" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.9.tgz#6e81739ad48a95cad45a279588e13e95e24a800a" @@ -2261,7 +1328,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@~4.1.2: +chalk@^4.0.0, chalk@^4.1.0, chalk@~4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2274,11 +1341,6 @@ chalk@^5.3.0: resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - check-error@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" @@ -2306,31 +1368,6 @@ ci-info@^3.2.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== -cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.6.tgz#8fe672437d01cd6c4561af5334e0cc50ff1955f7" - integrity sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw== - dependencies: - inherits "^2.0.4" - safe-buffer "^5.2.1" - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-spinners@^2.5.0: - version "2.9.2" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" - integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -2354,11 +1391,6 @@ clone@2.x: resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -2400,39 +1432,11 @@ commander@^2.20.3: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^8.2.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -create-hash@^1.1.0, create-hash@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@1.1.7, create-hmac@^1.1.4: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -2459,36 +1463,6 @@ crypto-hash@^1.3.0: resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== -crypto-js@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" - integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== - -csv-generate@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/csv-generate/-/csv-generate-3.4.3.tgz#bc42d943b45aea52afa896874291da4b9108ffff" - integrity sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw== - -csv-parse@^4.16.3: - version "4.16.3" - resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.16.3.tgz#7ca624d517212ebc520a36873c3478fa66efbaf7" - integrity sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg== - -csv-stringify@^5.6.5: - version "5.6.5" - resolved "https://registry.yarnpkg.com/csv-stringify/-/csv-stringify-5.6.5.tgz#c6d74badda4b49a79bf4e72f91cce1e33b94de00" - integrity sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A== - -csv@5.5.3: - version "5.5.3" - resolved "https://registry.yarnpkg.com/csv/-/csv-5.5.3.tgz#cd26c1e45eae00ce6a9b7b27dcb94955ec95207d" - integrity sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g== - dependencies: - csv-generate "^3.4.3" - csv-parse "^4.16.3" - csv-stringify "^5.6.5" - stream-transform "^2.1.3" - debug@^4.0.1, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5: version "4.4.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" @@ -2518,13 +1492,6 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -defaults@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" - integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== - dependencies: - clone "^1.0.2" - define-data-property@^1.0.1, define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" @@ -2553,16 +1520,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -depd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== - diff-sequences@^28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" @@ -2619,19 +1576,6 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" -elliptic@6.6.1, elliptic@^6.5.7: - version "6.6.1" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" - integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -2843,31 +1787,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -ethereum-bloom-filters@^1.0.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz#8294f074c1a6cbd32c39d2cc77ce86ff14797dab" - integrity sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA== - dependencies: - "@noble/hashes" "^1.4.0" - -ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" - integrity sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg== - dependencies: - "@noble/curves" "1.4.2" - "@noble/hashes" "1.4.0" - "@scure/bip32" "1.4.0" - "@scure/bip39" "1.3.0" - -ethjs-unit@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" - integrity sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw== - dependencies: - bn.js "4.11.6" - number-to-bn "1.7.0" - eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -2889,20 +1808,6 @@ expect@^28.0.0: jest-message-util "^28.1.3" jest-util "^28.1.3" -exponential-backoff@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.2.tgz#a8f26adb96bf78e8cd8ad1037928d5e5c0679d91" - integrity sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - eyes@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" @@ -2956,13 +1861,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -3025,7 +1923,7 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== -follow-redirects@^1.14.9, follow-redirects@^1.15.6: +follow-redirects@^1.15.6: version "1.15.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== @@ -3037,15 +1935,6 @@ for-each@^0.3.3: dependencies: is-callable "^1.2.7" -form-data@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c" @@ -3198,23 +2087,6 @@ has-tostringtag@^1.0.2: dependencies: has-symbols "^1.0.3" -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - hasown@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" @@ -3227,31 +2099,6 @@ he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hi-base32@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/hi-base32/-/hi-base32-0.5.1.tgz#1279f2ddae2673219ea5870c2121d2a33132857e" - integrity sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA== - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -http-errors@^1.7.2: - version "1.8.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" - integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.1" - humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -3259,13 +2106,6 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - iconv-lite@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" @@ -3273,7 +2113,7 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -ieee754@^1.1.13, ieee754@^1.2.1: +ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -3309,32 +2149,11 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: +inherits@2, inherits@^2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inquirer@^8.2.0: - version "8.2.6" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.6.tgz#733b74888195d8d400a67ac332011b5fae5ea562" - integrity sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.5.5" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - wrap-ansi "^6.0.1" - is-arguments@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.2.0.tgz#ad58c6aecf563b78ef2bf04df540da8f5d7d8e1b" @@ -3382,16 +2201,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== - -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - is-nan@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" @@ -3536,16 +2345,6 @@ js-sha256@^0.9.0: resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== -js-sha3@0.8.0, js-sha3@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -js-sha512@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha512/-/js-sha512-0.8.0.tgz#dd22db8d02756faccf19f218e3ed61ec8249f7d4" - integrity sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ== - js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -3566,13 +2365,6 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -json-bigint@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" - integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== - dependencies: - bignumber.js "^9.0.0" - json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -3608,15 +2400,6 @@ just-extend@^6.2.0: resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-6.2.0.tgz#b816abfb3d67ee860482e7401564672558163947" integrity sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw== -keccak@^3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" - integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.0" - keyv@^4.5.3: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" @@ -3644,21 +2427,11 @@ lodash.camelcase@^4.3.0: resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== - lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== -lodash.isequal@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -3669,7 +2442,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@4.17.21, lodash@^4.17.21: +lodash@4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3716,36 +2489,11 @@ math-intrinsics@^1.1.0: resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -merkletreejs@^0.3.11: - version "0.3.11" - resolved "https://registry.yarnpkg.com/merkletreejs/-/merkletreejs-0.3.11.tgz#e0de05c3ca1fd368de05a12cb8efb954ef6fc04f" - integrity sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ== - dependencies: - bignumber.js "^9.0.1" - buffer-reverse "^1.0.1" - crypto-js "^4.2.0" - treeify "^1.1.0" - web3-utils "^1.3.4" - -micro-ftch@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" - integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== - micromatch@^4.0.4, micromatch@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" @@ -3759,33 +2507,13 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.34: +mime-types@^2.1.12: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" -mime@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" - integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== - minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -3800,11 +2528,6 @@ minimatch@^5.0.1, minimatch@^5.1.6: dependencies: brace-expansion "^2.0.1" -mixme@^0.5.1: - version "0.5.10" - resolved "https://registry.yarnpkg.com/mixme/-/mixme-0.5.10.tgz#d653b2984b75d9018828f1ea333e51717ead5f51" - integrity sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q== - mocha@10.7.3: version "10.7.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" @@ -3836,24 +2559,6 @@ ms@^2.0.0, ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -multistream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/multistream/-/multistream-4.1.0.tgz#7bf00dfd119556fbc153cff3de4c6d477909f5a8" - integrity sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw== - dependencies: - once "^1.4.0" - readable-stream "^3.6.0" - -mustache@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" - integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== - -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - nanoid@3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" @@ -3864,25 +2569,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -near-hd-key@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/near-hd-key/-/near-hd-key-1.2.1.tgz#f508ff15436cf8a439b543220f3cc72188a46756" - integrity sha512-SIrthcL5Wc0sps+2e1xGj3zceEa68TgNZDLuCx0daxmfTP7sFTB3/mtE2pYhlFsCxWoMn+JfID5E1NlzvvbRJg== - dependencies: - bip39 "3.0.2" - create-hmac "1.1.7" - tweetnacl "1.0.3" - -near-seed-phrase@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/near-seed-phrase/-/near-seed-phrase-0.2.1.tgz#7d5b54d5e836d295f10b0bdfdae9086443651d20" - integrity sha512-feMuums+kVL3LSuPcP4ld07xHCb2mu6z48SGfP3W+8tl1Qm5xIcjiQzY2IDPBvFgajRDxWSb8GzsRHoInazByw== - dependencies: - bip39-light "^1.0.7" - bs58 "^4.0.1" - near-hd-key "^1.2.1" - tweetnacl "^1.0.2" - nise@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/nise/-/nise-6.1.1.tgz#78ea93cc49be122e44cb7c8fdf597b0e8778b64a" @@ -3902,16 +2588,6 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-addon-api@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" - integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== - node-cache@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/node-cache/-/node-cache-5.1.2.tgz#f264dc2ccad0a780e76253a694e9fd0ed19c398d" @@ -3919,14 +2595,14 @@ node-cache@5.1.2: dependencies: clone "2.x" -node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.7.0: +node-fetch@^2.6.7, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" -node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: +node-gyp-build@^4.3.0: version "4.8.4" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.4.tgz#8a70ee85464ae52327772a90d66c6077a900cfc8" integrity sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ== @@ -3936,14 +2612,6 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -number-to-bn@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" - integrity sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig== - dependencies: - bn.js "4.11.6" - strip-hex-prefix "1.0.0" - object-is@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" @@ -3976,20 +2644,13 @@ object.assign@^4.1.4: has-symbols "^1.1.0" object-keys "^1.1.1" -once@^1.3.0, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - optionator@^0.9.1: version "0.9.4" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" @@ -4002,26 +2663,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.5" -ora@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" - integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -4078,17 +2719,6 @@ pathval@^1.1.1: resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== -pbkdf2@^3.0.9: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - picocolors@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" @@ -4174,7 +2804,7 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -randombytes@^2.0.1, randombytes@^2.1.0: +randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -4186,15 +2816,6 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -4227,19 +2848,6 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -retry@0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" - integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== - reusify@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" @@ -4252,14 +2860,6 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - rpc-websockets@7.5.1: version "7.5.1" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.1.tgz#e0a05d525a97e7efc31a0617f093a13a2e10c401" @@ -4313,11 +2913,6 @@ rpc-websockets@^9.0.2: bufferutil "^4.0.1" utf-8-validate "^5.0.2" -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -4325,14 +2920,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.5.5: - version "7.8.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.2.tgz#955bc473ed8af11a002a2be52071bf475638607b" - integrity sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA== - dependencies: - tslib "^2.1.0" - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -4346,25 +2934,11 @@ safe-regex-test@^1.1.0: es-errors "^1.3.0" is-regex "^1.2.1" -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.1.0: +"safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -scrypt-js@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -secp256k1@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-5.0.1.tgz#dc2c86187d48ff2da756f0f7e96417ee03c414b1" - integrity sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA== - dependencies: - elliptic "^6.5.7" - node-addon-api "^5.0.0" - node-gyp-build "^4.2.0" - semver@^7.2.1, semver@^7.3.5, semver@^7.3.7: version "7.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" @@ -4389,19 +2963,6 @@ set-function-length@^1.2.2: gopd "^1.0.1" has-property-descriptors "^1.0.2" -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -4414,11 +2975,6 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -signal-exit@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - sinon@18.0.1: version "18.0.1" resolved "https://registry.yarnpkg.com/sinon/-/sinon-18.0.1.tgz#464334cdfea2cddc5eda9a4ea7e2e3f0c7a91c5e" @@ -4512,18 +3068,6 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -"statuses@>= 1.5.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== - -stream-transform@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/stream-transform/-/stream-transform-2.1.3.tgz#a1c3ecd72ddbf500aa8d342b0b9df38f5aa598e3" - integrity sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ== - dependencies: - mixme "^0.5.1" - strict-event-emitter-types@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-event-emitter-types/-/strict-event-emitter-types-2.0.0.tgz#05e15549cb4da1694478a53543e4e2f4abcf277f" @@ -4538,13 +3082,6 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -4552,13 +3089,6 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== - dependencies: - is-hex-prefixed "1.0.0" - strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -4626,30 +3156,11 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -"through@>=2.2.7 <3", through@^2.3.6: +"through@>=2.2.7 <3": version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -tmp-promise@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-3.0.3.tgz#60a1a1cc98c988674fcbfd23b6e3367bdeac4ce7" - integrity sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ== - dependencies: - tmp "^0.2.0" - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmp@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" - integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -4657,11 +3168,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - toml@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" @@ -4677,11 +3183,6 @@ traverse-chain@~0.1.0: resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" integrity sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg== -treeify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/treeify/-/treeify-1.1.0.tgz#4e31c6a463accd0943879f30667c4fdaff411bb8" - integrity sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A== - ts-node@10.9.2: version "10.9.2" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" @@ -4706,7 +3207,7 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.1.0, tslib@^2.8.0: +tslib@^2.0.3, tslib@^2.8.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -4723,7 +3224,7 @@ tweetnacl-util@0.15.1: resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== -tweetnacl@1.0.3, tweetnacl@^1.0.1, tweetnacl@^1.0.2, tweetnacl@^1.0.3: +tweetnacl@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== @@ -4750,16 +3251,6 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -typescript-collections@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/typescript-collections/-/typescript-collections-1.3.3.tgz#62d50d93c018c094d425eabee649f00ec5cc0fea" - integrity sha512-7sI4e/bZijOzyURng88oOFZCISQPTHozfE2sUu5AviFYk5QV7fYGb6YiDl+vKjF/pICA354JImBImL9XJWUvdQ== - typescript@4.9.5: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" @@ -4789,16 +3280,6 @@ utf-8-validate@^5.0.2: dependencies: node-gyp-build "^4.3.0" -utf8@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - util@^0.12.5: version "0.12.5" resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" @@ -4825,32 +3306,6 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== -vlq@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-2.0.4.tgz#6057b85729245b9829e3cc7755f95b228d4fe041" - integrity sha512-aodjPa2wPQFkra1G8CzJBTHXhgk3EVSwxSWXNPr1fgdFLUb8kvLV1iEb6rFgasIsjP82HWI6dsb5Io26DDnasA== - -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== - dependencies: - defaults "^1.0.3" - -web3-utils@^1.3.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.4.tgz#0daee7d6841641655d8b3726baf33b08eda1cbec" - integrity sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A== - dependencies: - "@ethereumjs/util" "^8.1.0" - bn.js "^5.2.1" - ethereum-bloom-filters "^1.0.6" - ethereum-cryptography "^2.1.2" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - utf8 "3.0.0" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -4893,15 +3348,6 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -wrap-ansi@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -4916,11 +3362,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@8.18.0: - version "8.18.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" - integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== - ws@^7.5.10: version "7.5.10" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" diff --git a/test-scripts/single-anchor-test.sh b/test-scripts/single-anchor-test.sh index 38b880342..f397705a8 100755 --- a/test-scripts/single-anchor-test.sh +++ b/test-scripts/single-anchor-test.sh @@ -6,7 +6,7 @@ fi export ANCHOR_WALLET=~/.config/solana/id.json -test_files=(fuelSweep.ts) +test_files=(lpPool.ts) for test_file in ${test_files[@]}; do ts-mocha -t 300000 ./tests/${test_file} diff --git a/tests/fixtures/token_2022.so b/tests/fixtures/token_2022.so new file mode 100755 index 0000000000000000000000000000000000000000..23c12ecb2fa59e69d92e9a2100b7e0395603d708 GIT binary patch literal 1382016 zcmeFa3xHi!bvJ${$w>yPU&4f&gux;AX7VC>>kxto@xg@fh$(6yxh7zz&SZ#r&}uG& zknL&94M9QL&jwIITHD;2yinVw4-39}WV2H9g(}K(RU(*YM+TUs^1b$-f*V< zilY8#RWwcho)L8_EFgC4c$a3cQ5-_=dIc6@j z@EZE>pcget{Lxr${#5#Jo)tyIT^&*50*k+V+&l|2S5!;p63;mLag7Q?Qh>O5LZBzb;kS6VmZeU(I9jQGqf5PLhQMk0iq~9#?Pe_4VNsdU?eu?VCc! zKdB!|?5nWA_;P_}i~hHGfRCeZC>)wO_{YQ@5TH*qy(5|@gVyOLF}2FH#SvJqS|lS@ z7xhU<=(upH`a_G=iz?HZ>mdv#al^y(~6K5LEN7p}5$ma88Y_FH(h zh1Xg5Qid07V7Pa^`k-64{?b3Sv-pP5!5;v!Cmr9HXvVNd zGKdR%=}#;VHYi+nynw#RQppK_AW_$V@Q)Dv|s*@8aFbGaXKgwDDS=Jc4+xX88N!X5d~*q8gc;- zGHxInMJb)nCY2g%6in;slb=rK#`%oT(>ayrYncu_KL41|vA#p;oOG{KKh$?yc!P!a zSa^$t*)O1b#?^XCjyDkwb;2iejLvnI=kg`gSzjFO(qcRwe9)Z1qgoujPSaDo(((*% zlUJcmyy9q(<=rd|6bC$snFedgV)85GG~!1VYkZWiD~1=!f2nu4|IJm zmCqYL{cRl_$8W0K8%9@I`nNS5<-vj8KOLXghTr}2FO2mQuJ>CCSLwj)C-Fy%8Xu0# zQ{UxA<2Fs!cF*`f&2d+W&eQQ&=v*3=q>g-lR62_?W*DF4pKveB3-_3u>OEH@T#rfR z)Hw!sG5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tests/lpPool.ts @@ -1,26 +1,28 @@ import * as anchor from '@coral-xyz/anchor'; -import { assert } from 'chai'; +import { expect } from 'chai'; import { Program } from '@coral-xyz/anchor'; -import { AccountInfo, Keypair, PublicKey } from '@solana/web3.js'; +import { Keypair, PublicKey } from '@solana/web3.js'; +import { unpack } from '@solana/spl-token-metadata'; +import { + TOKEN_2022_PROGRAM_ID, + unpackMint, + ExtensionType, + getExtensionData, +} from '@solana/spl-token'; import { BN, TestClient, QUOTE_PRECISION, - UserStatsAccount, - parseLogs, getLpPoolPublicKey, getAmmConstituentMappingPublicKey, + encodeName, + getConstituentTargetWeightsPublicKey, } from '../sdk/src'; -import { - initializeQuoteSpotMarket, - mockUSDCMint, - mockUserUSDCAccount, - printTxLogs, -} from './testHelpers'; +import { initializeQuoteSpotMarket, mockUSDCMint } from './testHelpers'; import { startAnchor } from 'solana-bankrun'; import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; import { BankrunContextWrapper } from '../sdk/src/bankrun/bankrunConnection'; @@ -34,17 +36,30 @@ describe('LP Pool', () => { let adminClient: TestClient; let usdcMint; - const usdcAmount = new BN(100 * 10 ** 6); const lpPoolName = 'test pool 1'; const tokenName = 'test pool token'; const tokenSymbol = 'DLP-1'; const tokenUri = 'https://token.token.token.gov'; const tokenDecimals = 6; - const lpPoolKey = getLpPoolPublicKey(program.programId, lpPoolName); + const lpPoolKey = getLpPoolPublicKey( + program.programId, + encodeName(lpPoolName) + ); before(async () => { - const context = await startAnchor('', [], []); + const context = await startAnchor( + '', + [ + { + name: 'token_2022', + programId: new PublicKey( + 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' + ), + }, + ], + [] + ); // @ts-ignore bankrunContextWrapper = new BankrunContextWrapper(context); @@ -83,15 +98,15 @@ describe('LP Pool', () => { await adminClient.subscribe(); await initializeQuoteSpotMarket(adminClient, usdcMint.publicKey); - const tx = await adminClient.initializeLpPool( + await adminClient.initializeLpPool( lpPoolName, tokenName, tokenSymbol, tokenUri, tokenDecimals, - new BN(100_000_000).mul(QUOTE_PRECISION) + new BN(100_000_000).mul(QUOTE_PRECISION), + Keypair.generate() ); - await printTxLogs(bankrunContextWrapper.connection.toConnection(), tx); }); after(async () => { @@ -101,17 +116,46 @@ describe('LP Pool', () => { it('can create a new LP Pool', async () => { // check LpPool created const lpPool = await adminClient.program.account.lpPool.fetch(lpPoolKey); - console.log(lpPool); - // Check amm constituent map exists and has length 0 - const ammConstituentMapPublicKey = await getAmmConstituentMappingPublicKey( + // Check amm constituent map exists + const ammConstituentMapPublicKey = getAmmConstituentMappingPublicKey( program.programId, lpPoolKey ); const ammConstituentMap = - await adminClient.program.account.ammConstituentMap.fetch( + await adminClient.program.account.ammConstituentMapping.fetch( ammConstituentMapPublicKey ); - console.log(ammConstituentMap); + expect(ammConstituentMap).to.not.be.null; + + // check constituent target weights exists + const constituentTargetWeightsPublicKey = getConstituentTargetWeightsPublicKey( + program.programId, + lpPoolKey + ); + const constituentTargetWeights = + await adminClient.program.account.constituentTargetWeights.fetch( + constituentTargetWeightsPublicKey + ); + expect(constituentTargetWeights).to.not.be.null; + + // check mint and metadata created correctly + const mintAccountInfo = + await bankrunContextWrapper.connection.getAccountInfo( + lpPool.mint as PublicKey + ); + const mintData = unpackMint( + lpPool.mint, + mintAccountInfo, + TOKEN_2022_PROGRAM_ID + ); + const data = getExtensionData( + ExtensionType.TokenMetadata, + mintData.tlvData + ); + const tokenMetadata = unpack(data); + expect(tokenMetadata.name).to.equal(tokenName); + expect(tokenMetadata.symbol).to.equal(tokenSymbol); + expect(tokenMetadata.uri).to.equal(tokenUri); }); }); diff --git a/yarn.lock b/yarn.lock index bcfae50f5..c0bcdac89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -473,6 +473,13 @@ dependencies: "@solana/errors" "2.0.0-preview.2" +"@solana/codecs-core@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz#1a2d76b9c7b9e7b7aeb3bd78be81c2ba21e3ce22" + integrity sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ== + dependencies: + "@solana/errors" "2.0.0-rc.1" + "@solana/codecs-data-structures@2.0.0-preview.2": version "2.0.0-preview.2" resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz#e82cb1b6d154fa636cd5c8953ff3f32959cc0370" @@ -482,6 +489,15 @@ "@solana/codecs-numbers" "2.0.0-preview.2" "@solana/errors" "2.0.0-preview.2" +"@solana/codecs-data-structures@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz#d47b2363d99fb3d643f5677c97d64a812982b888" + integrity sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + "@solana/codecs-numbers@2.0.0-preview.2": version "2.0.0-preview.2" resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz#56995c27396cd8ee3bae8bd055363891b630bbd0" @@ -490,6 +506,14 @@ "@solana/codecs-core" "2.0.0-preview.2" "@solana/errors" "2.0.0-preview.2" +"@solana/codecs-numbers@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz#f34978ddf7ea4016af3aaed5f7577c1d9869a614" + integrity sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + "@solana/codecs-strings@2.0.0-preview.2": version "2.0.0-preview.2" resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz#8bd01a4e48614d5289d72d743c3e81305d445c46" @@ -499,6 +523,15 @@ "@solana/codecs-numbers" "2.0.0-preview.2" "@solana/errors" "2.0.0-preview.2" +"@solana/codecs-strings@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz#e1d9167075b8c5b0b60849f8add69c0f24307018" + integrity sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + "@solana/codecs@2.0.0-preview.2": version "2.0.0-preview.2" resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-preview.2.tgz#d6615fec98f423166fb89409f9a4ad5b74c10935" @@ -510,6 +543,17 @@ "@solana/codecs-strings" "2.0.0-preview.2" "@solana/options" "2.0.0-preview.2" +"@solana/codecs@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-rc.1.tgz#146dc5db58bd3c28e04b4c805e6096c2d2a0a875" + integrity sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-data-structures" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/codecs-strings" "2.0.0-rc.1" + "@solana/options" "2.0.0-rc.1" + "@solana/errors@2.0.0-preview.2": version "2.0.0-preview.2" resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-preview.2.tgz#e0ea8b008c5c02528d5855bc1903e5e9bbec322e" @@ -518,6 +562,14 @@ chalk "^5.3.0" commander "^12.0.0" +"@solana/errors@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-rc.1.tgz#3882120886eab98a37a595b85f81558861b29d62" + integrity sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ== + dependencies: + chalk "^5.3.0" + commander "^12.1.0" + "@solana/options@2.0.0-preview.2": version "2.0.0-preview.2" resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-preview.2.tgz#13ff008bf43a5056ef9a091dc7bb3f39321e867e" @@ -526,6 +578,31 @@ "@solana/codecs-core" "2.0.0-preview.2" "@solana/codecs-numbers" "2.0.0-preview.2" +"@solana/options@2.0.0-rc.1": + version "2.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-rc.1.tgz#06924ba316dc85791fc46726a51403144a85fc4d" + integrity sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA== + dependencies: + "@solana/codecs-core" "2.0.0-rc.1" + "@solana/codecs-data-structures" "2.0.0-rc.1" + "@solana/codecs-numbers" "2.0.0-rc.1" + "@solana/codecs-strings" "2.0.0-rc.1" + "@solana/errors" "2.0.0-rc.1" + +"@solana/spl-token-group@^0.0.7": + version "0.0.7" + resolved "https://registry.yarnpkg.com/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz#83c00f0cd0bda33115468cd28b89d94f8ec1fee4" + integrity sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug== + dependencies: + "@solana/codecs" "2.0.0-rc.1" + +"@solana/spl-token-metadata@0.1.6", "@solana/spl-token-metadata@^0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz#d240947aed6e7318d637238022a7b0981b32ae80" + integrity sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA== + dependencies: + "@solana/codecs" "2.0.0-rc.1" + "@solana/spl-token-metadata@^0.1.2": version "0.1.4" resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.4.tgz#5cdc3b857a8c4a6877df24e24a8648c4132d22ba" @@ -534,13 +611,15 @@ "@solana/codecs" "2.0.0-preview.2" "@solana/spl-type-length-value" "0.1.0" -"@solana/spl-token@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.7.tgz#6f027f9ad8e841f792c32e50920d9d2e714fc8da" - integrity sha512-bKGxWTtIw6VDdCBngjtsGlKGLSmiu/8ghSt/IOYJV24BsymRbgq7r12GToeetpxmPaZYLddKwAz7+EwprLfkfg== +"@solana/spl-token@0.4.13": + version "0.4.13" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.4.13.tgz#8f65c3c2b315e1a00a91b8d0f60922c6eb71de62" + integrity sha512-cite/pYWQZZVvLbg5lsodSovbetK/eA24gaR0eeUeMuBAMNrT8XFCwaygKy0N2WSg3gSyjjNpIeAGBAKZaY/1w== dependencies: "@solana/buffer-layout" "^4.0.0" "@solana/buffer-layout-utils" "^0.2.0" + "@solana/spl-token-group" "^0.0.7" + "@solana/spl-token-metadata" "^0.1.6" buffer "^6.0.3" "@solana/spl-token@^0.1.6": @@ -1276,7 +1355,7 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^12.0.0: +commander@^12.0.0, commander@^12.1.0: version "12.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== From be22c2481b16e78ba443c8e07a910a5303e4efa5 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Wed, 23 Apr 2025 18:56:20 -0700 Subject: [PATCH 18/50] add add datum ix --- programs/drift/src/error.rs | 4 +- programs/drift/src/instructions/admin.rs | 62 ++++++++++++++++++++++++ programs/drift/src/lib.rs | 18 +++++++ 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index 8cd95ad9d..a82aec85d 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -635,8 +635,8 @@ pub enum ErrorCode { InvalidSignedMsgUserOrdersResize, #[msg("Invalid Constituent")] InvalidConstituent, - #[msg("Misatch amm mapping and constituent target weights")] - MismatchAmmConstituentMappingAndConstituentTargetWeights, + #[msg("Amm mapping constituent already exists")] + AmmMappingConstituentAlreadyExists, } #[macro_export] diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 424c26aee..72716e749 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4514,6 +4514,39 @@ pub fn handle_initialize_constituent<'info>( Ok(()) } +pub fn handle_add_amm_constituent_data<'info>( + ctx: Context, + market_index_constituent_index_pairs: Vec<(u16, u16)>, +) -> Result<()> { + let mut amm_mapping = &mut ctx.accounts.amm_constituent_mapping; + let mut current_len = amm_mapping.data.len(); + + for (perp_market_index, constituent_index) in market_index_constituent_index_pairs { + let mut datum = AmmConstituentDatum::default(); + datum.perp_market_index = perp_market_index; + datum.constituent_index = constituent_index; + + // Check if the datum already exists + let exists = amm_mapping.data.iter().any(|d| { + d.perp_market_index == perp_market_index && d.constituent_index == constituent_index + }); + + validate!( + !exists, + ErrorCode::AmmMappingConstituentAlreadyExists, + "AmmConstituentDatum already exists for perp_market_index {} and constituent_index {}", + perp_market_index, + constituent_index + )?; + + // Add the new datum to the mapping + current_len += 1; + amm_mapping.data.resize(current_len, datum); + } + + Ok(()) +} + #[derive(Accounts)] pub struct Initialize<'info> { #[account(mut)] @@ -5348,3 +5381,32 @@ pub struct InitializeConstituent<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, } + +#[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], + market_index_constituent_index_pairs: Vec<(u16, u16)>, +)] +pub struct AddAmmConstituentData<'info> { + #[account(mut)] + pub admin: Signer<'info>, + + #[account( + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, + + #[account( + mut, + seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + realloc = AmmConstituentMapping::space(amm_constituent_mapping.data.len() + market_index_constituent_index_pairs.len()), + realloc::payer = admin, + realloc::zero = false, + )] + pub amm_constituent_mapping: Box>, + #[account(mut)] + pub payer: Signer<'info>, + pub system_program: Program<'info, System>, +} diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 042b00570..05109a6d3 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1706,6 +1706,24 @@ pub mod drift { ) -> Result<()> { handle_update_protected_maker_mode_config(ctx, max_users, reduce_only, current_users) } + + pub fn initialize_constituent( + ctx: Context, + spot_market_index: u16, + decimals: u8, + max_weight_deviation: i64, + swap_fee_min: i64, + swap_fee_max: i64, + ) -> Result<()> { + handle_initialize_constituent( + ctx, + spot_market_index, + decimals, + max_weight_deviation, + swap_fee_min, + swap_fee_max, + ) + } } #[cfg(not(feature = "no-entrypoint"))] From 188ab4e67cc6f37ac7132ef0fdb0aedf161d9e76 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 24 Apr 2025 11:35:38 -0700 Subject: [PATCH 19/50] add init tests and invariant checks --- programs/drift/src/error.rs | 4 +- programs/drift/src/instructions/admin.rs | 51 ++++++-- programs/drift/src/lib.rs | 9 ++ programs/drift/src/state/lp_pool.rs | 6 +- sdk/src/adminClient.ts | 109 +++++++++++++++++ sdk/src/idl/drift.json | 142 ++++++++++++++++++++++- sdk/src/types.ts | 37 ++++++ tests/lpPool.ts | 126 +++++++++++++++++++- 8 files changed, 459 insertions(+), 25 deletions(-) diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index a82aec85d..640ba7d29 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -635,8 +635,8 @@ pub enum ErrorCode { InvalidSignedMsgUserOrdersResize, #[msg("Invalid Constituent")] InvalidConstituent, - #[msg("Amm mapping constituent already exists")] - AmmMappingConstituentAlreadyExists, + #[msg("Invalid Amm Constituent Mapping argument")] + InvalidAmmConstituentMappingArgument, } #[macro_export] diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 85b711e00..81bcd2d35 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4600,14 +4600,37 @@ pub fn handle_initialize_constituent<'info>( Ok(()) } +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct InitializeAmmConstituentMappingDatum { + pub constituent_index: u16, + pub perp_market_index: u16, +} + pub fn handle_add_amm_constituent_data<'info>( - ctx: Context, - market_index_constituent_index_pairs: Vec<(u16, u16)>, + ctx: Context, + init_amm_constituent_mapping_data: Vec, ) -> Result<()> { - let mut amm_mapping = &mut ctx.accounts.amm_constituent_mapping; + let amm_mapping = &mut ctx.accounts.amm_constituent_mapping; + let constituent_target_weights = &ctx.accounts.constituent_target_weights; + let state = &ctx.accounts.state; let mut current_len = amm_mapping.data.len(); - for (perp_market_index, constituent_index) in market_index_constituent_index_pairs { + for init_datum in init_amm_constituent_mapping_data { + let perp_market_index = init_datum.perp_market_index; + + validate!( + perp_market_index < state.number_of_markets, + ErrorCode::InvalidAmmConstituentMappingArgument, + "perp_market_index too large compared to number of markets" + )?; + + validate!( + (init_datum.constituent_index as usize) < constituent_target_weights.data.len(), + ErrorCode::InvalidAmmConstituentMappingArgument, + "constituent_index too large compared to number of constituents in target weights" + )?; + + let constituent_index = init_datum.constituent_index; let mut datum = AmmConstituentDatum::default(); datum.perp_market_index = perp_market_index; datum.constituent_index = constituent_index; @@ -4619,7 +4642,7 @@ pub fn handle_add_amm_constituent_data<'info>( validate!( !exists, - ErrorCode::AmmMappingConstituentAlreadyExists, + ErrorCode::InvalidAmmConstituentMappingArgument, "AmmConstituentDatum already exists for perp_market_index {} and constituent_index {}", perp_market_index, constituent_index @@ -5442,9 +5465,7 @@ pub struct InitializeConstituent<'info> { payer = admin, )] pub constituent: AccountLoader<'info, Constituent>, - - #[account(mut)] - pub payer: Signer<'info>, + pub rent: Sysvar<'info, Rent>, pub system_program: Program<'info, System>, } @@ -5453,7 +5474,7 @@ pub struct InitializeConstituent<'info> { lp_pool_name: [u8; 32], market_index_constituent_index_pairs: Vec<(u16, u16)>, )] -pub struct AddAmmConstituentData<'info> { +pub struct AddAmmConstituentMappingData<'info> { #[account(mut)] pub admin: Signer<'info>, @@ -5472,7 +5493,15 @@ pub struct AddAmmConstituentData<'info> { realloc::zero = false, )] pub amm_constituent_mapping: Box>, - #[account(mut)] - pub payer: Signer<'info>, + #[account( + mut, + seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + realloc = ConstituentTargetWeights::space(constituent_target_weights.data.len() + 1 as usize), + realloc::payer = admin, + realloc::zero = false, + )] + pub constituent_target_weights: Box>, + pub state: Box>, pub system_program: Program<'info, System>, } diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 05109a6d3..cbd2a4a52 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1709,6 +1709,7 @@ pub mod drift { pub fn initialize_constituent( ctx: Context, + lp_pool_name: [u8; 32], spot_market_index: u16, decimals: u8, max_weight_deviation: i64, @@ -1724,6 +1725,14 @@ pub mod drift { swap_fee_max, ) } + + pub fn add_amm_constituent_mapping_data( + ctx: Context, + lp_pool_name: [u8; 32], + init_amm_constituent_mapping_data: Vec, + ) -> Result<()> { + handle_add_amm_constituent_data(ctx, init_amm_constituent_mapping_data) + } } #[cfg(not(feature = "no-entrypoint"))] diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 3add22c94..eec5d794e 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -208,7 +208,7 @@ pub struct BLPosition { pub market_index: u16, /// Whether the position is deposit or borrow pub balance_type: SpotBalanceType, - pub padding: [u8; 4], + pub padding: [u8; 5], } impl SpotBalance for BLPosition { @@ -269,7 +269,7 @@ pub struct Constituent { } impl Size for Constituent { - const SIZE: usize = 108; + const SIZE: usize = 112; } impl Constituent { @@ -433,7 +433,7 @@ impl ConstituentTargetWeights { pub fn validate(&self) -> DriftResult<()> { validate!( - self.data.len() >= 0 && self.data.len() <= 128, + self.data.len() <= 128, ErrorCode::DefaultError, "Number of constituents len must be between 1 and 128" )?; diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 49e660c13..18a906e84 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -15,6 +15,7 @@ import { ContractTier, AssetTier, SpotFulfillmentConfigStatus, + InitAmmConstituentMappingDatum, } from './types'; import { DEFAULT_MARKET_NAME, encodeName } from './userName'; import { BN } from '@coral-xyz/anchor'; @@ -40,6 +41,7 @@ import { getLpPoolPublicKey, getAmmConstituentMappingPublicKey, getConstituentTargetWeightsPublicKey, + getConstituentPublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; import { @@ -4272,4 +4274,111 @@ export class AdminClient extends DriftClient { createAtaIx, ]; } + + public async initializeConstituent( + lpPoolName: number[], + spotMarketIndex: number, + decimals: number, + maxWeightDeviation: BN, + swapFeeMin: BN, + swapFeeMax: BN + ): Promise { + const ixs = await this.getInitializeConstituentIx( + lpPoolName, + spotMarketIndex, + decimals, + maxWeightDeviation, + swapFeeMin, + swapFeeMax + ); + const tx = await this.buildTransaction(ixs); + const { txSig } = await this.sendTransaction(tx, []); + return txSig; + } + + public async getInitializeConstituentIx( + lpPoolName: number[], + spotMarketIndex: number, + decimals: number, + maxWeightDeviation: BN, + swapFeeMin: BN, + swapFeeMax: BN + ): Promise { + const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); + const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + this.program.programId, + lpPool + ); + const constituent = getConstituentPublicKey( + this.program.programId, + lpPool, + spotMarketIndex + ); + return [ + this.program.instruction.initializeConstituent( + lpPoolName, + spotMarketIndex, + decimals, + maxWeightDeviation, + swapFeeMin, + swapFeeMax, + { + accounts: { + admin: this.wallet.publicKey, + lpPool, + constituentTargetWeights, + constituent, + rent: SYSVAR_RENT_PUBKEY, + systemProgram: SystemProgram.programId, + }, + signers: [], + } + ), + ]; + } + + public async addInitAmmConstituentMappingData( + lpPoolName: number[], + marketIndexConstituentIndexPairs: InitAmmConstituentMappingDatum[] + ): Promise { + const ixs = await this.getAddInitAmmConstituentMappingDataIx( + lpPoolName, + marketIndexConstituentIndexPairs + ); + const tx = await this.buildTransaction(ixs); + const { txSig } = await this.sendTransaction(tx, []); + return txSig; + } + + public async getAddInitAmmConstituentMappingDataIx( + lpPoolName: number[], + marketIndexConstituentIndexPairs: InitAmmConstituentMappingDatum[] + ): Promise { + const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); + const ammConstituentMapping = getAmmConstituentMappingPublicKey( + this.program.programId, + lpPool + ); + const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + this.program.programId, + lpPool + ); + return [ + this.program.instruction.addAmmConstituentMappingData( + lpPoolName, + marketIndexConstituentIndexPairs, + { + accounts: { + admin: this.wallet.publicKey, + lpPool, + ammConstituentMapping, + constituentTargetWeights, + rent: SYSVAR_RENT_PUBKEY, + systemProgram: SystemProgram.programId, + state: await this.getStatePublicKey(), + }, + } + ), + ]; + } } diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index adcf9db9e..e537792d0 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7143,6 +7143,126 @@ } } ] + }, + { + "name": "initializeConstituent", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "lpPool", + "isMut": false, + "isSigner": false + }, + { + "name": "constituentTargetWeights", + "isMut": true, + "isSigner": false + }, + { + "name": "constituent", + "isMut": true, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "spotMarketIndex", + "type": "u16" + }, + { + "name": "decimals", + "type": "u8" + }, + { + "name": "maxWeightDeviation", + "type": "i64" + }, + { + "name": "swapFeeMin", + "type": "i64" + }, + { + "name": "swapFeeMax", + "type": "i64" + } + ] + }, + { + "name": "addAmmConstituentMappingData", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "lpPool", + "isMut": false, + "isSigner": false + }, + { + "name": "ammConstituentMapping", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentTargetWeights", + "isMut": true, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "initAmmConstituentMappingData", + "type": { + "vec": { + "defined": "InitializeAmmConstituentMappingDatum" + } + } + } + ] } ], "accounts": [ @@ -9315,6 +9435,22 @@ ] } }, + { + "name": "InitializeAmmConstituentMappingDatum", + "type": { + "kind": "struct", + "fields": [ + { + "name": "constituentIndex", + "type": "u16" + }, + { + "name": "perpMarketIndex", + "type": "u16" + } + ] + } + }, { "name": "LiquidatePerpRecord", "type": { @@ -9581,7 +9717,7 @@ "type": { "array": [ "u8", - 4 + 5 ] } } @@ -15523,8 +15659,8 @@ }, { "code": 6315, - "name": "MismatchAmmConstituentMappingAndConstituentTargetWeights", - "msg": "Misatch amm mapping and constituent target weights" + "name": "InvalidAmmConstituentMappingArgument", + "msg": "Invalid Amm Constituent Mapping argument" } ], "metadata": { diff --git a/sdk/src/types.ts b/sdk/src/types.ts index 3f2243820..2700087c9 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1472,3 +1472,40 @@ export type SignedMsgUserOrdersAccount = { authorityPubkey: PublicKey; signedMsgOrderData: SignedMsgOrderId[]; }; + +export type InitAmmConstituentMappingDatum = { + constituentIndex: number; + perpMarketIndex: number; +}; + +export type AmmConstituentDatum = InitAmmConstituentMappingDatum & { + data: BN; + lastSlot: BN; +}; + +export type AmmConstituentMapping = { + data: AmmConstituentDatum[]; +}; + +export type WeightDatum = { + data: BN; + lastSlot: BN; +}; + +export type ConstituentTargetWeights = { + data: WeightDatum[]; +}; + +export type LPPool = { + name: number[]; + pubkey: PublicKey; + mint: PublicKey; + maxAum: BN; + lastAum: BN; + lastAumSlot: BN; + lastAumTs: BN; + lastRevenueRebalanceTs: BN; + totalFeesReceived: BN; + totalFeesPaid: BN; + constituents: number; +}; diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 495f01372..8e4c7f356 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -1,5 +1,5 @@ import * as anchor from '@coral-xyz/anchor'; -import { expect } from 'chai'; +import { expect, assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; @@ -20,9 +20,16 @@ import { getAmmConstituentMappingPublicKey, encodeName, getConstituentTargetWeightsPublicKey, + PERCENTAGE_PRECISION, + PRICE_PRECISION, + PEG_PRECISION, } from '../sdk/src'; -import { initializeQuoteSpotMarket, mockUSDCMint } from './testHelpers'; +import { + initializeQuoteSpotMarket, + mockOracleNoProgram, + mockUSDCMint, +} from './testHelpers'; import { startAnchor } from 'solana-bankrun'; import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; import { BankrunContextWrapper } from '../sdk/src/bankrun/bankrunConnection'; @@ -37,6 +44,15 @@ describe('LP Pool', () => { let adminClient: TestClient; let usdcMint; + const mantissaSqrtScale = new BN(Math.sqrt(PRICE_PRECISION.toNumber())); + const ammInitialQuoteAssetReserve = new anchor.BN(10 * 10 ** 13).mul( + mantissaSqrtScale + ); + const ammInitialBaseAssetReserve = new anchor.BN(10 * 10 ** 13).mul( + mantissaSqrtScale + ); + let solUsd: PublicKey; + const lpPoolName = 'test pool 1'; const tokenName = 'test pool token'; const tokenSymbol = 'DLP-1'; @@ -98,6 +114,27 @@ describe('LP Pool', () => { await adminClient.subscribe(); await initializeQuoteSpotMarket(adminClient, usdcMint.publicKey); + solUsd = await mockOracleNoProgram(bankrunContextWrapper, 224.3); + const periodicity = new BN(0); + + await adminClient.initializePerpMarket( + 0, + solUsd, + ammInitialBaseAssetReserve, + ammInitialQuoteAssetReserve, + periodicity, + new BN(224 * PEG_PRECISION.toNumber()) + ); + + await adminClient.initializePerpMarket( + 1, + solUsd, + ammInitialBaseAssetReserve, + ammInitialQuoteAssetReserve, + periodicity, + new BN(224 * PEG_PRECISION.toNumber()) + ); + await adminClient.initializeLpPool( lpPoolName, tokenName, @@ -127,17 +164,18 @@ describe('LP Pool', () => { ammConstituentMapPublicKey ); expect(ammConstituentMap).to.not.be.null; + // @ts-ignore + assert(ammConstituentMap.data.length == 0); // check constituent target weights exists - const constituentTargetWeightsPublicKey = getConstituentTargetWeightsPublicKey( - program.programId, - lpPoolKey - ); + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); const constituentTargetWeights = await adminClient.program.account.constituentTargetWeights.fetch( constituentTargetWeightsPublicKey ); expect(constituentTargetWeights).to.not.be.null; + assert(constituentTargetWeights.data.length == 0); // check mint and metadata created correctly const mintAccountInfo = @@ -158,4 +196,80 @@ describe('LP Pool', () => { expect(tokenMetadata.symbol).to.equal(tokenSymbol); expect(tokenMetadata.uri).to.equal(tokenUri); }); + + it('can add constituent to LP Pool', async () => { + await adminClient.initializeConstituent( + encodeName(lpPoolName), + 0, + 6, + new BN(10).mul(PERCENTAGE_PRECISION), + new BN(1).mul(PERCENTAGE_PRECISION), + new BN(2).mul(PERCENTAGE_PRECISION) + ); + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeights = + await adminClient.program.account.constituentTargetWeights.fetch( + constituentTargetWeightsPublicKey + ); + expect(constituentTargetWeights).to.not.be.null; + assert(constituentTargetWeights.data.length == 1); + }); + + it('can add amm mapping datum', async () => { + await adminClient.addInitAmmConstituentMappingData(encodeName(lpPoolName), [ + { + perpMarketIndex: 0, + constituentIndex: 0, + }, + { + perpMarketIndex: 1, + constituentIndex: 0, + }, + ]); + const ammConstituentMapping = getAmmConstituentMappingPublicKey( + program.programId, + lpPoolKey + ); + const ammMapping = + await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMapping + ); + expect(ammMapping).to.not.be.null; + assert(ammMapping.data.length == 2); + }); + + it('fails adding datum with bad params', async () => { + // Bad perp market index + try { + await adminClient.addInitAmmConstituentMappingData( + encodeName(lpPoolName), + [ + { + perpMarketIndex: 2, + constituentIndex: 0, + }, + ] + ); + expect.fail('should have failed'); + } catch (e) { + expect(e.message).to.contain('0x18ab'); + } + + // Bad constituent index + try { + await adminClient.addInitAmmConstituentMappingData( + encodeName(lpPoolName), + [ + { + perpMarketIndex: 0, + constituentIndex: 1, + }, + ] + ); + expect.fail('should have failed'); + } catch (e) { + expect(e.message).to.contain('0x18ab'); + } + }); }); From f450cb217465bfcc2b8d6b37576e9f1536aaec99 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 24 Apr 2025 12:06:46 -0700 Subject: [PATCH 20/50] rename data to more useful names --- programs/drift/src/instructions/admin.rs | 30 ++++++++++++++--------- programs/drift/src/state/lp_pool.rs | 20 +++++++-------- programs/drift/src/state/lp_pool/tests.rs | 14 +++++------ sdk/src/adminClient.ts | 8 +++--- sdk/src/idl/drift.json | 24 +++++++++++++++--- sdk/src/types.ts | 12 ++++----- tests/lpPool.ts | 27 ++++++++++---------- 7 files changed, 79 insertions(+), 56 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 81bcd2d35..6d3c295de 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4515,13 +4515,13 @@ pub fn handle_initialize_lp_pool( let amm_constituent_mapping = &mut ctx.accounts.amm_constituent_mapping; amm_constituent_mapping - .data + .weights .resize_with(0 as usize, AmmConstituentDatum::default); amm_constituent_mapping.validate()?; let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; constituent_target_weights - .data + .weights .resize_with(0 as usize, WeightDatum::default); constituent_target_weights.validate()?; @@ -4584,10 +4584,10 @@ pub fn handle_initialize_constituent<'info>( let mut constituent = ctx.accounts.constituent.load_init()?; let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; - let current_len = constituent_target_weights.data.len(); + let current_len = constituent_target_weights.weights.len(); constituent_target_weights - .data + .weights .resize_with((current_len + 1) as usize, WeightDatum::default); constituent_target_weights.validate()?; @@ -4613,7 +4613,7 @@ pub fn handle_add_amm_constituent_data<'info>( let amm_mapping = &mut ctx.accounts.amm_constituent_mapping; let constituent_target_weights = &ctx.accounts.constituent_target_weights; let state = &ctx.accounts.state; - let mut current_len = amm_mapping.data.len(); + let mut current_len = amm_mapping.weights.len(); for init_datum in init_amm_constituent_mapping_data { let perp_market_index = init_datum.perp_market_index; @@ -4625,7 +4625,7 @@ pub fn handle_add_amm_constituent_data<'info>( )?; validate!( - (init_datum.constituent_index as usize) < constituent_target_weights.data.len(), + (init_datum.constituent_index as usize) < constituent_target_weights.weights.len(), ErrorCode::InvalidAmmConstituentMappingArgument, "constituent_index too large compared to number of constituents in target weights" )?; @@ -4636,7 +4636,7 @@ pub fn handle_add_amm_constituent_data<'info>( datum.constituent_index = constituent_index; // Check if the datum already exists - let exists = amm_mapping.data.iter().any(|d| { + let exists = amm_mapping.weights.iter().any(|d| { d.perp_market_index == perp_market_index && d.constituent_index == constituent_index }); @@ -4650,7 +4650,7 @@ pub fn handle_add_amm_constituent_data<'info>( // Add the new datum to the mapping current_len += 1; - amm_mapping.data.resize(current_len, datum); + amm_mapping.weights.resize(current_len, datum); } Ok(()) @@ -5451,7 +5451,7 @@ pub struct InitializeConstituent<'info> { mut, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, - realloc = ConstituentTargetWeights::space(constituent_target_weights.data.len() + 1 as usize), + realloc = ConstituentTargetWeights::space(constituent_target_weights.weights.len() + 1 as usize), realloc::payer = admin, realloc::zero = false, )] @@ -5469,10 +5469,16 @@ pub struct InitializeConstituent<'info> { pub system_program: Program<'info, System>, } +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct AddAmmConstituentMappingDatum { + pub constituent_index: u16, + pub perp_market_index: u16, +} + #[derive(Accounts)] #[instruction( lp_pool_name: [u8; 32], - market_index_constituent_index_pairs: Vec<(u16, u16)>, + add_amm_constituent_mapping_data: Vec, )] pub struct AddAmmConstituentMappingData<'info> { #[account(mut)] @@ -5488,7 +5494,7 @@ pub struct AddAmmConstituentMappingData<'info> { mut, seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, - realloc = AmmConstituentMapping::space(amm_constituent_mapping.data.len() + market_index_constituent_index_pairs.len()), + realloc = AmmConstituentMapping::space(amm_constituent_mapping.weights.len() + add_amm_constituent_mapping_data.len()), realloc::payer = admin, realloc::zero = false, )] @@ -5497,7 +5503,7 @@ pub struct AddAmmConstituentMappingData<'info> { mut, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, - realloc = ConstituentTargetWeights::space(constituent_target_weights.data.len() + 1 as usize), + realloc = ConstituentTargetWeights::space(constituent_target_weights.weights.len() + 1 as usize), realloc::payer = admin, realloc::zero = false, )] diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index eec5d794e..3d92d0f91 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -346,7 +346,7 @@ pub struct AmmConstituentDatum { pub constituent_index: u16, pub padding: [u8; 4], /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market - pub data: i64, + pub weight: i64, pub last_slot: u64, } @@ -370,7 +370,7 @@ impl HasLen for AmmConstituentMappingFixed { pub struct AmmConstituentMapping { // PERCENTAGE_PRECISION. Each datum represents the target weight for a single (AMM, Constituent) pair. // An AMM may be partially backed by multiple Constituents - pub data: Vec, + pub weights: Vec, } impl AmmConstituentMapping { @@ -380,7 +380,7 @@ impl AmmConstituentMapping { pub fn validate(&self) -> DriftResult<()> { validate!( - self.data.len() >= 0 && self.data.len() <= 128, + self.weights.len() <= 128, ErrorCode::DefaultError, "Number of constituents len must be between 1 and 128" )?; @@ -399,7 +399,7 @@ impl_zero_copy_loader!( #[derive(Debug, Default, BorshDeserialize, BorshSerialize)] #[repr(C)] pub struct WeightDatum { - pub data: i64, + pub weight: i64, pub last_slot: u64, } @@ -423,7 +423,7 @@ impl HasLen for ConstituentTargetWeightsFixed { #[repr(C)] pub struct ConstituentTargetWeights { // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async - pub data: Vec, + pub weights: Vec, } impl ConstituentTargetWeights { @@ -433,7 +433,7 @@ impl ConstituentTargetWeights { pub fn validate(&self) -> DriftResult<()> { validate!( - self.data.len() <= 128, + self.weights.len() <= 128, ErrorCode::DefaultError, "Number of constituents len must be between 1 and 128" )?; @@ -451,7 +451,7 @@ impl_zero_copy_loader!( impl Default for ConstituentTargetWeights { fn default() -> Self { ConstituentTargetWeights { - data: Vec::with_capacity(0), + weights: Vec::with_capacity(0), } } } @@ -474,7 +474,7 @@ impl<'a> AccountZeroCopy<'a, WeightDatum, ConstituentTargetWeightsFixed> { self.len() )?; let datum = self.get(constituent_index as u32); - Ok(datum.data) + Ok(datum.weight) } } @@ -500,7 +500,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { .iter() .position(|d| &d.perp_market_index == perp_market_index) .expect("missing mapping for this market index"); - let weight = mapping.get(idx as u32).data; // PERCENTAGE_PRECISION + let weight = mapping.get(idx as u32).weight; // PERCENTAGE_PRECISION target_amount += (*inventory as i128) .saturating_mul(weight as i128) @@ -528,7 +528,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { } let cell = self.get_mut(i as u32); - cell.data = target_weight as i64; + cell.weight = target_weight as i64; cell.last_slot = slot; } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index bcbce3f99..99c351118 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -7,14 +7,14 @@ mod tests { fn amm_const_datum( perp_market_index: u16, constituent_index: u16, - data: i64, + weight: i64, last_slot: u64, ) -> AmmConstituentDatum { AmmConstituentDatum { perp_market_index, constituent_index, padding: [0; 4], - data, + weight, last_slot, } } @@ -78,7 +78,7 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).data, 0); + assert_eq!(target_zc_mut.get(0).weight, 0); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } @@ -141,7 +141,7 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).data, PERCENTAGE_PRECISION_I64); + assert_eq!(target_zc_mut.get(0).weight, PERCENTAGE_PRECISION_I64); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } @@ -217,7 +217,7 @@ mod tests { assert_eq!(target_zc_mut.len(), 2); for i in 0..target_zc_mut.len() { - assert_eq!(target_zc_mut.get(i).data, PERCENTAGE_PRECISION_I64 / 2); + assert_eq!(target_zc_mut.get(i).weight, PERCENTAGE_PRECISION_I64 / 2); assert_eq!(target_zc_mut.get(i).last_slot, now_ts); } } @@ -281,7 +281,7 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).data, 0); // no target + assert_eq!(target_zc_mut.get(0).weight, 0); // no target assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } @@ -344,7 +344,7 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert!(target_zc_mut.get(0).data <= PERCENTAGE_PRECISION_I64); + assert!(target_zc_mut.get(0).weight <= PERCENTAGE_PRECISION_I64); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 18a906e84..db0d3916a 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -15,7 +15,7 @@ import { ContractTier, AssetTier, SpotFulfillmentConfigStatus, - InitAmmConstituentMappingDatum, + AddAmmConstituentMappingDatum, } from './types'; import { DEFAULT_MARKET_NAME, encodeName } from './userName'; import { BN } from '@coral-xyz/anchor'; @@ -4339,7 +4339,7 @@ export class AdminClient extends DriftClient { public async addInitAmmConstituentMappingData( lpPoolName: number[], - marketIndexConstituentIndexPairs: InitAmmConstituentMappingDatum[] + marketIndexConstituentIndexPairs: AddAmmConstituentMappingDatum[] ): Promise { const ixs = await this.getAddInitAmmConstituentMappingDataIx( lpPoolName, @@ -4352,7 +4352,7 @@ export class AdminClient extends DriftClient { public async getAddInitAmmConstituentMappingDataIx( lpPoolName: number[], - marketIndexConstituentIndexPairs: InitAmmConstituentMappingDatum[] + addAmmConstituentMappingData: AddAmmConstituentMappingDatum[] ): Promise { const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); const ammConstituentMapping = getAmmConstituentMappingPublicKey( @@ -4366,7 +4366,7 @@ export class AdminClient extends DriftClient { return [ this.program.instruction.addAmmConstituentMappingData( lpPoolName, - marketIndexConstituentIndexPairs, + addAmmConstituentMappingData, { accounts: { admin: this.wallet.publicKey, diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index e537792d0..7f5112276 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7769,7 +7769,7 @@ "kind": "struct", "fields": [ { - "name": "data", + "name": "weights", "type": { "vec": { "defined": "AmmConstituentDatum" @@ -7785,7 +7785,7 @@ "kind": "struct", "fields": [ { - "name": "data", + "name": "weights", "type": { "vec": { "defined": "WeightDatum" @@ -9451,6 +9451,22 @@ ] } }, + { + "name": "AddAmmConstituentMappingDatum", + "type": { + "kind": "struct", + "fields": [ + { + "name": "constituentIndex", + "type": "u16" + }, + { + "name": "perpMarketIndex", + "type": "u16" + } + ] + } + }, { "name": "LiquidatePerpRecord", "type": { @@ -9747,7 +9763,7 @@ } }, { - "name": "data", + "name": "weight", "docs": [ "PERCENTAGE_PRECISION. The weight this constituent has on the perp market" ], @@ -9787,7 +9803,7 @@ "kind": "struct", "fields": [ { - "name": "data", + "name": "weight", "type": "i64" }, { diff --git a/sdk/src/types.ts b/sdk/src/types.ts index 2700087c9..e221c7f25 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1473,27 +1473,27 @@ export type SignedMsgUserOrdersAccount = { signedMsgOrderData: SignedMsgOrderId[]; }; -export type InitAmmConstituentMappingDatum = { +export type AddAmmConstituentMappingDatum = { constituentIndex: number; perpMarketIndex: number; }; -export type AmmConstituentDatum = InitAmmConstituentMappingDatum & { - data: BN; +export type AmmConstituentDatum = AddAmmConstituentMappingDatum & { + weight: BN; lastSlot: BN; }; export type AmmConstituentMapping = { - data: AmmConstituentDatum[]; + weights: AmmConstituentDatum[]; }; export type WeightDatum = { - data: BN; + weight: BN; lastSlot: BN; }; export type ConstituentTargetWeights = { - data: WeightDatum[]; + weights: WeightDatum[]; }; export type LPPool = { diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 8e4c7f356..2b56b28ed 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -23,6 +23,8 @@ import { PERCENTAGE_PRECISION, PRICE_PRECISION, PEG_PRECISION, + ConstituentTargetWeights, + AmmConstituentMapping, } from '../sdk/src'; import { @@ -160,22 +162,21 @@ describe('LP Pool', () => { lpPoolKey ); const ammConstituentMap = - await adminClient.program.account.ammConstituentMapping.fetch( + (await adminClient.program.account.ammConstituentMapping.fetch( ammConstituentMapPublicKey - ); + )) as AmmConstituentMapping; expect(ammConstituentMap).to.not.be.null; - // @ts-ignore - assert(ammConstituentMap.data.length == 0); + assert(ammConstituentMap.weights.length == 0); // check constituent target weights exists const constituentTargetWeightsPublicKey = getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); const constituentTargetWeights = - await adminClient.program.account.constituentTargetWeights.fetch( + (await adminClient.program.account.constituentTargetWeights.fetch( constituentTargetWeightsPublicKey - ); + )) as ConstituentTargetWeights; expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.data.length == 0); + assert(constituentTargetWeights.weights.length == 0); // check mint and metadata created correctly const mintAccountInfo = @@ -209,11 +210,11 @@ describe('LP Pool', () => { const constituentTargetWeightsPublicKey = getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); const constituentTargetWeights = - await adminClient.program.account.constituentTargetWeights.fetch( + (await adminClient.program.account.constituentTargetWeights.fetch( constituentTargetWeightsPublicKey - ); + )) as ConstituentTargetWeights; expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.data.length == 1); + assert(constituentTargetWeights.weights.length == 1); }); it('can add amm mapping datum', async () => { @@ -232,11 +233,11 @@ describe('LP Pool', () => { lpPoolKey ); const ammMapping = - await adminClient.program.account.ammConstituentMapping.fetch( + (await adminClient.program.account.ammConstituentMapping.fetch( ammConstituentMapping - ); + )) as AmmConstituentMapping; expect(ammMapping).to.not.be.null; - assert(ammMapping.data.length == 2); + assert(ammMapping.weights.length == 2); }); it('fails adding datum with bad params', async () => { From c803c166c2dc2868cebec1d95f485e6d185e525a Mon Sep 17 00:00:00 2001 From: wphan Date: Thu, 24 Apr 2025 14:16:17 -0700 Subject: [PATCH 21/50] dlp use spl token program (#1588) --- Cargo.lock | 1 - programs/drift/Cargo.toml | 1 - programs/drift/src/instructions/admin.rs | 140 ++--------------------- programs/drift/src/lib.rs | 14 +-- sdk/src/adminClient.ts | 59 +++------- sdk/src/idl/drift.json | 16 --- tests/lpPool.ts | 39 ++----- 7 files changed, 34 insertions(+), 236 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2051dcf9c..156ae6c31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -983,7 +983,6 @@ dependencies = [ "serum_dex", "solana-program", "solana-security-txt", - "spl-token-metadata-interface", "static_assertions", "switchboard", "switchboard-on-demand", diff --git a/programs/drift/Cargo.toml b/programs/drift/Cargo.toml index 1549d76ec..82f0f22c9 100644 --- a/programs/drift/Cargo.toml +++ b/programs/drift/Cargo.toml @@ -21,7 +21,6 @@ drift-rs=[] anchor-lang = "0.29.0" solana-program = "1.16" anchor-spl = { version = "0.29.0", features = [] } -spl-token-metadata-interface = "0.2.0" pyth-client = "0.2.2" pyth-lazer-solana-contract = { git = "https://github.com/drift-labs/pyth-crosschain", rev = "d790d1cb4da873a949cf33ff70349b7614b232eb", features = ["no-entrypoint"]} pythnet-sdk = { git = "https://github.com/drift-labs/pyth-crosschain", rev = "3e8a24ecd0bcf22b787313e2020f4186bb22c729"} diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 6d3c295de..eddd4266c 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -2,30 +2,18 @@ use std::convert::identity; use std::mem::size_of; use crate::msg; -use crate::signer::get_signer_seeds; use crate::state::lp_pool::{ AmmConstituentDatum, AmmConstituentMapping, Constituent, ConstituentTargetWeights, LPPool, WeightDatum, AMM_MAP_PDA_SEED, CONSITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, }; use anchor_lang::prelude::*; use anchor_spl::token::Token; -use anchor_spl::token_2022::spl_token_2022::{ - extension::{metadata_pointer::instruction as mp_ix, ExtensionType}, - instruction as token2022_ix, - state::Mint as Mint2022, - ID as TOKEN_2022_ID, -}; use anchor_spl::token_2022::Token2022; -use anchor_spl::token_interface::spl_token_2022::extension::{ - BaseStateWithExtensions, StateWithExtensions, -}; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use phoenix::quantities::WrapperU64; use pyth_solana_receiver_sdk::cpi::accounts::InitPriceUpdate; use pyth_solana_receiver_sdk::program::PythSolanaReceiver; use serum_dex::state::ToAlignedBytes; -use spl_token_metadata_interface::instruction::initialize as initialize_metadata_ix; -use spl_token_metadata_interface::state::TokenMetadata; use crate::controller::token::close_vault; use crate::error::ErrorCode; @@ -4378,18 +4366,10 @@ pub fn handle_initialize_high_leverage_mode_config( pub fn handle_initialize_lp_pool( ctx: Context, name: [u8; 32], - token_name: String, - token_symbol: String, - token_uri: String, - token_decimals: u8, max_aum: u64, ) -> Result<()> { let mut lp_pool = ctx.accounts.lp_pool.load_init()?; - let state = &mut ctx.accounts.state; let mint = ctx.accounts.mint.key(); - let mint_authority = ctx.accounts.lp_pool.key(); - let lp_pool_seeds = &[b"lp_pool" as &[u8], name.as_ref(), &[ctx.bumps.lp_pool]]; - let mint_authority_signer = &[&lp_pool_seeds[..]]; *lp_pool = LPPool { name, @@ -4406,113 +4386,6 @@ pub fn handle_initialize_lp_pool( _padding: [0; 6], }; - drop(lp_pool); - - // 1) allocate space for mint account - let space = - ExtensionType::try_calculate_account_len::(&[ExtensionType::MetadataPointer])?; - let lamports = Rent::get()?.minimum_balance(space); - - anchor_lang::solana_program::program::invoke( - &anchor_lang::solana_program::system_instruction::create_account( - &ctx.accounts.admin.key(), - &mint, - lamports, - space as u64, - &TOKEN_2022_ID, - ), - &[ - ctx.accounts.admin.to_account_info(), - ctx.accounts.mint.to_account_info(), - ctx.accounts.token_program.to_account_info(), - ctx.accounts.system_program.to_account_info(), - ], - )?; - - // 2) init metadata pointer extension - let ix = mp_ix::initialize( - &TOKEN_2022_ID, - &mint, - Some(ctx.accounts.admin.key()), - Some(mint), // self reference since metadata is on the mint - )?; - anchor_lang::solana_program::program::invoke( - &ix, - &[ - ctx.accounts.mint.to_account_info(), - ctx.accounts.admin.to_account_info(), - ], - // signers, - )?; - - // 3) init mint account - let ix = token2022_ix::initialize_mint2( - &TOKEN_2022_ID, - &mint, - &mint_authority, - None, // no freeze auth - token_decimals, - )?; - anchor_lang::solana_program::program::invoke_signed( - &ix, - &[ - ctx.accounts.mint.to_account_info(), - ctx.accounts.lp_pool.to_account_info(), - ctx.accounts.token_program.to_account_info(), - ], - mint_authority_signer, - )?; - - // 4) ensure mint account has enough rent for metadata extension - let metadata = TokenMetadata { - name: token_name, - symbol: token_symbol, - uri: token_uri, - ..Default::default() - }; - let mint_data = ctx.accounts.mint.try_borrow_data()?; - let mint_unpacked = StateWithExtensions::::unpack(&mint_data)?; - let new_account_len = mint_unpacked - .try_get_new_account_len::(&metadata)?; - let new_rent_exempt_minimum = Rent::get()?.minimum_balance(new_account_len); - let additional_rent = new_rent_exempt_minimum.saturating_sub(ctx.accounts.mint.lamports()); - drop(mint_data); - - anchor_lang::solana_program::program::invoke( - &anchor_lang::solana_program::system_instruction::transfer( - ctx.accounts.admin.key, - &mint, - additional_rent, - ), - &[ - ctx.accounts.admin.to_account_info(), - ctx.accounts.mint.to_account_info(), - ctx.accounts.system_program.to_account_info(), - ], - )?; - - // 5) write metadata info - let ix = initialize_metadata_ix( - &TOKEN_2022_ID, - &mint, - &ctx.accounts.admin.key(), - &mint, - &mint_authority, - metadata.name, - metadata.symbol, - metadata.uri, - ); - - anchor_lang::solana_program::program::invoke_signed( - &ix, - &[ - ctx.accounts.mint.to_account_info(), - ctx.accounts.admin.to_account_info(), - ctx.accounts.lp_pool.to_account_info(), - ], - mint_authority_signer, - )?; - let amm_constituent_mapping = &mut ctx.accounts.amm_constituent_mapping; amm_constituent_mapping .weights @@ -5385,7 +5258,6 @@ pub struct UpdateProtectedMakerModeConfig<'info> { #[derive(Accounts)] #[instruction( name: [u8; 32], - token_decimals: u8, )] pub struct InitializeLpPool<'info> { #[account(mut)] @@ -5399,9 +5271,13 @@ pub struct InitializeLpPool<'info> { )] pub lp_pool: AccountLoader<'info, LPPool>, - #[account(mut)] - /// CHECK: account created in ix - pub mint: Signer<'info>, + #[account( + init, + payer = admin, + mint::decimals = 6, + mint::authority = lp_pool.key(), + )] + pub mint: Account<'info, anchor_spl::token::Mint>, #[account( init, @@ -5426,7 +5302,7 @@ pub struct InitializeLpPool<'info> { )] pub state: Box>, - pub token_program: Program<'info, Token2022>, + pub token_program: Program<'info, Token>, pub rent: Sysvar<'info, Rent>, pub system_program: Program<'info, System>, diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index cbd2a4a52..ba244de30 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1666,21 +1666,9 @@ pub mod drift { pub fn initialize_lp_pool( ctx: Context, name: [u8; 32], - token_name: String, - token_symbol: String, - token_uri: String, - token_decimals: u8, max_aum: u64, ) -> Result<()> { - handle_initialize_lp_pool( - ctx, - name, - token_name, - token_symbol, - token_uri, - token_decimals, - max_aum, - ) + handle_initialize_lp_pool(ctx, name, max_aum) } pub fn update_high_leverage_mode_config( diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index db0d3916a..3cf4bd738 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -48,7 +48,6 @@ import { createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID, - TOKEN_2022_PROGRAM_ID, } from '@solana/spl-token'; import { DriftClient } from './driftClient'; import { @@ -4193,22 +4192,10 @@ export class AdminClient extends DriftClient { public async initializeLpPool( name: string, - tokenName: string, - tokenSymbol: string, - tokenUri: string, - tokenDecimals: number, maxAum: BN, mint: Keypair ): Promise { - const ixs = await this.getInitializeLpPoolIx( - name, - tokenName, - tokenSymbol, - tokenUri, - tokenDecimals, - maxAum, - mint - ); + const ixs = await this.getInitializeLpPoolIx(name, maxAum, mint); const tx = await this.buildTransaction(ixs); const { txSig } = await this.sendTransaction(tx, [mint]); return txSig; @@ -4216,10 +4203,6 @@ export class AdminClient extends DriftClient { public async getInitializeLpPoolIx( name: string, - tokenName: string, - tokenSymbol: string, - tokenUri: string, - tokenDecimals: number, maxAum: BN, mint: Keypair ): Promise { @@ -4236,41 +4219,33 @@ export class AdminClient extends DriftClient { mint.publicKey, lpPool, true, - TOKEN_2022_PROGRAM_ID + TOKEN_PROGRAM_ID ); const createAtaIx = createAssociatedTokenAccountInstruction( this.wallet.publicKey, lpPoolAta, lpPool, mint.publicKey, - TOKEN_2022_PROGRAM_ID + TOKEN_PROGRAM_ID ); const state = await this.getStatePublicKey(); return [ - this.program.instruction.initializeLpPool( - encodeName(name), - tokenName, - tokenSymbol, - tokenUri, - tokenDecimals, - maxAum, - { - accounts: { - admin: this.wallet.publicKey, - lpPool, - ammConstituentMapping, - constituentTargetWeights, - mint: mint.publicKey, - state, - tokenProgram: TOKEN_2022_PROGRAM_ID, - rent: SYSVAR_RENT_PUBKEY, - systemProgram: SystemProgram.programId, - }, - signers: [mint], - } - ), + this.program.instruction.initializeLpPool(encodeName(name), maxAum, { + accounts: { + admin: this.wallet.publicKey, + lpPool, + ammConstituentMapping, + constituentTargetWeights, + mint: mint.publicKey, + state, + tokenProgram: TOKEN_PROGRAM_ID, + rent: SYSVAR_RENT_PUBKEY, + systemProgram: SystemProgram.programId, + }, + signers: [mint], + }), createAtaIx, ]; } diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 7f5112276..a9d317bd9 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7020,22 +7020,6 @@ ] } }, - { - "name": "tokenName", - "type": "string" - }, - { - "name": "tokenSymbol", - "type": "string" - }, - { - "name": "tokenUri", - "type": "string" - }, - { - "name": "tokenDecimals", - "type": "u8" - }, { "name": "maxAum", "type": "u64" diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 2b56b28ed..338c9c55e 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -4,13 +4,7 @@ import { expect, assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { Keypair, PublicKey } from '@solana/web3.js'; -import { unpack } from '@solana/spl-token-metadata'; -import { - TOKEN_2022_PROGRAM_ID, - unpackMint, - ExtensionType, - getExtensionData, -} from '@solana/spl-token'; +import { TOKEN_PROGRAM_ID, getMint } from '@solana/spl-token'; import { BN, @@ -56,9 +50,6 @@ describe('LP Pool', () => { let solUsd: PublicKey; const lpPoolName = 'test pool 1'; - const tokenName = 'test pool token'; - const tokenSymbol = 'DLP-1'; - const tokenUri = 'https://token.token.token.gov'; const tokenDecimals = 6; const lpPoolKey = getLpPoolPublicKey( program.programId, @@ -139,10 +130,6 @@ describe('LP Pool', () => { await adminClient.initializeLpPool( lpPoolName, - tokenName, - tokenSymbol, - tokenUri, - tokenDecimals, new BN(100_000_000).mul(QUOTE_PRECISION), Keypair.generate() ); @@ -178,24 +165,14 @@ describe('LP Pool', () => { expect(constituentTargetWeights).to.not.be.null; assert(constituentTargetWeights.weights.length == 0); - // check mint and metadata created correctly - const mintAccountInfo = - await bankrunContextWrapper.connection.getAccountInfo( - lpPool.mint as PublicKey - ); - const mintData = unpackMint( - lpPool.mint, - mintAccountInfo, - TOKEN_2022_PROGRAM_ID - ); - const data = getExtensionData( - ExtensionType.TokenMetadata, - mintData.tlvData + // check mint created correctly + const mintInfo = await getMint( + bankrunContextWrapper.connection.toConnection(), + lpPool.mint as PublicKey ); - const tokenMetadata = unpack(data); - expect(tokenMetadata.name).to.equal(tokenName); - expect(tokenMetadata.symbol).to.equal(tokenSymbol); - expect(tokenMetadata.uri).to.equal(tokenUri); + expect(mintInfo.decimals).to.equal(tokenDecimals); + expect(Number(mintInfo.supply)).to.equal(0); + expect(mintInfo.mintAuthority!.toBase58()).to.equal(lpPoolKey.toBase58()); }); it('can add constituent to LP Pool', async () => { From f7fac7994a4abb910e16b7f8a2639d6ef2a31e63 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 24 Apr 2025 14:52:38 -0700 Subject: [PATCH 22/50] add crank ix --- programs/drift/src/error.rs | 2 + programs/drift/src/instructions/lp_pool.rs | 95 ++++++++++++++++------ programs/drift/src/lib.rs | 8 ++ programs/drift/src/math/oracle.rs | 4 + programs/drift/src/state/zero_copy.rs | 22 ++--- sdk/src/driftClient.ts | 72 ++++++++++++++++ sdk/src/idl/drift.json | 55 +++++++++++++ tests/lpPool.ts | 29 +++++++ 8 files changed, 248 insertions(+), 39 deletions(-) diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index 640ba7d29..b84fc2937 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -637,6 +637,8 @@ pub enum ErrorCode { InvalidConstituent, #[msg("Invalid Amm Constituent Mapping argument")] InvalidAmmConstituentMappingArgument, + #[msg("Invalid update constituent update target weights argument")] + InvalidUpdateConstituentTargetWeightsArgument, } #[macro_export] diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index f0837bcea..663586663 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -1,38 +1,50 @@ -use anchor_lang::{ - prelude::{Account, AccountInfo, AccountLoader, Context, Pubkey, Signer, SolanaSysvar}, - Accounts, Result, -}; +use anchor_lang::{prelude::*, Accounts, Key, Result, ToAccountInfo}; -use crate::state::{ - lp_pool::{ - AmmConstituentDatum, AmmConstituentMappingFixed, ConstituentTargetWeightsFixed, LPPool, - WeightDatum, WeightValidationFlags, +use crate::{ + error::ErrorCode, + math::oracle::{is_oracle_valid_for_action, DriftAction}, + msg, + state::{ + lp_pool::{AmmConstituentDatum, AmmConstituentMappingFixed, LPPool, WeightValidationFlags}, + perp_market_map::MarketSet, + state::State, + user::MarketType, + zero_copy::{AccountZeroCopy, ZeroCopyLoader}, }, - perp_market_map::MarketSet, - state::State, - zero_copy::{AccountZeroCopy, AccountZeroCopyMut, ZeroCopyLoader}, + validate, }; use solana_program::sysvar::clock::Clock; use super::optional_accounts::{load_maps, AccountMaps}; +use crate::state::lp_pool::{AMM_MAP_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED}; -pub fn handle_update_dlp_target_weights<'info, 'c: 'info>( - ctx: Context<'_, 'info, 'c, 'info, UpdateDlpTargetWeights<'info>>, +pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetWeights<'info>>, constituent_indexes: Vec, ) -> Result<()> { - let state = &ctx.accounts.state; let lp_pool = &ctx.accounts.lp_pool.load()?; + let state = &ctx.accounts.state; + let mut constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc_mut()?; + + let num_constituents = constituent_target_weights.len(); + let exists_invalid_constituent_index = constituent_indexes + .iter() + .any(|index| *index as u32 >= num_constituents); + + validate!( + !exists_invalid_constituent_index, + ErrorCode::InvalidUpdateConstituentTargetWeightsArgument, + "Constituent index larger than number of constituent target weights" + )?; + let slot = Clock::get()?.slot; let amm_constituent_mapping: AccountZeroCopy< - 'info, + '_, AmmConstituentDatum, AmmConstituentMappingFixed, > = ctx.accounts.amm_constituent_mapping.load_zc()?; - let mut target_weights: AccountZeroCopyMut<'info, WeightDatum, ConstituentTargetWeightsFixed> = - ctx.accounts.constituent_target_weights.load_zc_mut()?; - let AccountMaps { perp_market_map, spot_market_map, @@ -49,18 +61,33 @@ pub fn handle_update_dlp_target_weights<'info, 'c: 'info>( let mut oracle_prices: Vec = vec![]; for (_, datum) in amm_constituent_mapping.iter().enumerate() { let perp_market = perp_market_map.get_ref(&datum.perp_market_index)?; - let amm_inventory = perp_market.amm.get_protocol_owned_position()?; - amm_inventories.push((datum.perp_market_index, amm_inventory)); - let oracle_data = oracle_map.get_price_data_and_guard_rails(&( - perp_market.amm.oracle, - perp_market.amm.oracle_source, - ))?; + let oracle_data = oracle_map.get_price_data_and_validity( + MarketType::Perp, + datum.perp_market_index, + &perp_market.oracle_id(), + perp_market + .amm + .historical_oracle_data + .last_oracle_price_twap, + perp_market.get_max_confidence_interval_multiplier()?, + )?; + if !is_oracle_valid_for_action( + oracle_data.1, + Some(DriftAction::UpdateDlpConstituentTargetWeights), + )? { + msg!("Oracle data for perp market {} and constituent index {} is invalid. Skipping update", + datum.perp_market_index, datum.constituent_index); + continue; + } + + let amm_inventory = perp_market.amm.get_protocol_owned_position()?; + amm_inventories.push((datum.perp_market_index, amm_inventory)); oracle_prices.push(oracle_data.0.price); } - target_weights.update_target_weights( + constituent_target_weights.update_target_weights( &amm_constituent_mapping, amm_inventories.as_slice(), constituent_indexes.as_slice(), @@ -74,13 +101,29 @@ pub fn handle_update_dlp_target_weights<'info, 'c: 'info>( } #[derive(Accounts)] -pub struct UpdateDlpTargetWeights<'info> { +#[instruction( + lp_pool_name: [u8; 32], +)] +pub struct UpdateConstituentTargetWeights<'info> { pub state: Box>, #[account(mut)] pub keeper: Signer<'info>, + #[account( + seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] /// CHECK: checked in AmmConstituentMappingZeroCopy checks pub amm_constituent_mapping: AccountInfo<'info>, + #[account( + mut, + seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks pub constituent_target_weights: AccountInfo<'info>, + #[account( + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] pub lp_pool: AccountLoader<'info, LPPool>, } diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index cbd2a4a52..da8c7d06d 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1733,6 +1733,14 @@ pub mod drift { ) -> Result<()> { handle_add_amm_constituent_data(ctx, init_amm_constituent_mapping_data) } + + pub fn update_dlp_constituent_target_weights<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetWeights<'info>>, + lp_pool_name: [u8; 32], + constituent_indexes: Vec, + ) -> Result<()> { + handle_update_constituent_target_weights(ctx, constituent_indexes) + } } #[cfg(not(feature = "no-entrypoint"))] diff --git a/programs/drift/src/math/oracle.rs b/programs/drift/src/math/oracle.rs index 621bf9069..95ffa1565 100644 --- a/programs/drift/src/math/oracle.rs +++ b/programs/drift/src/math/oracle.rs @@ -69,6 +69,7 @@ pub enum DriftAction { UpdateTwap, UpdateAMMCurve, OracleOrderPrice, + UpdateDlpConstituentTargetWeights, } pub fn is_oracle_valid_for_action( @@ -128,6 +129,9 @@ pub fn is_oracle_valid_for_action( ), DriftAction::UpdateTwap => !matches!(oracle_validity, OracleValidity::NonPositive), DriftAction::UpdateAMMCurve => !matches!(oracle_validity, OracleValidity::NonPositive), + DriftAction::UpdateDlpConstituentTargetWeights => { + !matches!(oracle_validity, OracleValidity::NonPositive) + } }, None => { matches!(oracle_validity, OracleValidity::Valid) diff --git a/programs/drift/src/state/zero_copy.rs b/programs/drift/src/state/zero_copy.rs index 2bcc77dc7..623df7d97 100644 --- a/programs/drift/src/state/zero_copy.rs +++ b/programs/drift/src/state/zero_copy.rs @@ -77,8 +77,8 @@ pub trait ZeroCopyLoader<'a, T, F> { fn load_zc_mut(&'a self) -> DriftResult>; } -pub fn load_generic<'a, F, T>( - acct: &'a AccountInfo<'a>, +pub fn load_generic<'a, 'info, F, T>( + acct: &'a AccountInfo<'info>, expected_disc: [u8; 8], program_id: Pubkey, ) -> DriftResult> @@ -111,8 +111,8 @@ where }) } -pub fn load_generic_mut<'a, F, T>( - acct: &'a AccountInfo<'a>, +pub fn load_generic_mut<'a, 'info, F, T>( + acct: &'a AccountInfo<'info>, expected_disc: [u8; 8], program_id: Pubkey, ) -> DriftResult> @@ -145,17 +145,13 @@ where }) } -/// Anything that you can pull a zero‑copy view of `Elem`+`Fixed` out of. -pub trait ToZeroCopy<'info, Elem, Fixed> { - fn to_zc(&self) -> DriftResult>; - fn to_zc_mut(&self) -> DriftResult>; -} - #[macro_export] macro_rules! impl_zero_copy_loader { ($Acc:ty, $ID:path, $Fixed:ty, $Elem:ty) => { - impl<'a> crate::state::zero_copy::ZeroCopyLoader<'a, $Elem, $Fixed> for AccountInfo<'a> { - fn load_zc( + impl<'info> crate::state::zero_copy::ZeroCopyLoader<'_, $Elem, $Fixed> + for AccountInfo<'info> + { + fn load_zc<'a>( self: &'a Self, ) -> crate::error::DriftResult< crate::state::zero_copy::AccountZeroCopy<'a, $Elem, $Fixed>, @@ -167,7 +163,7 @@ macro_rules! impl_zero_copy_loader { ) } - fn load_zc_mut( + fn load_zc_mut<'a>( self: &'a Self, ) -> crate::error::DriftResult< crate::state::zero_copy::AccountZeroCopyMut<'a, $Elem, $Fixed>, diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index f699c9b91..d148f6414 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -58,6 +58,8 @@ import { UserStatsAccount, ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, + AmmConstituentMapping, + AmmConstituentDatum, } from './types'; import driftIDL from './idl/drift.json'; @@ -104,6 +106,9 @@ import { getUserAccountPublicKeySync, getUserStatsAccountPublicKey, getSignedMsgWsDelegatesAccountPublicKey, + getConstituentTargetWeightsPublicKey, + getAmmConstituentMappingPublicKey, + getLpPoolPublicKey, } from './addresses/pda'; import { DataAndSlot, @@ -9678,6 +9683,73 @@ export class DriftClient { return txSig; } + public async updateDlpConstituentTargetWeights( + lpPoolName: number[], + constituentIndexesToUpdate: number[], + ammConstituentMapping: AmmConstituentMapping, + txParams?: TxParams + ): Promise { + const { txSig } = await this.sendTransaction( + await this.buildTransaction( + await this.getUpdateDlpConstituentTargetWeightsIx( + lpPoolName, + constituentIndexesToUpdate, + ammConstituentMapping + ), + txParams + ), + [], + this.opts + ); + return txSig; + } + + public async getUpdateDlpConstituentTargetWeightsIx( + lpPoolName: number[], + constituentIndexesToUpdate: number[], + ammConstituentMapping: AmmConstituentMapping + ): Promise { + const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); + const ammConstituentMappingPublicKey = getAmmConstituentMappingPublicKey( + this.program.programId, + lpPool + ); + const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + this.program.programId, + lpPool + ); + + const perpMarketIndexes = ammConstituentMapping.weights + .filter((datum: AmmConstituentDatum) => { + return constituentIndexesToUpdate.includes(datum.constituentIndex); + }) + .map((datum: AmmConstituentDatum) => datum.perpMarketIndex); + + const remainingAccounts = this.getRemainingAccounts({ + readablePerpMarketIndex: perpMarketIndexes, + userAccounts: [], + }); + + return this.program.instruction.updateDlpConstituentTargetWeights( + lpPoolName, + constituentIndexesToUpdate, + { + accounts: { + keeper: this.wallet.publicKey, + lpPool, + ammConstituentMapping: ammConstituentMappingPublicKey, + constituentTargetWeights, + state: await this.getStatePublicKey(), + }, + remainingAccounts, + } + ); + } + + /** + * Below here are the transaction sending functions + */ + private handleSignedTransaction(signedTxs: SignedTxData[]) { if (this.enableMetricsEvents && this.metricsEventEmitter) { this.metricsEventEmitter.emit('txSigned', signedTxs); diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 7f5112276..8af16f219 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7263,6 +7263,53 @@ } } ] + }, + { + "name": "updateDlpConstituentTargetWeights", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "keeper", + "isMut": true, + "isSigner": true + }, + { + "name": "ammConstituentMapping", + "isMut": false, + "isSigner": false + }, + { + "name": "constituentTargetWeights", + "isMut": true, + "isSigner": false + }, + { + "name": "lpPool", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "constituentIndexes", + "type": { + "vec": "u16" + } + } + ] } ], "accounts": [ @@ -11907,6 +11954,9 @@ }, { "name": "OracleOrderPrice" + }, + { + "name": "UpdateDlpConstituentTargetWeights" } ] } @@ -15677,6 +15727,11 @@ "code": 6315, "name": "InvalidAmmConstituentMappingArgument", "msg": "Invalid Amm Constituent Mapping argument" + }, + { + "code": 6316, + "name": "InvalidUpdateConstituentTargetWeightsArgument", + "msg": "Invalid update constituent update target weights argument" } ], "metadata": { diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 2b56b28ed..2d3da2037 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -273,4 +273,33 @@ describe('LP Pool', () => { expect(e.message).to.contain('0x18ab'); } }); + + it('can update constituent target weights', async () => { + const ammConstituentMappingPublicKey = getAmmConstituentMappingPublicKey( + program.programId, + lpPoolKey + ); + + const ammMapping = + (await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMappingPublicKey + )) as AmmConstituentMapping; + + await adminClient.updateDlpConstituentTargetWeights( + encodeName(lpPoolName), + [0], + ammMapping + ); + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeights = + (await adminClient.program.account.constituentTargetWeights.fetch( + constituentTargetWeightsPublicKey + )) as ConstituentTargetWeights; + expect(constituentTargetWeights).to.not.be.null; + assert(constituentTargetWeights.weights.length == 1); + expect(constituentTargetWeights.weights[0].weight.toNumber()).to.not.equal( + 0 + ); + }); }); From 6bbe40dd915c4b433cc3d406536bbbcb0232e21e Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Thu, 24 Apr 2025 18:01:17 -0400 Subject: [PATCH 23/50] update total_weight for validation_flags check --- programs/drift/src/state/lp_pool.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 3d92d0f91..7e3803c9c 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,6 +1,6 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64}; +use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION, PRICE_PRECISION_I64}; use crate::math::safe_math::SafeMath; use anchor_lang::prelude::*; use anchor_spl::token::Mint; @@ -508,9 +508,11 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { } let price = prices[i] as i128; + + // assumes PRICE_PRECISION = PERCENTAGE_PRECISION let target_weight = if aum > 0 { target_amount - .saturating_mul(price) + .saturating_mul(price) .saturating_div(aum as i128) } else { 0 @@ -530,11 +532,13 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { let cell = self.get_mut(i as u32); cell.weight = target_weight as i64; cell.last_slot = slot; + + total_weight = total_weight.saturating_add(target_weight); } if (validation_flags as u8) & WeightValidationFlags::EnforceTotalWeight100 as u8 != 0 { let deviation = (total_weight - PERCENTAGE_PRECISION_I64 as i128).abs(); - let tolerance = 1; + let tolerance = 100; if deviation > tolerance { return Err(ErrorCode::DefaultError); } From 55014a04d276ac049e5fd844ebd1ef8e0941559a Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 24 Apr 2025 16:22:25 -0700 Subject: [PATCH 24/50] push test so far --- tests/lpPool.ts | 28 +++++++++++++++++++++++++--- tests/testHelpers.ts | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 2d3da2037..ec59f95fc 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -25,12 +25,16 @@ import { PEG_PRECISION, ConstituentTargetWeights, AmmConstituentMapping, + BASE_PRECISION, + ZERO, } from '../sdk/src'; import { + getPerpMarketDecoded, initializeQuoteSpotMarket, mockOracleNoProgram, mockUSDCMint, + overWritePerpMarket, } from './testHelpers'; import { startAnchor } from 'solana-bankrun'; import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; @@ -76,7 +80,7 @@ describe('LP Pool', () => { ), }, ], - [] + [], ); // @ts-ignore @@ -104,7 +108,7 @@ describe('LP Pool', () => { }, activeSubAccountId: 0, subAccountIds: [], - perpMarketIndexes: [], + perpMarketIndexes: [0, 1], spotMarketIndexes: [0], oracleInfos: [], accountSubscription: { @@ -275,6 +279,24 @@ describe('LP Pool', () => { }); it('can update constituent target weights', async () => { + + + const perpMarket = adminClient.getPerpMarketAccount(0); + const perpMarketAccountBefore = await getPerpMarketDecoded( + adminClient, + bankrunContextWrapper, + perpMarket.pubkey + ); + perpMarketAccountBefore.data.amm.baseAssetAmountLong = BASE_PRECISION; + await overWritePerpMarket( + adminClient, + bankrunContextWrapper, + perpMarketAccountBefore.data.pubkey, + perpMarketAccountBefore, + ); + + assert(!perpMarket.amm.baseAssetAmountLong.eq(ZERO)); + const ammConstituentMappingPublicKey = getAmmConstituentMappingPublicKey( program.programId, lpPoolKey @@ -302,4 +324,4 @@ describe('LP Pool', () => { 0 ); }); -}); +}); \ No newline at end of file diff --git a/tests/testHelpers.ts b/tests/testHelpers.ts index 7119a535d..1a0b653b2 100644 --- a/tests/testHelpers.ts +++ b/tests/testHelpers.ts @@ -29,7 +29,7 @@ import { } from '@solana/web3.js'; import { assert } from 'chai'; import buffer from 'buffer'; -import { BN, Wallet, OraclePriceData, OracleInfo } from '../sdk'; +import { BN, Wallet, OraclePriceData, OracleInfo, PerpMarketAccount } from '../sdk'; import { TestClient, SPOT_MARKET_RATE_PRECISION, @@ -1099,3 +1099,41 @@ export async function initializeSolSpotMarket( ); return txSig; } + +export async function overWritePerpMarket( + driftClient: TestClient, + bankrunContextWrapper: BankrunContextWrapper, + perpMarketKey: PublicKey, + perpMarket: AccountInfo +) { + bankrunContextWrapper.context.setAccount(perpMarketKey, { + executable: perpMarket.executable, + owner: perpMarket.owner, + lamports: perpMarket.lamports, + data: await driftClient.program.coder.accounts.encode( + 'PerpMarket', + perpMarket.data + ), + rentEpoch: perpMarket.rentEpoch, + }); +} + +export async function getPerpMarketDecoded( + driftClient: TestClient, + bankrunContextWrapper: BankrunContextWrapper, + perpMarketPublicKey: PublicKey +): Promise> { + const accountInfo = await bankrunContextWrapper.connection.getAccountInfo( + perpMarketPublicKey + ); + const perpMarketAccount: PerpMarketAccount = + driftClient.program.coder.accounts.decode( + 'PerpMarket', + accountInfo!.data + ); + + // @ts-ignore + accountInfo.data = perpMarketAccount; + // @ts-ignore + return accountInfo; +} From 4b13618d59d7043fa4eaba29c8781809a64f3626 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 24 Apr 2025 21:43:26 -0700 Subject: [PATCH 25/50] overriding perp position works --- programs/drift/src/state/lp_pool.rs | 5 ++ tests/lpPool.ts | 75 ++++++++++++++++++++++------- tests/testHelpers.ts | 35 +++++++------- 3 files changed, 79 insertions(+), 36 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 3d92d0f91..3caabe448 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -527,6 +527,11 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { return Err(ErrorCode::DefaultError); } + total_weight = total_weight + .saturating_add(target_weight) + .saturating_add(PERCENTAGE_PRECISION_I64 as i128); + + msg!("target_amount = {}", target_amount); let cell = self.get_mut(i as u32); cell.weight = target_weight as i64; cell.last_slot = slot; diff --git a/tests/lpPool.ts b/tests/lpPool.ts index ec59f95fc..22df50def 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -25,8 +25,7 @@ import { PEG_PRECISION, ConstituentTargetWeights, AmmConstituentMapping, - BASE_PRECISION, - ZERO, + User, } from '../sdk/src'; import { @@ -34,7 +33,7 @@ import { initializeQuoteSpotMarket, mockOracleNoProgram, mockUSDCMint, - overWritePerpMarket, + mockUserUSDCAccount, } from './testHelpers'; import { startAnchor } from 'solana-bankrun'; import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; @@ -49,6 +48,7 @@ describe('LP Pool', () => { let adminClient: TestClient; let usdcMint; + let adminUser: User; const mantissaSqrtScale = new BN(Math.sqrt(PRICE_PRECISION.toNumber())); const ammInitialQuoteAssetReserve = new anchor.BN(10 * 10 ** 13).mul( @@ -80,7 +80,7 @@ describe('LP Pool', () => { ), }, ], - [], + [] ); // @ts-ignore @@ -101,7 +101,7 @@ describe('LP Pool', () => { adminClient = new TestClient({ connection: bankrunContextWrapper.connection.toConnection(), - wallet: bankrunContextWrapper.provider.wallet, + wallet: new anchor.Wallet(keypair), programID: program.programId, opts: { commitment: 'confirmed', @@ -120,6 +120,26 @@ describe('LP Pool', () => { await adminClient.subscribe(); await initializeQuoteSpotMarket(adminClient, usdcMint.publicKey); + const userUSDCAccount = await mockUserUSDCAccount( + usdcMint, + new BN(10).mul(QUOTE_PRECISION), + bankrunContextWrapper, + keypair.publicKey + ); + + await adminClient.initializeUserAccountAndDepositCollateral( + new BN(10).mul(QUOTE_PRECISION), + userUSDCAccount.publicKey + ); + adminUser = new User({ + driftClient: adminClient, + userAccountPublicKey: await adminClient.getUserAccountPublicKey(), + accountSubscription: { + type: 'polling', + accountLoader: bulkAccountLoader, + }, + }); + solUsd = await mockOracleNoProgram(bankrunContextWrapper, 224.3); const periodicity = new BN(0); @@ -279,23 +299,45 @@ describe('LP Pool', () => { }); it('can update constituent target weights', async () => { + // Override AMM to have a balance + const perpMarket = adminClient.getPerpMarketAccount(0); + const raw = await bankrunContextWrapper.connection.getAccountInfo( + perpMarket.pubkey + ); + const buf = raw.data; + buf.writeBigInt64LE(BigInt(1000000000), 304); - const perpMarket = adminClient.getPerpMarketAccount(0); - const perpMarketAccountBefore = await getPerpMarketDecoded( + bankrunContextWrapper.context.setAccount(perpMarket.pubkey, { + executable: raw.executable, + owner: raw.owner, + lamports: raw.lamports, + rentEpoch: raw.rentEpoch, + data: buf, + }); + + const perpMarketAccountAfter = await getPerpMarketDecoded( adminClient, bankrunContextWrapper, perpMarket.pubkey ); - perpMarketAccountBefore.data.amm.baseAssetAmountLong = BASE_PRECISION; - await overWritePerpMarket( - adminClient, - bankrunContextWrapper, - perpMarketAccountBefore.data.pubkey, - perpMarketAccountBefore, + assert(!perpMarketAccountAfter.amm.baseAssetAmountLong.isZero()); + + // Override LP pool to have some aum + const lpraw = await bankrunContextWrapper.connection.getAccountInfo( + lpPoolKey ); + const lpbuf = lpraw.data; - assert(!perpMarket.amm.baseAssetAmountLong.eq(ZERO)); + buf.writeBigInt64LE(BigInt(1000000000), 152); + + bankrunContextWrapper.context.setAccount(lpPoolKey, { + executable: lpraw.executable, + owner: lpraw.owner, + lamports: lpraw.lamports, + rentEpoch: lpraw.rentEpoch, + data: lpbuf, + }); const ammConstituentMappingPublicKey = getAmmConstituentMappingPublicKey( program.programId, @@ -320,8 +362,5 @@ describe('LP Pool', () => { )) as ConstituentTargetWeights; expect(constituentTargetWeights).to.not.be.null; assert(constituentTargetWeights.weights.length == 1); - expect(constituentTargetWeights.weights[0].weight.toNumber()).to.not.equal( - 0 - ); }); -}); \ No newline at end of file +}); diff --git a/tests/testHelpers.ts b/tests/testHelpers.ts index 1a0b653b2..712fa6db2 100644 --- a/tests/testHelpers.ts +++ b/tests/testHelpers.ts @@ -29,7 +29,14 @@ import { } from '@solana/web3.js'; import { assert } from 'chai'; import buffer from 'buffer'; -import { BN, Wallet, OraclePriceData, OracleInfo, PerpMarketAccount } from '../sdk'; +import { + BN, + Wallet, + OraclePriceData, + OracleInfo, + PerpMarketAccount, + UserAccount, +} from '../sdk'; import { TestClient, SPOT_MARKET_RATE_PRECISION, @@ -1104,17 +1111,16 @@ export async function overWritePerpMarket( driftClient: TestClient, bankrunContextWrapper: BankrunContextWrapper, perpMarketKey: PublicKey, - perpMarket: AccountInfo + perpMarket: PerpMarketAccount ) { bankrunContextWrapper.context.setAccount(perpMarketKey, { - executable: perpMarket.executable, - owner: perpMarket.owner, - lamports: perpMarket.lamports, - data: await driftClient.program.coder.accounts.encode( + executable: false, + owner: driftClient.program.programId, + lamports: LAMPORTS_PER_SOL, + data: await driftClient.program.account.perpMarket.coder.accounts.encode( 'PerpMarket', - perpMarket.data + perpMarket ), - rentEpoch: perpMarket.rentEpoch, }); } @@ -1122,18 +1128,11 @@ export async function getPerpMarketDecoded( driftClient: TestClient, bankrunContextWrapper: BankrunContextWrapper, perpMarketPublicKey: PublicKey -): Promise> { +): Promise { const accountInfo = await bankrunContextWrapper.connection.getAccountInfo( perpMarketPublicKey ); const perpMarketAccount: PerpMarketAccount = - driftClient.program.coder.accounts.decode( - 'PerpMarket', - accountInfo!.data - ); - - // @ts-ignore - accountInfo.data = perpMarketAccount; - // @ts-ignore - return accountInfo; + driftClient.program.coder.accounts.decode('PerpMarket', accountInfo!.data); + return perpMarketAccount; } From 39726c57cd0ee0c82a511724ccecdd3d28e27eb2 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 24 Apr 2025 21:47:40 -0700 Subject: [PATCH 26/50] remove message --- programs/drift/src/state/lp_pool.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 3caabe448..bff188f54 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -531,7 +531,6 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { .saturating_add(target_weight) .saturating_add(PERCENTAGE_PRECISION_I64 as i128); - msg!("target_amount = {}", target_amount); let cell = self.get_mut(i as u32); cell.weight = target_weight as i64; cell.last_slot = slot; From bddb41fbff6ba274da57cdf72077681d4038b94d Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Fri, 25 Apr 2025 12:28:33 -0400 Subject: [PATCH 27/50] fix dup total_weight add --- programs/drift/src/state/lp_pool.rs | 8 ++------ programs/drift/src/state/lp_pool/tests.rs | 9 ++++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 97e30b109..152c70c46 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -490,7 +490,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { aum: u64, slot: u64, validation_flags: WeightValidationFlags, - ) -> DriftResult<()> { + ) -> DriftResult { let mut total_weight: i128 = 0; for (i, constituent_index) in constituents_indexes.iter().enumerate() { let mut target_amount = 0i128; @@ -529,10 +529,6 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { return Err(ErrorCode::DefaultError); } - total_weight = total_weight - .saturating_add(target_weight) - .saturating_add(PERCENTAGE_PRECISION_I64 as i128); - let cell = self.get_mut(i as u32); cell.weight = target_weight as i64; cell.last_slot = slot; @@ -548,7 +544,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { } } - Ok(()) + Ok(total_weight) } } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 99c351118..99233ecaf 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -65,7 +65,7 @@ mod tests { _marker: PhantomData::, }; - target_zc_mut + let totalw = target_zc_mut .update_target_weights( &mapping_zc, &amm_inventory, @@ -76,7 +76,8 @@ mod tests { WeightValidationFlags::NONE, ) .unwrap(); - + + assert_eq!(totalw, 0); assert_eq!(target_zc_mut.len(), 1); assert_eq!(target_zc_mut.get(0).weight, 0); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); @@ -128,7 +129,7 @@ mod tests { _marker: PhantomData::, }; - target_zc_mut + let totalw = target_zc_mut .update_target_weights( &mapping_zc, &amm_inventory, @@ -139,6 +140,8 @@ mod tests { WeightValidationFlags::NONE, ) .unwrap(); + + assert_eq!(totalw, 1000000); assert_eq!(target_zc_mut.len(), 1); assert_eq!(target_zc_mut.get(0).weight, PERCENTAGE_PRECISION_I64); From 495977fdd9327625338f9e97edee1524b98619ac Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Fri, 25 Apr 2025 11:29:24 -0700 Subject: [PATCH 28/50] constituent map remaining accounts --- programs/drift/src/error.rs | 10 + programs/drift/src/instructions/lp_pool.rs | 71 +++++++ .../src/instructions/optional_accounts.rs | 1 + programs/drift/src/state/constituent_map.rs | 185 ++++++++++++++++++ programs/drift/src/state/mod.rs | 1 + 5 files changed, 268 insertions(+) create mode 100644 programs/drift/src/state/constituent_map.rs diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index b84fc2937..716d5d4bd 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -1,5 +1,7 @@ use anchor_lang::prelude::*; +use crate::state::lp_pool::Constituent; + pub type DriftResult = std::result::Result; #[error_code] @@ -639,6 +641,14 @@ pub enum ErrorCode { InvalidAmmConstituentMappingArgument, #[msg("Invalid update constituent update target weights argument")] InvalidUpdateConstituentTargetWeightsArgument, + #[msg("Constituent not found")] + ConstituentNotFound, + #[msg("Constituent could not load")] + ConstituentCouldNotLoad, + #[msg("Constituent wrong mutability")] + ConstituentWrongMutability, + #[msg("Wrong number of constituents passed to instruction")] + WrongNumberOfConstituents, } #[macro_export] diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 663586663..ec17c885c 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -5,6 +5,7 @@ use crate::{ math::oracle::{is_oracle_valid_for_action, DriftAction}, msg, state::{ + constituent_map::{ConstituentMap, ConstituentSet}, lp_pool::{AmmConstituentDatum, AmmConstituentMappingFixed, LPPool, WeightValidationFlags}, perp_market_map::MarketSet, state::State, @@ -100,6 +101,76 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( Ok(()) } +pub fn handle_update_lp_pool_aum(ctx: Context) -> Result<()> { + let lp_pool = &ctx.accounts.lp_pool.load_mut()?; + let state = &ctx.accounts.state; + + let slot = Clock::get()?.slot; + + let AccountMaps { + perp_market_map, + spot_market_map, + oracle_map, + } = load_maps( + &mut ctx.remaining_accounts.iter().peekable(), + &MarketSet::new(), + &MarketSet::new(), + slot, + Some(state.oracle_guard_rails), + )?; + + let constituent_map = ConstituentMap::load( + &ConstituentSet::new(), + &mut ctx.remaining_accounts.iter().peekable(), + )?; + + validate!( + constituent_map.0.len() == lp_pool.constituents as usize, + ErrorCode::WrongNumberOfConstituents, + "Constituent map length does not match lp pool constituent count" + )?; + + for i in 0..lp_pool.constituents as usize { + let constituent = constituent_map; + + let oracle_data = oracle_map.get_price_data_and_validity( + MarketType::Perp, + constituent.perp_market_index, + &perp_market.oracle_id(), + perp_market + .amm + .historical_oracle_data + .last_oracle_price_twap, + perp_market.get_max_confidence_interval_multiplier()?, + )?; + + if !is_oracle_valid_for_action(oracle_data.1, Some(DriftAction::UpdateDlpLpPoolAum))? { + msg!( + "Oracle data for perp market {} is invalid. Skipping update", + constituent.perp_market_index + ); + continue; + } + } + + Ok(()) +} + +#[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], +)] +pub struct UpdateLPPoolAum<'info> { + pub state: Box>, + #[account(mut)] + pub keeper: Signer<'info>, + #[account( + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, +} + #[derive(Accounts)] #[instruction( lp_pool_name: [u8; 32], diff --git a/programs/drift/src/instructions/optional_accounts.rs b/programs/drift/src/instructions/optional_accounts.rs index b4bca139e..0a89c8932 100644 --- a/programs/drift/src/instructions/optional_accounts.rs +++ b/programs/drift/src/instructions/optional_accounts.rs @@ -1,4 +1,5 @@ use crate::error::{DriftResult, ErrorCode}; +use crate::state::constituent_map::ConstituentSet; use std::cell::RefMut; use std::convert::TryFrom; diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs new file mode 100644 index 000000000..8c0892bd0 --- /dev/null +++ b/programs/drift/src/state/constituent_map.rs @@ -0,0 +1,185 @@ +use anchor_lang::accounts::account_loader::AccountLoader; +use std::cell::{Ref, RefMut}; +use std::collections::{BTreeMap, BTreeSet}; +use std::iter::Peekable; +use std::slice::Iter; + +use anchor_lang::prelude::AccountInfo; + +use anchor_lang::Discriminator; +use arrayref::array_ref; + +use crate::error::{DriftResult, ErrorCode}; +use crate::state::user::PerpPositions; + +use crate::math::safe_unwrap::SafeUnwrap; +use crate::msg; +use crate::state::traits::Size; +use std::panic::Location; + +use super::lp_pool::Constituent; + +pub struct ConstituentMap<'a>(pub BTreeMap>); + +impl<'a> ConstituentMap<'a> { + #[track_caller] + #[inline(always)] + pub fn get_ref(&self, constituent_index: &u16) -> DriftResult> { + let loader = match self.0.get(constituent_index) { + Some(loader) => loader, + None => { + let caller = Location::caller(); + msg!( + "Could not find costituent {} at {}:{}", + constituent_index, + caller.file(), + caller.line() + ); + return Err(ErrorCode::ConstituentNotFound); + } + }; + + match loader.load() { + Ok(constituent) => Ok(constituent), + Err(e) => { + let caller = Location::caller(); + msg!("{:?}", e); + msg!( + "Could not load constituent {} at {}:{}", + constituent_index, + caller.file(), + caller.line() + ); + Err(ErrorCode::ConstituentCouldNotLoad) + } + } + } + + #[track_caller] + #[inline(always)] + pub fn get_ref_mut(&self, market_index: &u16) -> DriftResult> { + let loader = match self.0.get(market_index) { + Some(loader) => loader, + None => { + let caller = Location::caller(); + msg!( + "Could not find perp market {} at {}:{}", + market_index, + caller.file(), + caller.line() + ); + return Err(ErrorCode::ConstituentNotFound); + } + }; + + match loader.load_mut() { + Ok(perp_market) => Ok(perp_market), + Err(e) => { + let caller = Location::caller(); + msg!("{:?}", e); + msg!( + "Could not load perp market {} at {}:{}", + market_index, + caller.file(), + caller.line() + ); + Err(ErrorCode::ConstituentCouldNotLoad) + } + } + } + + pub fn load<'b, 'c>( + writable_markets: &'b ConstituentSet, + account_info_iter: &'c mut Peekable>>, + ) -> DriftResult> { + let mut constituent_map: ConstituentMap = ConstituentMap(BTreeMap::new()); + + let constituent_discriminator: [u8; 8] = Constituent::discriminator(); + while let Some(account_info) = account_info_iter.peek() { + let data = account_info + .try_borrow_data() + .or(Err(ErrorCode::ConstituentCouldNotLoad))?; + + let expected_data_len = Constituent::SIZE; + if data.len() < expected_data_len { + break; + } + + let account_discriminator = array_ref![data, 0, 8]; + if account_discriminator != &constituent_discriminator { + break; + } + + // constituent index 42 bytes from front of account + let constituent_index = u16::from_le_bytes(*array_ref![data, 42, 2]); + + if constituent_map.0.contains_key(&constituent_index) { + msg!( + "Can not include same constituent index twice {}", + constituent_index + ); + return Err(ErrorCode::InvalidConstituent); + } + + let account_info = account_info_iter.next().safe_unwrap()?; + + let is_writable = account_info.is_writable; + if writable_markets.contains(&constituent_index) && !is_writable { + return Err(ErrorCode::ConstituentWrongMutability); + } + + let account_loader: AccountLoader = AccountLoader::try_from(account_info) + .or(Err(ErrorCode::ConstituentCouldNotLoad))?; + + constituent_map.0.insert(constituent_index, account_loader); + } + + Ok(constituent_map) + } +} + +#[cfg(test)] +impl<'a> ConstituentMap<'a> { + pub fn load_one<'c: 'a>( + account_info: &'c AccountInfo<'a>, + must_be_writable: bool, + ) -> DriftResult> { + let mut constituent_map: ConstituentMap = ConstituentMap(BTreeMap::new()); + + let data = account_info + .try_borrow_data() + .or(Err(ErrorCode::ConstituentCouldNotLoad))?; + + let expected_data_len = Constituent::SIZE; + if data.len() < expected_data_len { + return Err(ErrorCode::ConstituentCouldNotLoad); + } + + let constituent_discriminator: [u8; 8] = Constituent::discriminator(); + let account_discriminator = array_ref![data, 0, 8]; + if account_discriminator != &constituent_discriminator { + return Err(ErrorCode::ConstituentCouldNotLoad); + } + + // market index 1160 bytes from front of account + let constituent_index = u16::from_le_bytes(*array_ref![data, 42, 2]); + + let is_writable = account_info.is_writable; + let account_loader: AccountLoader = + AccountLoader::try_from(account_info).or(Err(ErrorCode::InvalidMarketAccount))?; + + if must_be_writable && !is_writable { + return Err(ErrorCode::ConstituentWrongMutability); + } + + constituent_map.0.insert(constituent_index, account_loader); + + Ok(constituent_map) + } + + pub fn empty() -> Self { + ConstituentMap(BTreeMap::new()) + } +} + +pub(crate) type ConstituentSet = BTreeSet; diff --git a/programs/drift/src/state/mod.rs b/programs/drift/src/state/mod.rs index 07ef0306a..f8cb1274e 100644 --- a/programs/drift/src/state/mod.rs +++ b/programs/drift/src/state/mod.rs @@ -1,3 +1,4 @@ +pub mod constituent_map; pub mod events; pub mod fill_mode; pub mod fulfillment; From 014b4a3e10516d31f0be06e7a86d8fcc7a8917fc Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Fri, 25 Apr 2025 18:45:01 -0700 Subject: [PATCH 29/50] compiles --- programs/drift/src/error.rs | 2 + programs/drift/src/instructions/admin.rs | 2 +- programs/drift/src/instructions/lp_pool.rs | 66 +++++++++++++++------- programs/drift/src/lib.rs | 2 +- programs/drift/src/math/oracle.rs | 3 +- programs/drift/src/state/lp_pool.rs | 27 ++++++--- sdk/src/idl/drift.json | 49 ++++++++++++---- 7 files changed, 109 insertions(+), 42 deletions(-) diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index 716d5d4bd..e576077c8 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -649,6 +649,8 @@ pub enum ErrorCode { ConstituentWrongMutability, #[msg("Wrong number of constituents passed to instruction")] WrongNumberOfConstituents, + #[msg("Oracle too stale for LP AUM update")] + OracleTooStaleForLPAUMUpdate, } #[macro_export] diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index eddd4266c..da594c76d 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4366,7 +4366,7 @@ pub fn handle_initialize_high_leverage_mode_config( pub fn handle_initialize_lp_pool( ctx: Context, name: [u8; 32], - max_aum: u64, + max_aum: u128, ) -> Result<()> { let mut lp_pool = ctx.accounts.lp_pool.load_init()?; let mint = ctx.accounts.mint.key(); diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index ec17c885c..d7b5a7f9f 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -2,7 +2,11 @@ use anchor_lang::{prelude::*, Accounts, Key, Result, ToAccountInfo}; use crate::{ error::ErrorCode, - math::oracle::{is_oracle_valid_for_action, DriftAction}, + math::{ + casting::Cast, + oracle::{is_oracle_valid_for_action, DriftAction}, + safe_math::SafeMath, + }, msg, state::{ constituent_map::{ConstituentMap, ConstituentSet}, @@ -101,8 +105,10 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( Ok(()) } -pub fn handle_update_lp_pool_aum(ctx: Context) -> Result<()> { - let lp_pool = &ctx.accounts.lp_pool.load_mut()?; +pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateLPPoolAum<'info>>, +) -> Result<()> { + let mut lp_pool = ctx.accounts.lp_pool.load_mut()?; let state = &ctx.accounts.state; let slot = Clock::get()?.slot; @@ -110,7 +116,7 @@ pub fn handle_update_lp_pool_aum(ctx: Context) -> Result<()> { let AccountMaps { perp_market_map, spot_market_map, - oracle_map, + mut oracle_map, } = load_maps( &mut ctx.remaining_accounts.iter().peekable(), &MarketSet::new(), @@ -130,29 +136,51 @@ pub fn handle_update_lp_pool_aum(ctx: Context) -> Result<()> { "Constituent map length does not match lp pool constituent count" )?; + let mut aum: u128 = 0; for i in 0..lp_pool.constituents as usize { - let constituent = constituent_map; + let mut constituent = constituent_map.get_ref_mut(&(i as u16))?; + let spot_market = spot_market_map.get_ref(&constituent.spot_market_index)?; let oracle_data = oracle_map.get_price_data_and_validity( - MarketType::Perp, - constituent.perp_market_index, - &perp_market.oracle_id(), - perp_market - .amm - .historical_oracle_data - .last_oracle_price_twap, - perp_market.get_max_confidence_interval_multiplier()?, + MarketType::Spot, + constituent.spot_market_index, + &spot_market.oracle_id(), + spot_market.historical_oracle_data.last_oracle_price_twap, + spot_market.get_max_confidence_interval_multiplier()?, )?; - if !is_oracle_valid_for_action(oracle_data.1, Some(DriftAction::UpdateDlpLpPoolAum))? { - msg!( - "Oracle data for perp market {} is invalid. Skipping update", - constituent.perp_market_index - ); - continue; + let oracle_price = { + if !is_oracle_valid_for_action(oracle_data.1, Some(DriftAction::UpdateLpPoolAum))? { + msg!( + "Oracle data for spot market {} is invalid. Skipping update", + spot_market.market_index, + ); + if slot - constituent.last_oracle_slot > 400 { + i64::MAX + } else { + constituent.last_oracle_price + } + } else { + oracle_data.0.price + } + }; + + if oracle_price == i64::MAX { + return Err(ErrorCode::OracleTooStaleForLPAUMUpdate.into()); } + + constituent.last_oracle_price = oracle_price; + constituent.last_oracle_slot = slot; + + let token_amount = constituent.spot_balance.get_token_amount(&spot_market)?; + let constituent_aum = token_amount.safe_mul(oracle_price.cast()?)?; + aum = aum.safe_add(constituent_aum)?; } + lp_pool.last_aum = aum; + lp_pool.last_aum_slot = slot; + lp_pool.last_aum_ts = Clock::get()?.unix_timestamp; + Ok(()) } diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index f261d0093..500805ae5 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1666,7 +1666,7 @@ pub mod drift { pub fn initialize_lp_pool( ctx: Context, name: [u8; 32], - max_aum: u64, + max_aum: u128, ) -> Result<()> { handle_initialize_lp_pool(ctx, name, max_aum) } diff --git a/programs/drift/src/math/oracle.rs b/programs/drift/src/math/oracle.rs index 95ffa1565..3e4d67487 100644 --- a/programs/drift/src/math/oracle.rs +++ b/programs/drift/src/math/oracle.rs @@ -70,6 +70,7 @@ pub enum DriftAction { UpdateAMMCurve, OracleOrderPrice, UpdateDlpConstituentTargetWeights, + UpdateLpPoolAum, } pub fn is_oracle_valid_for_action( @@ -129,7 +130,7 @@ pub fn is_oracle_valid_for_action( ), DriftAction::UpdateTwap => !matches!(oracle_validity, OracleValidity::NonPositive), DriftAction::UpdateAMMCurve => !matches!(oracle_validity, OracleValidity::NonPositive), - DriftAction::UpdateDlpConstituentTargetWeights => { + DriftAction::UpdateDlpConstituentTargetWeights | DriftAction::UpdateLpPoolAum => { !matches!(oracle_validity, OracleValidity::NonPositive) } }, diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 97e30b109..20105f19d 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -2,6 +2,7 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION, PRICE_PRECISION_I64}; use crate::math::safe_math::SafeMath; +use crate::math::spot_balance::get_token_amount; use anchor_lang::prelude::*; use anchor_spl::token::Mint; use borsh::{BorshDeserialize, BorshSerialize}; @@ -41,15 +42,15 @@ pub struct LPPool { /// pub quote_constituent_index: u16, /// QUOTE_PRECISION: Max AUM, Prohibit minting new DLP beyond this - pub max_aum: u64, // 8, 136 + pub max_aum: u128, // 8, 136 /// QUOTE_PRECISION: AUM of the vault in USD, updated lazily - pub last_aum: u64, // 8, 144 + pub last_aum: u128, // 8, 144 /// timestamp of last AUM slot pub last_aum_slot: u64, // 8, 152 /// timestamp of last AUM update - pub last_aum_ts: u64, // 8, 160 + pub last_aum_ts: i64, // 8, 160 /// timestamp of last vAMM revenue rebalance pub last_revenue_rebalance_ts: u64, // 8, 168 @@ -68,13 +69,13 @@ impl Size for LPPool { } impl LPPool { - pub fn get_nav(&self, mint: &Mint) -> Result { + pub fn get_nav(&self, mint: &Mint) -> Result { match mint.supply { 0 => Ok(0), supply => { // TODO: assuming mint decimals = quote decimals = 6 self.last_aum - .checked_div(supply) + .checked_div(supply.into()) .ok_or(ErrorCode::MathError.into()) } } @@ -240,6 +241,12 @@ impl SpotBalance for BLPosition { } } +impl BLPosition { + pub fn get_token_amount(&self, spot_market: &SpotMarket) -> DriftResult { + get_token_amount(self.scaled_balance.cast()?, spot_market, &self.balance_type) + } +} + #[account(zero_copy(unsafe))] #[derive(Default, Debug, BorshDeserialize, BorshSerialize)] #[repr(C)] @@ -265,7 +272,9 @@ pub struct Constituent { /// spot borrow-lend balance for constituent pub spot_balance: BLPosition, // should be in constituent base asset - pub padding: [u8; 16], + + pub last_oracle_price: i64, + pub last_oracle_slot: u64, } impl Size for Constituent { @@ -293,7 +302,7 @@ impl Constituent { price: i64, token_balance: u64, token_amount_delta: i64, - lp_pool_aum: u64, + lp_pool_aum: u128, ) -> DriftResult { let balance = self.get_full_balance(token_balance)?.cast::()?; let token_precision = 10_i128.pow(self.decimals as u32); @@ -487,7 +496,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { amm_inventory: &[(u16, i64)], constituents_indexes: &[u16], prices: &[i64], - aum: u64, + aum: u128, slot: u64, validation_flags: WeightValidationFlags, ) -> DriftResult<()> { @@ -512,7 +521,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { // assumes PRICE_PRECISION = PERCENTAGE_PRECISION let target_weight = if aum > 0 { target_amount - .saturating_mul(price) + .saturating_mul(price) .saturating_div(aum as i128) } else { 0 diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 8ce17aa2e..6829a3b2a 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7022,7 +7022,7 @@ }, { "name": "maxAum", - "type": "u64" + "type": "u128" } ] }, @@ -7659,14 +7659,14 @@ "pub quote_constituent_index: u16,", "QUOTE_PRECISION: Max AUM, Prohibit minting new DLP beyond this" ], - "type": "u64" + "type": "u128" }, { "name": "lastAum", "docs": [ "QUOTE_PRECISION: AUM of the vault in USD, updated lazily" ], - "type": "u64" + "type": "u128" }, { "name": "lastAumSlot", @@ -7680,7 +7680,7 @@ "docs": [ "timestamp of last AUM update" ], - "type": "u64" + "type": "i64" }, { "name": "lastRevenueRebalanceTs", @@ -7783,13 +7783,12 @@ } }, { - "name": "padding", - "type": { - "array": [ - "u8", - 16 - ] - } + "name": "lastOraclePrice", + "type": "i64" + }, + { + "name": "lastOracleSlot", + "type": "u64" } ] } @@ -11941,6 +11940,9 @@ }, { "name": "UpdateDlpConstituentTargetWeights" + }, + { + "name": "UpdateLpPoolAum" } ] } @@ -15716,6 +15718,31 @@ "code": 6316, "name": "InvalidUpdateConstituentTargetWeightsArgument", "msg": "Invalid update constituent update target weights argument" + }, + { + "code": 6317, + "name": "ConstituentNotFound", + "msg": "Constituent not found" + }, + { + "code": 6318, + "name": "ConstituentCouldNotLoad", + "msg": "Constituent could not load" + }, + { + "code": 6319, + "name": "ConstituentWrongMutability", + "msg": "Constituent wrong mutability" + }, + { + "code": 6320, + "name": "WrongNumberOfConstituents", + "msg": "Wrong number of constituents passed to instruction" + }, + { + "code": 6321, + "name": "OracleTooStaleForLPAUMUpdate", + "msg": "Oracle too stale for LP AUM update" } ], "metadata": { From 228b94b61cb318389ad0cbfbd162ff7af6aa03f7 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Mon, 28 Apr 2025 10:47:20 -0700 Subject: [PATCH 30/50] bankrun tests pass --- programs/drift/src/instructions/admin.rs | 3 ++ programs/drift/src/instructions/lp_pool.rs | 15 +++--- programs/drift/src/lib.rs | 9 +++- programs/drift/src/state/constituent_map.rs | 11 +++++ programs/drift/src/state/lp_pool.rs | 1 + sdk/src/driftClient.ts | 53 +++++++++++++++++++++ sdk/src/idl/drift.json | 42 +++++++++++++++- tests/lpPool.ts | 34 +++++++++++++ 8 files changed, 160 insertions(+), 8 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index da594c76d..7fc9430ea 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4455,6 +4455,7 @@ pub fn handle_initialize_constituent<'info>( swap_fee_max: i64, ) -> Result<()> { let mut constituent = ctx.accounts.constituent.load_init()?; + let mut lp_pool = ctx.accounts.lp_pool.load_mut()?; let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; let current_len = constituent_target_weights.weights.len(); @@ -4469,6 +4470,7 @@ pub fn handle_initialize_constituent<'info>( constituent.max_weight_deviation = max_weight_deviation; constituent.swap_fee_min = swap_fee_min; constituent.swap_fee_max = swap_fee_max; + lp_pool.constituents += 1; Ok(()) } @@ -5318,6 +5320,7 @@ pub struct InitializeConstituent<'info> { pub admin: Signer<'info>, #[account( + mut, seeds = [b"lp_pool", lp_pool_name.as_ref()], bump, )] diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index d7b5a7f9f..4956de869 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -113,22 +113,24 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( let slot = Clock::get()?.slot; + let remaining_accounts = &mut ctx.remaining_accounts.iter().peekable(); + let AccountMaps { - perp_market_map, + perp_market_map: _, spot_market_map, mut oracle_map, } = load_maps( - &mut ctx.remaining_accounts.iter().peekable(), + remaining_accounts, &MarketSet::new(), &MarketSet::new(), slot, Some(state.oracle_guard_rails), )?; - let constituent_map = ConstituentMap::load( - &ConstituentSet::new(), - &mut ctx.remaining_accounts.iter().peekable(), - )?; + let constituent_map = ConstituentMap::load(&ConstituentSet::new(), remaining_accounts)?; + + msg!("{}", constituent_map.0.len()); + msg!("{}", lp_pool.constituents); validate!( constituent_map.0.len() == lp_pool.constituents as usize, @@ -193,6 +195,7 @@ pub struct UpdateLPPoolAum<'info> { #[account(mut)] pub keeper: Signer<'info>, #[account( + mut, seeds = [b"lp_pool", lp_pool_name.as_ref()], bump, )] diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 500805ae5..200a0801c 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -41,7 +41,7 @@ declare_id!("dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH"); #[program] pub mod drift { use super::*; - use crate::state::spot_market::SpotFulfillmentConfigStatus; + use crate::{instruction::UpdateLpPoolAum, state::spot_market::SpotFulfillmentConfigStatus}; // User Instructions @@ -1729,6 +1729,13 @@ pub mod drift { ) -> Result<()> { handle_update_constituent_target_weights(ctx, constituent_indexes) } + + pub fn update_lp_pool_aum<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateLPPoolAum<'info>>, + lp_pool_name: [u8; 32], + ) -> Result<()> { + handle_update_lp_pool_aum(ctx) + } } #[cfg(not(feature = "no-entrypoint"))] diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index 8c0892bd0..ffb4343fa 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -102,11 +102,22 @@ impl<'a> ConstituentMap<'a> { let expected_data_len = Constituent::SIZE; if data.len() < expected_data_len { + msg!( + "didnt match constituent size, {}, {}", + data.len(), + expected_data_len + ); break; } let account_discriminator = array_ref![data, 0, 8]; + msg!("pubkey: {}", account_info.key); if account_discriminator != &constituent_discriminator { + msg!( + "didnt match account discriminator {:?}, {:?}", + account_discriminator, + constituent_discriminator + ); break; } diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 20105f19d..a6b99394d 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -259,6 +259,7 @@ pub struct Constituent { pub constituent_index: u16, pub decimals: u8, + _padding1: [u8; 3], /// max deviation from target_weight allowed for the constituent /// precision: PERCENTAGE_PRECISION diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index d148f6414..9ae0f71b9 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -60,6 +60,7 @@ import { SignedMsgOrderParamsDelegateMessage, AmmConstituentMapping, AmmConstituentDatum, + LPPool, } from './types'; import driftIDL from './idl/drift.json'; @@ -109,6 +110,7 @@ import { getConstituentTargetWeightsPublicKey, getAmmConstituentMappingPublicKey, getLpPoolPublicKey, + getConstituentPublicKey, } from './addresses/pda'; import { DataAndSlot, @@ -9746,6 +9748,57 @@ export class DriftClient { ); } + public async updateDlpPoolAum( + lpPool: LPPool, + spotMarketIndexOfConstituents: number[], + txParams?: TxParams + ): Promise { + const { txSig } = await this.sendTransaction( + await this.buildTransaction( + await this.getUpdateDlpPoolAumIxs( + lpPool, + spotMarketIndexOfConstituents + ), + txParams + ), + [], + this.opts + ); + return txSig; + } + + public async getUpdateDlpPoolAumIxs( + lpPool: LPPool, + spotMarketIndexOfConstituents: number[] + ): Promise { + const remainingAccounts = this.getRemainingAccounts({ + userAccounts: [], + readableSpotMarketIndexes: spotMarketIndexOfConstituents, + }); + remainingAccounts.push( + ...spotMarketIndexOfConstituents.map((index) => { + return { + pubkey: getConstituentPublicKey( + this.program.programId, + lpPool.pubkey, + index + ), + isSigner: false, + isWritable: true, + }; + }) + ); + + return this.program.instruction.updateLpPoolAum(lpPool.name, { + accounts: { + keeper: this.wallet.publicKey, + lpPool: lpPool.pubkey, + state: await this.getStatePublicKey(), + }, + remainingAccounts, + }); + } + /** * Below here are the transaction sending functions */ diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 6829a3b2a..8f5a43ca6 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7138,7 +7138,7 @@ }, { "name": "lpPool", - "isMut": false, + "isMut": true, "isSigner": false }, { @@ -7294,6 +7294,37 @@ } } ] + }, + { + "name": "updateLpPoolAum", + "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "keeper", + "isMut": true, + "isSigner": true + }, + { + "name": "lpPool", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] } ], "accounts": [ @@ -7749,6 +7780,15 @@ "name": "decimals", "type": "u8" }, + { + "name": "padding1", + "type": { + "array": [ + "u8", + 3 + ] + } + }, { "name": "maxWeightDeviation", "docs": [ diff --git a/tests/lpPool.ts b/tests/lpPool.ts index f16225916..56631faba 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -20,6 +20,7 @@ import { ConstituentTargetWeights, AmmConstituentMapping, User, + LPPool, } from '../sdk/src'; import { @@ -214,6 +215,13 @@ describe('LP Pool', () => { (await adminClient.program.account.constituentTargetWeights.fetch( constituentTargetWeightsPublicKey )) as ConstituentTargetWeights; + + const lpPool = (await adminClient.program.account.lpPool.fetch( + lpPoolKey + )) as LPPool; + + assert(lpPool.constituents == 1); + expect(constituentTargetWeights).to.not.be.null; assert(constituentTargetWeights.weights.length == 1); }); @@ -340,4 +348,30 @@ describe('LP Pool', () => { expect(constituentTargetWeights).to.not.be.null; assert(constituentTargetWeights.weights.length == 1); }); + + it('can update pool aum', async () => { + const lpPool = (await adminClient.program.account.lpPool.fetch( + lpPoolKey + )) as LPPool; + assert(lpPool.constituents == 1); + + await adminClient.updateDlpPoolAum(lpPool, [0]); + + // Should fail if we initialize a second constituent and dont pass it in + await adminClient.initializeConstituent( + encodeName(lpPoolName), + 1, + 6, + new BN(10).mul(PERCENTAGE_PRECISION), + new BN(1).mul(PERCENTAGE_PRECISION), + new BN(2).mul(PERCENTAGE_PRECISION) + ); + + try { + await adminClient.updateDlpPoolAum(lpPool, [0]); + expect.fail('should have failed'); + } catch (e) { + assert(e.message.includes('0x18b0')); + } + }); }); From 0b7049ce6db2af4744c9c7dfe606de3d37439f11 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Mon, 28 Apr 2025 13:51:45 -0700 Subject: [PATCH 31/50] compiles but casting failure in overflow protection test --- programs/drift/src/instructions/admin.rs | 74 ++++++++++++++++++++-- programs/drift/src/instructions/lp_pool.rs | 24 +++++-- programs/drift/src/math/constants.rs | 2 + programs/drift/src/state/lp_pool.rs | 30 +++++---- programs/drift/src/state/lp_pool/tests.rs | 31 +++++---- sdk/src/types.ts | 5 +- 6 files changed, 128 insertions(+), 38 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 7fc9430ea..5466f3724 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4,7 +4,7 @@ use std::mem::size_of; use crate::msg; use crate::state::lp_pool::{ AmmConstituentDatum, AmmConstituentMapping, Constituent, ConstituentTargetWeights, LPPool, - WeightDatum, AMM_MAP_PDA_SEED, CONSITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, + WeightDatum, AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, }; use anchor_lang::prelude::*; use anchor_spl::token::Token; @@ -4475,6 +4475,46 @@ pub fn handle_initialize_constituent<'info>( Ok(()) } +pub fn handle_update_amm_constituent_mapping_data<'info>( + ctx: Context, + amm_constituent_mapping_data: Vec, +) -> Result<()> { + let amm_mapping = &mut ctx.accounts.amm_constituent_mapping; + + for datum in amm_constituent_mapping_data { + let existing_datum = amm_mapping.weights.iter().position(|existing_datum| { + existing_datum.perp_market_index == datum.perp_market_index + && existing_datum.constituent_index == datum.constituent_index + }); + + if existing_datum.is_none() { + msg!( + "AmmConstituentDatum not found for perp_market_index {} and constituent_index {}", + datum.perp_market_index, + datum.constituent_index + ); + return Err(ErrorCode::InvalidAmmConstituentMappingArgument.into()); + } + + amm_mapping.weights[existing_datum.unwrap()] = AmmConstituentDatum { + perp_market_index: datum.perp_market_index, + constituent_index: datum.constituent_index, + weight: datum.weight, + last_slot: Clock::get()?.slot, + ..AmmConstituentDatum::default() + }; + + msg!( + "Updated AmmConstituentDatum for perp_market_index {} and constituent_index {} to {}", + datum.perp_market_index, + datum.constituent_index, + datum.weight + ); + } + + Ok(()) +} + #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeAmmConstituentMappingDatum { pub constituent_index: u16, @@ -5338,7 +5378,7 @@ pub struct InitializeConstituent<'info> { #[account( init, - seeds = [CONSITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), spot_market_index.to_le_bytes().as_ref()], + seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), spot_market_index.to_le_bytes().as_ref()], bump, space = Constituent::SIZE, payer = admin, @@ -5352,12 +5392,13 @@ pub struct InitializeConstituent<'info> { pub struct AddAmmConstituentMappingDatum { pub constituent_index: u16, pub perp_market_index: u16, + pub weight: i32, } #[derive(Accounts)] #[instruction( lp_pool_name: [u8; 32], - add_amm_constituent_mapping_data: Vec, + amm_constituent_mapping_data: Vec, )] pub struct AddAmmConstituentMappingData<'info> { #[account(mut)] @@ -5373,7 +5414,7 @@ pub struct AddAmmConstituentMappingData<'info> { mut, seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, - realloc = AmmConstituentMapping::space(amm_constituent_mapping.weights.len() + add_amm_constituent_mapping_data.len()), + realloc = AmmConstituentMapping::space(amm_constituent_mapping.weights.len() + amm_constituent_mapping_data.len()), realloc::payer = admin, realloc::zero = false, )] @@ -5390,3 +5431,28 @@ pub struct AddAmmConstituentMappingData<'info> { pub state: Box>, pub system_program: Program<'info, System>, } + +#[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], + amm_constituent_mapping_data: Vec, +)] +pub struct UpdateAmmConstituentMappingData<'info> { + #[account(mut)] + pub admin: Signer<'info>, + + #[account( + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, + + #[account( + mut, + seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] + pub amm_constituent_mapping: Box>, + pub state: Box>, + pub system_program: Program<'info, System>, +} diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 4956de869..ed5d37cfa 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -10,7 +10,10 @@ use crate::{ msg, state::{ constituent_map::{ConstituentMap, ConstituentSet}, - lp_pool::{AmmConstituentDatum, AmmConstituentMappingFixed, LPPool, WeightValidationFlags}, + lp_pool::{ + AmmConstituentDatum, AmmConstituentMappingFixed, LPPool, WeightValidationFlags, + CONSTITUENT_PDA_SEED, + }, perp_market_map::MarketSet, state::State, user::MarketType, @@ -129,9 +132,6 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( let constituent_map = ConstituentMap::load(&ConstituentSet::new(), remaining_accounts)?; - msg!("{}", constituent_map.0.len()); - msg!("{}", lp_pool.constituents); - validate!( constituent_map.0.len() == lp_pool.constituents as usize, ErrorCode::WrongNumberOfConstituents, @@ -141,6 +141,22 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( let mut aum: u128 = 0; for i in 0..lp_pool.constituents as usize { let mut constituent = constituent_map.get_ref_mut(&(i as u16))?; + + // Validate PDA + let expected_pda = Pubkey::find_program_address( + &[ + CONSTITUENT_PDA_SEED.as_ref(), + lp_pool.pubkey.as_ref(), + i.to_le_bytes().as_ref(), + ], + &crate::ID, + ); + validate!( + expected_pda.0 == constituent.pubkey, + ErrorCode::InvalidConstituent, + "Constituent PDA does not match expected PDA" + )?; + let spot_market = spot_market_map.get_ref(&constituent.spot_market_index)?; let oracle_data = oracle_map.get_price_data_and_validity( diff --git a/programs/drift/src/math/constants.rs b/programs/drift/src/math/constants.rs index ce8c49dc9..db183c814 100644 --- a/programs/drift/src/math/constants.rs +++ b/programs/drift/src/math/constants.rs @@ -53,6 +53,8 @@ pub const PERCENTAGE_PRECISION: u128 = 1_000_000; // expo -6 (represents 100%) pub const PERCENTAGE_PRECISION_I128: i128 = PERCENTAGE_PRECISION as i128; pub const PERCENTAGE_PRECISION_U64: u64 = PERCENTAGE_PRECISION as u64; pub const PERCENTAGE_PRECISION_I64: i64 = PERCENTAGE_PRECISION as i64; +pub const PERCENTAGE_PRECISION_I32: i32 = PERCENTAGE_PRECISION as i32; + pub const TEN_BPS: i128 = PERCENTAGE_PRECISION_I128 / 1000; pub const TEN_BPS_I64: i64 = TEN_BPS as i64; pub const TWO_PT_TWO_PCT: i128 = 22_000; diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index a6b99394d..6cc9d8733 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,6 +1,8 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION, PRICE_PRECISION_I64}; +use crate::math::constants::{ + PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64, PRICE_PRECISION, PRICE_PRECISION_I64, +}; use crate::math::safe_math::SafeMath; use crate::math::spot_balance::get_token_amount; use anchor_lang::prelude::*; @@ -15,7 +17,7 @@ use crate::state::traits::Size; use crate::{impl_zero_copy_loader, validate}; pub const AMM_MAP_PDA_SEED: &str = "AMM_MAP"; -pub const CONSITUENT_PDA_SEED: &str = "CONSTITUENT"; +pub const CONSTITUENT_PDA_SEED: &str = "CONSTITUENT"; pub const CONSTITUENT_TARGET_WEIGHT_PDA_SEED: &str = "CONSTITUENT_TARGET_WEIGHTS"; #[cfg(test)] @@ -354,9 +356,8 @@ impl Constituent { pub struct AmmConstituentDatum { pub perp_market_index: u16, pub constituent_index: u16, - pub padding: [u8; 4], /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market - pub weight: i64, + pub weight: i32, pub last_slot: u64, } @@ -409,8 +410,9 @@ impl_zero_copy_loader!( #[derive(Debug, Default, BorshDeserialize, BorshSerialize)] #[repr(C)] pub struct WeightDatum { - pub weight: i64, pub last_slot: u64, + pub weight: i32, + pub weight_padding: [u8; 4], } #[zero_copy] @@ -475,7 +477,7 @@ pub enum WeightValidationFlags { } impl<'a> AccountZeroCopy<'a, WeightDatum, ConstituentTargetWeightsFixed> { - pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { + pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { validate!( constituent_index < self.len() as u16, ErrorCode::InvalidConstituent, @@ -502,6 +504,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { validation_flags: WeightValidationFlags, ) -> DriftResult<()> { let mut total_weight: i128 = 0; + let aum_i128 = aum.cast::()?; for (i, constituent_index) in constituents_indexes.iter().enumerate() { let mut target_amount = 0i128; @@ -520,10 +523,8 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { let price = prices[i] as i128; // assumes PRICE_PRECISION = PERCENTAGE_PRECISION - let target_weight = if aum > 0 { - target_amount - .saturating_mul(price) - .saturating_div(aum as i128) + let target_weight: i128 = if aum > 0 { + target_amount.saturating_mul(price).saturating_div(aum_i128) } else { 0 }; @@ -544,14 +545,19 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { .saturating_add(PERCENTAGE_PRECISION_I64 as i128); let cell = self.get_mut(i as u32); - cell.weight = target_weight as i64; + msg!( + "updating constituent index {} target weight to {}", + constituent_index, + target_weight + ); + cell.weight = target_weight.cast::()?; cell.last_slot = slot; total_weight = total_weight.saturating_add(target_weight); } if (validation_flags as u8) & WeightValidationFlags::EnforceTotalWeight100 as u8 != 0 { - let deviation = (total_weight - PERCENTAGE_PRECISION_I64 as i128).abs(); + let deviation = (total_weight - PERCENTAGE_PRECISION_I128).abs(); let tolerance = 100; if deviation > tolerance { return Err(ErrorCode::DefaultError); diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 99c351118..5906781f1 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -1,19 +1,18 @@ #[cfg(test)] mod tests { - use crate::math::constants::PERCENTAGE_PRECISION_I64; + use crate::math::constants::PERCENTAGE_PRECISION_I32; use crate::state::lp_pool::*; use std::{cell::RefCell, marker::PhantomData, vec}; fn amm_const_datum( perp_market_index: u16, constituent_index: u16, - weight: i64, + weight: i32, last_slot: u64, ) -> AmmConstituentDatum { AmmConstituentDatum { perp_market_index, constituent_index, - padding: [0; 4], weight, last_slot, } @@ -26,7 +25,7 @@ mod tests { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 24]); + let mapping_data = RefCell::new([0u8; 16]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -84,12 +83,12 @@ mod tests { #[test] fn test_single_full_weight() { - let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0); + let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I32, 0); let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 24]); + let mapping_data = RefCell::new([0u8; 16]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -141,15 +140,15 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).weight, PERCENTAGE_PRECISION_I64); + assert_eq!(target_zc_mut.get(0).weight, PERCENTAGE_PRECISION_I32); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } #[test] fn test_multiple_constituents_partial_weights() { let amm_mapping_data = vec![ - amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64 / 2, 111), - amm_const_datum(0, 2, PERCENTAGE_PRECISION_I64 / 2, 111), + amm_const_datum(0, 1, PERCENTAGE_PRECISION_I32 / 2, 111), + amm_const_datum(0, 2, PERCENTAGE_PRECISION_I32 / 2, 111), ]; let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { @@ -158,7 +157,7 @@ mod tests { }); // 48 = size_of::() * amm_mapping_data.len() - let mapping_data = RefCell::new([0u8; 48]); + let mapping_data = RefCell::new([0u8; 32]); { let mut mapping_zc_mut = @@ -217,19 +216,19 @@ mod tests { assert_eq!(target_zc_mut.len(), 2); for i in 0..target_zc_mut.len() { - assert_eq!(target_zc_mut.get(i).weight, PERCENTAGE_PRECISION_I64 / 2); + assert_eq!(target_zc_mut.get(i).weight, PERCENTAGE_PRECISION_I32 / 2); assert_eq!(target_zc_mut.get(i).last_slot, now_ts); } } #[test] fn test_zero_aum_safe() { - let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0); + let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I32, 0); let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 24]); + let mapping_data = RefCell::new([0u8; 16]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -287,12 +286,12 @@ mod tests { #[test] fn test_overflow_protection() { - let amm_datum = amm_const_datum(0, 1, i64::MAX, 0); + let amm_datum = amm_const_datum(0, 1, i32::MAX, 0); let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 24]); + let mapping_data = RefCell::new([0u8; 16]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -344,7 +343,7 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert!(target_zc_mut.get(0).weight <= PERCENTAGE_PRECISION_I64); + assert!(target_zc_mut.get(0).weight <= PERCENTAGE_PRECISION_I32); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } diff --git a/sdk/src/types.ts b/sdk/src/types.ts index e221c7f25..478a3267b 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1476,10 +1476,11 @@ export type SignedMsgUserOrdersAccount = { export type AddAmmConstituentMappingDatum = { constituentIndex: number; perpMarketIndex: number; + weight: number; }; export type AmmConstituentDatum = AddAmmConstituentMappingDatum & { - weight: BN; + weight: number; lastSlot: BN; }; @@ -1488,7 +1489,7 @@ export type AmmConstituentMapping = { }; export type WeightDatum = { - weight: BN; + weight: number; lastSlot: BN; }; From 9372702ca5520090308677a25ec69fcb1e666ae5 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Mon, 28 Apr 2025 14:35:10 -0700 Subject: [PATCH 32/50] address comment and change token arguments from u64 to u128 --- programs/drift/src/instructions/lp_pool.rs | 22 ++++++++++++---------- programs/drift/src/state/lp_pool.rs | 12 ++++++------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 4956de869..2ab6df2a7 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -1,4 +1,4 @@ -use anchor_lang::{prelude::*, Accounts, Key, Result, ToAccountInfo}; +use anchor_lang::{prelude::*, Accounts, Key, Result}; use crate::{ error::ErrorCode, @@ -52,7 +52,7 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( let AccountMaps { perp_market_map, - spot_market_map, + spot_market_map: _, mut oracle_map, } = load_maps( &mut ctx.remaining_accounts.iter().peekable(), @@ -151,32 +151,34 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( spot_market.get_max_confidence_interval_multiplier()?, )?; - let oracle_price = { + let oracle_price: Option = { if !is_oracle_valid_for_action(oracle_data.1, Some(DriftAction::UpdateLpPoolAum))? { msg!( "Oracle data for spot market {} is invalid. Skipping update", spot_market.market_index, ); if slot - constituent.last_oracle_slot > 400 { - i64::MAX + None } else { - constituent.last_oracle_price + Some(constituent.last_oracle_price) } } else { - oracle_data.0.price + Some(oracle_data.0.price) } }; - if oracle_price == i64::MAX { + if oracle_price.is_none() { return Err(ErrorCode::OracleTooStaleForLPAUMUpdate.into()); } - constituent.last_oracle_price = oracle_price; + constituent.last_oracle_price = oracle_price.unwrap(); constituent.last_oracle_slot = slot; let token_amount = constituent.spot_balance.get_token_amount(&spot_market)?; - let constituent_aum = token_amount.safe_mul(oracle_price.cast()?)?; - aum = aum.safe_add(constituent_aum)?; + let constituent_aum = constituent + .get_full_balance(token_amount)? + .safe_mul(oracle_price.unwrap() as i128)?; + aum = aum.safe_add(constituent_aum as u128)?; } lp_pool.last_aum = aum; diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index a6b99394d..cbcf7838d 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,6 +1,6 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; -use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION, PRICE_PRECISION_I64}; +use crate::math::constants::{PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64}; use crate::math::safe_math::SafeMath; use crate::math::spot_balance::get_token_amount; use anchor_lang::prelude::*; @@ -134,8 +134,8 @@ impl LPPool { out_constituent: &Constituent, in_spot_market: &SpotMarket, out_spot_market: &SpotMarket, - in_token_balance: u64, - out_token_balance: u64, + in_token_balance: u128, + out_token_balance: u128, in_target_weight: i64, out_target_weight: i64, in_amount: u64, @@ -178,7 +178,7 @@ impl LPPool { oracle_map: &mut OracleMap, // might not need oracle_map depending on how accounts are passed in constituent: &Constituent, spot_market: &SpotMarket, - token_balance: u64, + token_balance: u128, amount: u64, target_weight: i64, ) -> DriftResult { @@ -285,7 +285,7 @@ impl Size for Constituent { impl Constituent { /// Returns the full balance of the Constituent, the total of the amount in Constituent's token /// account and in Drift Borrow-Lend. - pub fn get_full_balance(&self, token_balance: u64) -> DriftResult { + pub fn get_full_balance(&self, token_balance: u128) -> DriftResult { match self.spot_balance.balance_type() { SpotBalanceType::Deposit => token_balance .cast::()? @@ -301,7 +301,7 @@ impl Constituent { pub fn get_weight( &self, price: i64, - token_balance: u64, + token_balance: u128, token_amount_delta: i64, lp_pool_aum: u128, ) -> DriftResult { From 9addd8cef9fef518f9de6eea939536be4cb88d20 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 29 Apr 2025 09:44:24 -0700 Subject: [PATCH 33/50] bankrun tests pass --- programs/drift/src/instructions/admin.rs | 4 ++- programs/drift/src/instructions/lp_pool.rs | 2 +- programs/drift/src/state/constituent_map.rs | 1 - programs/drift/src/state/lp_pool.rs | 13 +++++---- programs/drift/src/state/lp_pool/tests.rs | 31 +++++++++++---------- sdk/src/driftClient.ts | 1 - sdk/src/idl/drift.json | 24 ++++++++++------ sdk/src/types.ts | 5 ++-- tests/lpPool.ts | 18 ++++-------- 9 files changed, 51 insertions(+), 48 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 5466f3724..84ad3f03a 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4470,6 +4470,7 @@ pub fn handle_initialize_constituent<'info>( constituent.max_weight_deviation = max_weight_deviation; constituent.swap_fee_min = swap_fee_min; constituent.swap_fee_max = swap_fee_max; + constituent.pubkey = ctx.accounts.constituent.key(); lp_pool.constituents += 1; Ok(()) @@ -4519,6 +4520,7 @@ pub fn handle_update_amm_constituent_mapping_data<'info>( pub struct InitializeAmmConstituentMappingDatum { pub constituent_index: u16, pub perp_market_index: u16, + pub weight: i64, } pub fn handle_add_amm_constituent_data<'info>( @@ -5392,7 +5394,7 @@ pub struct InitializeConstituent<'info> { pub struct AddAmmConstituentMappingDatum { pub constituent_index: u16, pub perp_market_index: u16, - pub weight: i32, + pub weight: i64, } #[derive(Accounts)] diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index ed5d37cfa..99d4c2bae 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -147,7 +147,7 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( &[ CONSTITUENT_PDA_SEED.as_ref(), lp_pool.pubkey.as_ref(), - i.to_le_bytes().as_ref(), + constituent.spot_market_index.to_le_bytes().as_ref(), ], &crate::ID, ); diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index ffb4343fa..c229c64a1 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -111,7 +111,6 @@ impl<'a> ConstituentMap<'a> { } let account_discriminator = array_ref![data, 0, 8]; - msg!("pubkey: {}", account_info.key); if account_discriminator != &constituent_discriminator { msg!( "didnt match account discriminator {:?}, {:?}", diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 6cc9d8733..c8e578e0d 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -356,9 +356,10 @@ impl Constituent { pub struct AmmConstituentDatum { pub perp_market_index: u16, pub constituent_index: u16, - /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market - pub weight: i32, + pub _padding: [u8; 4], pub last_slot: u64, + /// PERCENTAGE_PRECISION. The weight this constituent has on the perp market + pub weight: i64, } #[zero_copy] @@ -411,8 +412,7 @@ impl_zero_copy_loader!( #[repr(C)] pub struct WeightDatum { pub last_slot: u64, - pub weight: i32, - pub weight_padding: [u8; 4], + pub weight: i64, } #[zero_copy] @@ -477,7 +477,7 @@ pub enum WeightValidationFlags { } impl<'a> AccountZeroCopy<'a, WeightDatum, ConstituentTargetWeightsFixed> { - pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { + pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { validate!( constituent_index < self.len() as u16, ErrorCode::InvalidConstituent, @@ -550,7 +550,8 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { constituent_index, target_weight ); - cell.weight = target_weight.cast::()?; + cell.weight = + target_weight.clamp(-PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I128) as i64; cell.last_slot = slot; total_weight = total_weight.saturating_add(target_weight); diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 5906781f1..619220594 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -1,13 +1,13 @@ #[cfg(test)] mod tests { - use crate::math::constants::PERCENTAGE_PRECISION_I32; + use crate::math::constants::PERCENTAGE_PRECISION_I64; use crate::state::lp_pool::*; use std::{cell::RefCell, marker::PhantomData, vec}; fn amm_const_datum( perp_market_index: u16, constituent_index: u16, - weight: i32, + weight: i64, last_slot: u64, ) -> AmmConstituentDatum { AmmConstituentDatum { @@ -15,6 +15,7 @@ mod tests { constituent_index, weight, last_slot, + ..AmmConstituentDatum::default() } } @@ -25,7 +26,7 @@ mod tests { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 16]); + let mapping_data = RefCell::new([0u8; 24]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -83,12 +84,12 @@ mod tests { #[test] fn test_single_full_weight() { - let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I32, 0); + let amm_datum = amm_const_datum(0, 1, 64, 0); let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 16]); + let mapping_data = RefCell::new([0u8; 24]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -140,15 +141,15 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).weight, PERCENTAGE_PRECISION_I32); + assert_eq!(target_zc_mut.get(0).weight, PERCENTAGE_PRECISION_I64); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } #[test] fn test_multiple_constituents_partial_weights() { let amm_mapping_data = vec![ - amm_const_datum(0, 1, PERCENTAGE_PRECISION_I32 / 2, 111), - amm_const_datum(0, 2, PERCENTAGE_PRECISION_I32 / 2, 111), + amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64 / 2, 111), + amm_const_datum(0, 2, PERCENTAGE_PRECISION_I64 / 2, 111), ]; let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { @@ -157,7 +158,7 @@ mod tests { }); // 48 = size_of::() * amm_mapping_data.len() - let mapping_data = RefCell::new([0u8; 32]); + let mapping_data = RefCell::new([0u8; 48]); { let mut mapping_zc_mut = @@ -216,19 +217,19 @@ mod tests { assert_eq!(target_zc_mut.len(), 2); for i in 0..target_zc_mut.len() { - assert_eq!(target_zc_mut.get(i).weight, PERCENTAGE_PRECISION_I32 / 2); + assert_eq!(target_zc_mut.get(i).weight, PERCENTAGE_PRECISION_I64 / 2); assert_eq!(target_zc_mut.get(i).last_slot, now_ts); } } #[test] fn test_zero_aum_safe() { - let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I32, 0); + let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0); let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 16]); + let mapping_data = RefCell::new([0u8; 24]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -286,12 +287,12 @@ mod tests { #[test] fn test_overflow_protection() { - let amm_datum = amm_const_datum(0, 1, i32::MAX, 0); + let amm_datum = amm_const_datum(0, 1, i64::MAX, 0); let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { len: 1, ..AmmConstituentMappingFixed::default() }); - let mapping_data = RefCell::new([0u8; 16]); + let mapping_data = RefCell::new([0u8; 24]); { let mut mapping_zc_mut = AccountZeroCopyMut::<'_, AmmConstituentDatum, AmmConstituentMappingFixed> { @@ -343,7 +344,7 @@ mod tests { .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert!(target_zc_mut.get(0).weight <= PERCENTAGE_PRECISION_I32); + assert!(target_zc_mut.get(0).weight <= PERCENTAGE_PRECISION_I64); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index 9ae0f71b9..3fb0a8972 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -9788,7 +9788,6 @@ export class DriftClient { }; }) ); - return this.program.instruction.updateLpPoolAum(lpPool.name, { accounts: { keeper: this.wallet.publicKey, diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 8f5a43ca6..11dce4725 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -9517,6 +9517,10 @@ { "name": "perpMarketIndex", "type": "u16" + }, + { + "name": "weight", + "type": "i64" } ] } @@ -9533,6 +9537,10 @@ { "name": "perpMarketIndex", "type": "u16" + }, + { + "name": "weight", + "type": "i64" } ] } @@ -9832,16 +9840,16 @@ ] } }, + { + "name": "lastSlot", + "type": "u64" + }, { "name": "weight", "docs": [ "PERCENTAGE_PRECISION. The weight this constituent has on the perp market" ], "type": "i64" - }, - { - "name": "lastSlot", - "type": "u64" } ] } @@ -9872,13 +9880,13 @@ "type": { "kind": "struct", "fields": [ - { - "name": "weight", - "type": "i64" - }, { "name": "lastSlot", "type": "u64" + }, + { + "name": "weight", + "type": "i64" } ] } diff --git a/sdk/src/types.ts b/sdk/src/types.ts index 478a3267b..c1c79937c 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1476,11 +1476,10 @@ export type SignedMsgUserOrdersAccount = { export type AddAmmConstituentMappingDatum = { constituentIndex: number; perpMarketIndex: number; - weight: number; + weight: BN; }; export type AmmConstituentDatum = AddAmmConstituentMappingDatum & { - weight: number; lastSlot: BN; }; @@ -1489,7 +1488,7 @@ export type AmmConstituentMapping = { }; export type WeightDatum = { - weight: number; + weight: BN; lastSlot: BN; }; diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 56631faba..9dfe06c29 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -4,7 +4,7 @@ import { expect, assert } from 'chai'; import { Program } from '@coral-xyz/anchor'; import { Keypair, PublicKey } from '@solana/web3.js'; -import { TOKEN_PROGRAM_ID, getMint } from '@solana/spl-token'; +import { getMint } from '@solana/spl-token'; import { BN, @@ -19,7 +19,6 @@ import { PEG_PRECISION, ConstituentTargetWeights, AmmConstituentMapping, - User, LPPool, } from '../sdk/src'; @@ -43,7 +42,6 @@ describe('LP Pool', () => { let adminClient: TestClient; let usdcMint; - let adminUser: User; const mantissaSqrtScale = new BN(Math.sqrt(PRICE_PRECISION.toNumber())); const ammInitialQuoteAssetReserve = new anchor.BN(10 * 10 ** 13).mul( @@ -123,14 +121,6 @@ describe('LP Pool', () => { new BN(10).mul(QUOTE_PRECISION), userUSDCAccount.publicKey ); - adminUser = new User({ - driftClient: adminClient, - userAccountPublicKey: await adminClient.getUserAccountPublicKey(), - accountSubscription: { - type: 'polling', - accountLoader: bulkAccountLoader, - }, - }); solUsd = await mockOracleNoProgram(bankrunContextWrapper, 224.3); const periodicity = new BN(0); @@ -231,10 +221,12 @@ describe('LP Pool', () => { { perpMarketIndex: 0, constituentIndex: 0, + weight: PERCENTAGE_PRECISION, }, { perpMarketIndex: 1, constituentIndex: 0, + weight: PERCENTAGE_PRECISION, }, ]); const ammConstituentMapping = getAmmConstituentMappingPublicKey( @@ -258,6 +250,7 @@ describe('LP Pool', () => { { perpMarketIndex: 2, constituentIndex: 0, + weight: PERCENTAGE_PRECISION, }, ] ); @@ -274,6 +267,7 @@ describe('LP Pool', () => { { perpMarketIndex: 0, constituentIndex: 1, + weight: PERCENTAGE_PRECISION, }, ] ); @@ -359,7 +353,7 @@ describe('LP Pool', () => { // Should fail if we initialize a second constituent and dont pass it in await adminClient.initializeConstituent( - encodeName(lpPoolName), + lpPool.name, 1, 6, new BN(10).mul(PERCENTAGE_PRECISION), From e950e5d245960f352c76b56a0a04b335a2d5ca1f Mon Sep 17 00:00:00 2001 From: wphan Date: Tue, 29 Apr 2025 10:21:56 -0700 Subject: [PATCH 34/50] init constituent token account (#1596) --- programs/drift/src/instructions/admin.rs | 28 +- programs/drift/src/state/lp_pool.rs | 5 +- programs/drift/src/state/lp_pool/tests.rs | 4 +- sdk/src/addresses/pda.ts | 15 + sdk/src/adminClient.ts | 12 + sdk/src/idl/drift.json | 25 ++ tests/lpPool.ts | 13 +- tests/lpPoolSwap.ts | 344 ++++++++++++++++++++++ 8 files changed, 438 insertions(+), 8 deletions(-) create mode 100644 tests/lpPoolSwap.ts diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index eddd4266c..146007b93 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4,7 +4,8 @@ use std::mem::size_of; use crate::msg; use crate::state::lp_pool::{ AmmConstituentDatum, AmmConstituentMapping, Constituent, ConstituentTargetWeights, LPPool, - WeightDatum, AMM_MAP_PDA_SEED, CONSITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, + WeightDatum, AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, + CONSTITUENT_VAULT_PDA_SEED, }; use anchor_lang::prelude::*; use anchor_spl::token::Token; @@ -5314,7 +5315,12 @@ pub struct InitializeLpPool<'info> { spot_market_index: u16, )] pub struct InitializeConstituent<'info> { - #[account(mut)] + #[account()] + pub state: Box>, + #[account( + mut, + constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin + )] pub admin: Signer<'info>, #[account( @@ -5335,14 +5341,30 @@ pub struct InitializeConstituent<'info> { #[account( init, - seeds = [CONSITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), spot_market_index.to_le_bytes().as_ref()], + seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), spot_market_index.to_le_bytes().as_ref()], bump, space = Constituent::SIZE, payer = admin, )] pub constituent: AccountLoader<'info, Constituent>, + pub spot_market_mint: Box>, + #[account( + init, + seeds = [CONSTITUENT_VAULT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), spot_market_index.to_le_bytes().as_ref()], + bump, + payer = admin, + token::mint = spot_market_mint, + token::authority = drift_signer + )] + pub constituent_vault: Box>, + #[account( + constraint = state.signer.eq(&drift_signer.key()) + )] + /// CHECK: program signer + pub drift_signer: AccountInfo<'info>, pub rent: Sysvar<'info, Rent>, pub system_program: Program<'info, System>, + pub token_program: Interface<'info, TokenInterface>, } #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 152c70c46..615b9657d 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -14,8 +14,9 @@ use crate::state::traits::Size; use crate::{impl_zero_copy_loader, validate}; pub const AMM_MAP_PDA_SEED: &str = "AMM_MAP"; -pub const CONSITUENT_PDA_SEED: &str = "CONSTITUENT"; +pub const CONSTITUENT_PDA_SEED: &str = "CONSTITUENT"; pub const CONSTITUENT_TARGET_WEIGHT_PDA_SEED: &str = "CONSTITUENT_TARGET_WEIGHTS"; +pub const CONSTITUENT_VAULT_PDA_SEED: &str = "CONSTITUENT_VAULT"; #[cfg(test)] mod tests; @@ -512,7 +513,7 @@ impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { // assumes PRICE_PRECISION = PERCENTAGE_PRECISION let target_weight = if aum > 0 { target_amount - .saturating_mul(price) + .saturating_mul(price) .saturating_div(aum as i128) } else { 0 diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 99233ecaf..4299a7b6c 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -76,7 +76,7 @@ mod tests { WeightValidationFlags::NONE, ) .unwrap(); - + assert_eq!(totalw, 0); assert_eq!(target_zc_mut.len(), 1); assert_eq!(target_zc_mut.get(0).weight, 0); @@ -140,7 +140,7 @@ mod tests { WeightValidationFlags::NONE, ) .unwrap(); - + assert_eq!(totalw, 1000000); assert_eq!(target_zc_mut.len(), 1); diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index b8cab80f5..8c9f30742 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -433,3 +433,18 @@ export function getConstituentPublicKey( programId )[0]; } + +export function getConstituentVaultPublicKey( + programId: PublicKey, + lpPoolPublicKey: PublicKey, + spotMarketIndex: number +): PublicKey { + return PublicKey.findProgramAddressSync( + [ + Buffer.from(anchor.utils.bytes.utf8.encode('CONSTITUENT_VAULT')), + lpPoolPublicKey.toBuffer(), + new anchor.BN(spotMarketIndex).toArrayLike(Buffer, 'le', 2), + ], + programId + )[0]; +} diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 3cf4bd738..922f16b92 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -42,6 +42,7 @@ import { getAmmConstituentMappingPublicKey, getConstituentTargetWeightsPublicKey, getConstituentPublicKey, + getConstituentVaultPublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; import { @@ -4289,6 +4290,8 @@ export class AdminClient extends DriftClient { lpPool, spotMarketIndex ); + const spotMarketAccount = this.getSpotMarketAccount(spotMarketIndex); + return [ this.program.instruction.initializeConstituent( lpPoolName, @@ -4305,6 +4308,15 @@ export class AdminClient extends DriftClient { constituent, rent: SYSVAR_RENT_PUBKEY, systemProgram: SystemProgram.programId, + state: await this.getStatePublicKey(), + spotMarketMint: spotMarketAccount.mint, + constituentVault: getConstituentVaultPublicKey( + this.program.programId, + lpPool, + spotMarketIndex + ), + driftSigner: this.getSignerPublicKey(), + tokenProgram: TOKEN_PROGRAM_ID, }, signers: [], } diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 8ce17aa2e..417b5770c 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7131,6 +7131,11 @@ { "name": "initializeConstituent", "accounts": [ + { + "name": "state", + "isMut": false, + "isSigner": false + }, { "name": "admin", "isMut": true, @@ -7151,6 +7156,21 @@ "isMut": true, "isSigner": false }, + { + "name": "spotMarketMint", + "isMut": false, + "isSigner": false + }, + { + "name": "constituentVault", + "isMut": true, + "isSigner": false + }, + { + "name": "driftSigner", + "isMut": false, + "isSigner": false + }, { "name": "rent", "isMut": false, @@ -7160,6 +7180,11 @@ "name": "systemProgram", "isMut": false, "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false } ], "args": [ diff --git a/tests/lpPool.ts b/tests/lpPool.ts index f16225916..b9fb26240 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -20,6 +20,7 @@ import { ConstituentTargetWeights, AmmConstituentMapping, User, + getConstituentVaultPublicKey, } from '../sdk/src'; import { @@ -216,8 +217,18 @@ describe('LP Pool', () => { )) as ConstituentTargetWeights; expect(constituentTargetWeights).to.not.be.null; assert(constituentTargetWeights.weights.length == 1); - }); + const constituentVaultPublicKey = getConstituentVaultPublicKey( + program.programId, + lpPoolKey, + 0 + ); + const constituentTokenVault = + await bankrunContextWrapper.connection.getAccountInfo( + constituentVaultPublicKey + ); + expect(constituentTokenVault).to.not.be.null; + }); it('can add amm mapping datum', async () => { await adminClient.addInitAmmConstituentMappingData(encodeName(lpPoolName), [ { diff --git a/tests/lpPoolSwap.ts b/tests/lpPoolSwap.ts new file mode 100644 index 000000000..7c29569ad --- /dev/null +++ b/tests/lpPoolSwap.ts @@ -0,0 +1,344 @@ +import * as anchor from '@coral-xyz/anchor'; +import { expect, assert } from 'chai'; + +import { Program } from '@coral-xyz/anchor'; + +import { Keypair, PublicKey } from '@solana/web3.js'; +import { TOKEN_PROGRAM_ID, getMint } from '@solana/spl-token'; + +import { + BN, + TestClient, + QUOTE_PRECISION, + getLpPoolPublicKey, + getAmmConstituentMappingPublicKey, + encodeName, + getConstituentTargetWeightsPublicKey, + PERCENTAGE_PRECISION, + PRICE_PRECISION, + PEG_PRECISION, + ConstituentTargetWeights, + AmmConstituentMapping, + User, +} from '../sdk/src'; + +import { + getPerpMarketDecoded, + initializeQuoteSpotMarket, + mockOracleNoProgram, + mockUSDCMint, + mockUserUSDCAccount, +} from './testHelpers'; +import { startAnchor } from 'solana-bankrun'; +import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; +import { BankrunContextWrapper } from '../sdk/src/bankrun/bankrunConnection'; +import dotenv from 'dotenv'; +dotenv.config(); + +describe('LP Pool', () => { + const program = anchor.workspace.Drift as Program; + let bankrunContextWrapper: BankrunContextWrapper; + let bulkAccountLoader: TestBulkAccountLoader; + + let adminClient: TestClient; + let usdcMint; + let adminUser: User; + + const mantissaSqrtScale = new BN(Math.sqrt(PRICE_PRECISION.toNumber())); + const ammInitialQuoteAssetReserve = new anchor.BN(10 * 10 ** 13).mul( + mantissaSqrtScale + ); + const ammInitialBaseAssetReserve = new anchor.BN(10 * 10 ** 13).mul( + mantissaSqrtScale + ); + let solUsd: PublicKey; + + const lpPoolName = 'test pool 1'; + const tokenDecimals = 6; + const lpPoolKey = getLpPoolPublicKey( + program.programId, + encodeName(lpPoolName) + ); + + before(async () => { + const context = await startAnchor( + '', + [ + { + name: 'token_2022', + programId: new PublicKey( + 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' + ), + }, + ], + [] + ); + + // @ts-ignore + bankrunContextWrapper = new BankrunContextWrapper(context); + + bulkAccountLoader = new TestBulkAccountLoader( + bankrunContextWrapper.connection, + 'processed', + 1 + ); + + usdcMint = await mockUSDCMint(bankrunContextWrapper); + + const keypair = new Keypair(); + await bankrunContextWrapper.fundKeypair(keypair, 10 ** 9); + + usdcMint = await mockUSDCMint(bankrunContextWrapper); + + adminClient = new TestClient({ + connection: bankrunContextWrapper.connection.toConnection(), + wallet: new anchor.Wallet(keypair), + programID: program.programId, + opts: { + commitment: 'confirmed', + }, + activeSubAccountId: 0, + subAccountIds: [], + perpMarketIndexes: [0, 1], + spotMarketIndexes: [0], + oracleInfos: [], + accountSubscription: { + type: 'polling', + accountLoader: bulkAccountLoader, + }, + }); + await adminClient.initialize(usdcMint.publicKey, true); + await adminClient.subscribe(); + await initializeQuoteSpotMarket(adminClient, usdcMint.publicKey); + + const userUSDCAccount = await mockUserUSDCAccount( + usdcMint, + new BN(10).mul(QUOTE_PRECISION), + bankrunContextWrapper, + keypair.publicKey + ); + + await adminClient.initializeUserAccountAndDepositCollateral( + new BN(10).mul(QUOTE_PRECISION), + userUSDCAccount.publicKey + ); + adminUser = new User({ + driftClient: adminClient, + userAccountPublicKey: await adminClient.getUserAccountPublicKey(), + accountSubscription: { + type: 'polling', + accountLoader: bulkAccountLoader, + }, + }); + + solUsd = await mockOracleNoProgram(bankrunContextWrapper, 224.3); + const periodicity = new BN(0); + + await adminClient.initializePerpMarket( + 0, + solUsd, + ammInitialBaseAssetReserve, + ammInitialQuoteAssetReserve, + periodicity, + new BN(224 * PEG_PRECISION.toNumber()) + ); + + await adminClient.initializePerpMarket( + 1, + solUsd, + ammInitialBaseAssetReserve, + ammInitialQuoteAssetReserve, + periodicity, + new BN(224 * PEG_PRECISION.toNumber()) + ); + + await adminClient.initializeLpPool( + lpPoolName, + new BN(100_000_000).mul(QUOTE_PRECISION), + Keypair.generate() + ); + }); + + after(async () => { + await adminClient.unsubscribe(); + }); + + it('can create a new LP Pool', async () => { + // check LpPool created + const lpPool = await adminClient.program.account.lpPool.fetch(lpPoolKey); + + // Check amm constituent map exists + const ammConstituentMapPublicKey = getAmmConstituentMappingPublicKey( + program.programId, + lpPoolKey + ); + const ammConstituentMap = + (await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMapPublicKey + )) as AmmConstituentMapping; + expect(ammConstituentMap).to.not.be.null; + assert(ammConstituentMap.weights.length == 0); + + // check constituent target weights exists + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeights = + (await adminClient.program.account.constituentTargetWeights.fetch( + constituentTargetWeightsPublicKey + )) as ConstituentTargetWeights; + expect(constituentTargetWeights).to.not.be.null; + assert(constituentTargetWeights.weights.length == 0); + + // check mint created correctly + const mintInfo = await getMint( + bankrunContextWrapper.connection.toConnection(), + lpPool.mint as PublicKey + ); + expect(mintInfo.decimals).to.equal(tokenDecimals); + expect(Number(mintInfo.supply)).to.equal(0); + expect(mintInfo.mintAuthority!.toBase58()).to.equal(lpPoolKey.toBase58()); + }); + + it('can add constituent to LP Pool', async () => { + await adminClient.initializeConstituent( + encodeName(lpPoolName), + 0, + 6, + new BN(10).mul(PERCENTAGE_PRECISION), + new BN(1).mul(PERCENTAGE_PRECISION), + new BN(2).mul(PERCENTAGE_PRECISION) + ); + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeights = + (await adminClient.program.account.constituentTargetWeights.fetch( + constituentTargetWeightsPublicKey + )) as ConstituentTargetWeights; + expect(constituentTargetWeights).to.not.be.null; + assert(constituentTargetWeights.weights.length == 1); + }); + + it('can add amm mapping datum', async () => { + await adminClient.addInitAmmConstituentMappingData(encodeName(lpPoolName), [ + { + perpMarketIndex: 0, + constituentIndex: 0, + }, + { + perpMarketIndex: 1, + constituentIndex: 0, + }, + ]); + const ammConstituentMapping = getAmmConstituentMappingPublicKey( + program.programId, + lpPoolKey + ); + const ammMapping = + (await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMapping + )) as AmmConstituentMapping; + expect(ammMapping).to.not.be.null; + assert(ammMapping.weights.length == 2); + }); + + it('fails adding datum with bad params', async () => { + // Bad perp market index + try { + await adminClient.addInitAmmConstituentMappingData( + encodeName(lpPoolName), + [ + { + perpMarketIndex: 2, + constituentIndex: 0, + }, + ] + ); + expect.fail('should have failed'); + } catch (e) { + expect(e.message).to.contain('0x18ab'); + } + + // Bad constituent index + try { + await adminClient.addInitAmmConstituentMappingData( + encodeName(lpPoolName), + [ + { + perpMarketIndex: 0, + constituentIndex: 1, + }, + ] + ); + expect.fail('should have failed'); + } catch (e) { + expect(e.message).to.contain('0x18ab'); + } + }); + + it('can update constituent target weights', async () => { + // Override AMM to have a balance + const perpMarket = adminClient.getPerpMarketAccount(0); + const raw = await bankrunContextWrapper.connection.getAccountInfo( + perpMarket.pubkey + ); + const buf = raw.data; + + buf.writeBigInt64LE(BigInt(1000000000), 304); + + bankrunContextWrapper.context.setAccount(perpMarket.pubkey, { + executable: raw.executable, + owner: raw.owner, + lamports: raw.lamports, + rentEpoch: raw.rentEpoch, + data: buf, + }); + + const perpMarketAccountAfter = await getPerpMarketDecoded( + adminClient, + bankrunContextWrapper, + perpMarket.pubkey + ); + assert(!perpMarketAccountAfter.amm.baseAssetAmountLong.isZero()); + + // Override LP pool to have some aum + const lpraw = await bankrunContextWrapper.connection.getAccountInfo( + lpPoolKey + ); + const lpbuf = lpraw.data; + + buf.writeBigInt64LE(BigInt(1000000000), 152); + + bankrunContextWrapper.context.setAccount(lpPoolKey, { + executable: lpraw.executable, + owner: lpraw.owner, + lamports: lpraw.lamports, + rentEpoch: lpraw.rentEpoch, + data: lpbuf, + }); + + const ammConstituentMappingPublicKey = getAmmConstituentMappingPublicKey( + program.programId, + lpPoolKey + ); + + const ammMapping = + (await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMappingPublicKey + )) as AmmConstituentMapping; + + console.log(`ok there should be ${ammMapping.weights.length} constituents`); + await adminClient.updateDlpConstituentTargetWeights( + encodeName(lpPoolName), + [0], + ammMapping + ); + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeights = + (await adminClient.program.account.constituentTargetWeights.fetch( + constituentTargetWeightsPublicKey + )) as ConstituentTargetWeights; + expect(constituentTargetWeights).to.not.be.null; + assert(constituentTargetWeights.weights.length == 1); + }); +}); From f145aa1b9a5947b453a26de651e182fc078f30ac Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 29 Apr 2025 12:53:47 -0700 Subject: [PATCH 35/50] update aum calc --- programs/drift/src/instructions/admin.rs | 3 +- programs/drift/src/instructions/lp_pool.rs | 5 ++- programs/drift/src/state/lp_pool.rs | 42 ++++++++++++---------- programs/drift/src/state/lp_pool/tests.rs | 2 +- sdk/src/idl/drift.json | 16 ++++++++- 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 84ad3f03a..7927c00b2 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4383,7 +4383,8 @@ pub fn handle_initialize_lp_pool( last_revenue_rebalance_ts: 0, total_fees_received: 0, total_fees_paid: 0, - _padding: [0; 6], + oldest_oracle_slot: 0, + _padding: [0; 13], }; let amm_constituent_mapping = &mut ctx.accounts.amm_constituent_mapping; diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index ee602727d..e87b9a546 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -3,7 +3,6 @@ use anchor_lang::{prelude::*, Accounts, Key, Result}; use crate::{ error::ErrorCode, math::{ - casting::Cast, oracle::{is_oracle_valid_for_action, DriftAction}, safe_math::SafeMath, }, @@ -139,6 +138,7 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( )?; let mut aum: u128 = 0; + let mut oldest_slot = u64::MAX; for i in 0..lp_pool.constituents as usize { let mut constituent = constituent_map.get_ref_mut(&(i as u16))?; @@ -190,9 +190,8 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( constituent.last_oracle_price = oracle_price.unwrap(); constituent.last_oracle_slot = slot; - let token_amount = constituent.spot_balance.get_token_amount(&spot_market)?; let constituent_aum = constituent - .get_full_balance(token_amount)? + .get_full_balance(&spot_market)? .safe_mul(oracle_price.unwrap() as i128)?; aum = aum.safe_add(constituent_aum as u128)?; } diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index f8987eef5..7ffe2f76c 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -54,6 +54,9 @@ pub struct LPPool { /// timestamp of last AUM update pub last_aum_ts: i64, // 8, 160 + /// Oldest slot of constituent oracles + pub oldest_oracle_slot: u64, + /// timestamp of last vAMM revenue rebalance pub last_revenue_rebalance_ts: u64, // 8, 168 @@ -63,11 +66,12 @@ pub struct LPPool { pub total_fees_paid: u128, // 16, 192 pub constituents: u16, // 2, 194 - pub _padding: [u8; 6], + + pub _padding: [u8; 13], } impl Size for LPPool { - const SIZE: usize = 1743; + const SIZE: usize = 216; } impl LPPool { @@ -136,8 +140,6 @@ impl LPPool { out_constituent: &Constituent, in_spot_market: &SpotMarket, out_spot_market: &SpotMarket, - in_token_balance: u128, - out_token_balance: u128, in_target_weight: i64, out_target_weight: i64, in_amount: u64, @@ -149,7 +151,6 @@ impl LPPool { oracle_map, in_constituent, in_spot_market, - in_token_balance, in_amount, in_target_weight, )?; @@ -163,7 +164,6 @@ impl LPPool { oracle_map, out_constituent, out_spot_market, - out_token_balance, out_amount, out_target_weight, )?; @@ -180,7 +180,6 @@ impl LPPool { oracle_map: &mut OracleMap, // might not need oracle_map depending on how accounts are passed in constituent: &Constituent, spot_market: &SpotMarket, - token_balance: u128, amount: u64, target_weight: i64, ) -> DriftResult { @@ -189,7 +188,7 @@ impl LPPool { .expect("failed to get price data") .price; let weight_after = - constituent.get_weight(price, token_balance, amount.cast::()?, self.last_aum)?; + constituent.get_weight(price, spot_market, amount.cast::()?, self.last_aum)?; let fee = constituent.get_fee_to_charge(weight_after, target_weight)?; Ok(fee) @@ -273,6 +272,9 @@ pub struct Constituent { /// precision: PERCENTAGE_PRECISION pub swap_fee_max: i64, + /// ata token balance in SPOT_BALANCE_PRECISION + pub token_balance: u64, + /// spot borrow-lend balance for constituent pub spot_balance: BLPosition, // should be in constituent base asset @@ -281,20 +283,24 @@ pub struct Constituent { } impl Size for Constituent { - const SIZE: usize = 112; + const SIZE: usize = 120; } impl Constituent { /// Returns the full balance of the Constituent, the total of the amount in Constituent's token /// account and in Drift Borrow-Lend. - pub fn get_full_balance(&self, token_balance: u128) -> DriftResult { + pub fn get_full_balance(&self, spot_market: &SpotMarket) -> DriftResult { match self.spot_balance.balance_type() { - SpotBalanceType::Deposit => token_balance - .cast::()? - .safe_add(self.spot_balance.balance().cast::()?), - SpotBalanceType::Borrow => token_balance - .cast::()? - .safe_sub(self.spot_balance.balance().cast::()?), + SpotBalanceType::Deposit => self.token_balance.cast::()?.safe_add( + self.spot_balance + .get_token_amount(spot_market)? + .cast::()?, + ), + SpotBalanceType::Borrow => self.token_balance.cast::()?.safe_sub( + self.spot_balance + .get_token_amount(spot_market)? + .cast::()?, + ), } } @@ -303,11 +309,11 @@ impl Constituent { pub fn get_weight( &self, price: i64, - token_balance: u128, + spot_market: &SpotMarket, token_amount_delta: i64, lp_pool_aum: u128, ) -> DriftResult { - let balance = self.get_full_balance(token_balance)?.cast::()?; + let balance = self.get_full_balance(spot_market)?.cast::()?; let token_precision = 10_i128.pow(self.decimals as u32); let value_usd = balance diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 619220594..6af86f3d6 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -84,7 +84,7 @@ mod tests { #[test] fn test_single_full_weight() { - let amm_datum = amm_const_datum(0, 1, 64, 0); + let amm_datum = amm_const_datum(0, 1, PERCENTAGE_PRECISION_I64, 0); let mapping_fixed = RefCell::new(AmmConstituentMappingFixed { len: 1, ..AmmConstituentMappingFixed::default() diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 11dce4725..f8602fd1e 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7713,6 +7713,13 @@ ], "type": "i64" }, + { + "name": "oldestOracleSlot", + "docs": [ + "Oldest slot of constituent oracles" + ], + "type": "u64" + }, { "name": "lastRevenueRebalanceTs", "docs": [ @@ -7743,7 +7750,7 @@ "type": { "array": [ "u8", - 6 + 13 ] } } @@ -7813,6 +7820,13 @@ ], "type": "i64" }, + { + "name": "tokenBalance", + "docs": [ + "ata token balance in SPOT_BALANCE_PRECISION" + ], + "type": "u64" + }, { "name": "spotBalance", "docs": [ From 4c8a72181da53f12e1ce73cdc3b5c39482c7a740 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 29 Apr 2025 14:08:56 -0700 Subject: [PATCH 36/50] add update /remove mapping ixs --- programs/drift/src/instructions/admin.rs | 59 ++++++++++-- programs/drift/src/lib.rs | 21 ++++- sdk/src/adminClient.ts | 91 +++++++++++++++++- sdk/src/idl/drift.json | 112 ++++++++++++++++++----- tests/lpPool.ts | 99 +++++++++++++++----- 5 files changed, 324 insertions(+), 58 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 7927c00b2..3bebdb64f 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4517,16 +4517,36 @@ pub fn handle_update_amm_constituent_mapping_data<'info>( Ok(()) } -#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] -pub struct InitializeAmmConstituentMappingDatum { - pub constituent_index: u16, - pub perp_market_index: u16, - pub weight: i64, +pub fn handle_remove_amm_constituent_mapping_data<'info>( + ctx: Context, + perp_market_index: u16, + constituent_index: u16, +) -> Result<()> { + let amm_mapping = &mut ctx.accounts.amm_constituent_mapping; + + let position = amm_mapping.weights.iter().position(|existing_datum| { + existing_datum.perp_market_index == perp_market_index + && existing_datum.constituent_index == constituent_index + }); + + if position.is_none() { + msg!( + "Not found for perp_market_index {} and constituent_index {}", + perp_market_index, + constituent_index + ); + return Err(ErrorCode::InvalidAmmConstituentMappingArgument.into()); + } + + amm_mapping.weights.remove(position.unwrap()); + amm_mapping.weights.shrink_to_fit(); + + Ok(()) } pub fn handle_add_amm_constituent_data<'info>( ctx: Context, - init_amm_constituent_mapping_data: Vec, + init_amm_constituent_mapping_data: Vec, ) -> Result<()> { let amm_mapping = &mut ctx.accounts.amm_constituent_mapping; let constituent_target_weights = &ctx.accounts.constituent_target_weights; @@ -5456,6 +5476,31 @@ pub struct UpdateAmmConstituentMappingData<'info> { bump, )] pub amm_constituent_mapping: Box>, - pub state: Box>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], +)] +pub struct RemoveAmmConstituentMappingData<'info> { + #[account(mut)] + pub admin: Signer<'info>, + + #[account( + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, + + #[account( + mut, + seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + realloc = AmmConstituentMapping::space(amm_constituent_mapping.weights.len() - 1), + realloc::payer = admin, + realloc::zero = false, + )] + pub amm_constituent_mapping: Box>, pub system_program: Program<'info, System>, } diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 200a0801c..13f344a54 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1717,9 +1717,26 @@ pub mod drift { pub fn add_amm_constituent_mapping_data( ctx: Context, lp_pool_name: [u8; 32], - init_amm_constituent_mapping_data: Vec, + amm_constituent_mapping_data: Vec, ) -> Result<()> { - handle_add_amm_constituent_data(ctx, init_amm_constituent_mapping_data) + handle_add_amm_constituent_data(ctx, amm_constituent_mapping_data) + } + + pub fn update_amm_constituent_mapping_data( + ctx: Context, + lp_pool_name: [u8; 32], + amm_constituent_mapping_data: Vec, + ) -> Result<()> { + handle_update_amm_constituent_mapping_data(ctx, amm_constituent_mapping_data) + } + + pub fn remove_amm_constituent_mapping_data<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, RemoveAmmConstituentMappingData<'info>>, + lp_pool_name: [u8; 32], + perp_market_index: u16, + constituent_index: u16, + ) -> Result<()> { + handle_remove_amm_constituent_mapping_data(ctx, perp_market_index, constituent_index) } pub fn update_dlp_constituent_target_weights<'c: 'info, 'info>( diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 3cf4bd738..887cb91a1 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -4312,20 +4312,20 @@ export class AdminClient extends DriftClient { ]; } - public async addInitAmmConstituentMappingData( + public async addAmmConstituentMappingData( lpPoolName: number[], - marketIndexConstituentIndexPairs: AddAmmConstituentMappingDatum[] + addAmmConstituentMappingData: AddAmmConstituentMappingDatum[] ): Promise { - const ixs = await this.getAddInitAmmConstituentMappingDataIx( + const ixs = await this.getAddAmmConstituentMappingDataIx( lpPoolName, - marketIndexConstituentIndexPairs + addAmmConstituentMappingData ); const tx = await this.buildTransaction(ixs); const { txSig } = await this.sendTransaction(tx, []); return txSig; } - public async getAddInitAmmConstituentMappingDataIx( + public async getAddAmmConstituentMappingDataIx( lpPoolName: number[], addAmmConstituentMappingData: AddAmmConstituentMappingDatum[] ): Promise { @@ -4356,4 +4356,85 @@ export class AdminClient extends DriftClient { ), ]; } + + public async updateAmmConstituentMappingData( + lpPoolName: number[], + addAmmConstituentMappingData: AddAmmConstituentMappingDatum[] + ): Promise { + const ixs = await this.getUpdateAmmConstituentMappingDataIx( + lpPoolName, + addAmmConstituentMappingData + ); + const tx = await this.buildTransaction(ixs); + const { txSig } = await this.sendTransaction(tx, []); + return txSig; + } + + public async getUpdateAmmConstituentMappingDataIx( + lpPoolName: number[], + addAmmConstituentMappingData: AddAmmConstituentMappingDatum[] + ): Promise { + const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); + const ammConstituentMapping = getAmmConstituentMappingPublicKey( + this.program.programId, + lpPool + ); + return [ + this.program.instruction.updateAmmConstituentMappingData( + lpPoolName, + addAmmConstituentMappingData, + { + accounts: { + admin: this.wallet.publicKey, + lpPool, + ammConstituentMapping, + systemProgram: SystemProgram.programId, + }, + } + ), + ]; + } + + public async removeAmmConstituentMappingData( + lpPoolName: number[], + perpMarketIndex: number, + constituentIndex: number + ): Promise { + const ixs = await this.getRemoveAmmConstituentMappingDataIx( + lpPoolName, + perpMarketIndex, + constituentIndex + ); + const tx = await this.buildTransaction(ixs); + const { txSig } = await this.sendTransaction(tx, []); + return txSig; + } + + public async getRemoveAmmConstituentMappingDataIx( + lpPoolName: number[], + perpMarketIndex: number, + constituentIndex: number + ): Promise { + const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); + const ammConstituentMapping = getAmmConstituentMappingPublicKey( + this.program.programId, + lpPool + ); + + return [ + this.program.instruction.removeAmmConstituentMappingData( + lpPoolName, + perpMarketIndex, + constituentIndex, + { + accounts: { + admin: this.wallet.publicKey, + lpPool, + ammConstituentMapping, + systemProgram: SystemProgram.programId, + }, + } + ), + ]; + } } diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index f8602fd1e..e8f7e1503 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7239,15 +7239,103 @@ } }, { - "name": "initAmmConstituentMappingData", + "name": "ammConstituentMappingData", "type": { "vec": { - "defined": "InitializeAmmConstituentMappingDatum" + "defined": "AddAmmConstituentMappingDatum" } } } ] }, + { + "name": "updateAmmConstituentMappingData", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "lpPool", + "isMut": false, + "isSigner": false + }, + { + "name": "ammConstituentMapping", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "ammConstituentMappingData", + "type": { + "vec": { + "defined": "AddAmmConstituentMappingDatum" + } + } + } + ] + }, + { + "name": "removeAmmConstituentMappingData", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "lpPool", + "isMut": false, + "isSigner": false + }, + { + "name": "ammConstituentMapping", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "perpMarketIndex", + "type": "u16" + }, + { + "name": "constituentIndex", + "type": "u16" + } + ] + }, { "name": "updateDlpConstituentTargetWeights", "accounts": [ @@ -9519,26 +9607,6 @@ ] } }, - { - "name": "InitializeAmmConstituentMappingDatum", - "type": { - "kind": "struct", - "fields": [ - { - "name": "constituentIndex", - "type": "u16" - }, - { - "name": "perpMarketIndex", - "type": "u16" - }, - { - "name": "weight", - "type": "i64" - } - ] - } - }, { "name": "AddAmmConstituentMappingDatum", "type": { diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 9dfe06c29..32e0e5f15 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -98,7 +98,7 @@ describe('LP Pool', () => { }, activeSubAccountId: 0, subAccountIds: [], - perpMarketIndexes: [0, 1], + perpMarketIndexes: [0, 1, 2], spotMarketIndexes: [0], oracleInfos: [], accountSubscription: { @@ -143,6 +143,15 @@ describe('LP Pool', () => { new BN(224 * PEG_PRECISION.toNumber()) ); + await adminClient.initializePerpMarket( + 2, + solUsd, + ammInitialBaseAssetReserve, + ammInitialQuoteAssetReserve, + periodicity, + new BN(224 * PEG_PRECISION.toNumber()) + ); + await adminClient.initializeLpPool( lpPoolName, new BN(100_000_000).mul(QUOTE_PRECISION), @@ -217,7 +226,7 @@ describe('LP Pool', () => { }); it('can add amm mapping datum', async () => { - await adminClient.addInitAmmConstituentMappingData(encodeName(lpPoolName), [ + await adminClient.addAmmConstituentMappingData(encodeName(lpPoolName), [ { perpMarketIndex: 0, constituentIndex: 0, @@ -244,16 +253,13 @@ describe('LP Pool', () => { it('fails adding datum with bad params', async () => { // Bad perp market index try { - await adminClient.addInitAmmConstituentMappingData( - encodeName(lpPoolName), - [ - { - perpMarketIndex: 2, - constituentIndex: 0, - weight: PERCENTAGE_PRECISION, - }, - ] - ); + await adminClient.addAmmConstituentMappingData(encodeName(lpPoolName), [ + { + perpMarketIndex: 3, + constituentIndex: 0, + weight: PERCENTAGE_PRECISION, + }, + ]); expect.fail('should have failed'); } catch (e) { expect(e.message).to.contain('0x18ab'); @@ -261,16 +267,13 @@ describe('LP Pool', () => { // Bad constituent index try { - await adminClient.addInitAmmConstituentMappingData( - encodeName(lpPoolName), - [ - { - perpMarketIndex: 0, - constituentIndex: 1, - weight: PERCENTAGE_PRECISION, - }, - ] - ); + await adminClient.addAmmConstituentMappingData(encodeName(lpPoolName), [ + { + perpMarketIndex: 0, + constituentIndex: 1, + weight: PERCENTAGE_PRECISION, + }, + ]); expect.fail('should have failed'); } catch (e) { expect(e.message).to.contain('0x18ab'); @@ -368,4 +371,56 @@ describe('LP Pool', () => { assert(e.message.includes('0x18b0')); } }); + + it('can update and remove amm constituent mapping entries', async () => { + await adminClient.addAmmConstituentMappingData(encodeName(lpPoolName), [ + { + perpMarketIndex: 2, + constituentIndex: 0, + weight: PERCENTAGE_PRECISION, + }, + ]); + const ammConstituentMapping = getAmmConstituentMappingPublicKey( + program.programId, + lpPoolKey + ); + let ammMapping = + (await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMapping + )) as AmmConstituentMapping; + expect(ammMapping).to.not.be.null; + assert(ammMapping.weights.length == 3); + + // Update + await adminClient.updateAmmConstituentMappingData(encodeName(lpPoolName), [ + { + perpMarketIndex: 2, + constituentIndex: 0, + weight: PERCENTAGE_PRECISION.muln(2), + }, + ]); + ammMapping = (await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMapping + )) as AmmConstituentMapping; + expect(ammMapping).to.not.be.null; + assert( + ammMapping.weights + .find((x) => x.perpMarketIndex == 2) + .weight.eq(PERCENTAGE_PRECISION.muln(2)) + ); + + // Remove + await adminClient.removeAmmConstituentMappingData( + encodeName(lpPoolName), + 2, + 0 + ); + ammMapping = (await adminClient.program.account.ammConstituentMapping.fetch( + ammConstituentMapping + )) as AmmConstituentMapping; + expect(ammMapping).to.not.be.null; + assert(ammMapping.weights.find((x) => x.perpMarketIndex == 2) == undefined); + assert(ammMapping.weights.length === 2); + + }); }); From 3923458e9eeb8adbc10bc471444bc567263dfb1d Mon Sep 17 00:00:00 2001 From: wphan Date: Tue, 29 Apr 2025 15:15:30 -0700 Subject: [PATCH 37/50] fix test - init constituent spot market --- tests/lpPool.ts | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 005df2fe7..eacb75437 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -22,6 +22,9 @@ import { LPPool, User, getConstituentVaultPublicKey, + SPOT_MARKET_WEIGHT_PRECISION, + SPOT_MARKET_RATE_PRECISION, + OracleSource, } from '../sdk/src'; import { @@ -43,7 +46,10 @@ describe('LP Pool', () => { let bulkAccountLoader: TestBulkAccountLoader; let adminClient: TestClient; - let usdcMint; + let usdcMint: Keypair; + let spotTokenMint: Keypair; + let spotMarketIndex: number; + let spotMarketOracle: PublicKey; const mantissaSqrtScale = new BN(Math.sqrt(PRICE_PRECISION.toNumber())); const ammInitialQuoteAssetReserve = new anchor.BN(10 * 10 ** 13).mul( @@ -85,12 +91,12 @@ describe('LP Pool', () => { ); usdcMint = await mockUSDCMint(bankrunContextWrapper); + spotTokenMint = await mockUSDCMint(bankrunContextWrapper); + spotMarketOracle = await mockOracleNoProgram(bankrunContextWrapper, 200); const keypair = new Keypair(); await bankrunContextWrapper.fundKeypair(keypair, 10 ** 9); - usdcMint = await mockUSDCMint(bankrunContextWrapper); - adminClient = new TestClient({ connection: bankrunContextWrapper.connection.toConnection(), wallet: new anchor.Wallet(keypair), @@ -154,6 +160,32 @@ describe('LP Pool', () => { new BN(224 * PEG_PRECISION.toNumber()) ); + const optimalUtilization = SPOT_MARKET_RATE_PRECISION.div( + new BN(2) + ).toNumber(); // 50% utilization + const optimalRate = SPOT_MARKET_RATE_PRECISION.toNumber(); + const maxRate = SPOT_MARKET_RATE_PRECISION.toNumber(); + const initialAssetWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const maintenanceAssetWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const initialLiabilityWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const maintenanceLiabilityWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const imfFactor = 0; + spotMarketIndex = adminClient.getStateAccount().numberOfSpotMarkets; + + await adminClient.initializeSpotMarket( + spotTokenMint.publicKey, + optimalUtilization, + optimalRate, + maxRate, + spotMarketOracle, + OracleSource.PYTH, + initialAssetWeight, + maintenanceAssetWeight, + initialLiabilityWeight, + maintenanceLiabilityWeight, + imfFactor + ); + await adminClient.initializeLpPool( lpPoolName, new BN(100_000_000).mul(QUOTE_PRECISION), @@ -433,6 +465,5 @@ describe('LP Pool', () => { expect(ammMapping).to.not.be.null; assert(ammMapping.weights.find((x) => x.perpMarketIndex == 2) == undefined); assert(ammMapping.weights.length === 2); - }); }); From 11fed5fea78863bfa683524c89bbd901f0b0bc2e Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 29 Apr 2025 15:49:46 -0700 Subject: [PATCH 38/50] add crank improvements --- programs/drift/src/instructions/admin.rs | 62 ++++++++++++++++++++++ programs/drift/src/instructions/lp_pool.rs | 14 ++++- programs/drift/src/lib.rs | 18 +++++++ programs/drift/src/state/lp_pool.rs | 4 +- sdk/src/adminClient.ts | 54 +++++++++++++++++-- sdk/src/idl/drift.json | 54 +++++++++++++++++++ sdk/src/types.ts | 22 ++++++++ tests/lpPool.ts | 46 +++++++++++++--- 8 files changed, 262 insertions(+), 12 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index f3637bc2f..b2cc67ca1 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4455,6 +4455,7 @@ pub fn handle_initialize_constituent<'info>( max_weight_deviation: i64, swap_fee_min: i64, swap_fee_max: i64, + oracle_staleness_threshold: u64, ) -> Result<()> { let mut constituent = ctx.accounts.constituent.load_init()?; let mut lp_pool = ctx.accounts.lp_pool.load_mut()?; @@ -4472,12 +4473,60 @@ pub fn handle_initialize_constituent<'info>( constituent.max_weight_deviation = max_weight_deviation; constituent.swap_fee_min = swap_fee_min; constituent.swap_fee_max = swap_fee_max; + constituent.oracle_staleness_threshold = oracle_staleness_threshold; constituent.pubkey = ctx.accounts.constituent.key(); lp_pool.constituents += 1; Ok(()) } +pub fn handle_update_constituent_params<'info>( + ctx: Context, + max_weight_deviation: Option, + swap_fee_min: Option, + swap_fee_max: Option, + oracle_staleness_threshold: Option, +) -> Result<()> { + let mut constituent = ctx.accounts.constituent.load_mut()?; + if max_weight_deviation.is_some() { + msg!( + "max_weight_deviation: {:?} -> {:?}", + constituent.max_weight_deviation, + max_weight_deviation + ); + constituent.max_weight_deviation = max_weight_deviation.unwrap(); + } + + if swap_fee_min.is_some() { + msg!( + "swap_fee_min: {:?} -> {:?}", + constituent.swap_fee_min, + swap_fee_min + ); + constituent.swap_fee_min = swap_fee_min.unwrap(); + } + + if swap_fee_max.is_some() { + msg!( + "swap_fee_max: {:?} -> {:?}", + constituent.swap_fee_max, + swap_fee_max + ); + constituent.swap_fee_max = swap_fee_max.unwrap(); + } + + if oracle_staleness_threshold.is_some() { + msg!( + "oracle_staleness_threshold: {:?} -> {:?}", + constituent.oracle_staleness_threshold, + oracle_staleness_threshold + ); + constituent.oracle_staleness_threshold = oracle_staleness_threshold.unwrap(); + } + + Ok(()) +} + pub fn handle_update_amm_constituent_mapping_data<'info>( ctx: Context, amm_constituent_mapping_data: Vec, @@ -5433,6 +5482,19 @@ pub struct InitializeConstituent<'info> { pub token_program: Interface<'info, TokenInterface>, } +#[derive(Accounts)] +pub struct UpdateConstituentParams<'info> { + #[account( + mut, + constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin + )] + pub admin: Signer<'info>, + #[account()] + pub state: Box>, + /// CHECK: doesnt need type check since just updating params + pub constituent: AccountLoader<'info, Constituent>, +} + #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct AddAmmConstituentMappingDatum { pub constituent_index: u16, diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index e87b9a546..1a8cf1643 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -3,6 +3,7 @@ use anchor_lang::{prelude::*, Accounts, Key, Result}; use crate::{ error::ErrorCode, math::{ + casting::Cast, oracle::{is_oracle_valid_for_action, DriftAction}, safe_math::SafeMath, }, @@ -167,13 +168,17 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( spot_market.get_max_confidence_interval_multiplier()?, )?; + let oracle_slot = slot - oracle_data.0.delay.cast::()?; + let oracle_price: Option = { if !is_oracle_valid_for_action(oracle_data.1, Some(DriftAction::UpdateLpPoolAum))? { msg!( "Oracle data for spot market {} is invalid. Skipping update", spot_market.market_index, ); - if slot - constituent.last_oracle_slot > 400 { + if slot.saturating_sub(constituent.last_oracle_slot) + > constituent.oracle_staleness_threshold + { None } else { Some(constituent.last_oracle_price) @@ -188,7 +193,11 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( } constituent.last_oracle_price = oracle_price.unwrap(); - constituent.last_oracle_slot = slot; + constituent.last_oracle_slot = oracle_slot; + + if oracle_slot < oldest_slot { + oldest_slot = oracle_slot; + } let constituent_aum = constituent .get_full_balance(&spot_market)? @@ -196,6 +205,7 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( aum = aum.safe_add(constituent_aum as u128)?; } + lp_pool.oldest_oracle_slot = oldest_slot; lp_pool.last_aum = aum; lp_pool.last_aum_slot = slot; lp_pool.last_aum_ts = Clock::get()?.unix_timestamp; diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 13f344a54..47cd96368 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1703,6 +1703,7 @@ pub mod drift { max_weight_deviation: i64, swap_fee_min: i64, swap_fee_max: i64, + oracle_staleness_threshold: u64, ) -> Result<()> { handle_initialize_constituent( ctx, @@ -1711,6 +1712,23 @@ pub mod drift { max_weight_deviation, swap_fee_min, swap_fee_max, + oracle_staleness_threshold, + ) + } + + pub fn update_constituent_params( + ctx: Context, + max_weight_deviation: Option, + swap_fee_min: Option, + swap_fee_max: Option, + oracle_staleness_threshold: Option, + ) -> Result<()> { + handle_update_constituent_params( + ctx, + max_weight_deviation, + swap_fee_min, + swap_fee_max, + oracle_staleness_threshold, ) } diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index c8121c4fe..604964e6e 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -281,10 +281,12 @@ pub struct Constituent { pub last_oracle_price: i64, pub last_oracle_slot: u64, + + pub oracle_staleness_threshold: u64, } impl Size for Constituent { - const SIZE: usize = 120; + const SIZE: usize = 128; } impl Constituent { diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index a1938c5a9..04719cf90 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -4257,7 +4257,8 @@ export class AdminClient extends DriftClient { decimals: number, maxWeightDeviation: BN, swapFeeMin: BN, - swapFeeMax: BN + swapFeeMax: BN, + oracleStalenessThreshold: BN ): Promise { const ixs = await this.getInitializeConstituentIx( lpPoolName, @@ -4265,7 +4266,8 @@ export class AdminClient extends DriftClient { decimals, maxWeightDeviation, swapFeeMin, - swapFeeMax + swapFeeMax, + oracleStalenessThreshold ); const tx = await this.buildTransaction(ixs); const { txSig } = await this.sendTransaction(tx, []); @@ -4278,7 +4280,8 @@ export class AdminClient extends DriftClient { decimals: number, maxWeightDeviation: BN, swapFeeMin: BN, - swapFeeMax: BN + swapFeeMax: BN, + oracleStalenessThreshold: BN ): Promise { const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); const constituentTargetWeights = getConstituentTargetWeightsPublicKey( @@ -4300,6 +4303,7 @@ export class AdminClient extends DriftClient { maxWeightDeviation, swapFeeMin, swapFeeMax, + oracleStalenessThreshold, { accounts: { admin: this.wallet.publicKey, @@ -4324,6 +4328,50 @@ export class AdminClient extends DriftClient { ]; } + public async updateConstituentParams( + constituentPublicKey: PublicKey, + maxWeightDeviation?: BN, + swapFeeMin?: BN, + swapFeeMax?: BN, + oracleStalenessThreshold?: BN + ): Promise { + const ixs = await this.getUpdateConstituentParamsIx( + constituentPublicKey, + maxWeightDeviation, + swapFeeMin, + swapFeeMax, + oracleStalenessThreshold + ); + const tx = await this.buildTransaction(ixs); + const { txSig } = await this.sendTransaction(tx, []); + return txSig; + } + + public async getUpdateConstituentParamsIx( + constituentPublicKey: PublicKey, + maxWeightDeviation?: BN, + swapFeeMin?: BN, + swapFeeMax?: BN, + oracleStalenessThreshold?: BN + ): Promise { + return [ + this.program.instruction.updateConstituentParams( + maxWeightDeviation, + swapFeeMin, + swapFeeMax, + oracleStalenessThreshold, + { + accounts: { + admin: this.wallet.publicKey, + constituent: constituentPublicKey, + state: await this.getStatePublicKey(), + }, + signers: [], + } + ), + ]; + } + public async addAmmConstituentMappingData( lpPoolName: number[], addAmmConstituentMappingData: AddAmmConstituentMappingDatum[] diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 95671a47d..fef7d42b8 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7216,6 +7216,56 @@ { "name": "swapFeeMax", "type": "i64" + }, + { + "name": "oracleStalenessThreshold", + "type": "u64" + } + ] + }, + { + "name": "updateConstituentParams", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "constituent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "maxWeightDeviation", + "type": { + "option": "i64" + } + }, + { + "name": "swapFeeMin", + "type": { + "option": "i64" + } + }, + { + "name": "swapFeeMax", + "type": { + "option": "i64" + } + }, + { + "name": "oracleStalenessThreshold", + "type": { + "option": "u64" + } } ] }, @@ -7956,6 +8006,10 @@ { "name": "lastOracleSlot", "type": "u64" + }, + { + "name": "oracleStalenessThreshold", + "type": "u64" } ] } diff --git a/sdk/src/types.ts b/sdk/src/types.ts index c1c79937c..81b88c5a3 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1509,3 +1509,25 @@ export type LPPool = { totalFeesPaid: BN; constituents: number; }; + +export type BLPosition = { + scaledBalance: BN; + cumulativeDeposits: BN; + marketIndex: number; + balanceType: SpotBalanceType; +}; + +export type Constituent = { + pubkey: PublicKey; + spotMarketIndex: number; + constituentIndex: number; + decimals: number; + maxWeightDeviation: BN; + swapFeeMin: BN; + swapFeeMax: BN; + tokenBalance: BN; + spotBalance: BLPosition; + lastOraclePrice: BN; + lastOracleSlot: BN; + oracleStalenessThreshold: BN; +}; diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 005df2fe7..bc08b3b41 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -20,8 +20,10 @@ import { ConstituentTargetWeights, AmmConstituentMapping, LPPool, - User, getConstituentVaultPublicKey, + getConstituentPublicKey, + ZERO, + OracleSource, } from '../sdk/src'; import { @@ -91,6 +93,8 @@ describe('LP Pool', () => { usdcMint = await mockUSDCMint(bankrunContextWrapper); + solUsd = await mockOracleNoProgram(bankrunContextWrapper, 224.3); + adminClient = new TestClient({ connection: bankrunContextWrapper.connection.toConnection(), wallet: new anchor.Wallet(keypair), @@ -102,7 +106,7 @@ describe('LP Pool', () => { subAccountIds: [], perpMarketIndexes: [0, 1, 2], spotMarketIndexes: [0], - oracleInfos: [], + oracleInfos: [{ publicKey: solUsd, source: OracleSource.PYTH }], accountSubscription: { type: 'polling', accountLoader: bulkAccountLoader, @@ -124,7 +128,6 @@ describe('LP Pool', () => { userUSDCAccount.publicKey ); - solUsd = await mockOracleNoProgram(bankrunContextWrapper, 224.3); const periodicity = new BN(0); await adminClient.initializePerpMarket( @@ -208,7 +211,8 @@ describe('LP Pool', () => { 6, new BN(10).mul(PERCENTAGE_PRECISION), new BN(1).mul(PERCENTAGE_PRECISION), - new BN(2).mul(PERCENTAGE_PRECISION) + new BN(2).mul(PERCENTAGE_PRECISION), + new BN(400) ); const constituentTargetWeightsPublicKey = getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); @@ -237,6 +241,7 @@ describe('LP Pool', () => { ); expect(constituentTokenVault).to.not.be.null; }); + it('can add amm mapping datum', async () => { await adminClient.addAmmConstituentMappingData(encodeName(lpPoolName), [ { @@ -364,6 +369,11 @@ describe('LP Pool', () => { )) as LPPool; assert(lpPool.constituents == 1); + const constituentPublicKey = getConstituentPublicKey( + program.programId, + lpPoolKey, + 0 + ); await adminClient.updateDlpPoolAum(lpPool, [0]); // Should fail if we initialize a second constituent and dont pass it in @@ -373,7 +383,24 @@ describe('LP Pool', () => { 6, new BN(10).mul(PERCENTAGE_PRECISION), new BN(1).mul(PERCENTAGE_PRECISION), - new BN(2).mul(PERCENTAGE_PRECISION) + new BN(2).mul(PERCENTAGE_PRECISION), + new BN(400) + ); + + try { + await adminClient.updateDlpPoolAum(lpPool, [0]); + expect.fail('should have failed'); + } catch (e) { + assert(e.message.includes('0x18b0')); + } + + // Should fail if the oracle is too delayed + await adminClient.updateConstituentParams( + constituentPublicKey, + undefined, + undefined, + undefined, + ZERO ); try { @@ -382,6 +409,14 @@ describe('LP Pool', () => { } catch (e) { assert(e.message.includes('0x18b0')); } + + await adminClient.updateConstituentParams( + constituentPublicKey, + undefined, + undefined, + undefined, + new BN(400) + ); }); it('can update and remove amm constituent mapping entries', async () => { @@ -433,6 +468,5 @@ describe('LP Pool', () => { expect(ammMapping).to.not.be.null; assert(ammMapping.weights.find((x) => x.perpMarketIndex == 2) == undefined); assert(ammMapping.weights.length === 2); - }); }); From a059f00d1f89b3febf4c1bca6683b74fb295771b Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 29 Apr 2025 19:08:50 -0700 Subject: [PATCH 39/50] passes tests --- programs/drift/src/instructions/admin.rs | 1 + programs/drift/src/instructions/lp_pool.rs | 6 +++--- programs/drift/src/state/constituent_map.rs | 1 - tests/lpPool.ts | 24 --------------------- 4 files changed, 4 insertions(+), 28 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 07b82a8e0..59a43808b 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4475,6 +4475,7 @@ pub fn handle_initialize_constituent<'info>( constituent.swap_fee_max = swap_fee_max; constituent.oracle_staleness_threshold = oracle_staleness_threshold; constituent.pubkey = ctx.accounts.constituent.key(); + constituent.constituent_index = (constituent_target_weights.weights.len() - 1) as u16; lp_pool.constituents += 1; Ok(()) diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 1a8cf1643..21224b273 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -168,8 +168,7 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( spot_market.get_max_confidence_interval_multiplier()?, )?; - let oracle_slot = slot - oracle_data.0.delay.cast::()?; - + let oracle_slot = slot - oracle_data.0.delay.max(0i64).cast::()?; let oracle_price: Option = { if !is_oracle_valid_for_action(oracle_data.1, Some(DriftAction::UpdateLpPoolAum))? { msg!( @@ -177,7 +176,7 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( spot_market.market_index, ); if slot.saturating_sub(constituent.last_oracle_slot) - > constituent.oracle_staleness_threshold + >= constituent.oracle_staleness_threshold { None } else { @@ -189,6 +188,7 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( }; if oracle_price.is_none() { + msg!("hi"); return Err(ErrorCode::OracleTooStaleForLPAUMUpdate.into()); } diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index c229c64a1..b98535103 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -122,7 +122,6 @@ impl<'a> ConstituentMap<'a> { // constituent index 42 bytes from front of account let constituent_index = u16::from_le_bytes(*array_ref![data, 42, 2]); - if constituent_map.0.contains_key(&constituent_index) { msg!( "Can not include same constituent index twice {}", diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 03827c077..92a238d6d 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -21,8 +21,6 @@ import { AmmConstituentMapping, LPPool, getConstituentVaultPublicKey, - getConstituentPublicKey, - ZERO, OracleSource, SPOT_MARKET_WEIGHT_PRECISION, SPOT_MARKET_RATE_PRECISION, @@ -49,7 +47,6 @@ describe('LP Pool', () => { let adminClient: TestClient; let usdcMint: Keypair; let spotTokenMint: Keypair; - let spotMarketIndex: number; let spotMarketOracle: PublicKey; const mantissaSqrtScale = new BN(Math.sqrt(PRICE_PRECISION.toNumber())); @@ -174,7 +171,6 @@ describe('LP Pool', () => { const initialLiabilityWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); const maintenanceLiabilityWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); const imfFactor = 0; - spotMarketIndex = adminClient.getStateAccount().numberOfSpotMarkets; await adminClient.initializeSpotMarket( spotTokenMint.publicKey, @@ -402,11 +398,6 @@ describe('LP Pool', () => { )) as LPPool; assert(lpPool.constituents == 1); - const constituentPublicKey = getConstituentPublicKey( - program.programId, - lpPoolKey, - 0 - ); await adminClient.updateDlpPoolAum(lpPool, [0]); // Should fail if we initialize a second constituent and dont pass it in @@ -426,21 +417,6 @@ describe('LP Pool', () => { } catch (e) { assert(e.message.includes('0x18b0')); } - - // Should fail if the oracle is too delayed - await adminClient.updateConstituentParams(constituentPublicKey, { - oracleStalenessThreshold: ZERO, - }); - try { - await adminClient.updateDlpPoolAum(lpPool, [0]); - expect.fail('should have failed'); - } catch (e) { - assert(e.message.includes('0x18b0')); - } - - await adminClient.updateConstituentParams(constituentPublicKey, { - oracleStalenessThreshold: new BN(400), - }); }); it('can update and remove amm constituent mapping entries', async () => { From cbf3395d99acd79f5b8203cdc68585fb1edd25f9 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 29 Apr 2025 19:14:49 -0700 Subject: [PATCH 40/50] precision fix crank aum --- programs/drift/src/instructions/lp_pool.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 21224b273..1b7d9d48a 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -4,6 +4,10 @@ use crate::{ error::ErrorCode, math::{ casting::Cast, + constants::{ + PRICE_PRECISION_I128, QUOTE_PRECISION, QUOTE_PRECISION_I128, SPOT_BALANCE_PRECISION, + SPOT_WEIGHT_PRECISION_I128, + }, oracle::{is_oracle_valid_for_action, DriftAction}, safe_math::SafeMath, }, @@ -201,7 +205,9 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( let constituent_aum = constituent .get_full_balance(&spot_market)? - .safe_mul(oracle_price.unwrap() as i128)?; + .safe_mul(oracle_price.unwrap() as i128)? + .safe_mul(QUOTE_PRECISION_I128)? + .safe_div(SPOT_WEIGHT_PRECISION_I128)?; aum = aum.safe_add(constituent_aum as u128)?; } From a7830f4d8b865df6a958d6bf4d7444679101d8f3 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 1 May 2025 13:07:38 -0700 Subject: [PATCH 41/50] precision fixes and constituent map check for account owner --- package.json | 6 +- programs/drift/src/instructions/lp_pool.rs | 14 +- programs/drift/src/state/constituent_map.rs | 5 +- programs/drift/src/state/lp_pool.rs | 17 +- sdk/package.json | 5 +- sdk/src/idl/drift.json | 17 +- sdk/yarn.lock | 283 +++--- yarn.lock | 935 +++++++++----------- 8 files changed, 605 insertions(+), 677 deletions(-) diff --git a/package.json b/package.json index 65a25c4fc..10a354314 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,8 @@ "@project-serum/common": "0.0.1-beta.3", "@project-serum/serum": "0.13.65", "@pythnetwork/client": "2.21.0", - "@solana/spl-token": "0.4.13", + "@solana/spl-token": "0.3.7", "@solana/web3.js": "1.73.2", - "@solana/spl-token-metadata": "0.1.6", "@types/bn.js": "5.1.6", "@types/chai": "5.0.0", "@types/mocha": "8.2.3", @@ -31,7 +30,8 @@ "dependencies": { "@ellipsis-labs/phoenix-sdk": "1.4.2", "@pythnetwork/pyth-solana-receiver": "0.8.0", - "@switchboard-xyz/on-demand": "2.3.2", + "@switchboard-xyz/on-demand": "2.4.1", + "@switchboard-xyz/common": "3.0.14", "anchor-bankrun": "0.3.0", "chai-bn": "0.2.2", "csvtojson": "2.0.10", diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 1b7d9d48a..43caa7dca 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -203,12 +203,20 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( oldest_slot = oracle_slot; } + let (numerator_scale, denominator_scale) = if spot_market.decimals > 6 { + (10_i128.pow(spot_market.decimals - 6), 1) + } else { + (1, 10_i128.pow(6 - spot_market.decimals)) + }; + let constituent_aum = constituent .get_full_balance(&spot_market)? + .safe_mul(numerator_scale)? + .safe_div(denominator_scale)? .safe_mul(oracle_price.unwrap() as i128)? - .safe_mul(QUOTE_PRECISION_I128)? - .safe_div(SPOT_WEIGHT_PRECISION_I128)?; - aum = aum.safe_add(constituent_aum as u128)?; + .safe_div(PRICE_PRECISION_I128)? + .max(0); + aum = aum.safe_add(constituent_aum.cast()?)?; } lp_pool.oldest_oracle_slot = oldest_slot; diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index b98535103..8e2300bb9 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -10,7 +10,6 @@ use anchor_lang::Discriminator; use arrayref::array_ref; use crate::error::{DriftResult, ErrorCode}; -use crate::state::user::PerpPositions; use crate::math::safe_unwrap::SafeUnwrap; use crate::msg; @@ -96,6 +95,10 @@ impl<'a> ConstituentMap<'a> { let constituent_discriminator: [u8; 8] = Constituent::discriminator(); while let Some(account_info) = account_info_iter.peek() { + if account_info.owner != &crate::ID { + break; + } + let data = account_info .try_borrow_data() .or(Err(ErrorCode::ConstituentCouldNotLoad))?; diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 604964e6e..e94399173 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -202,8 +202,8 @@ impl LPPool { pub struct BLPosition { /// The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow /// interest of corresponding market. - /// precision: SPOT_BALANCE_PRECISION - pub scaled_balance: u64, + /// precision: token precision + pub scaled_balance: u128, /// The cumulative deposits/borrows a user has made into a market /// precision: token mint precision pub cumulative_deposits: i64, @@ -228,12 +228,12 @@ impl SpotBalance for BLPosition { } fn increase_balance(&mut self, delta: u128) -> DriftResult { - self.scaled_balance = self.scaled_balance.safe_add(delta.cast()?)?; + self.scaled_balance = self.scaled_balance.safe_add(delta)?; Ok(()) } fn decrease_balance(&mut self, delta: u128) -> DriftResult { - self.scaled_balance = self.scaled_balance.safe_sub(delta.cast()?)?; + self.scaled_balance = self.scaled_balance.safe_sub(delta)?; Ok(()) } @@ -245,7 +245,7 @@ impl SpotBalance for BLPosition { impl BLPosition { pub fn get_token_amount(&self, spot_market: &SpotMarket) -> DriftResult { - get_token_amount(self.scaled_balance.cast()?, spot_market, &self.balance_type) + get_token_amount(self.scaled_balance, spot_market, &self.balance_type) } } @@ -273,8 +273,8 @@ pub struct Constituent { /// precision: PERCENTAGE_PRECISION pub swap_fee_max: i64, - /// ata token balance in SPOT_BALANCE_PRECISION - pub token_balance: u64, + /// ata token balance in token precision + pub token_balance: u128, /// spot borrow-lend balance for constituent pub spot_balance: BLPosition, // should be in constituent base asset @@ -283,10 +283,11 @@ pub struct Constituent { pub last_oracle_slot: u64, pub oracle_staleness_threshold: u64, + _padding2: [u8; 8], } impl Size for Constituent { - const SIZE: usize = 128; + const SIZE: usize = 152; } impl Constituent { diff --git a/sdk/package.json b/sdk/package.json index 2366daeef..ca357c8e1 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@drift-labs/sdk", - "version": "2.118.0-beta.4", + "version": "2.121.0-beta.5", "main": "lib/node/index.js", "types": "lib/node/index.d.ts", "browser": "./lib/browser/index.js", @@ -47,7 +47,8 @@ "@pythnetwork/pyth-solana-receiver": "0.7.0", "@solana/spl-token": "0.3.7", "@solana/web3.js": "1.92.3", - "@switchboard-xyz/on-demand": "2.4.0", + "@switchboard-xyz/common": "3.0.14", + "@switchboard-xyz/on-demand": "2.4.1", "@triton-one/yellowstone-grpc": "1.3.0", "anchor-bankrun": "0.3.0", "nanoid": "3.3.4", diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 98715721c..43945ce6d 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7968,9 +7968,9 @@ { "name": "tokenBalance", "docs": [ - "ata token balance in SPOT_BALANCE_PRECISION" + "ata token balance in token precision" ], - "type": "u64" + "type": "u128" }, { "name": "spotBalance", @@ -7992,6 +7992,15 @@ { "name": "oracleStalenessThreshold", "type": "u64" + }, + { + "name": "padding2", + "type": { + "array": [ + "u8", + 8 + ] + } } ] } @@ -9953,9 +9962,9 @@ "docs": [ "The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow", "interest of corresponding market.", - "precision: SPOT_BALANCE_PRECISION" + "precision: token precision" ], - "type": "u64" + "type": "u128" }, { "name": "cumulativeDeposits", diff --git a/sdk/yarn.lock b/sdk/yarn.lock index 3d446cd83..bf72153ff 100644 --- a/sdk/yarn.lock +++ b/sdk/yarn.lock @@ -10,18 +10,18 @@ "@babel/highlight" "^7.10.4" "@babel/code-frame@^7.12.13": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" - integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be" + integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg== dependencies: - "@babel/helper-validator-identifier" "^7.25.9" + "@babel/helper-validator-identifier" "^7.27.1" js-tokens "^4.0.0" - picocolors "^1.0.0" + picocolors "^1.1.1" -"@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== +"@babel/helper-validator-identifier@^7.25.9", "@babel/helper-validator-identifier@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" + integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== "@babel/highlight@^7.10.4": version "7.25.9" @@ -34,11 +34,9 @@ picocolors "^1.0.0" "@babel/runtime@^7.10.5", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.24.6", "@babel/runtime@^7.25.0": - version "7.26.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.9.tgz#aa4c6facc65b9cb3f87d75125ffd47781b475433" - integrity sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg== - dependencies: - regenerator-runtime "^0.14.0" + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.1.tgz#9fce313d12c9a77507f264de74626e87fd0dc541" + integrity sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog== "@coral-xyz/anchor-30@npm:@coral-xyz/anchor@0.30.1": version "0.30.1" @@ -138,7 +136,7 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@grpc/grpc-js@1.12.6", "@grpc/grpc-js@^1.8.0", "@grpc/grpc-js@^1.8.13": +"@grpc/grpc-js@1.12.6": version "1.12.6" resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.12.6.tgz#a3586ffdfb6a1f5cd5b4866dec9074c4a1e65472" integrity sha512-JXUj6PI0oqqzTGvKtzOkxtpsyPRNsrmhh41TtIz/zEB6J+AUiZZ0dxWzcMwO9Ns5rmSPuMdghlTbUuqIM48d3Q== @@ -146,10 +144,18 @@ "@grpc/proto-loader" "^0.7.13" "@js-sdsl/ordered-map" "^4.4.2" +"@grpc/grpc-js@^1.8.0", "@grpc/grpc-js@^1.8.13": + version "1.13.3" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.13.3.tgz#6ad08d186c2a8651697085f790c5c68eaca45904" + integrity sha512-FTXHdOoPbZrBjlVLHuKbDZnsTxXv2BlHF57xw6LuThXacXvtkahEPED0CKMk6obZDf65Hv4k3z62eyPNpvinIg== + dependencies: + "@grpc/proto-loader" "^0.7.13" + "@js-sdsl/ordered-map" "^4.4.2" + "@grpc/proto-loader@^0.7.13": - version "0.7.13" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" - integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== + version "0.7.15" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.15.tgz#4cdfbf35a35461fc843abe8b9e2c0770b5095e60" + integrity sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ== dependencies: lodash.camelcase "^4.3.0" long "^5.0.0" @@ -266,21 +272,21 @@ spok "^1.4.3" "@noble/curves@^1.0.0", "@noble/curves@^1.4.0", "@noble/curves@^1.4.2": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.8.1.tgz#19bc3970e205c99e4bdb1c64a4785706bce497ff" - integrity sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ== + version "1.9.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.9.0.tgz#13e0ca8be4a0ce66c113693a94514e5599f40cfc" + integrity sha512-7YDlXiNMdO1YZeH6t/kvopHHbIZzlxrCV9WLqCY6QhcXOoXiNCMDqJIglZ9Yjx5+w7Dz30TITFrlTjnRg7sKEg== dependencies: - "@noble/hashes" "1.7.1" + "@noble/hashes" "1.8.0" "@noble/ed25519@^1.7.1": - version "1.7.3" - resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123" - integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== + version "1.7.5" + resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.5.tgz#94df8bdb9fec9c4644a56007eecb57b0e9fbd0d7" + integrity sha512-xuS0nwRMQBvSxDa7UxMb61xTiH3MxTgUfhyPUALVIe0FlOAz4sjELwyDRyUvqeEYfRSG9qNjFIycqLZppg4RSA== -"@noble/hashes@1.7.1", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.1.tgz#5738f6d765710921e7a751e00c20ae091ed8db0f" - integrity sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ== +"@noble/hashes@1.8.0", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" + integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -520,6 +526,13 @@ dependencies: "@solana/errors" "2.0.0-rc.1" +"@solana/codecs-core@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.1.0.tgz#79ac28fbcde4a09d88f4360777ceeb30ec14e3f1" + integrity sha512-SR7pKtmJBg2mhmkel2NeHA1pz06QeQXdMv8WJoIR9m8F/hw80K/612uaYbwTt2nkK0jg/Qn/rNSd7EcJ4SBGjw== + dependencies: + "@solana/errors" "2.1.0" + "@solana/codecs-data-structures@2.0.0-preview.4", "@solana/codecs-data-structures@2.0.0-rc.1": version "2.0.0-preview.4" resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.4.tgz#f8a2470982a9792334737ea64000ccbdff287247" @@ -545,6 +558,14 @@ "@solana/codecs-core" "2.0.0-rc.1" "@solana/errors" "2.0.0-rc.1" +"@solana/codecs-numbers@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.1.0.tgz#f6a1a9009ace56238d8d9478dd5d375b09c6342a" + integrity sha512-XMu4yw5iCgQnMKsxSWPPOrGgtaohmupN3eyAtYv3K3C/MJEc5V90h74k5B1GUCiHvcrdUDO9RclNjD9lgbjFag== + dependencies: + "@solana/codecs-core" "2.1.0" + "@solana/errors" "2.1.0" + "@solana/codecs-strings@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz#e1d9167075b8c5b0b60849f8add69c0f24307018" @@ -565,7 +586,7 @@ "@solana/codecs-strings" "2.0.0-rc.1" "@solana/options" "2.0.0-rc.1" -"@solana/errors@2.0.0-preview.4", "@solana/errors@2.0.0-rc.1": +"@solana/errors@2.0.0-preview.4", "@solana/errors@2.0.0-rc.1", "@solana/errors@2.1.0": version "2.0.0-preview.4" resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-preview.4.tgz#056ba76b6dd900dafa70117311bec3aef0f5250b" integrity sha512-kadtlbRv2LCWr8A9V22On15Us7Nn8BvqNaOB4hXsTB3O0fU40D1ru2l+cReqLcRPij4znqlRzW9Xi0m6J5DIhA== @@ -630,9 +651,9 @@ buffer "^6.0.3" "@solana/spl-token@^0.4.0": - version "0.4.12" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.4.12.tgz#09361f9c8116f277b177dbcae7e3a273a19cd48a" - integrity sha512-K6CxzSoO1vC+WBys25zlSDaW0w4UFZO/IvEZquEI35A/PjqXNQHeVigmDCZYEJfESvYarKwsr8tYr/29lPtvaw== + version "0.4.13" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.4.13.tgz#8f65c3c2b315e1a00a91b8d0f60922c6eb71de62" + integrity sha512-cite/pYWQZZVvLbg5lsodSovbetK/eA24gaR0eeUeMuBAMNrT8XFCwaygKy0N2WSg3gSyjjNpIeAGBAKZaY/1w== dependencies: "@solana/buffer-layout" "^4.0.0" "@solana/buffer-layout-utils" "^0.2.0" @@ -662,16 +683,16 @@ superstruct "^1.0.4" "@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.77.3", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.98.0": - version "1.98.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.98.0.tgz#21ecfe8198c10831df6f0cfde7f68370d0405917" - integrity sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA== + version "1.98.2" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.98.2.tgz#45167a5cfb64436944bf4dc1e8be8482bd6d4c14" + integrity sha512-BqVwEG+TaG2yCkBMbD3C4hdpustR4FpuUFRPUmqRZYYlPI9Hg4XMWxHWOWRzHE9Lkc9NDjzXFX7lDXSgzC7R1A== dependencies: "@babel/runtime" "^7.25.0" "@noble/curves" "^1.4.2" "@noble/hashes" "^1.4.0" "@solana/buffer-layout" "^4.0.1" + "@solana/codecs-numbers" "^2.1.0" agentkeepalive "^4.5.0" - bigint-buffer "^1.1.5" bn.js "^5.2.1" borsh "^0.7.0" bs58 "^4.0.1" @@ -704,16 +725,16 @@ superstruct "^0.14.2" "@swc/helpers@^0.5.11": - version "0.5.15" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.15.tgz#79efab344c5819ecf83a43f3f9f811fc84b516d7" - integrity sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g== + version "0.5.17" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.17.tgz#5a7be95ac0f0bf186e7e6e890e7a6f6cda6ce971" + integrity sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A== dependencies: tslib "^2.8.0" -"@switchboard-xyz/common@>=3.0.0": - version "3.0.11" - resolved "https://registry.yarnpkg.com/@switchboard-xyz/common/-/common-3.0.11.tgz#4b2b0397033f240233234f604282219f80a5ad73" - integrity sha512-rRaBjJAvkR1gTGbkoykHLySSr7kjS7UgDpJBOni+0DkFqyh+SwkcxT1RmjhReAMqxZ5qvO88WNGMdF6IKsGXcA== +"@switchboard-xyz/common@3.0.14", "@switchboard-xyz/common@>=3.0.0": + version "3.0.14" + resolved "https://registry.yarnpkg.com/@switchboard-xyz/common/-/common-3.0.14.tgz#5b363995bd0fefa22198286992dbe54f3e544b08" + integrity sha512-LpxzEywO0DjPYIgPzQYkf32C7agwW4YRsPN6BcIvYrw0iJdDMtPZ3SQfIGHLSlD1fwvn2KLUYuGaKegeq4aBTw== dependencies: "@solana/web3.js" "^1.98.0" axios "^1.8.3" @@ -726,10 +747,10 @@ protobufjs "^7.4.0" yaml "^2.6.1" -"@switchboard-xyz/on-demand@2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@switchboard-xyz/on-demand/-/on-demand-2.4.0.tgz#adb5beaa113fcf3729ffa40bc30f7369900817c2" - integrity sha512-TtBw4CceI44NIWLJzHKTRdSqgIHr34UxUxRhp0r0P7Y1peIXgeJpmzx2Na18dH2XjcsTRcN/5U9Kdfm5bdf0+A== +"@switchboard-xyz/on-demand@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@switchboard-xyz/on-demand/-/on-demand-2.4.1.tgz#3db64b0596d9daa0b010ee44193d5512e0ba512d" + integrity sha512-eSlBp+c8lxpcSgh0/2xK8OaLHPziTSZlcs8V96gZGdiCJz1KgWJRNE1qnIJDOwaGdFecZdwcmajfQRtLRLED3w== dependencies: "@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1" "@isaacs/ttlcache" "^1.4.1" @@ -836,11 +857,11 @@ integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== "@types/node@*", "@types/node@>=13.7.0": - version "22.13.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.8.tgz#57e2450295b33a6518d6fd4f65f47236d3e41d8d" - integrity sha512-G3EfaZS+iOGYWLLRCEAXdWK9my08oHNZ+FHluRiggIYJPOXzhOiDgpVCUHaUvyIC5/fj7C/p637jdzC666AOKQ== + version "22.15.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.3.tgz#b7fb9396a8ec5b5dfb1345d8ac2502060e9af68b" + integrity sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw== dependencies: - undici-types "~6.20.0" + undici-types "~6.21.0" "@types/node@^12.12.54": version "12.20.55" @@ -848,9 +869,9 @@ integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== "@types/node@^18.11.13": - version "18.19.78" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.78.tgz#29f5e7b947840c7aa9050ecac920fe6b1c7646a0" - integrity sha512-m1ilZCTwKLkk9rruBJXFeYN0Bc5SbjirwYX/Td3MqPfioYbgun3IvK/m8dQxMCnrPGZPg1kvXjp3SIekCN/ynw== + version "18.19.87" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.87.tgz#690f000cc51e3c7f48bc00f7e86fac6eb550b709" + integrity sha512-OIAAu6ypnVZHmsHCeJ+7CCSub38QNBS9uceMQeg7K5Ur0Jr+wG9wEOEvvMbhp09pxD5czIUy/jND7s7Tb6Nw7A== dependencies: undici-types "~5.26.4" @@ -872,9 +893,9 @@ "@types/node" "*" "@types/ws@^8.2.2": - version "8.5.14" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.14.tgz#93d44b268c9127d96026cf44353725dd9b6c3c21" - integrity sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw== + version "8.18.1" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.18.1.tgz#48464e4bf2ddfd17db13d845467f6070ffea4aa9" + integrity sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg== dependencies: "@types/node" "*" @@ -959,14 +980,6 @@ "@typescript-eslint/types" "4.28.0" eslint-visitor-keys "^2.0.0" -JSONStream@^1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" - integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -985,9 +998,9 @@ acorn@^7.4.0: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.11.0, acorn@^8.4.1: - version "8.14.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" - integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + version "8.14.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb" + integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== agentkeepalive@^4.2.1, agentkeepalive@^4.3.0, agentkeepalive@^4.5.0: version "4.6.0" @@ -1119,9 +1132,9 @@ available-typed-arrays@^1.0.7: possible-typed-array-names "^1.0.0" axios@^1.8.3: - version "1.8.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.8.4.tgz#78990bb4bc63d2cae072952d374835950a82f447" - integrity sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw== + version "1.9.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.9.0.tgz#25534e3b72b54540077d33046f77e3b8d7081901" + integrity sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -1133,21 +1146,21 @@ balanced-match@^1.0.0: integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base-x@^3.0.2, base-x@^3.0.6: - version "3.0.10" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.10.tgz#62de58653f8762b5d6f8d9fe30fa75f7b2585a75" - integrity sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ== + version "3.0.11" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.11.tgz#40d80e2a1aeacba29792ccc6c5354806421287ff" + integrity sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA== dependencies: safe-buffer "^5.0.1" base-x@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a" - integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw== + version "4.0.1" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.1.tgz#817fb7b57143c501f649805cb247617ad016a885" + integrity sha512-uAZ8x6r6S3aUM9rbHGVOIsR15U/ZSc82b3ymnCPsT45Gk1DDvhDPdIgB5MrhirZWt+5K0EEPQH985kNqZgNPFw== base-x@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-5.0.0.tgz#6d835ceae379130e1a4cb846a70ac4746f28ea9b" - integrity sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ== + version "5.0.1" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-5.0.1.tgz#16bf35254be1df8aca15e36b7c1dda74b2aa6b03" + integrity sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg== base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" @@ -1167,9 +1180,9 @@ bigint-buffer@^1.1.5: bindings "^1.3.0" bignumber.js@^9.0.1: - version "9.1.2" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" - integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== + version "9.3.0" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.3.0.tgz#bdba7e2a4c1a2eba08290e8dcad4f36393c92acd" + integrity sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA== binary-extensions@^2.0.0: version "2.3.0" @@ -1184,9 +1197,9 @@ bindings@^1.3.0: file-uri-to-path "1.0.0" bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + version "5.2.2" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.2.tgz#82c09f9ebbb17107cd72cb7fd39bd1f9d0aaa566" + integrity sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw== borsh@^0.7.0: version "0.7.0" @@ -1283,13 +1296,13 @@ call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.7, call-bind@^1.0.8: get-intrinsic "^1.2.4" set-function-length "^1.2.2" -call-bound@^1.0.2, call-bound@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.3.tgz#41cfd032b593e39176a71533ab4f384aa04fd681" - integrity sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA== +call-bound@^1.0.2, call-bound@^1.0.3, call-bound@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== dependencies: - call-bind-apply-helpers "^1.0.1" - get-intrinsic "^1.2.6" + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" callsites@^3.0.0: version "3.1.0" @@ -1563,9 +1576,9 @@ dotenv@10.0.0: integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== dotenv@^16.0.3: - version "16.4.7" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.7.tgz#0e20c5b82950140aa99be360a8a5f52335f53c26" - integrity sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ== + version "16.5.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.5.0.tgz#092b49f25f808f020050051d1ff258e404c78692" + integrity sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg== dunder-proto@^1.0.1: version "1.0.1" @@ -1928,7 +1941,7 @@ follow-redirects@^1.15.6: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== -for-each@^0.3.3: +for-each@^0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.5.tgz#d650688027826920feeb0af747ee7b9421a41d47" integrity sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg== @@ -1975,7 +1988,7 @@ get-func-name@^2.0.1, get-func-name@^2.0.2: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== -get-intrinsic@^1.2.4, get-intrinsic@^1.2.6: +get-intrinsic@^1.2.4, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -2252,20 +2265,20 @@ isomorphic-ws@^4.0.1: integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== jayson@^4.0.0, jayson@^4.1.0, jayson@^4.1.1: - version "4.1.3" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.3.tgz#db9be2e4287d9fef4fc05b5fe367abe792c2eee8" - integrity sha512-LtXh5aYZodBZ9Fc3j6f2w+MTNcnxteMOrb+QgIouguGOulWi0lieEkOUg+HkjjFs0DGoWDds6bi4E9hpNFLulQ== + version "4.2.0" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.2.0.tgz#b71762393fa40bc9637eaf734ca6f40d3b8c0c93" + integrity sha512-VfJ9t1YLwacIubLhONk0KFeosUBwstRWQ0IRT1KDjEjnVnSOVHC3uwugyV7L0c7R9lpVyrUGT2XWiBA1UTtpyg== dependencies: "@types/connect" "^3.4.33" "@types/node" "^12.12.54" "@types/ws" "^7.4.4" - JSONStream "^1.3.5" commander "^2.20.3" delay "^5.0.0" es6-promisify "^5.0.0" eyes "^0.1.8" isomorphic-ws "^4.0.1" json-stringify-safe "^5.0.1" + stream-json "^1.9.1" uuid "^8.3.2" ws "^7.5.10" @@ -2390,11 +2403,6 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== - just-extend@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-6.2.0.tgz#b816abfb3d67ee860482e7401564672558163947" @@ -2461,9 +2469,9 @@ loglevel@^1.9.2: integrity sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg== long@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/long/-/long-5.3.1.tgz#9d4222d3213f38a5ec809674834e0f0ab21abe96" - integrity sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng== + version "5.3.2" + resolved "https://registry.yarnpkg.com/long/-/long-5.3.2.tgz#1d84463095999262d7d7b7f8bfd4a8cc55167f83" + integrity sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA== loupe@^2.3.6: version "2.3.7" @@ -2719,7 +2727,7 @@ pathval@^1.1.1: resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== -picocolors@^1.0.0: +picocolors@^1.0.0, picocolors@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== @@ -2772,9 +2780,9 @@ progress@^2.0.0: integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== protobufjs@^7.2.5, protobufjs@^7.4.0: - version "7.4.0" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" - integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw== + version "7.5.0" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.0.tgz#a317ad80713e9db43c8e55afa8636a9aa76bb630" + integrity sha512-Z2E/kOY1QjoMlCytmexzYfDm/w5fKAiRwpSzGtdnXW1zC88Z2yXazHHrOtwCzn+7wSxyE8PYM4rvVcMphF9sOA== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -2823,11 +2831,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - regexpp@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" @@ -3068,6 +3071,18 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" +stream-chain@^2.2.5: + version "2.2.5" + resolved "https://registry.yarnpkg.com/stream-chain/-/stream-chain-2.2.5.tgz#b30967e8f14ee033c5b9a19bbe8a2cba90ba0d09" + integrity sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA== + +stream-json@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/stream-json/-/stream-json-1.9.1.tgz#e3fec03e984a503718946c170db7d74556c2a187" + integrity sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw== + dependencies: + stream-chain "^2.2.5" + strict-event-emitter-types@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-event-emitter-types/-/strict-event-emitter-types-2.0.0.tgz#05e15549cb4da1694478a53543e4e2f4abcf277f" @@ -3156,11 +3171,6 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -"through@>=2.2.7 <3": - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -3261,10 +3271,10 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" - integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== +undici-types@~6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" + integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== uri-js@^4.2.2: version "4.4.1" @@ -3320,14 +3330,15 @@ whatwg-url@^5.0.0: webidl-conversions "^3.0.0" which-typed-array@^1.1.16, which-typed-array@^1.1.2: - version "1.1.18" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.18.tgz#df2389ebf3fbb246a71390e90730a9edb6ce17ad" - integrity sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA== + version "1.1.19" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" + integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw== dependencies: available-typed-arrays "^1.0.7" call-bind "^1.0.8" - call-bound "^1.0.3" - for-each "^0.3.3" + call-bound "^1.0.4" + for-each "^0.3.5" + get-proto "^1.0.1" gopd "^1.2.0" has-tostringtag "^1.0.2" @@ -3378,9 +3389,9 @@ y18n@^5.0.5: integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yaml@^2.6.1: - version "2.7.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" - integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== + version "2.7.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.1.tgz#44a247d1b88523855679ac7fa7cda6ed7e135cf6" + integrity sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ== yargs-parser@^20.2.2, yargs-parser@^20.2.9: version "20.2.9" diff --git a/yarn.lock b/yarn.lock index c0bcdac89..302868233 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,48 +9,25 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/helper-validator-identifier@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" - integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== +"@babel/helper-validator-identifier@^7.25.9": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" + integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== "@babel/highlight@^7.10.4": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" - integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6" + integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw== dependencies: - "@babel/helper-validator-identifier" "^7.24.7" + "@babel/helper-validator-identifier" "^7.25.9" chalk "^2.4.2" js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/runtime@^7.10.5", "@babel/runtime@^7.12.5", "@babel/runtime@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.7.tgz#f4f0d5530e8dbdf59b3451b9b3e594b6ba082e12" - integrity sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.15.4": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" - integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.17.2", "@babel/runtime@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e" - integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.25.0": - version "7.26.10" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.10.tgz#a07b4d8fa27af131a633d7b3524db803eb4764c2" - integrity sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw== - dependencies: - regenerator-runtime "^0.14.0" +"@babel/runtime@^7.10.5", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.17.2", "@babel/runtime@^7.25.0": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.1.tgz#9fce313d12c9a77507f264de74626e87fd0dc541" + integrity sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog== "@coral-xyz/anchor-30@npm:@coral-xyz/anchor@0.30.1": version "0.30.1" @@ -152,17 +129,17 @@ strip-json-comments "^3.1.1" "@grpc/grpc-js@^1.8.13": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.11.1.tgz#a92f33e98f1959feffcd1b25a33b113d2c977b70" - integrity sha512-gyt/WayZrVPH2w/UTLansS7F9Nwld472JxxaETamrM8HNlsa+jSLNyKAZmhxI2Me4c3mQHFiS1wWHDY1g1Kthw== + version "1.13.3" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.13.3.tgz#6ad08d186c2a8651697085f790c5c68eaca45904" + integrity sha512-FTXHdOoPbZrBjlVLHuKbDZnsTxXv2BlHF57xw6LuThXacXvtkahEPED0CKMk6obZDf65Hv4k3z62eyPNpvinIg== dependencies: "@grpc/proto-loader" "^0.7.13" "@js-sdsl/ordered-map" "^4.4.2" "@grpc/proto-loader@^0.7.13": - version "0.7.13" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" - integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== + version "0.7.15" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.15.tgz#4cdfbf35a35461fc843abe8b9e2c0770b5095e60" + integrity sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ== dependencies: lodash.camelcase "^4.3.0" long "^5.0.0" @@ -249,33 +226,26 @@ spok "^1.4.3" "@noble/curves@^1.0.0", "@noble/curves@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" - integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== - dependencies: - "@noble/hashes" "1.4.0" - -"@noble/curves@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" - integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== + version "1.9.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.9.0.tgz#13e0ca8be4a0ce66c113693a94514e5599f40cfc" + integrity sha512-7YDlXiNMdO1YZeH6t/kvopHHbIZzlxrCV9WLqCY6QhcXOoXiNCMDqJIglZ9Yjx5+w7Dz30TITFrlTjnRg7sKEg== dependencies: - "@noble/hashes" "1.4.0" + "@noble/hashes" "1.8.0" "@noble/ed25519@^1.7.0", "@noble/ed25519@^1.7.1": - version "1.7.3" - resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123" - integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== + version "1.7.5" + resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.5.tgz#94df8bdb9fec9c4644a56007eecb57b0e9fbd0d7" + integrity sha512-xuS0nwRMQBvSxDa7UxMb61xTiH3MxTgUfhyPUALVIe0FlOAz4sjELwyDRyUvqeEYfRSG9qNjFIycqLZppg4RSA== -"@noble/hashes@1.4.0", "@noble/hashes@^1.1.2", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" - integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== +"@noble/hashes@1.8.0", "@noble/hashes@^1.1.2", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" + integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== "@noble/secp256k1@^1.6.3": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" - integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + version "1.7.2" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.2.tgz#c2c3343e2dce80e15a914d7442147507f8a98e7f" + integrity sha512-/qzwYl5eFLH8OWIecQWM31qld2g1NfjgylK+TNhqtaUKP37Nm+Y+z30Fjhw0Ct8p9yCQEm2N3W/AckdIb3SMcQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -422,9 +392,9 @@ ws "^8.6.0" "@pythnetwork/price-service-sdk@*", "@pythnetwork/price-service-sdk@>=1.6.0": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@pythnetwork/price-service-sdk/-/price-service-sdk-1.7.1.tgz#dbfc8a8c2189f526346c1f79ec3995e89b690700" - integrity sha512-xr2boVXTyv1KUt/c6llUTfbv2jpud99pWlMJbFaHGUBoygQsByuy7WbjIJKZ+0Blg1itLZl0Lp/pJGGg8SdJoQ== + version "1.8.0" + resolved "https://registry.yarnpkg.com/@pythnetwork/price-service-sdk/-/price-service-sdk-1.8.0.tgz#f5f01f654963eb9a0cf12127b4f1a89b60ef008a" + integrity sha512-tFZ1thj3Zja06DzPIX2dEWSi7kIfIyqreoywvw5NQ3Z1pl5OJHQGMEhxt6Li3UCGSp2ooYZS9wl8/8XfrfrNSA== dependencies: bn.js "^5.2.1" @@ -440,9 +410,9 @@ "@solana/web3.js" "^1.90.0" "@pythnetwork/solana-utils@*": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@pythnetwork/solana-utils/-/solana-utils-0.4.2.tgz#3e220eed518c02ad702ebb023488afd7c5649a87" - integrity sha512-hKo7Bcs/kDWA5Fnqhg9zJSB94NMoUDIDjHjSi/uvZOzwizISUQI6oY3LWd2CXzNh4f8djjY2BS5iNHaM4cm8Bw== + version "0.4.4" + resolved "https://registry.yarnpkg.com/@pythnetwork/solana-utils/-/solana-utils-0.4.4.tgz#4134005af1aa6cf8e8cd6e5bf22f6481e15b4858" + integrity sha512-kE+q6kTfoXIaBXAtXKdpsjLlxvME2PQHFf3hxADYr8akV7nbpZc2u5vn6dVNN5qUbH+Pk5R/1VkxdfhoLX3l/w== dependencies: "@coral-xyz/anchor" "^0.29.0" "@solana/web3.js" "^1.90.0" @@ -466,13 +436,6 @@ dependencies: buffer "~6.0.3" -"@solana/codecs-core@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-preview.2.tgz#689784d032fbc1fedbde40bb25d76cdcecf6553b" - integrity sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg== - dependencies: - "@solana/errors" "2.0.0-preview.2" - "@solana/codecs-core@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz#1a2d76b9c7b9e7b7aeb3bd78be81c2ba21e3ce22" @@ -480,14 +443,12 @@ dependencies: "@solana/errors" "2.0.0-rc.1" -"@solana/codecs-data-structures@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz#e82cb1b6d154fa636cd5c8953ff3f32959cc0370" - integrity sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg== +"@solana/codecs-core@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.1.0.tgz#79ac28fbcde4a09d88f4360777ceeb30ec14e3f1" + integrity sha512-SR7pKtmJBg2mhmkel2NeHA1pz06QeQXdMv8WJoIR9m8F/hw80K/612uaYbwTt2nkK0jg/Qn/rNSd7EcJ4SBGjw== dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" - "@solana/errors" "2.0.0-preview.2" + "@solana/errors" "2.1.0" "@solana/codecs-data-structures@2.0.0-rc.1": version "2.0.0-rc.1" @@ -498,14 +459,6 @@ "@solana/codecs-numbers" "2.0.0-rc.1" "@solana/errors" "2.0.0-rc.1" -"@solana/codecs-numbers@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz#56995c27396cd8ee3bae8bd055363891b630bbd0" - integrity sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw== - dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/errors" "2.0.0-preview.2" - "@solana/codecs-numbers@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz#f34978ddf7ea4016af3aaed5f7577c1d9869a614" @@ -514,14 +467,13 @@ "@solana/codecs-core" "2.0.0-rc.1" "@solana/errors" "2.0.0-rc.1" -"@solana/codecs-strings@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz#8bd01a4e48614d5289d72d743c3e81305d445c46" - integrity sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g== +"@solana/codecs-numbers@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.1.0.tgz#f6a1a9009ace56238d8d9478dd5d375b09c6342a" + integrity sha512-XMu4yw5iCgQnMKsxSWPPOrGgtaohmupN3eyAtYv3K3C/MJEc5V90h74k5B1GUCiHvcrdUDO9RclNjD9lgbjFag== dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" - "@solana/errors" "2.0.0-preview.2" + "@solana/codecs-core" "2.1.0" + "@solana/errors" "2.1.0" "@solana/codecs-strings@2.0.0-rc.1": version "2.0.0-rc.1" @@ -532,17 +484,6 @@ "@solana/codecs-numbers" "2.0.0-rc.1" "@solana/errors" "2.0.0-rc.1" -"@solana/codecs@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-preview.2.tgz#d6615fec98f423166fb89409f9a4ad5b74c10935" - integrity sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA== - dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-data-structures" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" - "@solana/codecs-strings" "2.0.0-preview.2" - "@solana/options" "2.0.0-preview.2" - "@solana/codecs@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-rc.1.tgz#146dc5db58bd3c28e04b4c805e6096c2d2a0a875" @@ -554,14 +495,6 @@ "@solana/codecs-strings" "2.0.0-rc.1" "@solana/options" "2.0.0-rc.1" -"@solana/errors@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-preview.2.tgz#e0ea8b008c5c02528d5855bc1903e5e9bbec322e" - integrity sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA== - dependencies: - chalk "^5.3.0" - commander "^12.0.0" - "@solana/errors@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-rc.1.tgz#3882120886eab98a37a595b85f81558861b29d62" @@ -570,13 +503,13 @@ chalk "^5.3.0" commander "^12.1.0" -"@solana/options@2.0.0-preview.2": - version "2.0.0-preview.2" - resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-preview.2.tgz#13ff008bf43a5056ef9a091dc7bb3f39321e867e" - integrity sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w== +"@solana/errors@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.1.0.tgz#1a139965fcb8bec610cc1c6194d53d169f4b5852" + integrity sha512-l+GxAv0Ar4d3c3PlZdA9G++wFYZREEbbRyAFP8+n8HSg0vudCuzogh/13io6hYuUhG/9Ve8ARZNamhV7UScKNw== dependencies: - "@solana/codecs-core" "2.0.0-preview.2" - "@solana/codecs-numbers" "2.0.0-preview.2" + chalk "^5.3.0" + commander "^13.1.0" "@solana/options@2.0.0-rc.1": version "2.0.0-rc.1" @@ -589,37 +522,20 @@ "@solana/codecs-strings" "2.0.0-rc.1" "@solana/errors" "2.0.0-rc.1" -"@solana/spl-token-group@^0.0.7": - version "0.0.7" - resolved "https://registry.yarnpkg.com/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz#83c00f0cd0bda33115468cd28b89d94f8ec1fee4" - integrity sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug== - dependencies: - "@solana/codecs" "2.0.0-rc.1" - -"@solana/spl-token-metadata@0.1.6", "@solana/spl-token-metadata@^0.1.6": +"@solana/spl-token-metadata@^0.1.2": version "0.1.6" resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz#d240947aed6e7318d637238022a7b0981b32ae80" integrity sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA== dependencies: "@solana/codecs" "2.0.0-rc.1" -"@solana/spl-token-metadata@^0.1.2": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.4.tgz#5cdc3b857a8c4a6877df24e24a8648c4132d22ba" - integrity sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ== - dependencies: - "@solana/codecs" "2.0.0-preview.2" - "@solana/spl-type-length-value" "0.1.0" - -"@solana/spl-token@0.4.13": - version "0.4.13" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.4.13.tgz#8f65c3c2b315e1a00a91b8d0f60922c6eb71de62" - integrity sha512-cite/pYWQZZVvLbg5lsodSovbetK/eA24gaR0eeUeMuBAMNrT8XFCwaygKy0N2WSg3gSyjjNpIeAGBAKZaY/1w== +"@solana/spl-token@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.7.tgz#6f027f9ad8e841f792c32e50920d9d2e714fc8da" + integrity sha512-bKGxWTtIw6VDdCBngjtsGlKGLSmiu/8ghSt/IOYJV24BsymRbgq7r12GToeetpxmPaZYLddKwAz7+EwprLfkfg== dependencies: "@solana/buffer-layout" "^4.0.0" "@solana/buffer-layout-utils" "^0.2.0" - "@solana/spl-token-group" "^0.0.7" - "@solana/spl-token-metadata" "^0.1.6" buffer "^6.0.3" "@solana/spl-token@^0.1.6": @@ -644,13 +560,6 @@ "@solana/spl-token-metadata" "^0.1.2" buffer "^6.0.3" -"@solana/spl-type-length-value@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz#b5930cf6c6d8f50c7ff2a70463728a4637a2f26b" - integrity sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA== - dependencies: - buffer "^6.0.3" - "@solana/web3.js@1.73.2": version "1.73.2" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.73.2.tgz#4b30cd402b35733dae3a7d0b638be26a7742b395" @@ -673,59 +582,17 @@ rpc-websockets "^7.5.0" superstruct "^0.14.2" -"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.68.0": - version "1.93.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.93.0.tgz#4b6975020993cec2f6626e4f2bf559ca042df8db" - integrity sha512-suf4VYwWxERz4tKoPpXCRHFRNst7jmcFUaD65kII+zg9urpy5PeeqgLV6G5eWGzcVzA9tZeXOju1A1Y+0ojEVw== - dependencies: - "@babel/runtime" "^7.24.7" - "@noble/curves" "^1.4.0" - "@noble/hashes" "^1.4.0" - "@solana/buffer-layout" "^4.0.1" - agentkeepalive "^4.5.0" - bigint-buffer "^1.1.5" - bn.js "^5.2.1" - borsh "^0.7.0" - bs58 "^4.0.1" - buffer "6.0.3" - fast-stable-stringify "^1.0.0" - jayson "^4.1.0" - node-fetch "^2.7.0" - rpc-websockets "^9.0.0" - superstruct "^1.0.4" - -"@solana/web3.js@^1.90.0": - version "1.95.1" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.95.1.tgz#fcbbaf845309ff7ceb8d3726702799e8c27530e8" - integrity sha512-mRX/AjV6QbiOXpWcy5Rz1ZWEH2lVkwO7T0pcv9t97ACpv3/i3tPiqXwk0JIZgSR3wOSTiT26JfygnJH2ulS6dQ== - dependencies: - "@babel/runtime" "^7.24.8" - "@noble/curves" "^1.4.2" - "@noble/hashes" "^1.4.0" - "@solana/buffer-layout" "^4.0.1" - agentkeepalive "^4.5.0" - bigint-buffer "^1.1.5" - bn.js "^5.2.1" - borsh "^0.7.0" - bs58 "^4.0.1" - buffer "6.0.3" - fast-stable-stringify "^1.0.0" - jayson "^4.1.1" - node-fetch "^2.7.0" - rpc-websockets "^9.0.2" - superstruct "^2.0.2" - -"@solana/web3.js@^1.95.8": - version "1.98.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.98.0.tgz#21ecfe8198c10831df6f0cfde7f68370d0405917" - integrity sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA== +"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.98.0": + version "1.98.2" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.98.2.tgz#45167a5cfb64436944bf4dc1e8be8482bd6d4c14" + integrity sha512-BqVwEG+TaG2yCkBMbD3C4hdpustR4FpuUFRPUmqRZYYlPI9Hg4XMWxHWOWRzHE9Lkc9NDjzXFX7lDXSgzC7R1A== dependencies: "@babel/runtime" "^7.25.0" "@noble/curves" "^1.4.2" "@noble/hashes" "^1.4.0" "@solana/buffer-layout" "^4.0.1" + "@solana/codecs-numbers" "^2.1.0" agentkeepalive "^4.5.0" - bigint-buffer "^1.1.5" bn.js "^5.2.1" borsh "^0.7.0" bs58 "^4.0.1" @@ -758,39 +625,37 @@ superstruct "^0.14.2" "@swc/helpers@^0.5.11": - version "0.5.11" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.11.tgz#5bab8c660a6e23c13b2d23fcd1ee44a2db1b0cb7" - integrity sha512-YNlnKRWF2sVojTpIyzwou9XoTNbzbzONwRhOoniEioF1AtaitTvVZblaQRrAzChWQ1bLYyYSWzM18y4WwgzJ+A== + version "0.5.17" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.17.tgz#5a7be95ac0f0bf186e7e6e890e7a6f6cda6ce971" + integrity sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A== dependencies: - tslib "^2.4.0" + tslib "^2.8.0" -"@switchboard-xyz/common@^3": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@switchboard-xyz/common/-/common-3.0.6.tgz#9702471002b5faccb1f4f2a50d193624ff6191c1" - integrity sha512-HbG1kVBVbJ8KFxdAMVSOeeL7hxL7eCrS4jXFoKDNoPzdDVQrNGbr7yuQe9SqW+jvUt43P5D0Xnv0i4YOBHaZLQ== +"@switchboard-xyz/common@3.0.14", "@switchboard-xyz/common@>=3.0.0": + version "3.0.14" + resolved "https://registry.yarnpkg.com/@switchboard-xyz/common/-/common-3.0.14.tgz#5b363995bd0fefa22198286992dbe54f3e544b08" + integrity sha512-LpxzEywO0DjPYIgPzQYkf32C7agwW4YRsPN6BcIvYrw0iJdDMtPZ3SQfIGHLSlD1fwvn2KLUYuGaKegeq4aBTw== dependencies: - "@solana/web3.js" "^1.95.8" - axios "^1.7.8" + "@solana/web3.js" "^1.98.0" + axios "^1.8.3" big.js "^6.2.2" bn.js "^5.2.1" bs58 "^6.0.0" buffer "^6.0.3" - cron-validator "^1.3.1" decimal.js "^10.4.3" js-sha256 "^0.11.0" - lodash "^4.17.21" protobufjs "^7.4.0" yaml "^2.6.1" -"@switchboard-xyz/on-demand@2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@switchboard-xyz/on-demand/-/on-demand-2.3.2.tgz#78dca1eced8b8cda0863c605447700d96f927ca6" - integrity sha512-oFkkjIsJGfY64rEFtJpk4oqEK/ELlVRRy/WrpdgDW3HWXLMZSP13rjuG/0BkJMqI5xXDDEwI/AMgpXhH0XEJTQ== +"@switchboard-xyz/on-demand@2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@switchboard-xyz/on-demand/-/on-demand-2.4.1.tgz#3db64b0596d9daa0b010ee44193d5512e0ba512d" + integrity sha512-eSlBp+c8lxpcSgh0/2xK8OaLHPziTSZlcs8V96gZGdiCJz1KgWJRNE1qnIJDOwaGdFecZdwcmajfQRtLRLED3w== dependencies: "@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1" "@isaacs/ttlcache" "^1.4.1" - "@switchboard-xyz/common" "^3" - axios "^1.8.1" + "@switchboard-xyz/common" ">=3.0.0" + axios "^1.8.3" bs58 "^6.0.0" buffer "^6.0.3" js-yaml "^4.1.0" @@ -824,19 +689,12 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.3.tgz#bbeb55fbc73f28ea6de601fbfa4613f58d785323" integrity sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw== -"@types/node@*": - version "20.14.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.7.tgz#342cada27f97509eb8eb2dbc003edf21ce8ab5a8" - integrity sha512-uTr2m2IbJJucF3KUxgnGOZvYbN0QgkGyWxG6973HCpMYFy2KfcgYuIwkJQMQkt1VbBMlvWRbpshFTLxnxCZjKQ== +"@types/node@*", "@types/node@>=13.7.0": + version "22.15.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.3.tgz#b7fb9396a8ec5b5dfb1345d8ac2502060e9af68b" + integrity sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw== dependencies: - undici-types "~5.26.4" - -"@types/node@>=13.7.0": - version "20.14.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.12.tgz#129d7c3a822cb49fc7ff661235f19cfefd422b49" - integrity sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ== - dependencies: - undici-types "~5.26.4" + undici-types "~6.21.0" "@types/node@^12.12.54": version "12.20.55" @@ -844,9 +702,9 @@ integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== "@types/node@^18.11.13": - version "18.19.38" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.38.tgz#cf4f04c1dab1fcaaa514ec789cf5125184c8c5d8" - integrity sha512-SApYXUF7si4JJ+lO2o6X60OPOnA6wPpbiB09GMCkQ+JAwpa9hxUVG8p7GzA08TKQn5OhzK57rj1wFj+185YsGg== + version "18.19.87" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.87.tgz#690f000cc51e3c7f48bc00f7e86fac6eb550b709" + integrity sha512-OIAAu6ypnVZHmsHCeJ+7CCSub38QNBS9uceMQeg7K5Ur0Jr+wG9wEOEvvMbhp09pxD5czIUy/jND7s7Tb6Nw7A== dependencies: undici-types "~5.26.4" @@ -862,17 +720,10 @@ dependencies: "@types/node" "*" -"@types/ws@^8.2.2": - version "8.5.10" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.10.tgz#4acfb517970853fa6574a3a6886791d04a396787" - integrity sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A== - dependencies: - "@types/node" "*" - -"@types/ws@^8.5.3": - version "8.5.13" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.13.tgz#6414c280875e2691d0d1e080b05addbf5cb91e20" - integrity sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA== +"@types/ws@^8.2.2", "@types/ws@^8.5.3": + version "8.18.1" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.18.1.tgz#48464e4bf2ddfd17db13d845467f6070ffea4aa9" + integrity sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg== dependencies: "@types/node" "*" @@ -965,9 +816,9 @@ acorn@^7.4.0: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== agentkeepalive@^4.2.1, agentkeepalive@^4.3.0, agentkeepalive@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" - integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== + version "4.6.0" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.6.0.tgz#35f73e94b3f40bf65f105219c623ad19c136ea6a" + integrity sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ== dependencies: humanize-ms "^1.2.1" @@ -982,14 +833,14 @@ ajv@^6.10.0, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.16.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4" - integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw== + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== dependencies: fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" json-schema-traverse "^1.0.0" require-from-string "^2.0.2" - uri-js "^4.4.1" anchor-bankrun@0.3.0: version "0.3.0" @@ -1083,19 +934,10 @@ axios-retry@^3.8.0: "@babel/runtime" "^7.15.4" is-retry-allowed "^2.2.0" -axios@^1.5.1: - version "1.7.7" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.7.tgz#2f554296f9892a72ac8d8e4c5b79c14a91d0a47f" - integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q== - dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^1.7.8, axios@^1.8.1: - version "1.8.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.8.3.tgz#9ebccd71c98651d547162a018a1a95a4b4ed4de8" - integrity sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A== +axios@^1.5.1, axios@^1.8.3: + version "1.9.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.9.0.tgz#25534e3b72b54540077d33046f77e3b8d7081901" + integrity sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -1107,16 +949,16 @@ balanced-match@^1.0.0: integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base-x@^3.0.2: - version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + version "3.0.11" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.11.tgz#40d80e2a1aeacba29792ccc6c5354806421287ff" + integrity sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA== dependencies: safe-buffer "^5.0.1" base-x@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a" - integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw== + version "4.0.1" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.1.tgz#817fb7b57143c501f649805cb247617ad016a885" + integrity sha512-uAZ8x6r6S3aUM9rbHGVOIsR15U/ZSc82b3ymnCPsT45Gk1DDvhDPdIgB5MrhirZWt+5K0EEPQH985kNqZgNPFw== base-x@^5.0.0: version "5.0.1" @@ -1141,9 +983,9 @@ bigint-buffer@^1.1.5: bindings "^1.3.0" bignumber.js@^9.0.1: - version "9.1.2" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" - integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== + version "9.3.0" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.3.0.tgz#bdba7e2a4c1a2eba08290e8dcad4f36393c92acd" + integrity sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA== bindings@^1.3.0: version "1.5.0" @@ -1158,9 +1000,9 @@ bluebird@^3.5.1: integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + version "5.2.2" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.2.tgz#82c09f9ebbb17107cd72cb7fd39bd1f9d0aaa566" + integrity sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw== borsh@^0.7.0: version "0.7.0" @@ -1236,22 +1078,37 @@ buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3, buffer@~6.0.3: ieee754 "^1.2.1" bufferutil@^4.0.1: - version "4.0.8" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.8.tgz#1de6a71092d65d7766c4d8a522b261a6e787e8ea" - integrity sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw== + version "4.0.9" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.9.tgz#6e81739ad48a95cad45a279588e13e95e24a800a" + integrity sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw== dependencies: node-gyp-build "^4.3.0" -call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" - integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== +call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== dependencies: - es-define-property "^1.0.0" es-errors "^1.3.0" function-bind "^1.1.2" + +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.7, call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== + dependencies: + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" get-intrinsic "^1.2.4" - set-function-length "^1.2.1" + set-function-length "^1.2.2" + +call-bound@^1.0.2, call-bound@^1.0.3, call-bound@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== + dependencies: + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" callsites@^3.0.0: version "3.1.0" @@ -1295,7 +1152,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0: +chalk@^4.0.0, chalk@~4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1304,9 +1161,9 @@ chalk@^4.0.0: supports-color "^7.1.0" chalk@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" - integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + version "5.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" + integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== check-error@^1.0.3: version "1.0.3" @@ -1355,21 +1212,21 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^12.0.0, commander@^12.1.0: +commander@^12.1.0: version "12.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== +commander@^13.1.0: + version "13.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-13.1.0.tgz#776167db68c78f38dcce1f9b8d7b8b9a488abf46" + integrity sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw== + commander@^2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" - integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== - commander@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" @@ -1380,22 +1237,17 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -cron-validator@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/cron-validator/-/cron-validator-1.3.1.tgz#8f2fe430f92140df77f91178ae31fc1e3a48a20e" - integrity sha512-C1HsxuPCY/5opR55G5/WNzyEGDWFVG+6GLrA+fW/sCTcP6A6NTjUP2AK7B8n2PyFs90kDG2qzwm8LMheADku6A== - cross-fetch@^3.1.5: - version "3.1.8" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" - integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== + version "3.2.0" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.2.0.tgz#34e9192f53bc757d6614304d9e5e6fb4edb782e3" + integrity sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q== dependencies: - node-fetch "^2.6.12" + node-fetch "^2.7.0" cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -1416,16 +1268,16 @@ csvtojson@2.0.10: strip-bom "^2.0.0" debug@^4.0.1, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4: - version "4.3.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" - integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== dependencies: - ms "2.1.2" + ms "^2.1.3" decimal.js@^10.4.3: - version "10.4.3" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" - integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== + version "10.5.0" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.5.0.tgz#0f371c7cf6c4898ce0afb09836db73cd82010f22" + integrity sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw== deep-eql@^4.1.3: version "4.1.4" @@ -1494,11 +1346,25 @@ dotenv@10.0.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== -dotenv@16.4.5, dotenv@^16.0.3: +dotenv@16.4.5: version "16.4.5" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== +dotenv@^16.0.3: + version "16.5.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.5.0.tgz#092b49f25f808f020050051d1ff258e404c78692" + integrity sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg== + +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -1512,18 +1378,33 @@ enquirer@^2.3.5: ansi-colors "^4.1.1" strip-ansi "^6.0.1" -es-define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" - integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== - dependencies: - get-intrinsic "^1.2.4" +es-define-property@^1.0.0, es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== es-errors@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + es6-promise@^4.0.3: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" @@ -1537,9 +1418,9 @@ es6-promisify@^5.0.0: es6-promise "^4.0.3" escalade@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" - integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-string-regexp@^1.0.5: version "1.0.5" @@ -1656,9 +1537,9 @@ esprima@^4.0.0: integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.4.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" - integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== dependencies: estraverse "^5.1.0" @@ -1710,15 +1591,15 @@ fast-diff@^1.1.2: integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== fast-glob@^3.2.9: - version "3.3.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" - integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== + version "3.3.3" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" + integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.4" + micromatch "^4.0.8" fast-json-stable-stringify@^2.0.0: version "2.1.0" @@ -1735,10 +1616,15 @@ fast-stable-stringify@^1.0.0: resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag== +fast-uri@^3.0.1: + version "3.0.6" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" + integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== + fastq@^1.6.0: - version "1.17.1" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" - integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== + version "1.19.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.19.1.tgz#d50eaba803c8846a883c16492821ebcd2cda55f5" + integrity sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ== dependencies: reusify "^1.0.4" @@ -1762,13 +1648,13 @@ fill-range@^7.1.1: to-regex-range "^5.0.1" find-process@^1.4.7: - version "1.4.7" - resolved "https://registry.yarnpkg.com/find-process/-/find-process-1.4.7.tgz#8c76962259216c381ef1099371465b5b439ea121" - integrity sha512-/U4CYp1214Xrp3u3Fqr9yNynUrr5Le4y0SsJh2lMDDSbpwYSz3M2SMWQC+wqcx79cN8PQtHQIL8KnuY9M66fdg== + version "1.4.10" + resolved "https://registry.yarnpkg.com/find-process/-/find-process-1.4.10.tgz#006af3349d8debdb9fb79fb1e859959350307c02" + integrity sha512-ncYFnWEIwL7PzmrK1yZtaccN8GhethD37RzBHG6iOZoFYB4vSmLLXfeWJjeN5nMvCJMjOtBvBBF8OgxEcikiZg== dependencies: - chalk "^4.0.0" - commander "^5.1.0" - debug "^4.1.1" + chalk "~4.1.2" + commander "^12.1.0" + loglevel "^1.9.2" find@^0.3.0: version "0.3.0" @@ -1787,29 +1673,30 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" - integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== + version "3.3.3" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" + integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== follow-redirects@^1.15.6: - version "1.15.6" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== -for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== +for-each@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.5.tgz#d650688027826920feeb0af747ee7b9421a41d47" + integrity sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg== dependencies: - is-callable "^1.1.3" + is-callable "^1.2.7" form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + version "4.0.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c" + integrity sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" mime-types "^2.1.12" fs.realpath@^1.0.0: @@ -1837,16 +1724,29 @@ get-func-name@^2.0.1, get-func-name@^2.0.2: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== -get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" - integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== +get-intrinsic@^1.2.4, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" es-errors "^1.3.0" + es-object-atoms "^1.1.1" function-bind "^1.1.2" - has-proto "^1.0.1" - has-symbols "^1.0.3" - hasown "^2.0.0" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + +get-proto@^1.0.0, get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" glob-parent@^5.1.2: version "5.1.2" @@ -1886,12 +1786,10 @@ globby@^11.0.3: merge2 "^1.4.1" slash "^3.0.0" -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" +gopd@^1.0.1, gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== has-flag@^3.0.0: version "3.0.0" @@ -1910,24 +1808,19 @@ has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: dependencies: es-define-property "^1.0.0" -has-proto@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" - integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== - -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== -has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: +has-tostringtag@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== dependencies: has-symbols "^1.0.3" -hasown@^2.0.0: +hasown@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== @@ -1957,14 +1850,14 @@ ignore@^4.0.6: integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== ignore@^5.1.8, ignore@^5.2.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" - integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + version "3.3.1" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf" + integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" @@ -1988,14 +1881,14 @@ inherits@2, inherits@^2.0.3: integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-arguments@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.2.0.tgz#ad58c6aecf563b78ef2bf04df540da8f5d7d8e1b" + integrity sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA== dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" + call-bound "^1.0.2" + has-tostringtag "^1.0.2" -is-callable@^1.1.3: +is-callable@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== @@ -2011,11 +1904,14 @@ is-fullwidth-code-point@^3.0.0: integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-generator-function@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.1.0.tgz#bf3eeda931201394f57b5dba2800f91a238309ca" + integrity sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ== dependencies: - has-tostringtag "^1.0.0" + call-bound "^1.0.3" + get-proto "^1.0.0" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.3" @@ -2037,17 +1933,27 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-regex@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.2.1.tgz#76d70a3ed10ef9be48eb577887d74205bf0cad22" + integrity sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g== + dependencies: + call-bound "^1.0.2" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + is-retry-allowed@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz#88f34cbd236e043e71b6932d09b0c65fb7b4d71d" integrity sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg== is-typed-array@^1.1.3: - version "1.1.13" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" - integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== + version "1.1.15" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.15.tgz#4bfb4a45b61cee83a5a46fba778e4e8d59c0ce0b" + integrity sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== dependencies: - which-typed-array "^1.1.14" + which-typed-array "^1.1.16" is-utf8@^0.2.0: version "0.2.1" @@ -2083,42 +1989,24 @@ jayson@^3.4.4: uuid "^8.3.2" ws "^7.4.5" -jayson@^4.0.0, jayson@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.1.tgz#282ff13d3cea09776db684b7eeca98c47b2fa99a" - integrity sha512-5ZWm4Q/0DHPyeMfAsrwViwUS2DMVsQgWh8bEEIVTkfb3DzHZ2L3G5WUnF+AKmGjjM9r1uAv73SaqC1/U4RL45w== +jayson@^4.0.0, jayson@^4.1.0, jayson@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.2.0.tgz#b71762393fa40bc9637eaf734ca6f40d3b8c0c93" + integrity sha512-VfJ9t1YLwacIubLhONk0KFeosUBwstRWQ0IRT1KDjEjnVnSOVHC3uwugyV7L0c7R9lpVyrUGT2XWiBA1UTtpyg== dependencies: "@types/connect" "^3.4.33" "@types/node" "^12.12.54" "@types/ws" "^7.4.4" - JSONStream "^1.3.5" commander "^2.20.3" delay "^5.0.0" es6-promisify "^5.0.0" eyes "^0.1.8" isomorphic-ws "^4.0.1" json-stringify-safe "^5.0.1" + stream-json "^1.9.1" uuid "^8.3.2" ws "^7.5.10" -jayson@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.0.tgz#60dc946a85197317f2b1439d672a8b0a99cea2f9" - integrity sha512-R6JlbyLN53Mjku329XoRT2zJAE6ZgOQ8f91ucYdMCD4nkGCF9kZSrcGXpHIU4jeKj58zUZke2p+cdQchU7Ly7A== - dependencies: - "@types/connect" "^3.4.33" - "@types/node" "^12.12.54" - "@types/ws" "^7.4.4" - JSONStream "^1.3.5" - commander "^2.20.3" - delay "^5.0.0" - es6-promisify "^5.0.0" - eyes "^0.1.8" - isomorphic-ws "^4.0.1" - json-stringify-safe "^5.0.1" - uuid "^8.3.2" - ws "^7.4.5" - jito-ts@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/jito-ts/-/jito-ts-3.0.1.tgz#24126389896e042c26d303c4e802064b249ed27e" @@ -2198,9 +2086,9 @@ json2csv@5.0.7: lodash.get "^4.4.2" jsonc-parser@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" - integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== + version "3.3.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.3.1.tgz#f2a524b4f7fd11e3d791e559977ad60b98b798b4" + integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ== jsonparse@^1.2.0, jsonparse@^1.3.1: version "1.3.1" @@ -2247,15 +2135,20 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3: +lodash@^4.17.20, lodash@^4.17.3: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +loglevel@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.9.2.tgz#c2e028d6c757720107df4e64508530db6621ba08" + integrity sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg== + long@^5.0.0: - version "5.2.3" - resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" - integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== + version "5.3.2" + resolved "https://registry.yarnpkg.com/long/-/long-5.3.2.tgz#1d84463095999262d7d7b7f8bfd4a8cc55167f83" + integrity sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA== loupe@^2.3.6: version "2.3.7" @@ -2281,15 +2174,20 @@ marked@^4.2.4: resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5" - integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== +micromatch@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" picomatch "^2.3.1" @@ -2320,12 +2218,7 @@ minimatch@^5.1.1: dependencies: brace-expansion "^2.0.1" -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.0.0: +ms@^2.0.0, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -2348,7 +2241,7 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-fetch@2, node-fetch@^2.6.12, node-fetch@^2.6.7, node-fetch@^2.7.0: +node-fetch@2, node-fetch@^2.6.7, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -2356,9 +2249,9 @@ node-fetch@2, node-fetch@^2.6.12, node-fetch@^2.6.7, node-fetch@^2.7.0: whatwg-url "^5.0.0" node-gyp-build@^4.3.0: - version "4.8.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.1.tgz#976d3ad905e71b76086f4f0b0d3637fe79b6cda5" - integrity sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== + version "4.8.4" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.4.tgz#8a70ee85464ae52327772a90d66c6077a900cfc8" + integrity sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ== object-is@^1.1.5: version "1.1.6" @@ -2374,13 +2267,15 @@ object-keys@^1.1.1: integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object.assign@^4.1.4: - version "4.1.5" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" - integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== + version "4.1.7" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.7.tgz#8c14ca1a424c6a561b0bb2a22f66f5049a945d3d" + integrity sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw== dependencies: - call-bind "^1.0.5" + call-bind "^1.0.8" + call-bound "^1.0.3" define-properties "^1.2.1" - has-symbols "^1.0.3" + es-object-atoms "^1.0.0" + has-symbols "^1.1.0" object-keys "^1.1.1" once@^1.3.0: @@ -2435,9 +2330,9 @@ pathval@^1.1.1: integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== picocolors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" - integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== picomatch@^2.3.1: version "2.3.1" @@ -2445,9 +2340,9 @@ picomatch@^2.3.1: integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== possible-typed-array-names@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" - integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + version "1.1.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz#93e3582bc0e5426586d9d07b79ee40fc841de4ae" + integrity sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg== prelude-ls@^1.2.1: version "1.2.1" @@ -2476,28 +2371,10 @@ progress@^2.0.0: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -protobufjs@^7.2.5: - version "7.3.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.3.2.tgz#60f3b7624968868f6f739430cfbc8c9370e26df4" - integrity sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/node" ">=13.7.0" - long "^5.0.0" - -protobufjs@^7.4.0: - version "7.4.0" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" - integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw== +protobufjs@^7.2.5, protobufjs@^7.4.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.0.tgz#a317ad80713e9db43c8e55afa8636a9aa76bb630" + integrity sha512-Z2E/kOY1QjoMlCytmexzYfDm/w5fKAiRwpSzGtdnXW1zC88Z2yXazHHrOtwCzn+7wSxyE8PYM4rvVcMphF9sOA== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -2527,11 +2404,6 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - regexpp@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" @@ -2553,9 +2425,9 @@ resolve-from@^4.0.0: integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + version "1.1.0" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" + integrity sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw== rimraf@^3.0.2: version "3.0.2" @@ -2589,10 +2461,10 @@ rpc-websockets@^7.5.0, rpc-websockets@^7.5.1: bufferutil "^4.0.1" utf-8-validate "^5.0.2" -rpc-websockets@^9.0.0, rpc-websockets@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.0.2.tgz#4c1568d00b8100f997379a363478f41f8f4b242c" - integrity sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw== +rpc-websockets@^9.0.2: + version "9.1.1" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.1.1.tgz#5764336f3623ee1c5cc8653b7335183e3c0c78bd" + integrity sha512-1IXGM/TfPT6nfYMIXkJdzn+L4JEsmb0FL1O2OBjaH03V3yuUDdKFulGLMFG6ErV+8pZ5HVC0limve01RyO+saA== dependencies: "@swc/helpers" "^0.5.11" "@types/uuid" "^8.3.4" @@ -2617,12 +2489,21 @@ safe-buffer@^5.0.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-regex-test@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.1.0.tgz#7f87dfb67a3150782eaaf18583ff5d1711ac10c1" + integrity sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + is-regex "^1.2.1" + semver@^7.2.1, semver@^7.3.5, semver@^7.3.7: - version "7.6.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" - integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== + version "7.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== -set-function-length@^1.2.1: +set-function-length@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== @@ -2729,6 +2610,18 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== +stream-chain@^2.2.5: + version "2.2.5" + resolved "https://registry.yarnpkg.com/stream-chain/-/stream-chain-2.2.5.tgz#b30967e8f14ee033c5b9a19bbe8a2cba90ba0d09" + integrity sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA== + +stream-json@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/stream-json/-/stream-json-1.9.1.tgz#e3fec03e984a503718946c170db7d74556c2a187" + integrity sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw== + dependencies: + stream-chain "^2.2.5" + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -2775,7 +2668,7 @@ superstruct@^0.15.4: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== -superstruct@^1.0.3, superstruct@^1.0.4: +superstruct@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.4.tgz#0adb99a7578bd2f1c526220da6571b2d485d91ca" integrity sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ== @@ -2800,9 +2693,9 @@ supports-color@^7.1.0: has-flag "^4.0.0" table@^6.0.9: - version "6.8.2" - resolved "https://registry.yarnpkg.com/table/-/table-6.8.2.tgz#c5504ccf201213fa227248bdc8c5569716ac6c58" - integrity sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA== + version "6.9.0" + resolved "https://registry.yarnpkg.com/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" + integrity sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A== dependencies: ajv "^8.0.1" lodash.truncate "^4.4.2" @@ -2862,10 +2755,10 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.4.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" - integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== +tslib@^2.0.3, tslib@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== tsutils@^3.21.0: version "3.21.0" @@ -2882,9 +2775,9 @@ type-check@^0.4.0, type-check@~0.4.0: prelude-ls "^1.2.1" type-detect@^4.0.0, type-detect@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + version "4.1.0" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" + integrity sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== type-fest@^0.20.2: version "0.20.2" @@ -2911,7 +2804,12 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -uri-js@^4.2.2, uri-js@^4.4.1: +undici-types@~6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" + integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== + +uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== @@ -2969,15 +2867,17 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which-typed-array@^1.1.14, which-typed-array@^1.1.2: - version "1.1.15" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" - integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA== +which-typed-array@^1.1.16, which-typed-array@^1.1.2: + version "1.1.19" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" + integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw== dependencies: available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" + call-bind "^1.0.8" + call-bound "^1.0.4" + for-each "^0.3.5" + get-proto "^1.0.1" + gopd "^1.2.0" has-tostringtag "^1.0.2" which@^2.0.1: @@ -3011,15 +2911,10 @@ ws@^7.4.5, ws@^7.5.10: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== -ws@^8.5.0: - version "8.17.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" - integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== - -ws@^8.6.0: - version "8.18.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" - integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== +ws@^8.5.0, ws@^8.6.0: + version "8.18.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.1.tgz#ea131d3784e1dfdff91adb0a4a116b127515e3cb" + integrity sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w== y18n@^5.0.5: version "5.0.8" @@ -3027,9 +2922,9 @@ y18n@^5.0.5: integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yaml@^2.6.1: - version "2.7.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" - integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== + version "2.7.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.1.tgz#44a247d1b88523855679ac7fa7cda6ed7e135cf6" + integrity sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ== yargs-parser@^21.1.1: version "21.1.1" From 1c24027928a3be497bc41720bbd5b757db16b24c Mon Sep 17 00:00:00 2001 From: moosecat Date: Fri, 2 May 2025 15:50:57 -0700 Subject: [PATCH 42/50] add passthrough account logic (#1602) * add passthrough account logic * cant read yet * fix all zc alignment issues * make oracle source a u8 on zc struct --- programs/drift/src/instructions/admin.rs | 151 +++++++++++++- programs/drift/src/instructions/keeper.rs | 63 +++++- programs/drift/src/instructions/lp_pool.rs | 64 +++--- programs/drift/src/lib.rs | 20 +- programs/drift/src/math/oracle.rs | 24 +-- programs/drift/src/state/lp_pool.rs | 9 +- programs/drift/src/state/oracle.rs | 51 +++++ programs/drift/src/state/perp_market.rs | 96 +++++++++ sdk/src/addresses/pda.ts | 7 + sdk/src/adminClient.ts | 92 ++++++++- sdk/src/driftClient.ts | 57 +++-- sdk/src/idl/drift.json | 230 ++++++++++++++++++++- sdk/src/types.ts | 16 ++ tests/lpPool.ts | 17 ++ 14 files changed, 817 insertions(+), 80 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 59a43808b..ac4352921 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -57,9 +57,10 @@ use crate::state::oracle::{ use crate::state::oracle_map::OracleMap; use crate::state::paused_operations::{InsuranceFundOperation, PerpOperation, SpotOperation}; use crate::state::perp_market::{ - ContractTier, ContractType, InsuranceClaim, MarketStatus, PerpMarket, PoolBalance, AMM, + AmmCache, CacheInfo, ContractTier, ContractType, InsuranceClaim, MarketStatus, PerpMarket, + PoolBalance, AMM, AMM_POSITIONS_CACHE, }; -use crate::state::perp_market_map::get_writable_perp_market_set; +use crate::state::perp_market_map::{get_writable_perp_market_set, MarketSet}; use crate::state::protected_maker_mode_config::ProtectedMakerModeConfig; use crate::state::pyth_lazer_oracle::{PythLazerOracle, PYTH_LAZER_ORACLE_SEED}; use crate::state::spot_market::{ @@ -1055,6 +1056,22 @@ pub fn handle_initialize_perp_market( safe_increment!(state.number_of_markets, 1); + let amm_cache = &mut ctx.accounts.amm_cache; + let current_len = amm_cache.cache.len(); + amm_cache + .cache + .resize_with(current_len + 1, CacheInfo::default); + let current_market_info = amm_cache.cache.get_mut(current_len).unwrap(); + current_market_info.slot = clock_slot; + + current_market_info.oracle = perp_market.amm.oracle; + current_market_info.oracle_source = u8::from(perp_market.amm.oracle_source); + current_market_info.last_oracle_price_twap = perp_market + .amm + .historical_oracle_data + .last_oracle_price_twap; + amm_cache.validate(state)?; + controller::amm::update_concentration_coef(perp_market, concentration_coef_scale)?; crate::dlog!(oracle_price); @@ -1070,6 +1087,48 @@ pub fn handle_initialize_perp_market( Ok(()) } +pub fn handle_initialize_amm_cache(ctx: Context) -> Result<()> { + let amm_cache = &mut ctx.accounts.amm_cache; + let state = &ctx.accounts.state; + amm_cache + .cache + .resize_with(state.number_of_markets as usize, CacheInfo::default); + + Ok(()) +} + +pub fn handle_update_init_amm_cache_info<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateInitAmmCacheInfo<'info>>, +) -> Result<()> { + let amm_cache = &mut ctx.accounts.amm_cache; + + let AccountMaps { + perp_market_map, + spot_market_map: _, + oracle_map: _, + } = load_maps( + &mut ctx.remaining_accounts.iter().peekable(), + &MarketSet::new(), + &MarketSet::new(), + Clock::get()?.slot, + None, + )?; + + for (_, perp_market_loader) in perp_market_map.0 { + let perp_market = perp_market_loader.load()?; + let market_index = perp_market.market_index as usize; + let cache = amm_cache.cache.get_mut(market_index).unwrap(); + cache.oracle = perp_market.amm.oracle; + cache.oracle_source = u8::from(perp_market.amm.oracle_source); + cache.last_oracle_price_twap = perp_market + .amm + .historical_oracle_data + .last_oracle_price_twap; + } + + Ok(()) +} + #[access_control( perp_market_valid(&ctx.accounts.perp_market) )] @@ -3128,10 +3187,11 @@ pub fn handle_update_perp_market_paused_operations( perp_market_valid(&ctx.accounts.perp_market) )] pub fn handle_update_perp_market_contract_tier( - ctx: Context, + ctx: Context, contract_tier: ContractTier, ) -> Result<()> { let perp_market = &mut load_mut!(ctx.accounts.perp_market)?; + let amm_cache = &mut ctx.accounts.amm_cache; msg!("perp market {}", perp_market.market_index); msg!( @@ -3141,6 +3201,14 @@ pub fn handle_update_perp_market_contract_tier( ); perp_market.contract_tier = contract_tier; + let max_confidence_interval_multiplier = + perp_market.get_max_confidence_interval_multiplier()?; + amm_cache + .cache + .get_mut(perp_market.market_index as usize) + .expect("value should exist for market index") + .max_confidence_interval_multiplier = max_confidence_interval_multiplier; + Ok(()) } @@ -3488,6 +3556,7 @@ pub fn handle_update_perp_market_oracle( skip_invariant_check: bool, ) -> Result<()> { let perp_market = &mut load_mut!(ctx.accounts.perp_market)?; + let amm_cache = &mut ctx.accounts.amm_cache; msg!("perp market {}", perp_market.market_index); let clock = Clock::get()?; @@ -3566,6 +3635,14 @@ pub fn handle_update_perp_market_oracle( perp_market.amm.oracle = oracle; perp_market.amm.oracle_source = oracle_source; + let amm_position_cache_info = amm_cache + .cache + .get_mut(perp_market.market_index as usize) + .expect("value should exist for market index"); + + amm_position_cache_info.oracle = oracle; + amm_position_cache_info.oracle_source = u8::from(oracle_source); + Ok(()) } @@ -4890,12 +4967,57 @@ pub struct InitializePerpMarket<'info> { payer = admin )] pub perp_market: AccountLoader<'info, PerpMarket>, + #[account( + mut, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + bump, + realloc = AmmCache::space(amm_cache.cache.len() + 1 as usize), + realloc::payer = admin, + realloc::zero = false, + )] + pub amm_cache: Box>, /// CHECK: checked in `initialize_perp_market` pub oracle: AccountInfo<'info>, pub rent: Sysvar<'info, Rent>, pub system_program: Program<'info, System>, } +#[derive(Accounts)] +pub struct InitializeAmmCache<'info> { + #[account( + mut, + constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin + )] + pub admin: Signer<'info>, + pub state: Box>, + #[account( + init, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + space = AmmCache::space(state.number_of_markets as usize), + bump, + payer = admin + )] + pub amm_cache: Box>, + pub rent: Sysvar<'info, Rent>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct UpdateInitAmmCacheInfo<'info> { + #[account( + mut, + constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin + )] + pub state: Box>, + pub admin: Signer<'info>, + #[account( + mut, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + bump, + )] + pub amm_cache: Box>, +} + #[derive(Accounts)] pub struct DeleteInitializedPerpMarket<'info> { #[account(mut)] @@ -4920,6 +5042,23 @@ pub struct AdminUpdatePerpMarket<'info> { pub perp_market: AccountLoader<'info, PerpMarket>, } +#[derive(Accounts)] +pub struct AdminUpdatePerpMarketContractTier<'info> { + pub admin: Signer<'info>, + #[account( + has_one = admin + )] + pub state: Box>, + #[account(mut)] + pub perp_market: AccountLoader<'info, PerpMarket>, + #[account( + mut, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + bump, + )] + pub amm_cache: Box>, +} + #[derive(Accounts)] pub struct AdminUpdatePerpMarketAmmSummaryStats<'info> { #[account( @@ -5087,6 +5226,12 @@ pub struct AdminUpdatePerpMarketOracle<'info> { pub oracle: AccountInfo<'info>, /// CHECK: checked in `admin_update_perp_market_oracle` ix constraint pub old_oracle: AccountInfo<'info>, + #[account( + mut, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + bump, + )] + pub amm_cache: Box>, } #[derive(Accounts)] diff --git a/programs/drift/src/instructions/keeper.rs b/programs/drift/src/instructions/keeper.rs index 6bf530986..3e709767a 100644 --- a/programs/drift/src/instructions/keeper.rs +++ b/programs/drift/src/instructions/keeper.rs @@ -40,8 +40,10 @@ use crate::state::fulfillment_params::serum::SerumFulfillmentParams; use crate::state::high_leverage_mode_config::HighLeverageModeConfig; use crate::state::insurance_fund_stake::InsuranceFundStake; use crate::state::oracle_map::OracleMap; -use crate::state::order_params::{OrderParams, PlaceOrderOptions, SignedMsgOrderParamsMessage}; +use crate::state::order_params::{OrderParams, PlaceOrderOptions}; use crate::state::paused_operations::{PerpOperation, SpotOperation}; +use crate::state::perp_market::CacheInfo; +use crate::state::perp_market::AMM_POSITIONS_CACHE; use crate::state::perp_market::{ContractType, MarketStatus, PerpMarket}; use crate::state::perp_market_map::{ get_market_set_for_spot_positions, get_market_set_for_user_positions, get_market_set_from_list, @@ -62,6 +64,8 @@ use crate::state::user::{ MarginMode, MarketType, OrderStatus, OrderTriggerCondition, OrderType, User, UserStats, }; use crate::state::user_map::{load_user_map, load_user_maps, UserMap, UserStatsMap}; +use crate::state::zero_copy::AccountZeroCopyMut; +use crate::state::zero_copy::ZeroCopyLoader; use crate::validation::sig_verification::verify_and_decode_ed25519_msg; use crate::validation::user::{validate_user_deletion, validate_user_is_idle}; use crate::{ @@ -2911,6 +2915,63 @@ pub fn handle_pause_spot_market_deposit_withdraw( Ok(()) } +pub fn handle_update_amm_cache<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateAmmCache<'info>>, +) -> Result<()> { + let remaining_accounts_iter = &mut ctx.remaining_accounts.iter().peekable(); + let mut amm_cache: AccountZeroCopyMut<'_, CacheInfo, _> = + ctx.accounts.amm_cache.load_zc_mut()?; + let AccountMaps { + perp_market_map, + spot_market_map: _, + mut oracle_map, + } = load_maps( + remaining_accounts_iter, + &MarketSet::new(), + &MarketSet::new(), + Clock::get()?.slot, + None, + )?; + let slot = Clock::get()?.slot; + + for (_, perp_market_loader) in perp_market_map.0.iter() { + let perp_market = perp_market_loader.load()?; + let cached_info = amm_cache.get_mut(perp_market.market_index as u32); + cached_info.position = perp_market.amm.get_protocol_owned_position()?; + cached_info.slot = slot; + cached_info.last_oracle_price_twap = perp_market + .amm + .historical_oracle_data + .last_oracle_price_twap; + + validate!( + perp_market.oracle_id() == cached_info.oracle_id()?, + ErrorCode::DefaultError, + "oracle id mismatch between amm cache and perp market" + )?; + + let oracle_data = oracle_map.get_price_data(&perp_market.oracle_id())?; + cached_info.oracle_price = oracle_data.price; + cached_info.oracle_delay = oracle_data.delay; + cached_info.oracle_confidence = oracle_data.confidence; + } + + Ok(()) +} + +#[derive(Accounts)] +pub struct UpdateAmmCache<'info> { + #[account(mut)] + pub keeper: Signer<'info>, + #[account( + mut, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + bump, + )] + /// CHECK: checked in AmmCacheZeroCopy checks + pub amm_cache: AccountInfo<'info>, +} + #[derive(Accounts)] pub struct FillOrder<'info> { pub state: Box>, diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 43caa7dca..f4d8cae33 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -4,11 +4,8 @@ use crate::{ error::ErrorCode, math::{ casting::Cast, - constants::{ - PRICE_PRECISION_I128, QUOTE_PRECISION, QUOTE_PRECISION_I128, SPOT_BALANCE_PRECISION, - SPOT_WEIGHT_PRECISION_I128, - }, - oracle::{is_oracle_valid_for_action, DriftAction}, + constants::PRICE_PRECISION_I128, + oracle::{is_oracle_valid_for_action, oracle_validity, DriftAction}, safe_math::SafeMath, }, msg, @@ -18,6 +15,8 @@ use crate::{ AmmConstituentDatum, AmmConstituentMappingFixed, LPPool, WeightValidationFlags, CONSTITUENT_PDA_SEED, }, + oracle::OraclePriceData, + perp_market::{AmmCacheFixed, CacheInfo, AMM_POSITIONS_CACHE}, perp_market_map::MarketSet, state::State, user::MarketType, @@ -38,6 +37,9 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( let state = &ctx.accounts.state; let mut constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc_mut()?; + let amm_cache: AccountZeroCopy<'_, CacheInfo, AmmCacheFixed> = + ctx.accounts.amm_cache.load_zc()?; + let num_constituents = constituent_target_weights.len(); let exists_invalid_constituent_index = constituent_indexes .iter() @@ -57,36 +59,29 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( AmmConstituentMappingFixed, > = ctx.accounts.amm_constituent_mapping.load_zc()?; - let AccountMaps { - perp_market_map, - spot_market_map: _, - mut oracle_map, - } = load_maps( - &mut ctx.remaining_accounts.iter().peekable(), - &MarketSet::new(), - &MarketSet::new(), - slot, - Some(state.oracle_guard_rails), - )?; - let mut amm_inventories: Vec<(u16, i64)> = vec![]; let mut oracle_prices: Vec = vec![]; for (_, datum) in amm_constituent_mapping.iter().enumerate() { - let perp_market = perp_market_map.get_ref(&datum.perp_market_index)?; + let cache_info = amm_cache.get(datum.perp_market_index as u32); - let oracle_data = oracle_map.get_price_data_and_validity( + let oracle_validity = oracle_validity( MarketType::Perp, datum.perp_market_index, - &perp_market.oracle_id(), - perp_market - .amm - .historical_oracle_data - .last_oracle_price_twap, - perp_market.get_max_confidence_interval_multiplier()?, + cache_info.last_oracle_price_twap, + &OraclePriceData { + price: cache_info.oracle_price, + confidence: cache_info.oracle_confidence, + delay: cache_info.oracle_delay, + has_sufficient_number_of_data_points: true, + }, + &state.oracle_guard_rails.validity, + cache_info.max_confidence_interval_multiplier, + &cache_info.get_oracle_source()?, + true, )?; if !is_oracle_valid_for_action( - oracle_data.1, + oracle_validity, Some(DriftAction::UpdateDlpConstituentTargetWeights), )? { msg!("Oracle data for perp market {} and constituent index {} is invalid. Skipping update", @@ -94,9 +89,13 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( continue; } - let amm_inventory = perp_market.amm.get_protocol_owned_position()?; - amm_inventories.push((datum.perp_market_index, amm_inventory)); - oracle_prices.push(oracle_data.0.price); + amm_inventories.push((datum.perp_market_index, cache_info.position)); + oracle_prices.push(cache_info.oracle_price); + } + + if amm_inventories.is_empty() { + msg!("No valid inventories found for constituent target weights update"); + return Ok(()); } constituent_target_weights.update_target_weights( @@ -264,6 +263,13 @@ pub struct UpdateConstituentTargetWeights<'info> { )] /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks pub constituent_target_weights: AccountInfo<'info>, + #[account( + mut, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + bump, + )] + /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks + pub amm_cache: AccountInfo<'info>, #[account( seeds = [b"lp_pool", lp_pool_name.as_ref()], bump, diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index cab39b503..738b766b2 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -970,6 +970,18 @@ pub mod drift { ) } + pub fn initialize_amm_cache<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, InitializeAmmCache<'info>>, + ) -> Result<()> { + handle_initialize_amm_cache(ctx) + } + + pub fn update_init_amm_cache_info<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateInitAmmCacheInfo<'info>>, + ) -> Result<()> { + handle_update_init_amm_cache_info(ctx) + } + pub fn initialize_prediction_market<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, AdminUpdatePerpMarket<'info>>, ) -> Result<()> { @@ -1290,7 +1302,7 @@ pub mod drift { } pub fn update_perp_market_contract_tier( - ctx: Context, + ctx: Context, contract_tier: ContractTier, ) -> Result<()> { handle_update_perp_market_contract_tier(ctx, contract_tier) @@ -1762,6 +1774,12 @@ pub mod drift { ) -> Result<()> { handle_update_lp_pool_aum(ctx) } + + pub fn update_amm_cache<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateAmmCache<'info>>, + ) -> Result<()> { + handle_update_amm_cache(ctx) + } } #[cfg(not(feature = "no-entrypoint"))] diff --git a/programs/drift/src/math/oracle.rs b/programs/drift/src/math/oracle.rs index 3e4d67487..07e8337ea 100644 --- a/programs/drift/src/math/oracle.rs +++ b/programs/drift/src/math/oracle.rs @@ -227,7 +227,17 @@ pub fn oracle_validity( .. } = *oracle_price_data; - let is_oracle_price_nonpositive = oracle_price <= 0; + if oracle_price <= 0 { + // Return early so we dont panic with math errors later + if log_validity { + crate::msg!( + "Invalid {} {} Oracle: Non-positive (oracle_price <=0)", + market_type, + market_index + ); + } + return Ok(OracleValidity::NonPositive); + } let is_oracle_price_too_volatile = (oracle_price.max(last_oracle_twap)) .safe_div(last_oracle_twap.min(oracle_price).max(1))? @@ -255,9 +265,7 @@ pub fn oracle_validity( oracle_delay.gt(&valid_oracle_guard_rails.slots_before_stale_for_margin) }; - let oracle_validity = if is_oracle_price_nonpositive { - OracleValidity::NonPositive - } else if is_oracle_price_too_volatile { + let oracle_validity = if is_oracle_price_too_volatile { OracleValidity::TooVolatile } else if is_conf_too_large { OracleValidity::TooUncertain @@ -280,14 +288,6 @@ pub fn oracle_validity( ); } - if is_oracle_price_nonpositive { - crate::msg!( - "Invalid {} {} Oracle: Non-positive (oracle_price <=0)", - market_type, - market_index - ); - } - if is_oracle_price_too_volatile { crate::msg!( "Invalid {} {} Oracle: Too Volatile (last_oracle_price_twap={:?} vs oracle_price={:?})", diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index e94399173..660696157 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,7 +1,7 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; use crate::math::constants::{ - PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64, PRICE_PRECISION, PRICE_PRECISION_I64, + PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64, }; use crate::math::safe_math::SafeMath; use crate::math::spot_balance::get_token_amount; @@ -376,8 +376,8 @@ pub struct AmmConstituentDatum { #[derive(Debug, Default)] #[repr(C)] pub struct AmmConstituentMappingFixed { - pub len: u32, pub _pad: [u8; 4], + pub len: u32, } impl HasLen for AmmConstituentMappingFixed { @@ -390,6 +390,7 @@ impl HasLen for AmmConstituentMappingFixed { #[derive(Debug)] #[repr(C)] pub struct AmmConstituentMapping { + _padding: [u8; 4], // PERCENTAGE_PRECISION. Each datum represents the target weight for a single (AMM, Constituent) pair. // An AMM may be partially backed by multiple Constituents pub weights: Vec, @@ -430,8 +431,8 @@ pub struct WeightDatum { #[repr(C)] pub struct ConstituentTargetWeightsFixed { /// total elements in the flattened `data` vec + _pad: [u8; 4], pub len: u32, - pub _pad: [u8; 4], } impl HasLen for ConstituentTargetWeightsFixed { @@ -444,6 +445,7 @@ impl HasLen for ConstituentTargetWeightsFixed { #[derive(Debug)] #[repr(C)] pub struct ConstituentTargetWeights { + _padding: [u8; 4], // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async pub weights: Vec, } @@ -473,6 +475,7 @@ impl_zero_copy_loader!( impl Default for ConstituentTargetWeights { fn default() -> Self { ConstituentTargetWeights { + _padding: [0; 4], weights: Vec::with_capacity(0), } } diff --git a/programs/drift/src/state/oracle.rs b/programs/drift/src/state/oracle.rs index b1b328dba..bb4e02463 100644 --- a/programs/drift/src/state/oracle.rs +++ b/programs/drift/src/state/oracle.rs @@ -1,5 +1,7 @@ use anchor_lang::prelude::*; +use bytemuck::{Pod, Zeroable}; use std::cell::Ref; +use std::convert::TryFrom; use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; @@ -169,6 +171,55 @@ impl OracleSource { } } +impl TryFrom for OracleSource { + type Error = ErrorCode; + + fn try_from(v: u8) -> DriftResult { + match v { + 0 => Ok(OracleSource::Pyth), + 1 => Ok(OracleSource::Switchboard), + 2 => Ok(OracleSource::QuoteAsset), + 3 => Ok(OracleSource::Pyth1K), + 4 => Ok(OracleSource::Pyth1M), + 5 => Ok(OracleSource::PythStableCoin), + 6 => Ok(OracleSource::Prelaunch), + 7 => Ok(OracleSource::PythPull), + 8 => Ok(OracleSource::Pyth1KPull), + 9 => Ok(OracleSource::Pyth1MPull), + 10 => Ok(OracleSource::PythStableCoinPull), + 11 => Ok(OracleSource::SwitchboardOnDemand), + 12 => Ok(OracleSource::PythLazer), + 13 => Ok(OracleSource::PythLazer1K), + 14 => Ok(OracleSource::PythLazer1M), + 15 => Ok(OracleSource::PythLazerStableCoin), + _ => Err(ErrorCode::InvalidOracle), + } + } +} + +impl From for u8 { + fn from(src: OracleSource) -> u8 { + match src { + OracleSource::Pyth => 0, + OracleSource::Switchboard => 1, + OracleSource::QuoteAsset => 2, + OracleSource::Pyth1K => 3, + OracleSource::Pyth1M => 4, + OracleSource::PythStableCoin => 5, + OracleSource::Prelaunch => 6, + OracleSource::PythPull => 7, + OracleSource::Pyth1KPull => 8, + OracleSource::Pyth1MPull => 9, + OracleSource::PythStableCoinPull => 10, + OracleSource::SwitchboardOnDemand => 11, + OracleSource::PythLazer => 12, + OracleSource::PythLazer1K => 13, + OracleSource::PythLazer1M => 14, + OracleSource::PythLazerStableCoin => 15, + } + } +} + #[derive(Default, Clone, Copy, Debug)] pub struct OraclePriceData { pub price: i64, diff --git a/programs/drift/src/state/perp_market.rs b/programs/drift/src/state/perp_market.rs index 867127535..27acc8ca4 100644 --- a/programs/drift/src/state/perp_market.rs +++ b/programs/drift/src/state/perp_market.rs @@ -1,8 +1,10 @@ use crate::state::pyth_lazer_oracle::PythLazerOracle; +use crate::{impl_zero_copy_loader, validate}; use anchor_lang::prelude::*; use crate::state::state::State; use std::cmp::max; +use std::convert::TryFrom; use crate::controller::position::{PositionDelta, PositionDirection}; use crate::error::{DriftResult, ErrorCode}; @@ -42,8 +44,10 @@ use crate::state::paused_operations::PerpOperation; use drift_macros::assert_no_slop; use static_assertions::const_assert_eq; +use super::oracle::OraclePriceData; use super::oracle_map::OracleIdentifier; use super::protected_maker_mode_config::ProtectedMakerParams; +use super::zero_copy::HasLen; #[cfg(test)] mod tests; @@ -1669,3 +1673,95 @@ impl AMM { } } } + +pub const AMM_POSITIONS_CACHE: &str = "amm_positions_cache"; + +#[account] +#[derive(Debug)] +#[repr(C)] +pub struct AmmCache { + _padding: [u8; 4], + pub cache: Vec, +} + +#[zero_copy] +#[derive(AnchorSerialize, AnchorDeserialize, Debug)] +#[repr(C)] +pub struct CacheInfo { + /// BASE PRECISION + pub position: i64, + pub slot: u64, + pub max_confidence_interval_multiplier: u64, + pub last_oracle_price_twap: i64, + pub oracle_price: i64, + pub oracle_confidence: u64, + pub oracle_delay: i64, + pub oracle_slot: u64, + pub oracle: Pubkey, + pub oracle_source: u8, + _padding: [u8; 7], +} + +impl Size for CacheInfo { + const SIZE: usize = 104; +} + +impl Default for CacheInfo { + fn default() -> Self { + CacheInfo { + position: 0i64, + slot: 0u64, + max_confidence_interval_multiplier: 1u64, + last_oracle_price_twap: 0i64, + oracle_price: 0i64, + oracle_confidence: 0u64, + oracle_delay: 0i64, + oracle_slot: 0u64, + oracle: Pubkey::default(), + oracle_source: 0u8, + _padding: [0u8; 7], + } + } +} + +impl CacheInfo { + pub fn get_oracle_source(&self) -> DriftResult { + Ok(OracleSource::try_from(self.oracle_source)?) + } + + pub fn oracle_id(&self) -> DriftResult { + let oracle_source = self.get_oracle_source()?; + Ok((self.oracle, oracle_source)) + } +} + +#[zero_copy] +#[derive(Default, Debug)] +#[repr(C)] +pub struct AmmCacheFixed { + _pad: [u8; 4], + pub len: u32, +} + +impl HasLen for AmmCacheFixed { + fn len(&self) -> u32 { + self.len + } +} + +impl AmmCache { + pub fn space(num_markets: usize) -> usize { + 8 + 8 + 4 + num_markets * CacheInfo::SIZE + } + + pub fn validate(&self, state: &State) -> DriftResult<()> { + validate!( + self.cache.len() == state.number_of_markets as usize, + ErrorCode::DefaultError, + "Number of amm positions is different than number of markets" + )?; + Ok(()) + } +} + +impl_zero_copy_loader!(AmmCache, crate::id, AmmCacheFixed, CacheInfo); diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index 8c9f30742..17a5ec894 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -448,3 +448,10 @@ export function getConstituentVaultPublicKey( programId )[0]; } + +export function getAmmCachePublicKey(programId: PublicKey): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from(anchor.utils.bytes.utf8.encode('amm_positions_cache'))], + programId + )[0]; +} diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index df32916bf..d2617a157 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -16,6 +16,7 @@ import { AssetTier, SpotFulfillmentConfigStatus, AddAmmConstituentMappingDatum, + TxParams, } from './types'; import { DEFAULT_MARKET_NAME, encodeName } from './userName'; import { BN } from '@coral-xyz/anchor'; @@ -43,6 +44,7 @@ import { getConstituentTargetWeightsPublicKey, getConstituentPublicKey, getConstituentVaultPublicKey, + getAmmCachePublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; import { @@ -485,7 +487,13 @@ export class AdminClient extends DriftClient { ): Promise { const currentPerpMarketIndex = this.getStateAccount().numberOfMarkets; - const initializeMarketIx = await this.getInitializePerpMarketIx( + const ammCachePublicKey = getAmmCachePublicKey(this.program.programId); + const ammCacheAccount = await this.connection.getAccountInfo( + ammCachePublicKey + ); + const mustInitializeAmmCache = ammCacheAccount?.data == null; + + const initializeMarketIxs = await this.getInitializePerpMarketIx( marketIndex, priceOracle, baseAssetReserve, @@ -511,9 +519,10 @@ export class AdminClient extends DriftClient { concentrationCoefScale, curveUpdateIntensity, ammJitIntensity, - name + name, + mustInitializeAmmCache ); - const tx = await this.buildTransaction(initializeMarketIx); + const tx = await this.buildTransaction(initializeMarketIxs); const { txSig } = await this.sendTransaction(tx, [], this.opts); @@ -557,15 +566,21 @@ export class AdminClient extends DriftClient { concentrationCoefScale = ONE, curveUpdateIntensity = 0, ammJitIntensity = 0, - name = DEFAULT_MARKET_NAME - ): Promise { + name = DEFAULT_MARKET_NAME, + includeInitAmmCacheIx = false + ): Promise { const perpMarketPublicKey = await getPerpMarketPublicKey( this.program.programId, marketIndex ); + const ixs: TransactionInstruction[] = []; + if (includeInitAmmCacheIx) { + ixs.push(await this.getInitializeAmmCacheIx()); + } + const nameBuffer = encodeName(name); - return await this.program.instruction.initializePerpMarket( + const initPerpIx = await this.program.instruction.initializePerpMarket( marketIndex, baseAssetReserve, quoteAssetReserve, @@ -599,11 +614,74 @@ export class AdminClient extends DriftClient { : this.wallet.publicKey, oracle: priceOracle, perpMarket: perpMarketPublicKey, + ammCache: getAmmCachePublicKey(this.program.programId), rent: SYSVAR_RENT_PUBKEY, systemProgram: anchor.web3.SystemProgram.programId, }, } ); + ixs.push(initPerpIx); + return ixs; + } + + public async initializeAmmCache( + txParams?: TxParams + ): Promise { + const initializeAmmCacheIx = await this.getInitializeAmmCacheIx(); + + const tx = await this.buildTransaction(initializeAmmCacheIx, txParams); + + const { txSig } = await this.sendTransaction(tx, [], this.opts); + + return txSig; + } + + public async getInitializeAmmCacheIx(): Promise { + return await this.program.instruction.initializeAmmCache({ + accounts: { + state: await this.getStatePublicKey(), + admin: this.isSubscribed + ? this.getStateAccount().admin + : this.wallet.publicKey, + ammCache: getAmmCachePublicKey(this.program.programId), + rent: SYSVAR_RENT_PUBKEY, + systemProgram: anchor.web3.SystemProgram.programId, + }, + }); + } + + public async updateInitAmmCacheInfo( + perpMarketIndexes: number[], + txParams?: TxParams + ): Promise { + const initializeAmmCacheIx = await this.getUpdateInitAmmCacheInfoIx( + perpMarketIndexes + ); + + const tx = await this.buildTransaction(initializeAmmCacheIx, txParams); + + const { txSig } = await this.sendTransaction(tx, [], this.opts); + + return txSig; + } + + public async getUpdateInitAmmCacheInfoIx( + perpMarketIndexes: number[] + ): Promise { + const remainingAccounts = this.getRemainingAccounts({ + userAccounts: [], + readablePerpMarketIndex: perpMarketIndexes, + }); + return await this.program.instruction.updateInitAmmCacheInfo({ + accounts: { + state: await this.getStatePublicKey(), + admin: this.isSubscribed + ? this.getStateAccount().admin + : this.wallet.publicKey, + ammCache: getAmmCachePublicKey(this.program.programId), + }, + remainingAccounts, + }); } public async initializePredictionMarket( @@ -2229,6 +2307,7 @@ export class AdminClient extends DriftClient { ), oracle: oracle, oldOracle: this.getPerpMarketAccount(perpMarketIndex).amm.oracle, + amm_cache: getAmmCachePublicKey(this.program.programId), }, } ); @@ -3039,6 +3118,7 @@ export class AdminClient extends DriftClient { this.program.programId, perpMarketIndex ), + amm_cache: getAmmCachePublicKey(this.program.programId), }, } ); diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index 3fb0a8972..72c0e7951 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -59,7 +59,6 @@ import { ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, AmmConstituentMapping, - AmmConstituentDatum, LPPool, } from './types'; import driftIDL from './idl/drift.json'; @@ -111,6 +110,7 @@ import { getAmmConstituentMappingPublicKey, getLpPoolPublicKey, getConstituentPublicKey, + getAmmCachePublicKey, } from './addresses/pda'; import { DataAndSlot, @@ -9695,8 +9695,7 @@ export class DriftClient { await this.buildTransaction( await this.getUpdateDlpConstituentTargetWeightsIx( lpPoolName, - constituentIndexesToUpdate, - ammConstituentMapping + constituentIndexesToUpdate ), txParams ), @@ -9708,8 +9707,7 @@ export class DriftClient { public async getUpdateDlpConstituentTargetWeightsIx( lpPoolName: number[], - constituentIndexesToUpdate: number[], - ammConstituentMapping: AmmConstituentMapping + constituentIndexesToUpdate: number[] ): Promise { const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); const ammConstituentMappingPublicKey = getAmmConstituentMappingPublicKey( @@ -9721,16 +9719,7 @@ export class DriftClient { lpPool ); - const perpMarketIndexes = ammConstituentMapping.weights - .filter((datum: AmmConstituentDatum) => { - return constituentIndexesToUpdate.includes(datum.constituentIndex); - }) - .map((datum: AmmConstituentDatum) => datum.perpMarketIndex); - - const remainingAccounts = this.getRemainingAccounts({ - readablePerpMarketIndex: perpMarketIndexes, - userAccounts: [], - }); + const ammCache = getAmmCachePublicKey(this.program.programId); return this.program.instruction.updateDlpConstituentTargetWeights( lpPoolName, @@ -9742,8 +9731,8 @@ export class DriftClient { ammConstituentMapping: ammConstituentMappingPublicKey, constituentTargetWeights, state: await this.getStatePublicKey(), + ammCache, }, - remainingAccounts, } ); } @@ -9798,6 +9787,42 @@ export class DriftClient { }); } + public async updateAmmCache( + perpMarketIndexes: number[], + txParams?: TxParams + ): Promise { + const { txSig } = await this.sendTransaction( + await this.buildTransaction( + await this.getUpdateAmmCacheIx(perpMarketIndexes), + txParams + ), + [], + this.opts + ); + return txSig; + } + + public async getUpdateAmmCacheIx( + perpMarketIndexes: number[] + ): Promise { + if (perpMarketIndexes.length > 50) { + throw new Error('Cant update more than 50 markets at once'); + } + + const remainingAccounts = this.getRemainingAccounts({ + userAccounts: [], + readablePerpMarketIndex: perpMarketIndexes, + }); + + return this.program.instruction.updateAmmCache({ + accounts: { + keeper: this.wallet.publicKey, + ammCache: getAmmCachePublicKey(this.program.programId), + }, + remainingAccounts, + }); + } + /** * Below here are the transaction sending functions */ diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 43945ce6d..03ff1ba51 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -4217,6 +4217,11 @@ "isMut": true, "isSigner": false }, + { + "name": "ammCache", + "isMut": true, + "isSigner": false + }, { "name": "oracle", "isMut": false, @@ -4345,6 +4350,58 @@ } ] }, + { + "name": "initializeAmmCache", + "accounts": [ + { + "name": "admin", + "isMut": true, + "isSigner": true + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "ammCache", + "isMut": true, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateInitAmmCacheInfo", + "accounts": [ + { + "name": "state", + "isMut": true, + "isSigner": false + }, + { + "name": "admin", + "isMut": false, + "isSigner": true + }, + { + "name": "ammCache", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, { "name": "initializePredictionMarket", "accounts": [ @@ -5609,6 +5666,11 @@ "name": "perpMarket", "isMut": true, "isSigner": false + }, + { + "name": "ammCache", + "isMut": true, + "isSigner": false } ], "args": [ @@ -6027,6 +6089,11 @@ "name": "oldOracle", "isMut": false, "isSigner": false + }, + { + "name": "ammCache", + "isMut": true, + "isSigner": false } ], "args": [ @@ -7416,6 +7483,11 @@ "isMut": true, "isSigner": false }, + { + "name": "ammCache", + "isMut": true, + "isSigner": false + }, { "name": "lpPool", "isMut": false, @@ -7470,6 +7542,22 @@ } } ] + }, + { + "name": "updateAmmCache", + "accounts": [ + { + "name": "keeper", + "isMut": true, + "isSigner": true + }, + { + "name": "ammCache", + "isMut": true, + "isSigner": false + } + ], + "args": [] } ], "accounts": [ @@ -8010,6 +8098,15 @@ "type": { "kind": "struct", "fields": [ + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + }, { "name": "weights", "type": { @@ -8026,6 +8123,15 @@ "type": { "kind": "struct", "fields": [ + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + }, { "name": "weights", "type": { @@ -8366,6 +8472,31 @@ ] } }, + { + "name": "AmmCache", + "type": { + "kind": "struct", + "fields": [ + { + "name": "padding", + "type": { + "array": [ + "u8", + 4 + ] + } + }, + { + "name": "cache", + "type": { + "vec": { + "defined": "CacheInfo" + } + } + } + ] + } + }, { "name": "ProtectedMakerModeConfig", "type": { @@ -10043,10 +10174,6 @@ "type": { "kind": "struct", "fields": [ - { - "name": "len", - "type": "u32" - }, { "name": "pad", "type": { @@ -10055,6 +10182,10 @@ 4 ] } + }, + { + "name": "len", + "type": "u32" } ] } @@ -10081,20 +10212,20 @@ "kind": "struct", "fields": [ { - "name": "len", + "name": "pad", "docs": [ "total elements in the flattened `data` vec" ], - "type": "u32" - }, - { - "name": "pad", "type": { "array": [ "u8", 4 ] } + }, + { + "name": "len", + "type": "u32" } ] } @@ -11259,6 +11390,87 @@ ] } }, + { + "name": "CacheInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "position", + "docs": [ + "BASE PRECISION" + ], + "type": "i64" + }, + { + "name": "slot", + "type": "u64" + }, + { + "name": "maxConfidenceIntervalMultiplier", + "type": "u64" + }, + { + "name": "lastOraclePriceTwap", + "type": "i64" + }, + { + "name": "oraclePrice", + "type": "i64" + }, + { + "name": "oracleConfidence", + "type": "u64" + }, + { + "name": "oracleDelay", + "type": "i64" + }, + { + "name": "oracleSlot", + "type": "u64" + }, + { + "name": "oracle", + "type": "publicKey" + }, + { + "name": "oracleSource", + "type": "u8" + }, + { + "name": "padding", + "type": { + "array": [ + "u8", + 7 + ] + } + } + ] + } + }, + { + "name": "AmmCacheFixed", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pad", + "type": { + "array": [ + "u8", + 4 + ] + } + }, + { + "name": "len", + "type": "u32" + } + ] + } + }, { "name": "SignedMsgOrderId", "type": { diff --git a/sdk/src/types.ts b/sdk/src/types.ts index 81b88c5a3..eb58c70c8 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1531,3 +1531,19 @@ export type Constituent = { lastOracleSlot: BN; oracleStalenessThreshold: BN; }; + +export type CacheInfo = { + slot: BN; + position: BN; + maxConfidenceIntervalMultiplier: BN; + lastOraclePriceTwap: BN; + oracle: PublicKey; + oracleSource: number; + oraclePrice: BN; + oracleDelay: BN; + oracleConfidence: BN; +}; + +export type AmmCache = { + cache: CacheInfo[]; +}; diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 92a238d6d..d7e4c6e91 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -24,6 +24,8 @@ import { OracleSource, SPOT_MARKET_WEIGHT_PRECISION, SPOT_MARKET_RATE_PRECISION, + getAmmCachePublicKey, + AmmCache, } from '../sdk/src'; import { @@ -469,4 +471,19 @@ describe('LP Pool', () => { assert(ammMapping.weights.find((x) => x.perpMarketIndex == 2) == undefined); assert(ammMapping.weights.length === 2); }); + + it('can crank amm info into the cache', async () => { + let ammCache = (await adminClient.program.account.ammCache.fetch( + getAmmCachePublicKey(program.programId) + )) as AmmCache; + + await adminClient.updateAmmCache([0, 1, 2]); + ammCache = (await adminClient.program.account.ammCache.fetch( + getAmmCachePublicKey(program.programId) + )) as AmmCache; + expect(ammCache).to.not.be.null; + assert(ammCache.cache.length == 3); + assert(ammCache.cache[0].oracle.equals(solUsd)); + assert(ammCache.cache[0].oraclePrice.eq(new BN(224300000))); + }); }); From cb34da4b602d483b616c800a3c54a254bc5cd0d7 Mon Sep 17 00:00:00 2001 From: wphan Date: Fri, 2 May 2025 16:17:00 -0700 Subject: [PATCH 43/50] Wphan/dlp-swap-ixs (#1592) * add lp_swap ix * rebase * test helpers * swap works * fix swaps, add more cargo tests for fees n swap amt * remove console.logs * address PR comments * merge upstream --- programs/drift/src/error.rs | 2 + programs/drift/src/instructions/admin.rs | 4 + programs/drift/src/instructions/lp_pool.rs | 281 ++++++++++++- programs/drift/src/instructions/user.rs | 1 + programs/drift/src/lib.rs | 18 +- programs/drift/src/math/oracle.rs | 7 + programs/drift/src/state/constituent_map.rs | 2 +- programs/drift/src/state/events.rs | 31 ++ programs/drift/src/state/lp_pool.rs | 164 +++++--- programs/drift/src/state/lp_pool/tests.rs | 330 +++++++++++++++ sdk/src/driftClient.ts | 97 ++++- sdk/src/idl/drift.json | 192 ++++++++- sdk/src/types.ts | 8 +- tests/adminDeposit.ts | 222 ++++++++++ tests/lpPool.ts | 8 +- tests/lpPoolSwap.ts | 428 +++++++++++--------- tests/testHelpers.ts | 98 ++++- 17 files changed, 1607 insertions(+), 286 deletions(-) create mode 100644 tests/adminDeposit.ts diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index e576077c8..67d7a96f6 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -651,6 +651,8 @@ pub enum ErrorCode { WrongNumberOfConstituents, #[msg("Oracle too stale for LP AUM update")] OracleTooStaleForLPAUMUpdate, + #[msg("Insufficient constituent token balance")] + InsufficientConstituentTokenBalance, } #[macro_export] diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index ac4352921..9f6daad6f 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4545,13 +4545,17 @@ pub fn handle_initialize_constituent<'info>( .resize_with((current_len + 1) as usize, WeightDatum::default); constituent_target_weights.validate()?; + msg!("initializing constituent {}", lp_pool.constituents); + constituent.spot_market_index = spot_market_index; + constituent.constituent_index = lp_pool.constituents; constituent.decimals = decimals; constituent.max_weight_deviation = max_weight_deviation; constituent.swap_fee_min = swap_fee_min; constituent.swap_fee_max = swap_fee_max; constituent.oracle_staleness_threshold = oracle_staleness_threshold; constituent.pubkey = ctx.accounts.constituent.key(); + constituent.mint = ctx.accounts.spot_market_mint.key(); constituent.constituent_index = (constituent_target_weights.weights.len() - 1) as u16; lp_pool.constituents += 1; diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index f4d8cae33..3e8544e06 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -1,4 +1,5 @@ use anchor_lang::{prelude::*, Accounts, Key, Result}; +use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use crate::{ error::ErrorCode, @@ -12,22 +13,30 @@ use crate::{ state::{ constituent_map::{ConstituentMap, ConstituentSet}, lp_pool::{ - AmmConstituentDatum, AmmConstituentMappingFixed, LPPool, WeightValidationFlags, - CONSTITUENT_PDA_SEED, + AmmConstituentDatum, AmmConstituentMappingFixed, Constituent, LPPool, + WeightValidationFlags, }, oracle::OraclePriceData, perp_market::{AmmCacheFixed, CacheInfo, AMM_POSITIONS_CACHE}, perp_market_map::MarketSet, + spot_market_map::get_writable_spot_market_set_from_many, state::State, user::MarketType, zero_copy::{AccountZeroCopy, ZeroCopyLoader}, + events::LPSwapRecord, }, validate, }; + use solana_program::sysvar::clock::Clock; use super::optional_accounts::{load_maps, AccountMaps}; -use crate::state::lp_pool::{AMM_MAP_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED}; +use crate::controller::spot_balance::update_spot_market_cumulative_interest; +use crate::controller::token::{receive, send_from_program_vault}; +use crate::instructions::constraints::*; +use crate::state::lp_pool::{ + AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, +}; pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetWeights<'info>>, @@ -191,7 +200,6 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( }; if oracle_price.is_none() { - msg!("hi"); return Err(ErrorCode::OracleTooStaleForLPAUMUpdate.into()); } @@ -226,16 +234,214 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( Ok(()) } +#[access_control( + fill_not_paused(&ctx.accounts.state) +)] +pub fn handle_lp_pool_swap<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, LPPoolSwap<'info>>, + in_market_index: u16, + out_market_index: u16, + in_amount: u64, + min_out_amount: u64, +) -> Result<()> { + validate!( + in_market_index != out_market_index, + ErrorCode::InvalidSpotMarketAccount, + "In and out spot market indices cannot be the same" + )?; + + let slot = Clock::get()?.slot; + let now = Clock::get()?.unix_timestamp; + let state = &ctx.accounts.state; + let lp_pool = &ctx.accounts.lp_pool.load()?; + + let mut in_constituent = ctx.accounts.in_constituent.load_mut()?; + let mut out_constituent = ctx.accounts.out_constituent.load_mut()?; + + let constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc()?; + + let AccountMaps { + perp_market_map: _, + spot_market_map, + mut oracle_map, + } = load_maps( + &mut ctx.remaining_accounts.iter().peekable(), + &MarketSet::new(), + &get_writable_spot_market_set_from_many(vec![in_market_index, out_market_index]), + slot, + Some(state.oracle_guard_rails), + )?; + + let mut in_spot_market = spot_market_map.get_ref_mut(&in_market_index)?; + let mut out_spot_market = spot_market_map.get_ref_mut(&out_market_index)?; + + let in_oracle_id = in_spot_market.oracle_id(); + let out_oracle_id = out_spot_market.oracle_id(); + + let (in_oracle, in_oracle_validity) = oracle_map.get_price_data_and_validity( + MarketType::Spot, + in_spot_market.market_index, + &in_oracle_id, + in_spot_market.historical_oracle_data.last_oracle_price_twap, + in_spot_market.get_max_confidence_interval_multiplier()?, + )?; + let in_oracle = in_oracle.clone(); + + let (out_oracle, out_oracle_validity) = oracle_map.get_price_data_and_validity( + MarketType::Spot, + out_spot_market.market_index, + &out_oracle_id, + out_spot_market + .historical_oracle_data + .last_oracle_price_twap, + out_spot_market.get_max_confidence_interval_multiplier()?, + )?; + + if !is_oracle_valid_for_action(in_oracle_validity, Some(DriftAction::LpPoolSwap))? { + msg!( + "In oracle data for spot market {} is invalid for lp pool swap.", + in_spot_market.market_index, + ); + return Err(ErrorCode::InvalidOracle.into()); + } + + if !is_oracle_valid_for_action(out_oracle_validity, Some(DriftAction::LpPoolSwap))? { + msg!( + "Out oracle data for spot market {} is invalid for lp pool swap.", + out_spot_market.market_index, + ); + return Err(ErrorCode::InvalidOracle.into()); + } + + update_spot_market_cumulative_interest(&mut in_spot_market, Some(&in_oracle), now)?; + update_spot_market_cumulative_interest(&mut out_spot_market, Some(&out_oracle), now)?; + + let in_target_weight = + constituent_target_weights.get_target_weight(in_constituent.constituent_index)?; + let out_target_weight = + constituent_target_weights.get_target_weight(out_constituent.constituent_index)?; + + let (in_amount, out_amount, in_fee, out_fee) = lp_pool.get_swap_amount( + &in_oracle, + &out_oracle, + &in_constituent, + &out_constituent, + &in_spot_market, + &out_spot_market, + in_target_weight, + out_target_weight, + in_amount, + )?; + msg!( + "in_amount: {}, out_amount: {}, in_fee: {}, out_fee: {}", + in_amount, + out_amount, + in_fee, + out_fee + ); + let out_amount_net_fees = if out_fee > 0 { + out_amount.safe_sub(out_fee.unsigned_abs() as u64)? + } else { + out_amount.safe_add(out_fee.unsigned_abs() as u64)? + }; + + validate!( + out_amount_net_fees >= min_out_amount, + ErrorCode::SlippageOutsideLimit, + format!( + "Slippage outside limit: out_amount_net_fees({}) < min_out_amount({})", + out_amount_net_fees, min_out_amount + ) + .as_str() + )?; + + validate!( + out_amount_net_fees <= out_constituent.token_balance, + ErrorCode::InsufficientConstituentTokenBalance, + format!( + "Insufficient out constituent balance: out_amount_net_fees({}) > out_constituent.token_balance({})", + out_amount_net_fees, out_constituent.token_balance + ) + .as_str() + )?; + + in_constituent.record_swap_fees(in_fee)?; + out_constituent.record_swap_fees(out_fee)?; + + emit!(LPSwapRecord { + ts: now, + authority: ctx.accounts.authority.key(), + amount_out: out_amount_net_fees, + amount_in: in_amount, + fee_out: out_fee, + fee_in: in_fee, + out_spot_market_index: out_market_index, + in_spot_market_index: in_market_index, + out_constituent_index: out_constituent.constituent_index, + in_constituent_index: in_constituent.constituent_index, + out_oracle_price: out_oracle.price, + in_oracle_price: in_oracle.price, + mint_out: out_constituent.mint, + mint_in: in_constituent.mint, + }); + + receive( + &ctx.accounts.token_program, + &ctx.accounts.user_in_token_account, + &ctx.accounts.constituent_in_token_account, + &ctx.accounts.authority, + in_amount, + &Some((*ctx.accounts.in_market_mint).clone()), + )?; + + send_from_program_vault( + &ctx.accounts.token_program, + &ctx.accounts.constituent_out_token_account, + &ctx.accounts.user_out_token_account, + &ctx.accounts.drift_signer, + state.signer_nonce, + out_amount_net_fees, + &Some((*ctx.accounts.out_market_mint).clone()), + )?; + + ctx.accounts.constituent_in_token_account.reload()?; + ctx.accounts.constituent_out_token_account.reload()?; + + 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(()) +} + #[derive(Accounts)] #[instruction( lp_pool_name: [u8; 32], )] -pub struct UpdateLPPoolAum<'info> { +pub struct UpdateConstituentTargetWeights<'info> { pub state: Box>, #[account(mut)] pub keeper: Signer<'info>, + #[account( + seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] + /// CHECK: checked in AmmConstituentMappingZeroCopy checks + pub amm_constituent_mapping: AccountInfo<'info>, + #[account( + mut, + seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] + /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks + pub constituent_target_weights: AccountInfo<'info>, #[account( mut, + seeds = [AMM_POSITIONS_CACHE.as_ref()], + bump, + )] + /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks + pub amm_cache: AccountInfo<'info>, + #[account( seeds = [b"lp_pool", lp_pool_name.as_ref()], bump, )] @@ -246,16 +452,30 @@ pub struct UpdateLPPoolAum<'info> { #[instruction( lp_pool_name: [u8; 32], )] -pub struct UpdateConstituentTargetWeights<'info> { +pub struct UpdateLPPoolAum<'info> { pub state: Box>, #[account(mut)] pub keeper: Signer<'info>, #[account( - seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + mut, + seeds = [b"lp_pool", lp_pool_name.as_ref()], bump, )] - /// CHECK: checked in AmmConstituentMappingZeroCopy checks - pub amm_constituent_mapping: AccountInfo<'info>, + pub lp_pool: AccountLoader<'info, LPPool>, +} + +/// `in`/`out` is in the program's POV for this swap. So `user_in_token_account` is the user owned token account +/// for the `in` token for this swap. +#[derive(Accounts)] +#[instruction( + in_market_index: u16, + out_market_index: u16, +)] +pub struct LPPoolSwap<'info> { + /// CHECK: forced drift_signer + pub drift_signer: AccountInfo<'info>, + pub state: Box>, + pub lp_pool: AccountLoader<'info, LPPool>, #[account( mut, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], @@ -263,16 +483,49 @@ pub struct UpdateConstituentTargetWeights<'info> { )] /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks pub constituent_target_weights: AccountInfo<'info>, + + #[account(mut)] + pub constituent_in_token_account: Box>, + #[account(mut)] + pub constituent_out_token_account: Box>, + #[account( mut, - seeds = [AMM_POSITIONS_CACHE.as_ref()], + constraint = user_in_token_account.mint.eq(&constituent_in_token_account.mint) + )] + pub user_in_token_account: Box>, + #[account( + mut, + constraint = user_out_token_account.mint.eq(&constituent_out_token_account.mint) + )] + pub user_out_token_account: Box>, + + #[account( + mut, + seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), in_market_index.to_le_bytes().as_ref()], bump, + constraint = in_constituent.load()?.mint.eq(&constituent_in_token_account.mint) )] - /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks - pub amm_cache: AccountInfo<'info>, + pub in_constituent: AccountLoader<'info, Constituent>, #[account( - seeds = [b"lp_pool", lp_pool_name.as_ref()], + mut, + seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), out_market_index.to_le_bytes().as_ref()], bump, + constraint = out_constituent.load()?.mint.eq(&constituent_out_token_account.mint) )] - pub lp_pool: AccountLoader<'info, LPPool>, + pub out_constituent: AccountLoader<'info, Constituent>, + + #[account( + constraint = in_market_mint.key() == in_constituent.load()?.mint, + )] + pub in_market_mint: Box>, + #[account( + constraint = out_market_mint.key() == out_constituent.load()?.mint, + )] + pub out_market_mint: Box>, + + pub authority: Signer<'info>, + + // TODO: in/out token program + pub token_program: Interface<'info, TokenInterface>, } diff --git a/programs/drift/src/instructions/user.rs b/programs/drift/src/instructions/user.rs index 9ae0b462b..59cfc1818 100644 --- a/programs/drift/src/instructions/user.rs +++ b/programs/drift/src/instructions/user.rs @@ -67,6 +67,7 @@ use crate::state::fulfillment_params::openbook_v2::OpenbookV2FulfillmentParams; use crate::state::fulfillment_params::phoenix::PhoenixFulfillmentParams; use crate::state::fulfillment_params::serum::SerumFulfillmentParams; use crate::state::high_leverage_mode_config::HighLeverageModeConfig; +use crate::state::lp_pool::{Constituent, LPPool}; use crate::state::margin_calculation::MarginContext; use crate::state::oracle::StrictOraclePrice; use crate::state::order_params::{ diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 738b766b2..3ad633f2c 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -41,7 +41,7 @@ declare_id!("dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH"); #[program] pub mod drift { use super::*; - use crate::{instruction::UpdateLpPoolAum, state::spot_market::SpotFulfillmentConfigStatus}; + use crate::state::spot_market::SpotFulfillmentConfigStatus; // User Instructions @@ -1780,6 +1780,22 @@ pub mod drift { ) -> Result<()> { handle_update_amm_cache(ctx) } + + pub fn lp_pool_swap<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, LPPoolSwap<'info>>, + in_market_index: u16, + out_market_index: u16, + in_amount: u64, + min_out_amount: u64, + ) -> Result<()> { + handle_lp_pool_swap( + ctx, + in_market_index, + out_market_index, + in_amount, + min_out_amount, + ) + } } #[cfg(not(feature = "no-entrypoint"))] diff --git a/programs/drift/src/math/oracle.rs b/programs/drift/src/math/oracle.rs index 07e8337ea..ba255a85a 100644 --- a/programs/drift/src/math/oracle.rs +++ b/programs/drift/src/math/oracle.rs @@ -71,6 +71,7 @@ pub enum DriftAction { OracleOrderPrice, UpdateDlpConstituentTargetWeights, UpdateLpPoolAum, + LpPoolSwap, } pub fn is_oracle_valid_for_action( @@ -133,6 +134,12 @@ pub fn is_oracle_valid_for_action( DriftAction::UpdateDlpConstituentTargetWeights | DriftAction::UpdateLpPoolAum => { !matches!(oracle_validity, OracleValidity::NonPositive) } + DriftAction::LpPoolSwap => !matches!( + oracle_validity, + OracleValidity::NonPositive + | OracleValidity::StaleForAMM + | OracleValidity::InsufficientDataPoints + ), }, None => { matches!(oracle_validity, OracleValidity::Valid) diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index 8e2300bb9..f79f97e7e 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -29,7 +29,7 @@ impl<'a> ConstituentMap<'a> { None => { let caller = Location::caller(); msg!( - "Could not find costituent {} at {}:{}", + "Could not find constituent {} at {}:{}", constituent_index, caller.file(), caller.line() diff --git a/programs/drift/src/state/events.rs b/programs/drift/src/state/events.rs index aee150991..8497ddcd4 100644 --- a/programs/drift/src/state/events.rs +++ b/programs/drift/src/state/events.rs @@ -672,3 +672,34 @@ pub fn emit_buffers( Ok(()) } + +#[event] +#[derive(Default)] +pub struct LPSwapRecord { + pub ts: i64, + pub authority: Pubkey, + /// precision: out market mint precision, gross fees + pub amount_out: u64, + /// precision: in market mint precision, gross fees + pub amount_in: u64, + /// precision: fee on amount_out, in market mint precision + pub fee_out: i64, + /// precision: fee on amount_in, out market mint precision + pub fee_in: i64, + // out spot market index + pub out_spot_market_index: u16, + // in spot market index + pub in_spot_market_index: u16, + // out constituent index + pub out_constituent_index: u16, + // in constituent index + pub in_constituent_index: u16, + /// precision: PRICE_PRECISION + pub out_oracle_price: i64, + /// precision: PRICE_PRECISION + pub in_oracle_price: i64, + /// out token mint + pub mint_out: Pubkey, + /// in token mint + pub mint_in: Pubkey, +} diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 660696157..f8c70e482 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -7,8 +7,10 @@ use crate::math::safe_math::SafeMath; use crate::math::spot_balance::get_token_amount; use anchor_lang::prelude::*; use anchor_spl::token::Mint; +use anchor_spl::token_interface::TokenAccount; use borsh::{BorshDeserialize, BorshSerialize}; +use super::oracle::OraclePriceData; use super::oracle_map::OracleMap; use super::spot_market::SpotMarket; use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen}; @@ -88,55 +90,39 @@ impl LPPool { } } - /// get the swap price between two (non-LP token) constituents + /// Get the swap price between two (non-LP token) constituents. + /// Accounts for precision differences between in and out constituents /// returns swap price in PRICE_PRECISION pub fn get_swap_price( &self, - oracle_map: &mut OracleMap, - in_spot_market: &SpotMarket, - out_spot_market: &SpotMarket, - in_amount: u64, - ) -> DriftResult { - let in_price = oracle_map - .get_price_data(&(in_spot_market.oracle, in_spot_market.oracle_source)) - .expect("failed to get price data") - .price - .cast::() - .expect("failed to cast price"); - - let out_price = oracle_map - .get_price_data(&(out_spot_market.oracle, out_spot_market.oracle_source)) - .expect("failed to get price data") - .price - .cast::() - .expect("failed to cast price"); - - let (prec_diff_numerator, prec_diff_denominator) = - if out_spot_market.decimals > in_spot_market.decimals { - ( - 10_u64.pow(out_spot_market.decimals as u32 - in_spot_market.decimals as u32), - 1, - ) - } else { - ( - 1, - 10_u64.pow(in_spot_market.decimals as u32 - out_spot_market.decimals as u32), - ) - }; + in_decimals: u32, + out_decimals: u32, + in_oracle: &OraclePriceData, + out_oracle: &OraclePriceData, + ) -> DriftResult<(u64, u64)> { + let in_price = in_oracle.price.cast::()?; + let out_price = out_oracle.price.cast::()?; + + let (prec_diff_numerator, prec_diff_denominator) = if out_decimals > in_decimals { + (10_u64.pow(out_decimals - in_decimals), 1) + } else { + (1, 10_u64.pow(in_decimals - out_decimals)) + }; - let swap_price = in_amount - .safe_mul(in_price)? - .safe_mul(prec_diff_numerator)? - .safe_div(out_price.safe_mul(prec_diff_denominator)?)?; + let swap_price_num = in_price.safe_mul(prec_diff_numerator)?; + let swap_price_denom = out_price.safe_mul(prec_diff_denominator)?; - Ok(swap_price) + Ok((swap_price_num, swap_price_denom)) } - /// - /// Returns the (out_amount, in_fee, out_fee) in the respective token units. Amounts are gross fees. + /// in the respective token units. Amounts are gross fees and in + /// token mint precision. + /// Positive fees are paid, negative fees are rebated + /// Returns (in_amount out_amount, in_fee, out_fee) pub fn get_swap_amount( &self, - oracle_map: &mut OracleMap, + in_oracle: &OraclePriceData, + out_oracle: &OraclePriceData, in_constituent: &Constituent, out_constituent: &Constituent, in_spot_market: &SpotMarket, @@ -145,51 +131,77 @@ impl LPPool { out_target_weight: i64, in_amount: u64, ) -> DriftResult<(u64, u64, i64, i64)> { - let swap_price = - self.get_swap_price(oracle_map, in_spot_market, out_spot_market, in_amount)?; + let (swap_price_num, swap_price_denom) = self.get_swap_price( + in_spot_market.decimals, + out_spot_market.decimals, + in_oracle, + out_oracle, + )?; let in_fee = self.get_swap_fees( - oracle_map, - in_constituent, in_spot_market, - in_amount, + in_oracle, + in_constituent, + in_amount.cast::()?, in_target_weight, )?; + let in_fee_amount = in_amount + .cast::()? + .safe_mul(in_fee)? + .safe_div(PERCENTAGE_PRECISION_I64.cast::()?)?; + let out_amount = in_amount .cast::()? - .safe_sub(in_fee)? - .safe_mul(swap_price.cast::()?)? - .safe_div(PRICE_PRECISION_I64)? + .safe_sub(in_fee_amount)? + .safe_mul(swap_price_num.cast::()?)? + .safe_div(swap_price_denom.cast::()?)? .cast::()?; let out_fee = self.get_swap_fees( - oracle_map, - out_constituent, out_spot_market, - out_amount, + out_oracle, + out_constituent, + out_amount + .cast::()? + .checked_neg() + .ok_or(ErrorCode::MathError.into())?, out_target_weight, )?; - // TODO: additional spot quoter logic can go here - // TODO: emit swap event + msg!("in_fee: {}, out_fee: {}", in_fee, out_fee); + let out_fee_amount = out_amount + .cast::()? + .safe_mul(out_fee)? + .safe_div(PERCENTAGE_PRECISION_I64.cast::()?)?; - Ok((in_amount, out_amount, in_fee, out_fee)) + Ok((in_amount, out_amount, in_fee_amount, out_fee_amount)) } /// returns fee in PERCENTAGE_PRECISION pub fn get_swap_fees( &self, - oracle_map: &mut OracleMap, // might not need oracle_map depending on how accounts are passed in - constituent: &Constituent, spot_market: &SpotMarket, - amount: u64, + oracle: &OraclePriceData, + constituent: &Constituent, + amount: i64, target_weight: i64, ) -> DriftResult { - let price = oracle_map - .get_price_data(&(spot_market.oracle, spot_market.oracle_source)) - .expect("failed to get price data") - .price; + // +4,976 CUs to log weight_before + let weight_before = constituent.get_weight(oracle.price, spot_market, 0, self.last_aum)?; + msg!( + "constituent {}: weight_before: {} target_weight: {}", + constituent.constituent_index, + weight_before, + target_weight + ); + let weight_after = - constituent.get_weight(price, spot_market, amount.cast::()?, self.last_aum)?; + constituent.get_weight(oracle.price, spot_market, amount, self.last_aum)?; + msg!( + "constituent {}: weight_after: {} target_weight: {}", + constituent.constituent_index, + weight_after, + target_weight + ); let fee = constituent.get_fee_to_charge(weight_after, target_weight)?; Ok(fee) @@ -255,7 +267,8 @@ impl BLPosition { pub struct Constituent { /// address of the constituent pub pubkey: Pubkey, - /// underlying drift spot market index + /// underlying drift spot market index. + /// TODO: redundant with spot_balance.market_index pub spot_market_index: u16, /// idx in LPPool.constituents pub constituent_index: u16, @@ -273,8 +286,11 @@ pub struct Constituent { /// precision: PERCENTAGE_PRECISION pub swap_fee_max: i64, + /// total fees received by the constituent. Positive = fees received, Negative = fees paid + pub total_swap_fees: i128, + /// ata token balance in token precision - pub token_balance: u128, + pub token_balance: u64, /// spot borrow-lend balance for constituent pub spot_balance: BLPosition, // should be in constituent base asset @@ -282,12 +298,14 @@ pub struct Constituent { pub last_oracle_price: i64, pub last_oracle_slot: u64, + pub mint: Pubkey, + pub oracle_staleness_threshold: u64, _padding2: [u8; 8], } impl Size for Constituent { - const SIZE: usize = 152; + const SIZE: usize = 192; } impl Constituent { @@ -308,6 +326,11 @@ impl Constituent { } } + pub fn record_swap_fees(&mut self, amount: i64) -> DriftResult { + self.total_swap_fees = self.total_swap_fees.safe_add(amount.cast::()?)?; + Ok(()) + } + /// Current weight of this constituent = price * token_balance / lp_pool_aum /// Note: lp_pool_aum is from LPPool.last_aum, which is a lagged value updated via crank pub fn get_weight( @@ -345,7 +368,9 @@ impl Constituent { let denom = target_weight.safe_sub(min_weight)?; (num, denom) }; - + if slope_denominator == 0 { + return Ok(self.swap_fee_min); + } let b = self .swap_fee_min .safe_mul(slope_denominator)? @@ -353,7 +378,12 @@ impl Constituent { Ok(post_swap_weight .safe_mul(slope_numerator)? .safe_add(b)? - .safe_div(slope_denominator)?) + .safe_div(slope_denominator)? + .clamp(self.swap_fee_min, self.swap_fee_max)) + } + + pub fn sync_token_balance(&mut self, token_account_amount: u64) { + self.token_balance = token_account_amount; } } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index 63a8ae445..e661018ff 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -404,3 +404,333 @@ mod tests { assert_eq!(fee, PERCENTAGE_PRECISION_I64 / 10000); // 1 bps (min fee) } } + +#[cfg(test)] +mod swap_tests { + use crate::math::constants::PERCENTAGE_PRECISION_I64; + use crate::state::lp_pool::*; + + #[test] + fn test_get_swap_price() { + let lp_pool = LPPool::default(); + + let in_oracle = OraclePriceData { + price: 1_000_000, + ..OraclePriceData::default() + }; + let out_oracle = OraclePriceData { + price: 233_400_000, + ..OraclePriceData::default() + }; + + // same decimals + let (price_num, price_denom) = lp_pool + .get_swap_price(6, 6, &in_oracle, &out_oracle) + .unwrap(); + assert_eq!(price_num, 1_000_000); + assert_eq!(price_denom, 233_400_000); + + let (price_num, price_denom) = lp_pool + .get_swap_price(6, 6, &out_oracle, &in_oracle) + .unwrap(); + assert_eq!(price_num, 233_400_000); + assert_eq!(price_denom, 1_000_000); + } + + fn get_swap_amount_decimals_scenario( + in_decimals: u32, + out_decimals: u32, + in_amount: u64, + expected_in_amount: u64, + expected_out_amount: u64, + expected_in_fee: i64, + expected_out_fee: i64, + ) { + let lp_pool = LPPool { + last_aum: 1_000_000_000_000, + ..LPPool::default() + }; + + let oracle_0 = OraclePriceData { + price: 1_000_000, + ..OraclePriceData::default() + }; + let oracle_1 = OraclePriceData { + price: 233_400_000, + ..OraclePriceData::default() + }; + + let constituent_0 = Constituent { + decimals: in_decimals as u8, + swap_fee_min: PERCENTAGE_PRECISION_I64 / 10000, + swap_fee_max: PERCENTAGE_PRECISION_I64 / 1000, + // max_weight_deviation: PERCENTAGE_PRECISION_I64 / 10, + ..Constituent::default() + }; + let constituent_1 = Constituent { + decimals: out_decimals as u8, + swap_fee_min: PERCENTAGE_PRECISION_I64 / 10000, + swap_fee_max: PERCENTAGE_PRECISION_I64 / 1000, + // max_weight_deviation: PERCENTAGE_PRECISION_I64 / 10, + ..Constituent::default() + }; + let spot_market_0 = SpotMarket { + decimals: in_decimals, + ..SpotMarket::default() + }; + let spot_market_1 = SpotMarket { + decimals: out_decimals, + ..SpotMarket::default() + }; + + let (in_amount, out_amount, in_fee, out_fee) = lp_pool + .get_swap_amount( + &oracle_0, + &oracle_1, + &constituent_0, + &constituent_1, + &spot_market_0, + &spot_market_1, + 500_000, + 500_000, + in_amount, + ) + .unwrap(); + assert_eq!(in_amount, expected_in_amount); + assert_eq!(out_amount, expected_out_amount); + assert_eq!(in_fee, expected_in_fee); + assert_eq!(out_fee, expected_out_fee); + } + + #[test] + fn test_get_swap_amount_in_6_out_6() { + get_swap_amount_decimals_scenario( + 6, + 6, + 233_400_000, + 233_400_000, + 999900, + 23340, // 1 bps + 99, + ); + } + + #[test] + fn test_get_swap_amount_in_6_out_9() { + get_swap_amount_decimals_scenario(6, 9, 233_400_000, 233_400_000, 999900000, 23340, 99990); + } + + #[test] + fn test_get_swap_amount_in_9_out_6() { + get_swap_amount_decimals_scenario( + 9, + 6, + 233_400_000_000, + 233_400_000_000, + 999900, + 23340000, + 99, + ); + } + + #[test] + fn test_get_fee_to_charge_positive_min_fee() { + let c = Constituent { + swap_fee_min: PERCENTAGE_PRECISION_I64 / 10000, // 1 bps + swap_fee_max: PERCENTAGE_PRECISION_I64 / 100, // 100 bps + max_weight_deviation: PERCENTAGE_PRECISION_I64 / 10, // 10% + ..Constituent::default() + }; + + // swapping to target should incur minimum fee + let target_weight = PERCENTAGE_PRECISION_I64 / 2; // 50% + let post_swap_weight = target_weight; // 50% + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_min); + + // positive target: swapping to max deviation above target should incur maximum fee + let post_swap_weight = target_weight + c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // positive target: swapping to max deviation below target should incur minimum fee + let post_swap_weight = target_weight - c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // negative target: swapping to max deviation above target should incur maximum fee + let post_swap_weight = -1 * target_weight + c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // negative target: swapping to max deviation below target should incur minimum fee + let post_swap_weight = -1 * target_weight - c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // positive target: swaps to +max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = target_weight + c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + + // positive target: swaps to -max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = target_weight - c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + + // negative target: swaps to +max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = -1 * target_weight + c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + + // negative target: swaps to -max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = -1 * target_weight - c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + } + + #[test] + fn test_get_fee_to_charge_negative_min_fee() { + let c = Constituent { + swap_fee_min: -1 * PERCENTAGE_PRECISION_I64 / 10000, // -1 bps (rebate) + swap_fee_max: PERCENTAGE_PRECISION_I64 / 100, // 100 bps + max_weight_deviation: PERCENTAGE_PRECISION_I64 / 10, // 10% + ..Constituent::default() + }; + + // swapping to target should incur minimum fee + let target_weight = PERCENTAGE_PRECISION_I64 / 2; // 50% + let post_swap_weight = target_weight; // 50% + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_min); + + // positive target: swapping to max deviation above target should incur maximum fee + let post_swap_weight = target_weight + c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // positive target: swapping to max deviation below target should incur minimum fee + let post_swap_weight = target_weight - c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // negative target: swapping to max deviation above target should incur maximum fee + let post_swap_weight = -1 * target_weight + c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // negative target: swapping to max deviation below target should incur minimum fee + let post_swap_weight = -1 * target_weight - c.max_weight_deviation; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, c.swap_fee_max); + + // positive target: swaps to +max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = target_weight + c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + + // positive target: swaps to -max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = target_weight - c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + + // negative target: swaps to +max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = -1 * target_weight + c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + + // negative target: swaps to -max_weight_deviation/2, should incur half of the max fee + let post_swap_weight = -1 * target_weight - c.max_weight_deviation / 2; + let fee = c + .get_fee_to_charge(post_swap_weight, -1 * target_weight) + .unwrap(); + assert_eq!(fee, (c.swap_fee_max + c.swap_fee_min) / 2); + } + + #[test] + fn test_get_weight() { + let c = Constituent { + swap_fee_min: -1 * PERCENTAGE_PRECISION_I64 / 10000, // -1 bps (rebate) + swap_fee_max: PERCENTAGE_PRECISION_I64 / 100, // 100 bps + max_weight_deviation: PERCENTAGE_PRECISION_I64 / 10, // 10% + spot_market_index: 0, + spot_balance: BLPosition { + scaled_balance: 500_000, + cumulative_deposits: 1_000_000, + balance_type: SpotBalanceType::Deposit, + market_index: 0, + ..BLPosition::default() + }, + token_balance: 500_000, + decimals: 6, + ..Constituent::default() + }; + + let spot_market = SpotMarket { + market_index: 0, + decimals: 6, + cumulative_deposit_interest: 10_000_000_000_000, + ..SpotMarket::default() + }; + + let full_balance = c.get_full_balance(&spot_market).unwrap(); + assert_eq!(full_balance, 1_000_000); + + // 1/10 = 10% + let weight = c + .get_weight( + 1_000_000, // $1 + &spot_market, + 0, + 10_000_000, + ) + .unwrap(); + assert_eq!(weight, 100_000); + + // (1+1)/10 = 20% + let weight = c + .get_weight(1_000_000, &spot_market, 1_000_000, 10_000_000) + .unwrap(); + assert_eq!(weight, 200_000); + + // (1-0.5)/10 = 0.5% + let weight = c + .get_weight(1_000_000, &spot_market, -500_000, 10_000_000) + .unwrap(); + assert_eq!(weight, 50_000); + } +} diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index 72c0e7951..7b9eb7be2 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -59,7 +59,8 @@ import { ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, AmmConstituentMapping, - LPPool, + AmmConstituentDatum, + LPPoolAccount, } from './types'; import driftIDL from './idl/drift.json'; @@ -9738,7 +9739,7 @@ export class DriftClient { } public async updateDlpPoolAum( - lpPool: LPPool, + lpPool: LPPoolAccount, spotMarketIndexOfConstituents: number[], txParams?: TxParams ): Promise { @@ -9757,7 +9758,7 @@ export class DriftClient { } public async getUpdateDlpPoolAumIxs( - lpPool: LPPool, + lpPool: LPPoolAccount, spotMarketIndexOfConstituents: number[] ): Promise { const remainingAccounts = this.getRemainingAccounts({ @@ -9823,6 +9824,96 @@ export class DriftClient { }); } + public async lpPoolSwap( + inMarketIndex: number, + outMarketIndex: number, + inAmount: BN, + minOutAmount: BN, + lpPool: PublicKey, + constituentTargetWeights: PublicKey, + constituentInTokenAccount: PublicKey, + constituentOutTokenAccount: PublicKey, + userInTokenAccount: PublicKey, + userOutTokenAccount: PublicKey, + inConstituent: PublicKey, + outConstituent: PublicKey, + inMarketMint: PublicKey, + outMarketMint: PublicKey, + txParams?: TxParams + ): Promise { + const { txSig } = await this.sendTransaction( + await this.buildTransaction( + await this.getLpPoolSwapIx( + inMarketIndex, + outMarketIndex, + inAmount, + minOutAmount, + lpPool, + constituentTargetWeights, + constituentInTokenAccount, + constituentOutTokenAccount, + userInTokenAccount, + userOutTokenAccount, + inConstituent, + outConstituent, + inMarketMint, + outMarketMint + ), + txParams + ), + [], + this.opts + ); + return txSig; + } + + public async getLpPoolSwapIx( + inMarketIndex: number, + outMarketIndex: number, + inAmount: BN, + minOutAmount: BN, + lpPool: PublicKey, + constituentTargetWeights: PublicKey, + constituentInTokenAccount: PublicKey, + constituentOutTokenAccount: PublicKey, + userInTokenAccount: PublicKey, + userOutTokenAccount: PublicKey, + inConstituent: PublicKey, + outConstituent: PublicKey, + inMarketMint: PublicKey, + outMarketMint: PublicKey + ): Promise { + const remainingAccounts = this.getRemainingAccounts({ + userAccounts: [], + writableSpotMarketIndexes: [inMarketIndex, outMarketIndex], + }); + + return this.program.instruction.lpPoolSwap( + inMarketIndex, + outMarketIndex, + inAmount, + minOutAmount, + { + remainingAccounts, + accounts: { + driftSigner: this.getSignerPublicKey(), + state: await this.getStatePublicKey(), + lpPool, + constituentTargetWeights, + constituentInTokenAccount, + constituentOutTokenAccount, + userInTokenAccount, + userOutTokenAccount, + inConstituent, + outConstituent, + inMarketMint, + outMarketMint, + authority: this.wallet.publicKey, + tokenProgram: TOKEN_PROGRAM_ID, + }, + } + ); + } /** * Below here are the transaction sending functions */ diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 03ff1ba51..4383a5387 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7558,6 +7558,99 @@ } ], "args": [] + }, + { + "name": "lpPoolSwap", + "accounts": [ + { + "name": "driftSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "lpPool", + "isMut": false, + "isSigner": false + }, + { + "name": "constituentTargetWeights", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentInTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentOutTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userInTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userOutTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "inConstituent", + "isMut": true, + "isSigner": false + }, + { + "name": "outConstituent", + "isMut": true, + "isSigner": false + }, + { + "name": "inMarketMint", + "isMut": false, + "isSigner": false + }, + { + "name": "outMarketMint", + "isMut": false, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "inMarketIndex", + "type": "u16" + }, + { + "name": "outMarketIndex", + "type": "u16" + }, + { + "name": "inAmount", + "type": "u64" + }, + { + "name": "minOutAmount", + "type": "u64" + } + ] } ], "accounts": [ @@ -8005,7 +8098,8 @@ { "name": "spotMarketIndex", "docs": [ - "underlying drift spot market index" + "underlying drift spot market index.", + "TODO: redundant with spot_balance.market_index" ], "type": "u16" }, @@ -8053,12 +8147,19 @@ ], "type": "i64" }, + { + "name": "totalSwapFees", + "docs": [ + "total fees received by the constituent. Positive = fees received, Negative = fees paid" + ], + "type": "i128" + }, { "name": "tokenBalance", "docs": [ "ata token balance in token precision" ], - "type": "u128" + "type": "u64" }, { "name": "spotBalance", @@ -8077,6 +8178,10 @@ "name": "lastOracleSlot", "type": "u64" }, + { + "name": "mint", + "type": "publicKey" + }, { "name": "oracleStalenessThreshold", "type": "u64" @@ -12387,6 +12492,9 @@ }, { "name": "UpdateLpPoolAum" + }, + { + "name": "LpPoolSwap" } ] } @@ -14575,6 +14683,81 @@ "index": false } ] + }, + { + "name": "LPSwapRecord", + "fields": [ + { + "name": "ts", + "type": "i64", + "index": false + }, + { + "name": "authority", + "type": "publicKey", + "index": false + }, + { + "name": "amountOut", + "type": "u64", + "index": false + }, + { + "name": "amountIn", + "type": "u64", + "index": false + }, + { + "name": "feeOut", + "type": "i64", + "index": false + }, + { + "name": "feeIn", + "type": "i64", + "index": false + }, + { + "name": "outSpotMarketIndex", + "type": "u16", + "index": false + }, + { + "name": "inSpotMarketIndex", + "type": "u16", + "index": false + }, + { + "name": "outConstituentIndex", + "type": "u16", + "index": false + }, + { + "name": "inConstituentIndex", + "type": "u16", + "index": false + }, + { + "name": "outOraclePrice", + "type": "i64", + "index": false + }, + { + "name": "inOraclePrice", + "type": "i64", + "index": false + }, + { + "name": "mintOut", + "type": "publicKey", + "index": false + }, + { + "name": "mintIn", + "type": "publicKey", + "index": false + } + ] } ], "errors": [ @@ -16187,6 +16370,11 @@ "code": 6321, "name": "OracleTooStaleForLPAUMUpdate", "msg": "Oracle too stale for LP AUM update" + }, + { + "code": 6322, + "name": "InsufficientConstituentTokenBalance", + "msg": "Insufficient constituent token balance" } ], "metadata": { diff --git a/sdk/src/types.ts b/sdk/src/types.ts index eb58c70c8..c04ac2851 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1496,7 +1496,7 @@ export type ConstituentTargetWeights = { weights: WeightDatum[]; }; -export type LPPool = { +export type LPPoolAccount = { name: number[]; pubkey: PublicKey; mint: PublicKey; @@ -1504,6 +1504,7 @@ export type LPPool = { lastAum: BN; lastAumSlot: BN; lastAumTs: BN; + oldestOracleSlot: BN; lastRevenueRebalanceTs: BN; totalFeesReceived: BN; totalFeesPaid: BN; @@ -1517,7 +1518,7 @@ export type BLPosition = { balanceType: SpotBalanceType; }; -export type Constituent = { +export type ConstituentAccount = { pubkey: PublicKey; spotMarketIndex: number; constituentIndex: number; @@ -1525,11 +1526,12 @@ export type Constituent = { maxWeightDeviation: BN; swapFeeMin: BN; swapFeeMax: BN; + totalSwapFees: BN; tokenBalance: BN; spotBalance: BLPosition; lastOraclePrice: BN; lastOracleSlot: BN; - oracleStalenessThreshold: BN; + mint: PublicKey; }; export type CacheInfo = { diff --git a/tests/adminDeposit.ts b/tests/adminDeposit.ts new file mode 100644 index 000000000..2eee301d8 --- /dev/null +++ b/tests/adminDeposit.ts @@ -0,0 +1,222 @@ +import * as anchor from '@coral-xyz/anchor'; +import { expect } from 'chai'; + +import { Program, Wallet } from '@coral-xyz/anchor'; + +import { Keypair } from '@solana/web3.js'; + +import { + BN, + TestClient, + getTokenAmount, + getSignedTokenAmount, +} from '../sdk/src'; + +import { + createFundedKeyPair, + initializeQuoteSpotMarket, + mockUSDCMint, + mockUserUSDCAccount, +} from './testHelpers'; +import { startAnchor } from 'solana-bankrun'; +import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; +import { BankrunContextWrapper } from '../sdk/src/bankrun/bankrunConnection'; +import dotenv from 'dotenv'; +dotenv.config(); + +describe('admin deposit', () => { + const chProgram = anchor.workspace.Drift as Program; + let bankrunContextWrapper: BankrunContextWrapper; + let bulkAccountLoader: TestBulkAccountLoader; + + let adminDriftClient: TestClient; + let adminUSDCAccount: Keypair; + + let userKeyPair: Keypair; + let userDriftClient: TestClient; + + let userKeyPair2: Keypair; + let userDriftClient2: TestClient; + let user2USDCAccount: Keypair; + + let usdcMint; + const usdcAmount = new BN(100 * 10 ** 6); + + before(async () => { + const context = await startAnchor('', [], []); + + // @ts-ignore + bankrunContextWrapper = new BankrunContextWrapper(context); + + userKeyPair = await createFundedKeyPair(bankrunContextWrapper); + userKeyPair2 = await createFundedKeyPair(bankrunContextWrapper); + + bulkAccountLoader = new TestBulkAccountLoader( + bankrunContextWrapper.connection, + 'processed', + 1 + ); + + usdcMint = await mockUSDCMint(bankrunContextWrapper); + adminUSDCAccount = await mockUserUSDCAccount( + usdcMint, + usdcAmount, + bankrunContextWrapper + ); + + user2USDCAccount = await mockUserUSDCAccount( + usdcMint, + usdcAmount, + bankrunContextWrapper, + userKeyPair2.publicKey + ); + + adminDriftClient = new TestClient({ + connection: bankrunContextWrapper.connection.toConnection(), + wallet: bankrunContextWrapper.provider.wallet, + programID: chProgram.programId, + opts: { + commitment: 'confirmed', + }, + activeSubAccountId: 0, + subAccountIds: [], + perpMarketIndexes: [], + spotMarketIndexes: [0], + oracleInfos: [], + accountSubscription: { + type: 'polling', + accountLoader: bulkAccountLoader, + }, + }); + await adminDriftClient.initialize(usdcMint.publicKey, true); + await adminDriftClient.subscribe(); + await initializeQuoteSpotMarket(adminDriftClient, usdcMint.publicKey); + // await adminDriftClient.initializeUserAccountAndDepositCollateral( + // QUOTE_PRECISION, + // adminUSDCAccount.publicKey + // ); + await adminDriftClient.initializeUserAccount(0, 'admin subacc 0'); + + userDriftClient = new TestClient({ + connection: bankrunContextWrapper.connection.toConnection(), + wallet: new Wallet(userKeyPair), + programID: chProgram.programId, + opts: { + commitment: 'confirmed', + }, + activeSubAccountId: 0, + perpMarketIndexes: [], + spotMarketIndexes: [0], + subAccountIds: [], + oracleInfos: [], + accountSubscription: { + type: 'polling', + accountLoader: bulkAccountLoader, + }, + }); + await userDriftClient.subscribe(); + await userDriftClient.initializeUserAccount(0, 'user account 0'); + + userKeyPair2 = await createFundedKeyPair(bankrunContextWrapper); + userDriftClient2 = new TestClient({ + connection: bankrunContextWrapper.connection.toConnection(), + wallet: new Wallet(userKeyPair2), + programID: chProgram.programId, + opts: { + commitment: 'confirmed', + }, + activeSubAccountId: 0, + perpMarketIndexes: [], + spotMarketIndexes: [0], + subAccountIds: [], + oracleInfos: [], + accountSubscription: { + type: 'polling', + accountLoader: bulkAccountLoader, + }, + }); + await userDriftClient2.subscribe(); + }); + + after(async () => { + await adminDriftClient.unsubscribe(); + await userDriftClient.unsubscribe(); + }); + + it('admin can deposit into user', async () => { + const userAccount = await userDriftClient.getUserAccountPublicKey(0); + console.log('user userAccount', userAccount.toBase58()); + + const state = adminDriftClient.getStateAccount().admin.toBase58(); + expect(state).to.be.equal(adminDriftClient.wallet.publicKey.toBase58()); + + // user has 0 balance + let spotPos = userDriftClient.getSpotPosition(0); + let spotMarket = userDriftClient.getSpotMarketAccount(0); + const userSpotBalBefore = getSignedTokenAmount( + getTokenAmount(spotPos.scaledBalance, spotMarket, spotPos.balanceType), + spotPos.balanceType + ); + expect(userSpotBalBefore.toString()).to.be.equal('0'); + + // admin deposits into user + await adminDriftClient.adminDeposit( + 0, + usdcAmount, + userAccount, + adminUSDCAccount.publicKey + ); + + await adminDriftClient.fetchAccounts(); + await userDriftClient.fetchAccounts(); + + // check user got the deposit + spotPos = userDriftClient.getSpotPosition(0); + spotMarket = userDriftClient.getSpotMarketAccount(0); + const userSpotBalAfter = getSignedTokenAmount( + getTokenAmount(spotPos.scaledBalance, spotMarket, spotPos.balanceType), + spotPos.balanceType + ); + const spotBalDiff = userSpotBalAfter.sub(userSpotBalBefore); + expect(spotBalDiff.toString()).to.be.equal(usdcAmount.toString()); + }); + + it('user2 cannot deposit into user', async () => { + const state = adminDriftClient.getStateAccount().admin.toBase58(); + expect(state).to.not.be.equal(userDriftClient2.wallet.publicKey.toBase58()); + + // user has 0 balance + let spotPos = userDriftClient.getSpotPosition(0); + let spotMarket = userDriftClient.getSpotMarketAccount(0); + const userSpotBalBefore = getSignedTokenAmount( + getTokenAmount(spotPos.scaledBalance, spotMarket, spotPos.balanceType), + spotPos.balanceType + ); + + // user2 attempts to deposit into user + try { + await userDriftClient2.adminDeposit( + 0, + usdcAmount, + await userDriftClient.getUserAccountPublicKey(0), + user2USDCAccount.publicKey + ); + expect.fail('should not allow non-admin to call adminDeposit'); + } catch (e) { + expect(e.message as string).to.contain('0x7d3'); + } + + await adminDriftClient.fetchAccounts(); + await userDriftClient.fetchAccounts(); + + // check user did not get the deposit + spotPos = userDriftClient.getSpotPosition(0); + spotMarket = userDriftClient.getSpotMarketAccount(0); + const userSpotBalAfter = getSignedTokenAmount( + getTokenAmount(spotPos.scaledBalance, spotMarket, spotPos.balanceType), + spotPos.balanceType + ); + const spotBalDiff = userSpotBalAfter.sub(userSpotBalBefore); + expect(spotBalDiff.toString()).to.be.equal('0'); + }); +}); diff --git a/tests/lpPool.ts b/tests/lpPool.ts index d7e4c6e91..42d890d33 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -19,7 +19,7 @@ import { PEG_PRECISION, ConstituentTargetWeights, AmmConstituentMapping, - LPPool, + LPPoolAccount, getConstituentVaultPublicKey, OracleSource, SPOT_MARKET_WEIGHT_PRECISION, @@ -111,7 +111,7 @@ describe('LP Pool', () => { activeSubAccountId: 0, subAccountIds: [], perpMarketIndexes: [0, 1, 2], - spotMarketIndexes: [0], + spotMarketIndexes: [0, 1], oracleInfos: [{ publicKey: solUsd, source: OracleSource.PYTH }], accountSubscription: { type: 'polling', @@ -254,7 +254,7 @@ describe('LP Pool', () => { const lpPool = (await adminClient.program.account.lpPool.fetch( lpPoolKey - )) as LPPool; + )) as LPPoolAccount; assert(lpPool.constituents == 1); @@ -397,7 +397,7 @@ describe('LP Pool', () => { it('can update pool aum', async () => { const lpPool = (await adminClient.program.account.lpPool.fetch( lpPoolKey - )) as LPPool; + )) as LPPoolAccount; assert(lpPool.constituents == 1); await adminClient.updateDlpPoolAum(lpPool, [0]); diff --git a/tests/lpPoolSwap.ts b/tests/lpPoolSwap.ts index 7c29569ad..7becd3221 100644 --- a/tests/lpPoolSwap.ts +++ b/tests/lpPoolSwap.ts @@ -1,33 +1,36 @@ import * as anchor from '@coral-xyz/anchor'; import { expect, assert } from 'chai'; - import { Program } from '@coral-xyz/anchor'; - import { Keypair, PublicKey } from '@solana/web3.js'; -import { TOKEN_PROGRAM_ID, getMint } from '@solana/spl-token'; - import { BN, TestClient, QUOTE_PRECISION, getLpPoolPublicKey, - getAmmConstituentMappingPublicKey, encodeName, getConstituentTargetWeightsPublicKey, PERCENTAGE_PRECISION, PRICE_PRECISION, PEG_PRECISION, ConstituentTargetWeights, - AmmConstituentMapping, - User, + OracleSource, + SPOT_MARKET_RATE_PRECISION, + SPOT_MARKET_WEIGHT_PRECISION, + LPPoolAccount, + convertToNumber, + getConstituentVaultPublicKey, + getConstituentPublicKey, + ConstituentAccount, } from '../sdk/src'; - import { - getPerpMarketDecoded, initializeQuoteSpotMarket, - mockOracleNoProgram, mockUSDCMint, mockUserUSDCAccount, + mockOracleNoProgram, + setFeedPriceNoProgram, + overWriteTokenAccountBalance, + overwriteConstituentAccount, + mockAtaTokenAccountForMint, } from './testHelpers'; import { startAnchor } from 'solana-bankrun'; import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; @@ -41,8 +44,9 @@ describe('LP Pool', () => { let bulkAccountLoader: TestBulkAccountLoader; let adminClient: TestClient; - let usdcMint; - let adminUser: User; + let usdcMint: Keypair; + let spotTokenMint: Keypair; + let spotMarketOracle: PublicKey; const mantissaSqrtScale = new BN(Math.sqrt(PRICE_PRECISION.toNumber())); const ammInitialQuoteAssetReserve = new anchor.BN(10 * 10 ** 13).mul( @@ -51,7 +55,6 @@ describe('LP Pool', () => { const ammInitialBaseAssetReserve = new anchor.BN(10 * 10 ** 13).mul( mantissaSqrtScale ); - let solUsd: PublicKey; const lpPoolName = 'test pool 1'; const tokenDecimals = 6; @@ -61,18 +64,7 @@ describe('LP Pool', () => { ); before(async () => { - const context = await startAnchor( - '', - [ - { - name: 'token_2022', - programId: new PublicKey( - 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' - ), - }, - ], - [] - ); + const context = await startAnchor('', [], []); // @ts-ignore bankrunContextWrapper = new BankrunContextWrapper(context); @@ -84,12 +76,12 @@ describe('LP Pool', () => { ); usdcMint = await mockUSDCMint(bankrunContextWrapper); + spotTokenMint = await mockUSDCMint(bankrunContextWrapper); + spotMarketOracle = await mockOracleNoProgram(bankrunContextWrapper, 200.1); const keypair = new Keypair(); await bankrunContextWrapper.fundKeypair(keypair, 10 ** 9); - usdcMint = await mockUSDCMint(bankrunContextWrapper); - adminClient = new TestClient({ connection: bankrunContextWrapper.connection.toConnection(), wallet: new anchor.Wallet(keypair), @@ -100,8 +92,13 @@ describe('LP Pool', () => { activeSubAccountId: 0, subAccountIds: [], perpMarketIndexes: [0, 1], - spotMarketIndexes: [0], - oracleInfos: [], + spotMarketIndexes: [0, 1], + oracleInfos: [ + { + publicKey: spotMarketOracle, + source: OracleSource.PYTH, + }, + ], accountSubscription: { type: 'polling', accountLoader: bulkAccountLoader, @@ -122,21 +119,12 @@ describe('LP Pool', () => { new BN(10).mul(QUOTE_PRECISION), userUSDCAccount.publicKey ); - adminUser = new User({ - driftClient: adminClient, - userAccountPublicKey: await adminClient.getUserAccountPublicKey(), - accountSubscription: { - type: 'polling', - accountLoader: bulkAccountLoader, - }, - }); - solUsd = await mockOracleNoProgram(bankrunContextWrapper, 224.3); const periodicity = new BN(0); await adminClient.initializePerpMarket( 0, - solUsd, + spotMarketOracle, ammInitialBaseAssetReserve, ammInitialQuoteAssetReserve, periodicity, @@ -145,200 +133,260 @@ describe('LP Pool', () => { await adminClient.initializePerpMarket( 1, - solUsd, + spotMarketOracle, ammInitialBaseAssetReserve, ammInitialQuoteAssetReserve, periodicity, new BN(224 * PEG_PRECISION.toNumber()) ); + const optimalUtilization = SPOT_MARKET_RATE_PRECISION.div( + new BN(2) + ).toNumber(); // 50% utilization + const optimalRate = SPOT_MARKET_RATE_PRECISION.toNumber(); + const maxRate = SPOT_MARKET_RATE_PRECISION.toNumber(); + const initialAssetWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const maintenanceAssetWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const initialLiabilityWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const maintenanceLiabilityWeight = SPOT_MARKET_WEIGHT_PRECISION.toNumber(); + const imfFactor = 0; + + await adminClient.initializeSpotMarket( + spotTokenMint.publicKey, + optimalUtilization, + optimalRate, + maxRate, + spotMarketOracle, + OracleSource.PYTH, + initialAssetWeight, + maintenanceAssetWeight, + initialLiabilityWeight, + maintenanceLiabilityWeight, + imfFactor + ); + await adminClient.initializeLpPool( lpPoolName, new BN(100_000_000).mul(QUOTE_PRECISION), - Keypair.generate() + Keypair.generate() // dlp mint ); - }); - - after(async () => { - await adminClient.unsubscribe(); - }); - - it('can create a new LP Pool', async () => { - // check LpPool created - const lpPool = await adminClient.program.account.lpPool.fetch(lpPoolKey); - - // Check amm constituent map exists - const ammConstituentMapPublicKey = getAmmConstituentMappingPublicKey( - program.programId, - lpPoolKey - ); - const ammConstituentMap = - (await adminClient.program.account.ammConstituentMapping.fetch( - ammConstituentMapPublicKey - )) as AmmConstituentMapping; - expect(ammConstituentMap).to.not.be.null; - assert(ammConstituentMap.weights.length == 0); - - // check constituent target weights exists - const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); - const constituentTargetWeights = - (await adminClient.program.account.constituentTargetWeights.fetch( - constituentTargetWeightsPublicKey - )) as ConstituentTargetWeights; - expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.weights.length == 0); - - // check mint created correctly - const mintInfo = await getMint( - bankrunContextWrapper.connection.toConnection(), - lpPool.mint as PublicKey - ); - expect(mintInfo.decimals).to.equal(tokenDecimals); - expect(Number(mintInfo.supply)).to.equal(0); - expect(mintInfo.mintAuthority!.toBase58()).to.equal(lpPoolKey.toBase58()); - }); - - it('can add constituent to LP Pool', async () => { await adminClient.initializeConstituent( encodeName(lpPoolName), 0, 6, - new BN(10).mul(PERCENTAGE_PRECISION), - new BN(1).mul(PERCENTAGE_PRECISION), - new BN(2).mul(PERCENTAGE_PRECISION) + PERCENTAGE_PRECISION.divn(10), // 10% max dev + PERCENTAGE_PRECISION.divn(10000), // min fee 1 bps + PERCENTAGE_PRECISION.divn(100), // max 1% + new BN(100) + ); + await adminClient.initializeConstituent( + encodeName(lpPoolName), + 1, + 6, + PERCENTAGE_PRECISION.divn(10), // 10% max dev + PERCENTAGE_PRECISION.divn(10000), // min 1 bps + PERCENTAGE_PRECISION.divn(100), // max 1% + new BN(100) ); - const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); - const constituentTargetWeights = - (await adminClient.program.account.constituentTargetWeights.fetch( - constituentTargetWeightsPublicKey - )) as ConstituentTargetWeights; - expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.weights.length == 1); }); - it('can add amm mapping datum', async () => { - await adminClient.addInitAmmConstituentMappingData(encodeName(lpPoolName), [ - { - perpMarketIndex: 0, - constituentIndex: 0, - }, - { - perpMarketIndex: 1, - constituentIndex: 0, - }, - ]); - const ammConstituentMapping = getAmmConstituentMappingPublicKey( - program.programId, - lpPoolKey - ); - const ammMapping = - (await adminClient.program.account.ammConstituentMapping.fetch( - ammConstituentMapping - )) as AmmConstituentMapping; - expect(ammMapping).to.not.be.null; - assert(ammMapping.weights.length == 2); + after(async () => { + await adminClient.unsubscribe(); }); - it('fails adding datum with bad params', async () => { - // Bad perp market index + it('LP Pool init properly', async () => { + let lpPool: LPPoolAccount; try { - await adminClient.addInitAmmConstituentMappingData( - encodeName(lpPoolName), - [ - { - perpMarketIndex: 2, - constituentIndex: 0, - }, - ] - ); - expect.fail('should have failed'); + lpPool = (await adminClient.program.account.lpPool.fetch( + lpPoolKey + )) as LPPoolAccount; + expect(lpPool).to.not.be.null; } catch (e) { - expect(e.message).to.contain('0x18ab'); + expect.fail('LP Pool should have been created'); } - // Bad constituent index try { - await adminClient.addInitAmmConstituentMappingData( - encodeName(lpPoolName), - [ - { - perpMarketIndex: 0, - constituentIndex: 1, - }, - ] - ); - expect.fail('should have failed'); + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeights = + (await adminClient.program.account.constituentTargetWeights.fetch( + constituentTargetWeightsPublicKey + )) as ConstituentTargetWeights; + expect(constituentTargetWeights).to.not.be.null; + assert(constituentTargetWeights.weights.length == 2); } catch (e) { - expect(e.message).to.contain('0x18ab'); + expect.fail('Amm constituent map should have been created'); } }); - it('can update constituent target weights', async () => { - // Override AMM to have a balance - const perpMarket = adminClient.getPerpMarketAccount(0); - const raw = await bankrunContextWrapper.connection.getAccountInfo( - perpMarket.pubkey + it('lp pool swap', async () => { + let spotOracle = adminClient.getOracleDataForSpotMarket(1); + const price1 = convertToNumber(spotOracle.price); + + await setFeedPriceNoProgram(bankrunContextWrapper, 224.3, spotMarketOracle); + + await adminClient.fetchAccounts(); + + spotOracle = adminClient.getOracleDataForSpotMarket(1); + const price2 = convertToNumber(spotOracle.price); + assert(price2 > price1); + + const const0TokenAccount = getConstituentVaultPublicKey( + program.programId, + lpPoolKey, + 0 + ); + const const1TokenAccount = getConstituentVaultPublicKey( + program.programId, + lpPoolKey, + 1 ); - const buf = raw.data; - buf.writeBigInt64LE(BigInt(1000000000), 304); + const const0Key = getConstituentPublicKey(program.programId, lpPoolKey, 0); + const const1Key = getConstituentPublicKey(program.programId, lpPoolKey, 1); - bankrunContextWrapper.context.setAccount(perpMarket.pubkey, { - executable: raw.executable, - owner: raw.owner, - lamports: raw.lamports, - rentEpoch: raw.rentEpoch, - data: buf, - }); + const c0TokenBalance = new BN(224_300_000_000); + const c1TokenBalance = new BN(1_000_000_000); - const perpMarketAccountAfter = await getPerpMarketDecoded( - adminClient, + await overWriteTokenAccountBalance( bankrunContextWrapper, - perpMarket.pubkey + const0TokenAccount, + BigInt(c0TokenBalance.toString()) + ); + await overwriteConstituentAccount( + bankrunContextWrapper, + adminClient.program, + const0Key, + [['tokenBalance', c0TokenBalance]] ); - assert(!perpMarketAccountAfter.amm.baseAssetAmountLong.isZero()); - // Override LP pool to have some aum - const lpraw = await bankrunContextWrapper.connection.getAccountInfo( - lpPoolKey + await overWriteTokenAccountBalance( + bankrunContextWrapper, + const1TokenAccount, + BigInt(c1TokenBalance.toString()) + ); + await overwriteConstituentAccount( + bankrunContextWrapper, + adminClient.program, + const1Key, + [['tokenBalance', c1TokenBalance]] ); - const lpbuf = lpraw.data; - buf.writeBigInt64LE(BigInt(1000000000), 152); + // check fields overwritten correctly + const c0 = (await adminClient.program.account.constituent.fetch( + const0Key + )) as ConstituentAccount; + expect(c0.tokenBalance.toString()).to.equal(c0TokenBalance.toString()); + console.log('c0', c0); - bankrunContextWrapper.context.setAccount(lpPoolKey, { - executable: lpraw.executable, - owner: lpraw.owner, - lamports: lpraw.lamports, - rentEpoch: lpraw.rentEpoch, - data: lpbuf, - }); + const c1 = (await adminClient.program.account.constituent.fetch( + const1Key + )) as ConstituentAccount; + expect(c1.tokenBalance.toString()).to.equal(c1TokenBalance.toString()); + console.log('c1', c1); - const ammConstituentMappingPublicKey = getAmmConstituentMappingPublicKey( - program.programId, + const prec = new BN(10).pow(new BN(tokenDecimals)); + console.log(`const0 balance: ${convertToNumber(c0.tokenBalance, prec)}`); + console.log(`const1 balance: ${convertToNumber(c1.tokenBalance, prec)}`); + + const lpPool1 = (await adminClient.program.account.lpPool.fetch( lpPoolKey - ); + )) as LPPoolAccount; + expect(lpPool1.lastAumSlot.toNumber()).to.be.equal(0); - const ammMapping = - (await adminClient.program.account.ammConstituentMapping.fetch( - ammConstituentMappingPublicKey - )) as AmmConstituentMapping; + await adminClient.updateDlpPoolAum(lpPool1, [1, 0]); + + const lpPool2 = (await adminClient.program.account.lpPool.fetch( + lpPoolKey + )) as LPPoolAccount; + + expect(lpPool2.lastAumSlot.toNumber()).to.be.greaterThan(0); + expect(lpPool2.lastAum.gt(lpPool1.lastAum)).to.be.true; + console.log(`AUM: ${convertToNumber(lpPool2.lastAum, QUOTE_PRECISION)}`); - console.log(`ok there should be ${ammMapping.weights.length} constituents`); - await adminClient.updateDlpConstituentTargetWeights( - encodeName(lpPoolName), - [0], - ammMapping - ); const constituentTargetWeightsPublicKey = getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); - const constituentTargetWeights = - (await adminClient.program.account.constituentTargetWeights.fetch( - constituentTargetWeightsPublicKey - )) as ConstituentTargetWeights; - expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.weights.length == 1); + + // swap c0 for c1 + + const adminAuth = adminClient.wallet.publicKey; + + // mint some tokens for user + const c0UserTokenAccount = await mockAtaTokenAccountForMint( + bankrunContextWrapper, + usdcMint.publicKey, + new BN(224_300_000_000), + adminAuth + ); + const c1UserTokenAccount = await mockAtaTokenAccountForMint( + bankrunContextWrapper, + spotTokenMint.publicKey, + new BN(1_000_000_000), + adminAuth + ); + + // console.log(`0 mint: ${usdcMint.publicKey.toBase58()}`) + // console.log(`const0:`, await adminClient.program.account.constituent.fetch(const0Key)) + // console.log(`1 mint: ${spotTokenMint.publicKey.toBase58()}`) + // console.log(`const1:`, await adminClient.program.account.constituent.fetch(const1Key)) + + // const m0 = await adminClient.getSpotMarketAccount(0); + // const m1 = await adminClient.getSpotMarketAccount(1); + // console.log(`m0 ${m0.pubkey.toBase58()}, ${m0.oracle.toBase58()}`) + // console.log(`m1 ${m1.pubkey.toBase58()}, ${m1.oracle.toBase58()}`) + + const inTokenBalanceBefore = + await bankrunContextWrapper.connection.getTokenAccount( + c0UserTokenAccount + ); + const outTokenBalanceBefore = + await bankrunContextWrapper.connection.getTokenAccount( + c1UserTokenAccount + ); + + // in = 0, out = 1 + await adminClient.lpPoolSwap( + 0, + 1, + new BN(224_300_000), + new BN(0), + lpPoolKey, + constituentTargetWeightsPublicKey, + const0TokenAccount, + const1TokenAccount, + c0UserTokenAccount, + c1UserTokenAccount, + const0Key, + const1Key, + usdcMint.publicKey, + spotTokenMint.publicKey + ); + + const inTokenBalanceAfter = + await bankrunContextWrapper.connection.getTokenAccount( + c0UserTokenAccount + ); + const outTokenBalanceAfter = + await bankrunContextWrapper.connection.getTokenAccount( + c1UserTokenAccount + ); + const diffInToken = + inTokenBalanceAfter.amount - inTokenBalanceBefore.amount; + const diffOutToken = + outTokenBalanceAfter.amount - outTokenBalanceBefore.amount; + + expect(Number(diffInToken)).to.be.equal(-224_300_000); + expect(Number(diffOutToken)).to.be.approximately(980100, 1); + + console.log( + `in Token: ${inTokenBalanceBefore.amount} -> ${ + inTokenBalanceAfter.amount + } (${Number(diffInToken) / 1e6})` + ); + console.log( + `out Token: ${outTokenBalanceBefore.amount} -> ${ + outTokenBalanceAfter.amount + } (${Number(diffOutToken) / 1e6})` + ); }); }); diff --git a/tests/testHelpers.ts b/tests/testHelpers.ts index 712fa6db2..6738c476a 100644 --- a/tests/testHelpers.ts +++ b/tests/testHelpers.ts @@ -15,6 +15,9 @@ import { createInitializePermanentDelegateInstruction, getMintLen, ExtensionType, + unpackAccount, + type RawAccount, + AccountState, } from '@solana/spl-token'; import { AccountInfo, @@ -35,7 +38,6 @@ import { OraclePriceData, OracleInfo, PerpMarketAccount, - UserAccount, } from '../sdk'; import { TestClient, @@ -45,6 +47,7 @@ import { QUOTE_PRECISION, User, OracleSource, + ConstituentAccount, } from '../sdk/src'; import { BankrunContextWrapper, @@ -224,6 +227,39 @@ export async function mockUserUSDCAccount( return userUSDCAccount; } +export async function mockAtaTokenAccountForMint( + context: BankrunContextWrapper, + tokenMint: PublicKey, + amount: BN, + owner: PublicKey +): Promise { + const userTokenAccount = getAssociatedTokenAddressSync(tokenMint, owner); + const newTx = new Transaction(); + + const tokenProgram = (await context.connection.getAccountInfo(tokenMint)) + .owner; + + newTx.add( + createAssociatedTokenAccountIdempotentInstruction( + context.context.payer.publicKey, + userTokenAccount, + owner, + tokenMint, + tokenProgram + ) + ); + + await context.sendTransaction(newTx, [context.context.payer]); + + await overWriteTokenAccountBalance( + context, + userTokenAccount, + BigInt(amount.toString()) + ); + + return userTokenAccount; +} + export function getMockUserUsdcAccountInfo( fakeUSDCMint: Keypair, usdcMintAmount: BN, @@ -1136,3 +1172,63 @@ export async function getPerpMarketDecoded( driftClient.program.coder.accounts.decode('PerpMarket', accountInfo!.data); return perpMarketAccount; } + +export async function overWriteTokenAccountBalance( + bankrunContextWrapper: BankrunContextWrapper, + tokenAccount: PublicKey, + newBalance: bigint +) { + const info = await bankrunContextWrapper.connection.getAccountInfo( + tokenAccount + ); + const account = unpackAccount(tokenAccount, info, info.owner); + account.amount = newBalance; + const data = Buffer.alloc(AccountLayout.span); + const rawAccount: RawAccount = { + mint: account.mint, + owner: account.owner, + amount: account.amount, + delegateOption: account.delegate ? 1 : 0, + delegate: account.delegate || PublicKey.default, + state: account.isFrozen ? AccountState.Frozen : AccountState.Initialized, + isNativeOption: account.isNative ? 1 : 0, + isNative: account.rentExemptReserve || BigInt(0), + delegatedAmount: account.delegatedAmount, + closeAuthorityOption: account.closeAuthority ? 1 : 0, + closeAuthority: account.closeAuthority || PublicKey.default, + }; + AccountLayout.encode(rawAccount, data); + bankrunContextWrapper.context.setAccount(tokenAccount, { + executable: info.executable, + owner: info.owner, + lamports: info.lamports, + data: data, + rentEpoch: info.rentEpoch, + }); +} + +export async function overwriteConstituentAccount( + bankrunContextWrapper: BankrunContextWrapper, + program: Program, + constituentPublicKey: PublicKey, + overwriteFields: Array<[key: keyof ConstituentAccount, value: any]> +) { + const acc = await program.account.constituent.fetch(constituentPublicKey); + if (!acc) { + throw new Error( + `Constituent account ${constituentPublicKey.toBase58()} not found` + ); + } + for (const [key, value] of overwriteFields) { + acc[key] = value; + } + bankrunContextWrapper.context.setAccount(constituentPublicKey, { + executable: false, + owner: program.programId, + lamports: LAMPORTS_PER_SOL, + data: await program.account.constituent.coder.accounts.encode( + 'Constituent', + acc + ), + }); +} From 2589040a3bc745888d87c2a4c28f7686d0189ca1 Mon Sep 17 00:00:00 2001 From: wphan Date: Fri, 2 May 2025 17:00:42 -0700 Subject: [PATCH 44/50] post-merge fixes --- programs/drift/src/instructions/admin.rs | 1 + programs/drift/src/instructions/lp_pool.rs | 2 +- .../src/instructions/optional_accounts.rs | 2 +- sdk/src/driftClient.ts | 1 - sdk/src/idl/drift.json | 18 +++++++++--------- test-scripts/single-anchor-test.sh | 5 ++++- tests/lpPool.ts | 6 +++--- tests/lpPoolSwap.ts | 2 -- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 4645a1f22..91fa01eb4 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -5711,6 +5711,7 @@ pub struct UpdateProtectedMakerModeConfig<'info> { pub state: Box>, } +#[derive(Accounts)] #[instruction(market_index: u16,)] pub struct AdminDeposit<'info> { pub state: Box>, diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 3e8544e06..5d006dc97 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -12,6 +12,7 @@ use crate::{ msg, state::{ constituent_map::{ConstituentMap, ConstituentSet}, + events::LPSwapRecord, lp_pool::{ AmmConstituentDatum, AmmConstituentMappingFixed, Constituent, LPPool, WeightValidationFlags, @@ -23,7 +24,6 @@ use crate::{ state::State, user::MarketType, zero_copy::{AccountZeroCopy, ZeroCopyLoader}, - events::LPSwapRecord, }, validate, }; diff --git a/programs/drift/src/instructions/optional_accounts.rs b/programs/drift/src/instructions/optional_accounts.rs index f28c8579d..ae89b1c3e 100644 --- a/programs/drift/src/instructions/optional_accounts.rs +++ b/programs/drift/src/instructions/optional_accounts.rs @@ -1,6 +1,6 @@ use crate::error::{DriftResult, ErrorCode}; -use crate::state::high_leverage_mode_config::HighLeverageModeConfig; use crate::state::constituent_map::ConstituentSet; +use crate::state::high_leverage_mode_config::HighLeverageModeConfig; use std::cell::RefMut; use std::convert::TryFrom; diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index 0c1c6ca0d..f09e19961 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -59,7 +59,6 @@ import { ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, AmmConstituentMapping, - AmmConstituentDatum, LPPoolAccount, } from './types'; import driftIDL from './idl/drift.json'; diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 50b895327..9dc855d02 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -16450,47 +16450,47 @@ "msg": "Could not deserialize high leverage mode config" }, { - "code": 6314, + "code": 6315, "name": "InvalidConstituent", "msg": "Invalid Constituent" }, { - "code": 6315, + "code": 6316, "name": "InvalidAmmConstituentMappingArgument", "msg": "Invalid Amm Constituent Mapping argument" }, { - "code": 6316, + "code": 6317, "name": "InvalidUpdateConstituentTargetWeightsArgument", "msg": "Invalid update constituent update target weights argument" }, { - "code": 6317, + "code": 6318, "name": "ConstituentNotFound", "msg": "Constituent not found" }, { - "code": 6318, + "code": 6319, "name": "ConstituentCouldNotLoad", "msg": "Constituent could not load" }, { - "code": 6319, + "code": 6320, "name": "ConstituentWrongMutability", "msg": "Constituent wrong mutability" }, { - "code": 6320, + "code": 6321, "name": "WrongNumberOfConstituents", "msg": "Wrong number of constituents passed to instruction" }, { - "code": 6321, + "code": 6322, "name": "OracleTooStaleForLPAUMUpdate", "msg": "Oracle too stale for LP AUM update" }, { - "code": 6322, + "code": 6323, "name": "InsufficientConstituentTokenBalance", "msg": "Insufficient constituent token balance" } diff --git a/test-scripts/single-anchor-test.sh b/test-scripts/single-anchor-test.sh index 2c328b03a..96fcd2d6f 100755 --- a/test-scripts/single-anchor-test.sh +++ b/test-scripts/single-anchor-test.sh @@ -6,7 +6,10 @@ fi export ANCHOR_WALLET=~/.config/solana/id.json -test_files=(lpPool.ts) +test_files=( + lpPool.ts + # lpPoolSwap.ts +) for test_file in ${test_files[@]}; do ts-mocha -t 300000 ./tests/${test_file} diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 42d890d33..82385c307 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -310,7 +310,7 @@ describe('LP Pool', () => { ]); expect.fail('should have failed'); } catch (e) { - expect(e.message).to.contain('0x18ab'); + expect(e.message).to.contain('0x18ac'); } // Bad constituent index @@ -324,7 +324,7 @@ describe('LP Pool', () => { ]); expect.fail('should have failed'); } catch (e) { - expect(e.message).to.contain('0x18ab'); + expect(e.message).to.contain('0x18ac'); } }); @@ -417,7 +417,7 @@ describe('LP Pool', () => { await adminClient.updateDlpPoolAum(lpPool, [0]); expect.fail('should have failed'); } catch (e) { - assert(e.message.includes('0x18b0')); + assert(e.message.includes('0x18b1')); } }); diff --git a/tests/lpPoolSwap.ts b/tests/lpPoolSwap.ts index 7becd3221..021058ab3 100644 --- a/tests/lpPoolSwap.ts +++ b/tests/lpPoolSwap.ts @@ -277,13 +277,11 @@ describe('LP Pool', () => { const0Key )) as ConstituentAccount; expect(c0.tokenBalance.toString()).to.equal(c0TokenBalance.toString()); - console.log('c0', c0); const c1 = (await adminClient.program.account.constituent.fetch( const1Key )) as ConstituentAccount; expect(c1.tokenBalance.toString()).to.equal(c1TokenBalance.toString()); - console.log('c1', c1); const prec = new BN(10).pow(new BN(tokenDecimals)); console.log(`const0 balance: ${convertToNumber(c0.tokenBalance, prec)}`); From 961d6ed0e6c0235b9fa1b6df84e539483b0b4ddc Mon Sep 17 00:00:00 2001 From: moosecat Date: Mon, 5 May 2025 14:07:53 -0700 Subject: [PATCH 45/50] store bumps on accounts (#1604) * store bumps on accounts * do pda check in constituent map --- programs/drift/src/instructions/admin.rs | 21 +-- programs/drift/src/instructions/keeper.rs | 22 ++- programs/drift/src/instructions/lp_pool.rs | 148 ++++++++++++++------ programs/drift/src/lib.rs | 6 +- programs/drift/src/state/constituent_map.rs | 24 +++- programs/drift/src/state/lp_pool.rs | 22 ++- programs/drift/src/state/perp_market.rs | 6 +- sdk/src/idl/drift.json | 58 ++++++-- sdk/src/types.ts | 4 + 9 files changed, 230 insertions(+), 81 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 91fa01eb4..a848ba212 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -1095,6 +1095,7 @@ pub fn handle_initialize_amm_cache(ctx: Context) -> Result<( amm_cache .cache .resize_with(state.number_of_markets as usize, CacheInfo::default); + amm_cache.bump = ctx.bumps.amm_cache; Ok(()) } @@ -4497,16 +4498,19 @@ pub fn handle_initialize_lp_pool( total_fees_received: 0, total_fees_paid: 0, oldest_oracle_slot: 0, - _padding: [0; 13], + bump: ctx.bumps.lp_pool, + _padding: [0; 12], }; let amm_constituent_mapping = &mut ctx.accounts.amm_constituent_mapping; + amm_constituent_mapping.bump = ctx.bumps.amm_constituent_mapping; amm_constituent_mapping .weights .resize_with(0 as usize, AmmConstituentDatum::default); amm_constituent_mapping.validate()?; let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; + constituent_target_weights.bump = ctx.bumps.constituent_target_weights; constituent_target_weights .weights .resize_with(0 as usize, WeightDatum::default); @@ -4711,7 +4715,7 @@ pub fn handle_admin_deposit<'c: 'info, 'info>( } pub fn handle_initialize_constituent<'info>( - ctx: Context, + ctx: Context<'_, '_, '_, 'info, InitializeConstituent<'info>>, spot_market_index: u16, decimals: u8, max_weight_deviation: i64, @@ -4741,6 +4745,7 @@ pub fn handle_initialize_constituent<'info>( constituent.oracle_staleness_threshold = oracle_staleness_threshold; constituent.pubkey = ctx.accounts.constituent.key(); constituent.mint = ctx.accounts.spot_market_mint.key(); + constituent.bump = ctx.bumps.constituent; constituent.constituent_index = (constituent_target_weights.weights.len() - 1) as u16; lp_pool.constituents += 1; @@ -5159,7 +5164,7 @@ pub struct InitializePerpMarket<'info> { #[account( mut, seeds = [AMM_POSITIONS_CACHE.as_ref()], - bump, + bump = amm_cache.bump, realloc = AmmCache::space(amm_cache.cache.len() + 1 as usize), realloc::payer = admin, realloc::zero = false, @@ -5202,7 +5207,7 @@ pub struct UpdateInitAmmCacheInfo<'info> { #[account( mut, seeds = [AMM_POSITIONS_CACHE.as_ref()], - bump, + bump = amm_cache.bump, )] pub amm_cache: Box>, } @@ -5243,7 +5248,7 @@ pub struct AdminUpdatePerpMarketContractTier<'info> { #[account( mut, seeds = [AMM_POSITIONS_CACHE.as_ref()], - bump, + bump = amm_cache.bump, )] pub amm_cache: Box>, } @@ -5418,7 +5423,7 @@ pub struct AdminUpdatePerpMarketOracle<'info> { #[account( mut, seeds = [AMM_POSITIONS_CACHE.as_ref()], - bump, + bump = amm_cache.bump, )] pub amm_cache: Box>, } @@ -5807,14 +5812,14 @@ pub struct InitializeConstituent<'info> { #[account( mut, seeds = [b"lp_pool", lp_pool_name.as_ref()], - bump, + bump = lp_pool.load()?.bump, )] pub lp_pool: AccountLoader<'info, LPPool>, #[account( mut, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], - bump, + bump = constituent_target_weights.bump, realloc = ConstituentTargetWeights::space(constituent_target_weights.weights.len() + 1 as usize), realloc::payer = admin, realloc::zero = false, diff --git a/programs/drift/src/instructions/keeper.rs b/programs/drift/src/instructions/keeper.rs index 526bcedca..1fcdc4fa0 100644 --- a/programs/drift/src/instructions/keeper.rs +++ b/programs/drift/src/instructions/keeper.rs @@ -2938,8 +2938,24 @@ pub fn handle_update_amm_cache<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, UpdateAmmCache<'info>>, ) -> Result<()> { let remaining_accounts_iter = &mut ctx.remaining_accounts.iter().peekable(); + let amm_cache_key = &ctx.accounts.amm_cache.key(); let mut amm_cache: AccountZeroCopyMut<'_, CacheInfo, _> = ctx.accounts.amm_cache.load_zc_mut()?; + + let expected_pda = &Pubkey::create_program_address( + &[ + AMM_POSITIONS_CACHE.as_ref(), + amm_cache.fixed.bump.to_le_bytes().as_ref(), + ], + &crate::ID, + ) + .map_err(|_| ErrorCode::InvalidPDA)?; + validate!( + expected_pda.eq(amm_cache_key), + ErrorCode::InvalidPDA, + "Amm cache PDA does not match expected PDA" + )?; + let AccountMaps { perp_market_map, spot_market_map: _, @@ -2982,12 +2998,8 @@ pub fn handle_update_amm_cache<'c: 'info, 'info>( pub struct UpdateAmmCache<'info> { #[account(mut)] pub keeper: Signer<'info>, - #[account( - mut, - seeds = [AMM_POSITIONS_CACHE.as_ref()], - bump, - )] /// CHECK: checked in AmmCacheZeroCopy checks + #[account(mut)] pub amm_cache: AccountInfo<'info>, } diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 5d006dc97..fc5246f4a 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -14,8 +14,8 @@ use crate::{ constituent_map::{ConstituentMap, ConstituentSet}, events::LPSwapRecord, lp_pool::{ - AmmConstituentDatum, AmmConstituentMappingFixed, Constituent, LPPool, - WeightValidationFlags, + AmmConstituentDatum, AmmConstituentMappingFixed, Constituent, + ConstituentTargetWeightsFixed, LPPool, WeightDatum, WeightValidationFlags, }, oracle::OraclePriceData, perp_market::{AmmCacheFixed, CacheInfo, AMM_POSITIONS_CACHE}, @@ -23,7 +23,7 @@ use crate::{ spot_market_map::get_writable_spot_market_set_from_many, state::State, user::MarketType, - zero_copy::{AccountZeroCopy, ZeroCopyLoader}, + zero_copy::{AccountZeroCopy, AccountZeroCopyMut, ZeroCopyLoader}, }, validate, }; @@ -40,16 +40,77 @@ use crate::state::lp_pool::{ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetWeights<'info>>, + lp_pool_name: [u8; 32], constituent_indexes: Vec, ) -> Result<()> { let lp_pool = &ctx.accounts.lp_pool.load()?; - let state = &ctx.accounts.state; - let mut constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc_mut()?; + let lp_pool_key: &Pubkey = &ctx.accounts.lp_pool.key(); + let amm_cache_key: &Pubkey = &ctx.accounts.amm_cache.key(); let amm_cache: AccountZeroCopy<'_, CacheInfo, AmmCacheFixed> = ctx.accounts.amm_cache.load_zc()?; + let expected_cache_pda = &Pubkey::create_program_address( + &[ + AMM_POSITIONS_CACHE.as_ref(), + amm_cache.fixed.bump.to_le_bytes().as_ref(), + ], + &crate::ID, + ) + .map_err(|_| ErrorCode::InvalidPDA)?; + validate!( + expected_cache_pda.eq(amm_cache_key), + ErrorCode::InvalidPDA, + "Amm cache PDA does not match expected PDA" + )?; + + let state = &ctx.accounts.state; + let constituent_target_weights_key = &ctx.accounts.constituent_target_weights.key(); + let amm_mapping_key = &ctx.accounts.amm_constituent_mapping.key(); + + // Validate lp pool pda + let expected_lp_pda = &Pubkey::create_program_address( + &[ + b"lp_pool", + lp_pool_name.as_ref(), + lp_pool.bump.to_le_bytes().as_ref(), + ], + &crate::ID, + ) + .map_err(|_| ErrorCode::InvalidPDA)?; + validate!( + expected_lp_pda.eq(lp_pool_key), + ErrorCode::InvalidPDA, + "Lp pool PDA does not match expected PDA" + )?; + + let mut constituent_target_weights: AccountZeroCopyMut< + '_, + WeightDatum, + ConstituentTargetWeightsFixed, + > = ctx.accounts.constituent_target_weights.load_zc_mut()?; + + let bump = constituent_target_weights.fixed.bump; + let expected_pda = &Pubkey::create_program_address( + &[ + CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), + lp_pool.pubkey.as_ref(), + bump.to_le_bytes().as_ref(), + ], + &crate::ID, + ) + .map_err(|_| ErrorCode::InvalidPDA)?; + validate!( + expected_pda.eq(constituent_target_weights_key), + ErrorCode::InvalidPDA, + "Constituent target weights PDA does not match expected PDA" + )?; + let num_constituents = constituent_target_weights.len(); + for datum in constituent_target_weights.iter() { + msg!("weight datum: {:?}", datum); + } + let exists_invalid_constituent_index = constituent_indexes .iter() .any(|index| *index as u32 >= num_constituents); @@ -68,6 +129,22 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( AmmConstituentMappingFixed, > = ctx.accounts.amm_constituent_mapping.load_zc()?; + let amm_mapping_bump = amm_constituent_mapping.fixed.bump; + let expected_map_pda = &Pubkey::create_program_address( + &[ + AMM_MAP_PDA_SEED.as_ref(), + lp_pool.pubkey.as_ref(), + amm_mapping_bump.to_le_bytes().as_ref(), + ], + &crate::ID, + ) + .map_err(|_| ErrorCode::InvalidPDA)?; + validate!( + expected_map_pda.eq(amm_mapping_key), + ErrorCode::InvalidPDA, + "Amm mapping PDA does not match expected PDA" + )?; + let mut amm_inventories: Vec<(u16, i64)> = vec![]; let mut oracle_prices: Vec = vec![]; for (_, datum) in amm_constituent_mapping.iter().enumerate() { @@ -142,7 +219,8 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( Some(state.oracle_guard_rails), )?; - let constituent_map = ConstituentMap::load(&ConstituentSet::new(), remaining_accounts)?; + let constituent_map = + ConstituentMap::load(&ConstituentSet::new(), &lp_pool.pubkey, remaining_accounts)?; validate!( constituent_map.0.len() == lp_pool.constituents as usize, @@ -155,21 +233,6 @@ pub fn handle_update_lp_pool_aum<'c: 'info, 'info>( for i in 0..lp_pool.constituents as usize { let mut constituent = constituent_map.get_ref_mut(&(i as u16))?; - // Validate PDA - let expected_pda = Pubkey::find_program_address( - &[ - CONSTITUENT_PDA_SEED.as_ref(), - lp_pool.pubkey.as_ref(), - constituent.spot_market_index.to_le_bytes().as_ref(), - ], - &crate::ID, - ); - validate!( - expected_pda.0 == constituent.pubkey, - ErrorCode::InvalidConstituent, - "Constituent PDA does not match expected PDA" - )?; - let spot_market = spot_market_map.get_ref(&constituent.spot_market_index)?; let oracle_data = oracle_map.get_price_data_and_validity( @@ -258,7 +321,26 @@ pub fn handle_lp_pool_swap<'c: 'info, 'info>( let mut in_constituent = ctx.accounts.in_constituent.load_mut()?; let mut out_constituent = ctx.accounts.out_constituent.load_mut()?; - let constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc()?; + let constituent_target_weights_key = &ctx.accounts.constituent_target_weights.key(); + let constituent_target_weights: AccountZeroCopy< + '_, + WeightDatum, + ConstituentTargetWeightsFixed, + > = ctx.accounts.constituent_target_weights.load_zc()?; + let expected_pda = &Pubkey::create_program_address( + &[ + CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), + lp_pool.pubkey.as_ref(), + constituent_target_weights.fixed.bump.to_le_bytes().as_ref(), + ], + &crate::ID, + ) + .map_err(|_| ErrorCode::InvalidPDA)?; + validate!( + expected_pda.eq(constituent_target_weights_key), + ErrorCode::InvalidPDA, + "Constituent target weights PDA does not match expected PDA" + )?; let AccountMaps { perp_market_map: _, @@ -421,29 +503,15 @@ pub struct UpdateConstituentTargetWeights<'info> { pub state: Box>, #[account(mut)] pub keeper: Signer<'info>, - #[account( - seeds = [AMM_MAP_PDA_SEED.as_ref(), lp_pool.key().as_ref()], - bump, - )] /// CHECK: checked in AmmConstituentMappingZeroCopy checks pub amm_constituent_mapping: AccountInfo<'info>, - #[account( - mut, - seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], - bump, - )] /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks pub constituent_target_weights: AccountInfo<'info>, - #[account( - mut, - seeds = [AMM_POSITIONS_CACHE.as_ref()], - bump, - )] - /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks + /// CHECK: checked in AmmCacheZeroCopy checks pub amm_cache: AccountInfo<'info>, #[account( seeds = [b"lp_pool", lp_pool_name.as_ref()], - bump, + bump = lp_pool.load()?.bump, )] pub lp_pool: AccountLoader<'info, LPPool>, } @@ -503,14 +571,14 @@ pub struct LPPoolSwap<'info> { #[account( mut, seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), in_market_index.to_le_bytes().as_ref()], - bump, + bump=in_constituent.load()?.bump, constraint = in_constituent.load()?.mint.eq(&constituent_in_token_account.mint) )] pub in_constituent: AccountLoader<'info, Constituent>, #[account( mut, seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), out_market_index.to_le_bytes().as_ref()], - bump, + bump=out_constituent.load()?.bump, constraint = out_constituent.load()?.mint.eq(&constituent_out_token_account.mint) )] pub out_constituent: AccountLoader<'info, Constituent>, diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index a341e737a..7687411b2 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1727,8 +1727,8 @@ pub mod drift { handle_admin_deposit(ctx, market_index, amount) } - pub fn initialize_constituent( - ctx: Context, + pub fn initialize_constituent<'info>( + ctx: Context<'_, '_, '_, 'info, InitializeConstituent<'info>>, lp_pool_name: [u8; 32], spot_market_index: u16, decimals: u8, @@ -1785,7 +1785,7 @@ pub mod drift { lp_pool_name: [u8; 32], constituent_indexes: Vec, ) -> Result<()> { - handle_update_constituent_target_weights(ctx, constituent_indexes) + handle_update_constituent_target_weights(ctx, lp_pool_name, constituent_indexes) } pub fn update_lp_pool_aum<'c: 'info, 'info>( diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index f79f97e7e..047afe505 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -4,7 +4,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::iter::Peekable; use std::slice::Iter; -use anchor_lang::prelude::AccountInfo; +use anchor_lang::prelude::{AccountInfo, Pubkey}; use anchor_lang::Discriminator; use arrayref::array_ref; @@ -12,11 +12,11 @@ use arrayref::array_ref; use crate::error::{DriftResult, ErrorCode}; use crate::math::safe_unwrap::SafeUnwrap; -use crate::msg; use crate::state::traits::Size; +use crate::{msg, validate}; use std::panic::Location; -use super::lp_pool::Constituent; +use super::lp_pool::{Constituent, CONSTITUENT_PDA_SEED}; pub struct ConstituentMap<'a>(pub BTreeMap>); @@ -89,6 +89,7 @@ impl<'a> ConstituentMap<'a> { pub fn load<'b, 'c>( writable_markets: &'b ConstituentSet, + lp_pool_key: &Pubkey, account_info_iter: &'c mut Peekable>>, ) -> DriftResult> { let mut constituent_map: ConstituentMap = ConstituentMap(BTreeMap::new()); @@ -123,6 +124,23 @@ impl<'a> ConstituentMap<'a> { break; } + // // Check if valid pda + let expected_pda = &Pubkey::create_program_address( + &[ + CONSTITUENT_PDA_SEED.as_ref(), + lp_pool_key.as_ref(), + array_ref![data, 40, 2], + array_ref![data, 45, 1], + ], + &crate::ID, + ) + .map_err(|_| ErrorCode::InvalidPDA)?; + validate!( + expected_pda.eq(account_info.key), + ErrorCode::InvalidPDA, + "Constituent PDA does not match expected PDA" + )?; + // constituent index 42 bytes from front of account let constituent_index = u16::from_le_bytes(*array_ref![data, 42, 2]); if constituent_map.0.contains_key(&constituent_index) { diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index f8c70e482..e564fc742 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -70,7 +70,9 @@ pub struct LPPool { pub constituents: u16, // 2, 194 - pub _padding: [u8; 13], + pub bump: u8, + + pub _padding: [u8; 12], } impl Size for LPPool { @@ -274,7 +276,8 @@ pub struct Constituent { pub constituent_index: u16, pub decimals: u8, - _padding1: [u8; 3], + pub bump: u8, + _padding1: [u8; 2], /// max deviation from target_weight allowed for the constituent /// precision: PERCENTAGE_PRECISION @@ -406,7 +409,8 @@ pub struct AmmConstituentDatum { #[derive(Debug, Default)] #[repr(C)] pub struct AmmConstituentMappingFixed { - pub _pad: [u8; 4], + pub bump: u8, + pub _pad: [u8; 3], pub len: u32, } @@ -420,7 +424,8 @@ impl HasLen for AmmConstituentMappingFixed { #[derive(Debug)] #[repr(C)] pub struct AmmConstituentMapping { - _padding: [u8; 4], + pub bump: u8, + _padding: [u8; 3], // PERCENTAGE_PRECISION. Each datum represents the target weight for a single (AMM, Constituent) pair. // An AMM may be partially backed by multiple Constituents pub weights: Vec, @@ -460,8 +465,9 @@ pub struct WeightDatum { #[derive(Debug, Default)] #[repr(C)] pub struct ConstituentTargetWeightsFixed { + pub bump: u8, + _pad: [u8; 3], /// total elements in the flattened `data` vec - _pad: [u8; 4], pub len: u32, } @@ -475,7 +481,8 @@ impl HasLen for ConstituentTargetWeightsFixed { #[derive(Debug)] #[repr(C)] pub struct ConstituentTargetWeights { - _padding: [u8; 4], + pub bump: u8, + _padding: [u8; 3], // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async pub weights: Vec, } @@ -505,7 +512,8 @@ impl_zero_copy_loader!( impl Default for ConstituentTargetWeights { fn default() -> Self { ConstituentTargetWeights { - _padding: [0; 4], + bump: 0, + _padding: [0; 3], weights: Vec::with_capacity(0), } } diff --git a/programs/drift/src/state/perp_market.rs b/programs/drift/src/state/perp_market.rs index b333ba87a..d63dd8255 100644 --- a/programs/drift/src/state/perp_market.rs +++ b/programs/drift/src/state/perp_market.rs @@ -1680,7 +1680,8 @@ pub const AMM_POSITIONS_CACHE: &str = "amm_positions_cache"; #[derive(Debug)] #[repr(C)] pub struct AmmCache { - _padding: [u8; 4], + pub bump: u8, + _padding: [u8; 3], pub cache: Vec, } @@ -1739,7 +1740,8 @@ impl CacheInfo { #[derive(Default, Debug)] #[repr(C)] pub struct AmmCacheFixed { - _pad: [u8; 4], + pub bump: u8, + _pad: [u8; 3], pub len: u32, } diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 9dc855d02..4a1f3e878 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7559,12 +7559,12 @@ }, { "name": "constituentTargetWeights", - "isMut": true, + "isMut": false, "isSigner": false }, { "name": "ammCache", - "isMut": true, + "isMut": false, "isSigner": false }, { @@ -8150,12 +8150,16 @@ "name": "constituents", "type": "u16" }, + { + "name": "bump", + "type": "u8" + }, { "name": "padding", "type": { "array": [ "u8", - 13 + 12 ] } } @@ -8193,12 +8197,16 @@ "name": "decimals", "type": "u8" }, + { + "name": "bump", + "type": "u8" + }, { "name": "padding1", "type": { "array": [ "u8", - 3 + 2 ] } }, @@ -8282,12 +8290,16 @@ "type": { "kind": "struct", "fields": [ + { + "name": "bump", + "type": "u8" + }, { "name": "padding", "type": { "array": [ "u8", - 4 + 3 ] } }, @@ -8307,12 +8319,16 @@ "type": { "kind": "struct", "fields": [ + { + "name": "bump", + "type": "u8" + }, { "name": "padding", "type": { "array": [ "u8", - 4 + 3 ] } }, @@ -8661,12 +8677,16 @@ "type": { "kind": "struct", "fields": [ + { + "name": "bump", + "type": "u8" + }, { "name": "padding", "type": { "array": [ "u8", - 4 + 3 ] } }, @@ -10358,12 +10378,16 @@ "type": { "kind": "struct", "fields": [ + { + "name": "bump", + "type": "u8" + }, { "name": "pad", "type": { "array": [ "u8", - 4 + 3 ] } }, @@ -10395,20 +10419,24 @@ "type": { "kind": "struct", "fields": [ + { + "name": "bump", + "type": "u8" + }, { "name": "pad", - "docs": [ - "total elements in the flattened `data` vec" - ], "type": { "array": [ "u8", - 4 + 3 ] } }, { "name": "len", + "docs": [ + "total elements in the flattened `data` vec" + ], "type": "u32" } ] @@ -11639,12 +11667,16 @@ "type": { "kind": "struct", "fields": [ + { + "name": "bump", + "type": "u8" + }, { "name": "pad", "type": { "array": [ "u8", - 4 + 3 ] } }, diff --git a/sdk/src/types.ts b/sdk/src/types.ts index cf5d076f8..f1d3f2f23 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1496,6 +1496,7 @@ export type AmmConstituentDatum = AddAmmConstituentMappingDatum & { }; export type AmmConstituentMapping = { + bump: number; weights: AmmConstituentDatum[]; }; @@ -1505,6 +1506,7 @@ export type WeightDatum = { }; export type ConstituentTargetWeights = { + bump: number; weights: WeightDatum[]; }; @@ -1516,6 +1518,7 @@ export type LPPoolAccount = { lastAum: BN; lastAumSlot: BN; lastAumTs: BN; + bump: number; oldestOracleSlot: BN; lastRevenueRebalanceTs: BN; totalFeesReceived: BN; @@ -1544,6 +1547,7 @@ export type ConstituentAccount = { lastOraclePrice: BN; lastOracleSlot: BN; mint: PublicKey; + bump: number; }; export type CacheInfo = { From 9bfbab14e23902858571522758290731a4444203 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 6 May 2025 21:05:10 -0700 Subject: [PATCH 46/50] address comments --- programs/drift/src/instructions/admin.rs | 24 +++++++++++++++++---- programs/drift/src/instructions/keeper.rs | 15 +++++++------ programs/drift/src/instructions/lp_pool.rs | 2 +- programs/drift/src/lib.rs | 2 +- programs/drift/src/math/oracle.rs | 4 ++-- programs/drift/src/state/constituent_map.rs | 21 ++++++------------ programs/drift/src/state/lp_pool.rs | 4 +++- sdk/src/adminClient.ts | 2 ++ sdk/src/driftClient.ts | 14 ++++++------ sdk/src/idl/drift.json | 18 ++++++++++++++-- tests/lpPool.ts | 6 +++--- 11 files changed, 70 insertions(+), 42 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index a848ba212..faef1b0e6 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4734,7 +4734,11 @@ pub fn handle_initialize_constituent<'info>( .resize_with((current_len + 1) as usize, WeightDatum::default); constituent_target_weights.validate()?; - msg!("initializing constituent {}", lp_pool.constituents); + msg!( + "initializing constituent {} with spot market index {}", + lp_pool.constituents, + spot_market_index + ); constituent.spot_market_index = spot_market_index; constituent.constituent_index = lp_pool.constituents; @@ -4746,6 +4750,7 @@ pub fn handle_initialize_constituent<'info>( constituent.pubkey = ctx.accounts.constituent.key(); constituent.mint = ctx.accounts.spot_market_mint.key(); constituent.bump = ctx.bumps.constituent; + constituent.lp_pool = lp_pool.pubkey; constituent.constituent_index = (constituent_target_weights.weights.len() - 1) as u16; lp_pool.constituents += 1; @@ -5879,7 +5884,10 @@ pub struct AddAmmConstituentMappingDatum { amm_constituent_mapping_data: Vec, )] pub struct AddAmmConstituentMappingData<'info> { - #[account(mut)] + #[account( + mut, + constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin + )] pub admin: Signer<'info>, #[account( @@ -5916,7 +5924,10 @@ pub struct AddAmmConstituentMappingData<'info> { amm_constituent_mapping_data: Vec, )] pub struct UpdateAmmConstituentMappingData<'info> { - #[account(mut)] + #[account( + mut, + constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin + )] pub admin: Signer<'info>, #[account( @@ -5932,6 +5943,7 @@ pub struct UpdateAmmConstituentMappingData<'info> { )] pub amm_constituent_mapping: Box>, pub system_program: Program<'info, System>, + pub state: Box>, } #[derive(Accounts)] @@ -5939,7 +5951,10 @@ pub struct UpdateAmmConstituentMappingData<'info> { lp_pool_name: [u8; 32], )] pub struct RemoveAmmConstituentMappingData<'info> { - #[account(mut)] + #[account( + mut, + constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin + )] pub admin: Signer<'info>, #[account( @@ -5958,4 +5973,5 @@ pub struct RemoveAmmConstituentMappingData<'info> { )] pub amm_constituent_mapping: Box>, pub system_program: Program<'info, System>, + pub state: Box>, } diff --git a/programs/drift/src/instructions/keeper.rs b/programs/drift/src/instructions/keeper.rs index 1fcdc4fa0..0525fe258 100644 --- a/programs/drift/src/instructions/keeper.rs +++ b/programs/drift/src/instructions/keeper.rs @@ -2972,12 +2972,6 @@ pub fn handle_update_amm_cache<'c: 'info, 'info>( for (_, perp_market_loader) in perp_market_map.0.iter() { let perp_market = perp_market_loader.load()?; let cached_info = amm_cache.get_mut(perp_market.market_index as u32); - cached_info.position = perp_market.amm.get_protocol_owned_position()?; - cached_info.slot = slot; - cached_info.last_oracle_price_twap = perp_market - .amm - .historical_oracle_data - .last_oracle_price_twap; validate!( perp_market.oracle_id() == cached_info.oracle_id()?, @@ -2986,9 +2980,18 @@ pub fn handle_update_amm_cache<'c: 'info, 'info>( )?; let oracle_data = oracle_map.get_price_data(&perp_market.oracle_id())?; + + cached_info.position = perp_market.amm.get_protocol_owned_position()?; + cached_info.slot = slot; + cached_info.last_oracle_price_twap = perp_market + .amm + .historical_oracle_data + .last_oracle_price_twap; cached_info.oracle_price = oracle_data.price; cached_info.oracle_delay = oracle_data.delay; cached_info.oracle_confidence = oracle_data.confidence; + cached_info.max_confidence_interval_multiplier = + perp_market.get_max_confidence_interval_multiplier()?; } Ok(()) diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index fc5246f4a..403b35961 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -168,7 +168,7 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( if !is_oracle_valid_for_action( oracle_validity, - Some(DriftAction::UpdateDlpConstituentTargetWeights), + Some(DriftAction::UpdateLpConstituentTargetWeights), )? { msg!("Oracle data for perp market {} and constituent index {} is invalid. Skipping update", datum.perp_market_index, datum.constituent_index); diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 7687411b2..4533f415e 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1780,7 +1780,7 @@ pub mod drift { handle_remove_amm_constituent_mapping_data(ctx, perp_market_index, constituent_index) } - pub fn update_dlp_constituent_target_weights<'c: 'info, 'info>( + pub fn update_lp_constituent_target_weights<'c: 'info, 'info>( ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetWeights<'info>>, lp_pool_name: [u8; 32], constituent_indexes: Vec, diff --git a/programs/drift/src/math/oracle.rs b/programs/drift/src/math/oracle.rs index ba255a85a..09d18d817 100644 --- a/programs/drift/src/math/oracle.rs +++ b/programs/drift/src/math/oracle.rs @@ -69,7 +69,7 @@ pub enum DriftAction { UpdateTwap, UpdateAMMCurve, OracleOrderPrice, - UpdateDlpConstituentTargetWeights, + UpdateLpConstituentTargetWeights, UpdateLpPoolAum, LpPoolSwap, } @@ -131,7 +131,7 @@ pub fn is_oracle_valid_for_action( ), DriftAction::UpdateTwap => !matches!(oracle_validity, OracleValidity::NonPositive), DriftAction::UpdateAMMCurve => !matches!(oracle_validity, OracleValidity::NonPositive), - DriftAction::UpdateDlpConstituentTargetWeights | DriftAction::UpdateLpPoolAum => { + DriftAction::UpdateLpConstituentTargetWeights | DriftAction::UpdateLpPoolAum => { !matches!(oracle_validity, OracleValidity::NonPositive) } DriftAction::LpPoolSwap => !matches!( diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index 047afe505..e8adee9ba 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -124,22 +124,13 @@ impl<'a> ConstituentMap<'a> { break; } - // // Check if valid pda - let expected_pda = &Pubkey::create_program_address( - &[ - CONSTITUENT_PDA_SEED.as_ref(), - lp_pool_key.as_ref(), - array_ref![data, 40, 2], - array_ref![data, 45, 1], - ], - &crate::ID, - ) - .map_err(|_| ErrorCode::InvalidPDA)?; + // Pubkey + let constituent_lp_key = Pubkey::from(*array_ref![data, 184, 32]); validate!( - expected_pda.eq(account_info.key), - ErrorCode::InvalidPDA, - "Constituent PDA does not match expected PDA" - )?; + &constituent_lp_key == lp_pool_key, + ErrorCode::InvalidConstituent, + "Constituent lp pool pubkey does not match lp pool pubkey" + ); // constituent index 42 bytes from front of account let constituent_index = u16::from_le_bytes(*array_ref![data, 42, 2]); diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index e564fc742..71d0846fb 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -304,11 +304,13 @@ pub struct Constituent { pub mint: Pubkey, pub oracle_staleness_threshold: u64, + + pub lp_pool: Pubkey, _padding2: [u8; 8], } impl Size for Constituent { - const SIZE: usize = 192; + const SIZE: usize = 224; } impl Constituent { diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 4dea56ca9..a6cc72dbc 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -4627,6 +4627,7 @@ export class AdminClient extends DriftClient { lpPool, ammConstituentMapping, systemProgram: SystemProgram.programId, + state: await this.getStatePublicKey(), }, } ), @@ -4670,6 +4671,7 @@ export class AdminClient extends DriftClient { lpPool, ammConstituentMapping, systemProgram: SystemProgram.programId, + state: await this.getStatePublicKey(), }, } ), diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index f09e19961..ca1aee9ce 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -9710,7 +9710,7 @@ export class DriftClient { return txSig; } - public async updateDlpConstituentTargetWeights( + public async updateLpConstituentTargetWeights( lpPoolName: number[], constituentIndexesToUpdate: number[], ammConstituentMapping: AmmConstituentMapping, @@ -9718,7 +9718,7 @@ export class DriftClient { ): Promise { const { txSig } = await this.sendTransaction( await this.buildTransaction( - await this.getUpdateDlpConstituentTargetWeightsIx( + await this.getUpdateLpConstituentTargetWeightsIx( lpPoolName, constituentIndexesToUpdate ), @@ -9730,7 +9730,7 @@ export class DriftClient { return txSig; } - public async getUpdateDlpConstituentTargetWeightsIx( + public async getUpdateLpConstituentTargetWeightsIx( lpPoolName: number[], constituentIndexesToUpdate: number[] ): Promise { @@ -9746,7 +9746,7 @@ export class DriftClient { const ammCache = getAmmCachePublicKey(this.program.programId); - return this.program.instruction.updateDlpConstituentTargetWeights( + return this.program.instruction.updateLpConstituentTargetWeights( lpPoolName, constituentIndexesToUpdate, { @@ -9762,14 +9762,14 @@ export class DriftClient { ); } - public async updateDlpPoolAum( + public async updateLpPoolAum( lpPool: LPPoolAccount, spotMarketIndexOfConstituents: number[], txParams?: TxParams ): Promise { const { txSig } = await this.sendTransaction( await this.buildTransaction( - await this.getUpdateDlpPoolAumIxs( + await this.getUpdateLpPoolAumIxs( lpPool, spotMarketIndexOfConstituents ), @@ -9781,7 +9781,7 @@ export class DriftClient { return txSig; } - public async getUpdateDlpPoolAumIxs( + public async getUpdateLpPoolAumIxs( lpPool: LPPoolAccount, spotMarketIndexOfConstituents: number[] ): Promise { diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 4a1f3e878..ee0c41e71 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7473,6 +7473,11 @@ "name": "systemProgram", "isMut": false, "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false } ], "args": [ @@ -7517,6 +7522,11 @@ "name": "systemProgram", "isMut": false, "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false } ], "args": [ @@ -7540,7 +7550,7 @@ ] }, { - "name": "updateDlpConstituentTargetWeights", + "name": "updateLpConstituentTargetWeights", "accounts": [ { "name": "state", @@ -8273,6 +8283,10 @@ "name": "oracleStalenessThreshold", "type": "u64" }, + { + "name": "lpPool", + "type": "publicKey" + }, { "name": "padding2", "type": { @@ -12599,7 +12613,7 @@ "name": "OracleOrderPrice" }, { - "name": "UpdateDlpConstituentTargetWeights" + "name": "UpdateLpConstituentTargetWeights" }, { "name": "UpdateLpPoolAum" diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 82385c307..480bc0903 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -379,7 +379,7 @@ describe('LP Pool', () => { ammConstituentMappingPublicKey )) as AmmConstituentMapping; - await adminClient.updateDlpConstituentTargetWeights( + await adminClient.updateLpConstituentTargetWeights( encodeName(lpPoolName), [0], ammMapping @@ -400,7 +400,7 @@ describe('LP Pool', () => { )) as LPPoolAccount; assert(lpPool.constituents == 1); - await adminClient.updateDlpPoolAum(lpPool, [0]); + await adminClient.updateLpPoolAum(lpPool, [0]); // Should fail if we initialize a second constituent and dont pass it in await adminClient.initializeConstituent( @@ -414,7 +414,7 @@ describe('LP Pool', () => { ); try { - await adminClient.updateDlpPoolAum(lpPool, [0]); + await adminClient.updateLpPoolAum(lpPool, [0]); expect.fail('should have failed'); } catch (e) { assert(e.message.includes('0x18b1')); From dce244299e10128e2ff5d5d79a4d00b1b0147a28 Mon Sep 17 00:00:00 2001 From: wphan Date: Wed, 7 May 2025 22:15:58 -0700 Subject: [PATCH 47/50] Wphan/add liquidity (#1607) * add add remove liquidity fees calc * add liquidity ix * fix init mint and lppool token account, refactor test fees * add removeLiquidity bankrun test * merge upstream * add LPPool.next_mint_redeem_id --- programs/drift/src/controller/token.rs | 54 ++- programs/drift/src/instructions/admin.rs | 20 +- programs/drift/src/instructions/lp_pool.rs | 471 ++++++++++++++++++++- programs/drift/src/lib.rs | 32 +- programs/drift/src/state/events.rs | 29 ++ programs/drift/src/state/lp_pool.rs | 172 +++++++- programs/drift/src/state/lp_pool/tests.rs | 358 ++++++++++++++++ sdk/src/addresses/pda.ts | 12 + sdk/src/adminClient.ts | 92 ++-- sdk/src/driftClient.ts | 235 +++++++++- sdk/src/idl/drift.json | 311 +++++++++++++- tests/lpPool.ts | 10 +- tests/lpPoolSwap.ts | 152 ++++++- tests/testHelpers.ts | 32 ++ 14 files changed, 1917 insertions(+), 63 deletions(-) diff --git a/programs/drift/src/controller/token.rs b/programs/drift/src/controller/token.rs index e1fa1601a..91d8f8bfe 100644 --- a/programs/drift/src/controller/token.rs +++ b/programs/drift/src/controller/token.rs @@ -8,7 +8,7 @@ use anchor_spl::token_2022::spl_token_2022::extension::{ }; use anchor_spl::token_2022::spl_token_2022::state::Mint as MintInner; use anchor_spl::token_interface::{ - self, CloseAccount, Mint, TokenAccount, TokenInterface, Transfer, TransferChecked, + self, Burn, CloseAccount, Mint, MintTo, TokenAccount, TokenInterface, Transfer, TransferChecked, }; pub fn send_from_program_vault<'info>( @@ -106,6 +106,58 @@ pub fn close_vault<'info>( token_interface::close_account(cpi_context) } +pub fn mint_tokens<'info>( + token_program: &Interface<'info, TokenInterface>, + destination: &InterfaceAccount<'info, TokenAccount>, + authority: &AccountInfo<'info>, + nonce: u8, + amount: u64, + mint: &InterfaceAccount<'info, Mint>, +) -> Result<()> { + let signature_seeds = get_signer_seeds(&nonce); + let signers = &[&signature_seeds[..]]; + + let mint_account_info = mint.to_account_info(); + + validate_mint_fee(&mint_account_info)?; + + let cpi_accounts = MintTo { + mint: mint_account_info, + to: destination.to_account_info(), + authority: authority.to_account_info(), + }; + + let cpi_program = token_program.to_account_info(); + let cpi_context = CpiContext::new_with_signer(cpi_program, cpi_accounts, signers); + token_interface::mint_to(cpi_context, amount) +} + +pub fn burn_tokens<'info>( + token_program: &Interface<'info, TokenInterface>, + destination: &InterfaceAccount<'info, TokenAccount>, + authority: &AccountInfo<'info>, + nonce: u8, + amount: u64, + mint: &InterfaceAccount<'info, Mint>, +) -> Result<()> { + let signature_seeds = get_signer_seeds(&nonce); + let signers = &[&signature_seeds[..]]; + + let mint_account_info = mint.to_account_info(); + + validate_mint_fee(&mint_account_info)?; + + let cpi_accounts = Burn { + mint: mint_account_info, + from: destination.to_account_info(), + authority: authority.to_account_info(), + }; + + let cpi_program = token_program.to_account_info(); + let cpi_context = CpiContext::new_with_signer(cpi_program, cpi_accounts, signers); + token_interface::burn(cpi_context, amount) +} + pub fn validate_mint_fee(account_info: &AccountInfo) -> Result<()> { let mint_data = account_info.try_borrow_data()?; let mint_with_extension = StateWithExtensions::::unpack(&mint_data)?; diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index faef1b0e6..4b02054af 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4480,6 +4480,9 @@ pub fn handle_initialize_high_leverage_mode_config( pub fn handle_initialize_lp_pool( ctx: Context, name: [u8; 32], + min_mint_fee: i64, + max_mint_fee: i64, + revenue_rebalance_period: u64, max_aum: u128, ) -> Result<()> { let mut lp_pool = ctx.accounts.lp_pool.load_init()?; @@ -4497,8 +4500,13 @@ pub fn handle_initialize_lp_pool( last_revenue_rebalance_ts: 0, total_fees_received: 0, total_fees_paid: 0, + total_mint_redeem_fees_paid: 0, oldest_oracle_slot: 0, bump: ctx.bumps.lp_pool, + min_mint_fee, + max_mint_fee_premium: max_mint_fee, + revenue_rebalance_period, + next_mint_redeem_id: 1, _padding: [0; 12], }; @@ -5763,13 +5771,17 @@ pub struct InitializeLpPool<'info> { )] pub lp_pool: AccountLoader<'info, LPPool>, + pub mint: Account<'info, anchor_spl::token::Mint>, + #[account( init, + seeds = [b"LP_POOL_TOKEN_VAULT".as_ref(), lp_pool.key().as_ref()], + bump, payer = admin, - mint::decimals = 6, - mint::authority = lp_pool.key(), + token::mint = mint, + token::authority = drift_signer )] - pub mint: Account<'info, anchor_spl::token::Mint>, + pub lp_pool_token_vault: Box>, #[account( init, @@ -5793,6 +5805,8 @@ pub struct InitializeLpPool<'info> { has_one = admin )] pub state: Box>, + /// CHECK: program signer + pub drift_signer: AccountInfo<'info>, pub token_program: Program<'info, Token>, diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 403b35961..725344d2e 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -2,7 +2,9 @@ use anchor_lang::{prelude::*, Accounts, Key, Result}; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use crate::{ + controller::token::{burn_tokens, mint_tokens}, error::ErrorCode, + get_then_update_id, math::{ casting::Cast, constants::PRICE_PRECISION_I128, @@ -12,7 +14,7 @@ use crate::{ msg, state::{ constituent_map::{ConstituentMap, ConstituentSet}, - events::LPSwapRecord, + events::{LPMintRedeemRecord, LPSwapRecord}, lp_pool::{ AmmConstituentDatum, AmmConstituentMappingFixed, Constituent, ConstituentTargetWeightsFixed, LPPool, WeightDatum, WeightValidationFlags, @@ -36,6 +38,7 @@ use crate::controller::token::{receive, send_from_program_vault}; use crate::instructions::constraints::*; use crate::state::lp_pool::{ AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, + LP_POOL_TOKEN_VAULT_PDA_SEED, }; pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( @@ -495,6 +498,347 @@ pub fn handle_lp_pool_swap<'c: 'info, 'info>( Ok(()) } +#[access_control( + fill_not_paused(&ctx.accounts.state) +)] +pub fn handle_lp_pool_add_liquidity<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, LPPoolAddLiquidity<'info>>, + in_market_index: u16, + in_amount: u64, + min_mint_amount: u64, +) -> Result<()> { + let slot = Clock::get()?.slot; + let now = Clock::get()?.unix_timestamp; + let state = &ctx.accounts.state; + let mut lp_pool = ctx.accounts.lp_pool.load_mut()?; + + let mut in_constituent = ctx.accounts.in_constituent.load_mut()?; + + let constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc()?; + + let AccountMaps { + perp_market_map: _, + spot_market_map, + mut oracle_map, + } = load_maps( + &mut ctx.remaining_accounts.iter().peekable(), + &MarketSet::new(), + &get_writable_spot_market_set_from_many(vec![in_market_index]), + slot, + Some(state.oracle_guard_rails), + )?; + + let mut in_spot_market = spot_market_map.get_ref_mut(&in_market_index)?; + + let in_oracle_id = in_spot_market.oracle_id(); + + let (in_oracle, in_oracle_validity) = oracle_map.get_price_data_and_validity( + MarketType::Spot, + in_spot_market.market_index, + &in_oracle_id, + in_spot_market.historical_oracle_data.last_oracle_price_twap, + in_spot_market.get_max_confidence_interval_multiplier()?, + )?; + let in_oracle = in_oracle.clone(); + + if !is_oracle_valid_for_action(in_oracle_validity, Some(DriftAction::LpPoolSwap))? { + msg!( + "In oracle data for spot market {} is invalid for lp pool swap.", + in_spot_market.market_index, + ); + return Err(ErrorCode::InvalidOracle.into()); + } + + // TODO: check self.aum validity + + update_spot_market_cumulative_interest(&mut in_spot_market, Some(&in_oracle), now)?; + + let in_target_weight = + constituent_target_weights.get_target_weight(in_constituent.constituent_index)?; + + let dlp_total_supply = ctx.accounts.lp_mint.supply; + + let (lp_amount, in_amount, lp_fee_amount, in_fee_amount) = lp_pool + .get_add_liquidity_mint_amount( + now, + &in_spot_market, + &in_constituent, + in_amount, + &in_oracle, + in_target_weight, + dlp_total_supply, + )?; + msg!( + "lp_amount: {}, in_amount: {}, lp_fee_amount: {}, in_fee_amount: {}", + lp_amount, + in_amount, + lp_fee_amount, + in_fee_amount + ); + + let lp_mint_amount_net_fees = if lp_fee_amount > 0 { + lp_amount.safe_sub(lp_fee_amount.unsigned_abs() as u64)? + } else { + lp_amount.safe_add(lp_fee_amount.unsigned_abs() as u64)? + }; + + validate!( + lp_mint_amount_net_fees >= min_mint_amount, + ErrorCode::SlippageOutsideLimit, + format!( + "Slippage outside limit: lp_mint_amount_net_fees({}) < min_mint_amount({})", + lp_mint_amount_net_fees, min_mint_amount + ) + .as_str() + )?; + + in_constituent.record_swap_fees(in_fee_amount)?; + lp_pool.record_mint_redeem_fees(lp_fee_amount)?; + + msg!("receive"); + receive( + &ctx.accounts.token_program, + &ctx.accounts.user_in_token_account, + &ctx.accounts.constituent_in_token_account, + &ctx.accounts.authority, + in_amount, + &Some((*ctx.accounts.in_market_mint).clone()), + )?; + + msg!("mint_tokens"); + mint_tokens( + &ctx.accounts.token_program, + &ctx.accounts.lp_pool_token_vault, + &ctx.accounts.drift_signer, + state.signer_nonce, + lp_amount, + &ctx.accounts.lp_mint, + )?; + + msg!("send_from_program_vault"); + send_from_program_vault( + &ctx.accounts.token_program, + &ctx.accounts.lp_pool_token_vault, + &ctx.accounts.user_lp_token_account, + &ctx.accounts.drift_signer, + state.signer_nonce, + lp_mint_amount_net_fees, + &Some((*ctx.accounts.lp_mint).clone()), + )?; + + lp_pool.last_aum = lp_pool.last_aum.safe_add( + in_amount + .cast::()? + .safe_mul(in_oracle.price.cast::()?)? + .safe_div(10_u128.pow(in_spot_market.decimals))?, + )?; + + ctx.accounts.constituent_in_token_account.reload()?; + ctx.accounts.lp_mint.reload()?; + + in_constituent.sync_token_balance(ctx.accounts.constituent_in_token_account.amount); + + let dlp_total_supply = ctx.accounts.lp_mint.supply; + let lp_nav = if dlp_total_supply > 0 { + lp_pool.last_aum.safe_div(dlp_total_supply as u128)? + } else { + 0 + }; + + let mint_redeem_id = get_then_update_id!(lp_pool, next_mint_redeem_id); + emit!(LPMintRedeemRecord { + ts: now, + authority: ctx.accounts.authority.key(), + is_minting: true, + amount: in_amount, + fee: in_fee_amount, + spot_market_index: in_market_index, + constituent_index: in_constituent.constituent_index, + oracle_price: in_oracle.price, + mint: in_constituent.mint, + lp_mint: lp_pool.mint, + lp_amount, + lp_fee: lp_fee_amount, + lp_nav, + mint_redeem_id, + }); + + Ok(()) +} + +#[access_control( + fill_not_paused(&ctx.accounts.state) +)] +pub fn handle_lp_pool_remove_liquidity<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, LPPoolRemoveLiquidity<'info>>, + out_market_index: u16, + lp_to_burn: u64, + min_amount_out: u64, +) -> Result<()> { + let slot = Clock::get()?.slot; + let now = Clock::get()?.unix_timestamp; + let state = &ctx.accounts.state; + let mut lp_pool = ctx.accounts.lp_pool.load_mut()?; + + let mut out_constituent = ctx.accounts.out_constituent.load_mut()?; + + let constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc()?; + + let AccountMaps { + perp_market_map: _, + spot_market_map, + mut oracle_map, + } = load_maps( + &mut ctx.remaining_accounts.iter().peekable(), + &MarketSet::new(), + &get_writable_spot_market_set_from_many(vec![out_market_index]), + slot, + Some(state.oracle_guard_rails), + )?; + + let mut out_spot_market = spot_market_map.get_ref_mut(&out_market_index)?; + + let out_oracle_id = out_spot_market.oracle_id(); + + let (out_oracle, out_oracle_validity) = oracle_map.get_price_data_and_validity( + MarketType::Spot, + out_spot_market.market_index, + &out_oracle_id, + out_spot_market + .historical_oracle_data + .last_oracle_price_twap, + out_spot_market.get_max_confidence_interval_multiplier()?, + )?; + let out_oracle = out_oracle.clone(); + + // TODO: check self.aum validity + + if !is_oracle_valid_for_action(out_oracle_validity, Some(DriftAction::LpPoolSwap))? { + msg!( + "Out oracle data for spot market {} is invalid for lp pool swap.", + out_spot_market.market_index, + ); + return Err(ErrorCode::InvalidOracle.into()); + } + + update_spot_market_cumulative_interest(&mut out_spot_market, Some(&out_oracle), now)?; + + let out_target_weight = + constituent_target_weights.get_target_weight(out_constituent.constituent_index)?; + + let dlp_total_supply = ctx.accounts.lp_mint.supply; + + let (lp_burn_amount, out_amount, lp_fee_amount, out_fee_amount) = lp_pool + .get_remove_liquidity_amount( + now, + &out_spot_market, + &out_constituent, + lp_to_burn, + &out_oracle, + out_target_weight, + dlp_total_supply, + )?; + msg!( + "lp_burn_amount: {}, out_amount: {}, lp_fee_amount: {}, out_fee_amount: {}", + lp_burn_amount, + out_amount, + lp_fee_amount, + out_fee_amount + ); + + let lp_burn_amount_net_fees = if lp_fee_amount > 0 { + lp_burn_amount.safe_sub(lp_fee_amount.unsigned_abs() as u64)? + } else { + lp_burn_amount.safe_add(lp_fee_amount.unsigned_abs() as u64)? + }; + + let out_amount_net_fees = if out_fee_amount > 0 { + out_amount.safe_sub(out_fee_amount.unsigned_abs() as u64)? + } else { + out_amount.safe_add(out_fee_amount.unsigned_abs() as u64)? + }; + + validate!( + out_amount_net_fees >= min_amount_out, + ErrorCode::SlippageOutsideLimit, + format!( + "Slippage outside limit: lp_mint_amount_net_fees({}) < min_mint_amount({})", + out_amount_net_fees, min_amount_out + ) + .as_str() + )?; + + out_constituent.record_swap_fees(out_fee_amount)?; + lp_pool.record_mint_redeem_fees(lp_fee_amount)?; + + receive( + &ctx.accounts.token_program, + &ctx.accounts.user_lp_token_account, + &ctx.accounts.lp_pool_token_vault, + &ctx.accounts.authority, + lp_burn_amount, + &None, + )?; + + burn_tokens( + &ctx.accounts.token_program, + &ctx.accounts.lp_pool_token_vault, + &ctx.accounts.drift_signer, + state.signer_nonce, + lp_burn_amount_net_fees, + &ctx.accounts.lp_mint, + )?; + + send_from_program_vault( + &ctx.accounts.token_program, + &ctx.accounts.constituent_out_token_account, + &ctx.accounts.user_out_token_account, + &ctx.accounts.drift_signer, + state.signer_nonce, + out_amount_net_fees, + &None, + )?; + + lp_pool.last_aum = lp_pool.last_aum.safe_sub( + out_amount_net_fees + .cast::()? + .safe_mul(out_oracle.price.cast::()?)? + .safe_div(10_u128.pow(out_spot_market.decimals))?, + )?; + + ctx.accounts.constituent_out_token_account.reload()?; + ctx.accounts.lp_mint.reload()?; + + out_constituent.sync_token_balance(ctx.accounts.constituent_out_token_account.amount); + + let dlp_total_supply = ctx.accounts.lp_mint.supply; + let lp_nav = if dlp_total_supply > 0 { + lp_pool.last_aum.safe_div(dlp_total_supply as u128)? + } else { + 0 + }; + + let mint_redeem_id = get_then_update_id!(lp_pool, next_mint_redeem_id); + emit!(LPMintRedeemRecord { + ts: now, + authority: ctx.accounts.authority.key(), + is_minting: false, + amount: out_amount, + fee: out_fee_amount, + spot_market_index: out_market_index, + constituent_index: out_constituent.constituent_index, + oracle_price: out_oracle.price, + mint: out_constituent.mint, + lp_mint: lp_pool.mint, + lp_amount: lp_burn_amount, + lp_fee: lp_fee_amount, + lp_nav, + mint_redeem_id, + }); + + Ok(()) +} + #[derive(Accounts)] #[instruction( lp_pool_name: [u8; 32], @@ -545,7 +889,6 @@ pub struct LPPoolSwap<'info> { pub state: Box>, pub lp_pool: AccountLoader<'info, LPPool>, #[account( - mut, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, )] @@ -597,3 +940,127 @@ pub struct LPPoolSwap<'info> { // TODO: in/out token program pub token_program: Interface<'info, TokenInterface>, } + +#[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], + in_market_index: u16, +)] +pub struct LPPoolAddLiquidity<'info> { + /// CHECK: forced drift_signer + pub drift_signer: AccountInfo<'info>, + pub state: Box>, + #[account( + mut, + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, + pub authority: Signer<'info>, + pub in_market_mint: Box>, + #[account( + mut, + seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), in_market_index.to_le_bytes().as_ref()], + bump, + constraint = + in_constituent.load()?.mint.eq(&constituent_in_token_account.mint) + )] + pub in_constituent: AccountLoader<'info, Constituent>, + + #[account( + mut, + constraint = user_in_token_account.mint.eq(&constituent_in_token_account.mint) + )] + pub user_in_token_account: Box>, + + #[account(mut)] + pub constituent_in_token_account: Box>, + + #[account( + mut, + constraint = user_lp_token_account.mint.eq(&lp_mint.key()) + )] + pub user_lp_token_account: Box>, + + #[account( + mut, + constraint = lp_mint.key() == lp_pool.load()?.mint, + )] + pub lp_mint: Box>, + #[account( + seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] + /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks + pub constituent_target_weights: AccountInfo<'info>, + + #[account( + mut, + seeds = [LP_POOL_TOKEN_VAULT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] + pub lp_pool_token_vault: Box>, + + pub token_program: Interface<'info, TokenInterface>, +} + +#[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], + in_market_index: u16, +)] +pub struct LPPoolRemoveLiquidity<'info> { + /// CHECK: forced drift_signer + pub drift_signer: AccountInfo<'info>, + pub state: Box>, + #[account( + mut, + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, + pub authority: Signer<'info>, + pub out_market_mint: Box>, + #[account( + mut, + seeds = [CONSTITUENT_PDA_SEED.as_ref(), lp_pool.key().as_ref(), in_market_index.to_le_bytes().as_ref()], + bump, + constraint = + out_constituent.load()?.mint.eq(&constituent_out_token_account.mint) + )] + pub out_constituent: AccountLoader<'info, Constituent>, + + #[account( + mut, + constraint = user_out_token_account.mint.eq(&constituent_out_token_account.mint) + )] + pub user_out_token_account: Box>, + #[account(mut)] + pub constituent_out_token_account: Box>, + #[account( + mut, + constraint = user_lp_token_account.mint.eq(&lp_mint.key()) + )] + pub user_lp_token_account: Box>, + + #[account( + mut, + constraint = lp_mint.key() == lp_pool.load()?.mint, + )] + pub lp_mint: Box>, + #[account( + seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] + /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks + pub constituent_target_weights: AccountInfo<'info>, + + #[account( + mut, + seeds = [LP_POOL_TOKEN_VAULT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump, + )] + pub lp_pool_token_vault: Box>, + + pub token_program: Interface<'info, TokenInterface>, +} diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 4533f415e..6785ceeb3 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1690,9 +1690,19 @@ pub mod drift { pub fn initialize_lp_pool( ctx: Context, name: [u8; 32], + min_mint_fee: i64, + max_mint_fee: i64, + revenue_rebalance_period: u64, max_aum: u128, ) -> Result<()> { - handle_initialize_lp_pool(ctx, name, max_aum) + handle_initialize_lp_pool( + ctx, + name, + min_mint_fee, + max_mint_fee, + revenue_rebalance_period, + max_aum, + ) } pub fn update_high_leverage_mode_config( @@ -1816,6 +1826,26 @@ pub mod drift { min_out_amount, ) } + + pub fn lp_pool_add_liquidity<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, LPPoolAddLiquidity<'info>>, + _lp_pool_name: [u8; 32], + in_market_index: u16, + in_amount: u64, + min_mint_amount: u64, + ) -> Result<()> { + handle_lp_pool_add_liquidity(ctx, in_market_index, in_amount, min_mint_amount) + } + + pub fn lp_pool_remove_liquidity<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, LPPoolRemoveLiquidity<'info>>, + _lp_pool_name: [u8; 32], + in_market_index: u16, + in_amount: u64, + min_out_amount: u64, + ) -> Result<()> { + handle_lp_pool_remove_liquidity(ctx, in_market_index, in_amount, min_out_amount) + } } #[cfg(not(feature = "no-entrypoint"))] diff --git a/programs/drift/src/state/events.rs b/programs/drift/src/state/events.rs index 4c3bd4cb8..2cedb32e6 100644 --- a/programs/drift/src/state/events.rs +++ b/programs/drift/src/state/events.rs @@ -704,3 +704,32 @@ pub struct LPSwapRecord { /// in token mint pub mint_in: Pubkey, } + +#[event] +#[derive(Default)] +pub struct LPMintRedeemRecord { + pub ts: i64, + pub authority: Pubkey, + pub is_minting: bool, + /// precision: continutent mint precision, gross fees + pub amount: u64, + /// precision: fee on amount, constituent market mint precision + pub fee: i64, + // spot market index + pub spot_market_index: u16, + // constituent index + pub constituent_index: u16, + /// precision: PRICE_PRECISION + pub oracle_price: i64, + /// token mint + pub mint: Pubkey, + /// lp mint + pub lp_mint: Pubkey, + /// lp amount, lp mint precision + pub lp_amount: u64, + /// lp fee, lp mint precision + pub lp_fee: i64, + /// lp nav, PRICE_PRECISION + pub lp_nav: u128, + pub mint_redeem_id: u64, +} diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index 71d0846fb..b43cc0461 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -1,17 +1,15 @@ use crate::error::{DriftResult, ErrorCode}; use crate::math::casting::Cast; use crate::math::constants::{ - PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64, + PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I64, PRICE_PRECISION_I64, QUOTE_PRECISION, }; use crate::math::safe_math::SafeMath; use crate::math::spot_balance::get_token_amount; use anchor_lang::prelude::*; use anchor_spl::token::Mint; -use anchor_spl::token_interface::TokenAccount; use borsh::{BorshDeserialize, BorshSerialize}; use super::oracle::OraclePriceData; -use super::oracle_map::OracleMap; use super::spot_market::SpotMarket; use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen}; use crate::state::spot_market::{SpotBalance, SpotBalanceType}; @@ -22,6 +20,7 @@ pub const AMM_MAP_PDA_SEED: &str = "AMM_MAP"; pub const CONSTITUENT_PDA_SEED: &str = "CONSTITUENT"; pub const CONSTITUENT_TARGET_WEIGHT_PDA_SEED: &str = "CONSTITUENT_TARGET_WEIGHTS"; pub const CONSTITUENT_VAULT_PDA_SEED: &str = "CONSTITUENT_VAULT"; +pub const LP_POOL_TOKEN_VAULT_PDA_SEED: &str = "LP_POOL_TOKEN_VAULT"; #[cfg(test)] mod tests; @@ -36,8 +35,6 @@ pub struct LPPool { pub pubkey: Pubkey, // 32, 64 // vault token mint pub mint: Pubkey, // 32, 96 - /// LPPool's token account - // pub token_vault: Pubkey, // 32, 128 /// token_supply? to simplify NAV calculation, or load from mint account /// token_total_supply: u64 @@ -62,12 +59,21 @@ pub struct LPPool { /// timestamp of last vAMM revenue rebalance pub last_revenue_rebalance_ts: u64, // 8, 168 + pub revenue_rebalance_period: u64, + + /// Every mint/redeem has a monotonically increasing id. This is the next id to use + pub next_mint_redeem_id: u64, /// all revenue settles recieved pub total_fees_received: u128, // 16, 176 /// all revenues paid out pub total_fees_paid: u128, // 16, 192 + pub total_mint_redeem_fees_paid: i128, + + pub min_mint_fee: i64, + pub max_mint_fee_premium: i64, + pub constituents: u16, // 2, 194 pub bump: u8, @@ -76,7 +82,7 @@ pub struct LPPool { } impl Size for LPPool { - const SIZE: usize = 216; + const SIZE: usize = 296; } impl LPPool { @@ -178,6 +184,119 @@ impl LPPool { Ok((in_amount, out_amount, in_fee_amount, out_fee_amount)) } + /// Calculates the amount of LP tokens to mint for a given input of constituent tokens. + /// Returns the mint_amount in lp token precision and fee to charge in constituent mint precision + pub fn get_add_liquidity_mint_amount( + &self, + now: i64, + in_spot_market: &SpotMarket, + in_constituent: &Constituent, + in_amount: u64, + in_oracle: &OraclePriceData, + in_target_weight: i64, + dlp_total_supply: u64, + ) -> DriftResult<(u64, u64, i64, i64)> { + let in_fee_pct = self.get_swap_fees( + in_spot_market, + in_oracle, + in_constituent, + in_amount.cast::()?, + in_target_weight, + )?; + let in_fee_amount = in_amount + .cast::()? + .safe_mul(in_fee_pct)? + .safe_div(PERCENTAGE_PRECISION_I64.cast::()?)?; + + let in_amount_less_fees = in_amount + .cast::()? + .safe_sub(in_fee_amount as i128)? + .cast::()?; + + let token_precision_denominator = 10_u128.pow(in_spot_market.decimals); + let token_amount_usd = in_oracle + .price + .cast::()? + .safe_mul(in_amount_less_fees)?; + let lp_amount = if self.last_aum == 0 { + token_amount_usd.safe_div(token_precision_denominator)? + } else { + token_amount_usd + .safe_mul(dlp_total_supply as u128)? + .safe_div(self.last_aum.safe_mul(token_precision_denominator)?)? + }; + + let lp_fee_to_charge_pct = self.get_mint_redeem_fee(now, true)?; + let lp_fee_to_charge = lp_amount + .cast::()? + .safe_mul(lp_fee_to_charge_pct)? + .safe_div(PERCENTAGE_PRECISION_I64)?; + + Ok(( + lp_amount.cast::()?, + in_amount, + lp_fee_to_charge, + in_fee_amount, + )) + } + + /// Calculates the amount of constituent tokens to receive for a given amount of LP tokens to burn + /// Returns the mint_amount in lp token precision and fee to charge in constituent mint precision + pub fn get_remove_liquidity_amount( + &self, + now: i64, + out_spot_market: &SpotMarket, + out_constituent: &Constituent, + lp_burn_amount: u64, + out_oracle: &OraclePriceData, + out_target_weight: i64, + dlp_total_supply: u64, + ) -> DriftResult<(u64, u64, i64, i64)> { + let lp_fee_to_charge_pct = self.get_mint_redeem_fee(now, false)?; + let lp_fee_to_charge = lp_burn_amount + .cast::()? + .safe_mul(lp_fee_to_charge_pct)? + .safe_div(PERCENTAGE_PRECISION_I64)?; + + let lp_amount_less_fees = (lp_burn_amount as i128).safe_sub(lp_fee_to_charge as i128)?; + + let token_precision_denominator = 10_u128.pow(out_spot_market.decimals); + + // Calculate proportion of LP tokens being burned + let proportion = lp_amount_less_fees + .cast::()? + .safe_mul(QUOTE_PRECISION)? + .safe_div(dlp_total_supply as u128)?; + msg!("proportion: {}", proportion); + + // Apply proportion to AUM and convert to token amount + let out_amount = self + .last_aum + .safe_mul(proportion)? + .safe_div(out_oracle.price.cast::()?)?; + // .safe_div(token_precision_denominator)?; + msg!("out_amount: {}", out_amount); + + let out_fee_pct = self.get_swap_fees( + out_spot_market, + out_oracle, + out_constituent, + out_amount.cast::()?, + out_target_weight, + )?; + let out_fee_amount = out_amount + .cast::()? + .safe_mul(out_fee_pct)? + .safe_div(PERCENTAGE_PRECISION_I64.cast::()?)?; + + Ok(( + lp_burn_amount, + out_amount.cast::()?, + lp_fee_to_charge, + out_fee_amount, + )) + } + /// returns fee in PERCENTAGE_PRECISION pub fn get_swap_fees( &self, @@ -208,6 +327,43 @@ impl LPPool { Ok(fee) } + + /// Returns the fee to charge for a mint or redeem in PERCENTAGE_PRECISION + pub fn get_mint_redeem_fee(&self, now: i64, is_minting: bool) -> DriftResult { + let time_since_last_rebalance = + now.safe_sub(self.last_revenue_rebalance_ts.cast::()?)?; + if is_minting { + // mint fee + self.min_mint_fee.safe_add( + self.max_mint_fee_premium.min( + self.max_mint_fee_premium + .safe_mul(time_since_last_rebalance)? + .safe_div(self.revenue_rebalance_period.cast::()?)?, + ), + ) + } else { + // burn fee + self.min_mint_fee.safe_add( + 0_i64.max( + self.max_mint_fee_premium.min( + self.revenue_rebalance_period + .cast::()? + .safe_sub(time_since_last_rebalance)? + .cast::()? + .safe_mul(self.max_mint_fee_premium.cast::()?)? + .safe_div(self.revenue_rebalance_period.cast::()?)?, + ), + ), + ) + } + } + + pub fn record_mint_redeem_fees(&mut self, amount: i64) -> DriftResult { + self.total_mint_redeem_fees_paid = self + .total_mint_redeem_fees_paid + .safe_add(amount.cast::()?)?; + Ok(()) + } } #[zero_copy(unsafe)] @@ -345,6 +501,10 @@ impl Constituent { token_amount_delta: i64, lp_pool_aum: u128, ) -> DriftResult { + if lp_pool_aum == 0 { + return Ok(0); + } + let balance = self.get_full_balance(spot_market)?.cast::()?; let token_precision = 10_i128.pow(self.decimals as u32); diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index e661018ff..d14cdf999 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -733,4 +733,362 @@ mod swap_tests { .unwrap(); assert_eq!(weight, 50_000); } + + fn get_mint_redeem_fee_scenario(now: i64, is_mint: bool, expected_fee: i64) { + let lp_pool = LPPool { + last_revenue_rebalance_ts: 0, + revenue_rebalance_period: 3600, // hourly + max_mint_fee_premium: 2000, // 20 bps + min_mint_fee: 100, // 1 bps + ..LPPool::default() + }; + + let fee = lp_pool.get_mint_redeem_fee(now, is_mint).unwrap(); + assert_eq!(fee, expected_fee); + } + + #[test] + fn test_get_mint_fee_before_dist() { + get_mint_redeem_fee_scenario(0, true, 100); + } + + #[test] + fn test_get_mint_fee_during_dist() { + get_mint_redeem_fee_scenario(1800, true, 1100); + } + + #[test] + fn test_get_mint_fee_after_dist() { + get_mint_redeem_fee_scenario(3600, true, 2100); + } + + #[test] + fn test_get_redeem_fee_before_dist() { + get_mint_redeem_fee_scenario(0, false, 2100); + } + + #[test] + fn test_get_redeem_fee_during_dist() { + get_mint_redeem_fee_scenario(1800, false, 1100); + } + + #[test] + fn test_get_redeem_fee_after_dist() { + get_mint_redeem_fee_scenario(3600, false, 100); + } + + fn get_add_liquidity_mint_amount_scenario( + last_aum: u128, + now: i64, + in_decimals: u32, + in_amount: u64, + dlp_total_supply: u64, + expected_lp_amount: u64, + expected_lp_fee: i64, + expected_in_fee_amount: i64, + ) { + let lp_pool = LPPool { + last_aum, + last_revenue_rebalance_ts: 0, + revenue_rebalance_period: 3600, + max_mint_fee_premium: 0, + min_mint_fee: 0, + ..LPPool::default() + }; + + let spot_market = SpotMarket { + decimals: in_decimals, + ..SpotMarket::default() + }; + + let token_balance = if in_decimals > 6 { + last_aum.safe_mul(10_u128.pow(in_decimals - 6)).unwrap() + } else { + last_aum.safe_div(10_u128.pow(6 - in_decimals)).unwrap() + }; + + let constituent = Constituent { + decimals: in_decimals as u8, + swap_fee_min: 0, + swap_fee_max: 0, + max_weight_deviation: PERCENTAGE_PRECISION_I64 / 10, + spot_market_index: 0, + spot_balance: BLPosition { + scaled_balance: 0, + cumulative_deposits: 0, + balance_type: SpotBalanceType::Deposit, + market_index: 0, + ..BLPosition::default() + }, + token_balance: token_balance as u64, + ..Constituent::default() + }; + + let oracle = OraclePriceData { + price: PRICE_PRECISION_I64, // $1 + ..OraclePriceData::default() + }; + + let (lp_amount, in_amount_1, lp_fee, in_fee_amount) = lp_pool + .get_add_liquidity_mint_amount( + now, + &spot_market, + &constituent, + in_amount, + &oracle, + PERCENTAGE_PRECISION_I64, // 100% target weight, to minimize fee for this test + dlp_total_supply, + ) + .unwrap(); + + assert_eq!(lp_amount, expected_lp_amount); + assert_eq!(lp_fee, expected_lp_fee); + assert_eq!(in_amount_1, in_amount); + assert_eq!(in_fee_amount, expected_in_fee_amount); + } + + // test with 6 decimal constituent (matches dlp precision) + #[test] + fn test_get_add_liquidity_mint_amount_zero_aum() { + get_add_liquidity_mint_amount_scenario( + 0, // last_aum + 0, // now + 6, // in_decimals + 1_000_000, // in_amount + 0, // dlp_total_supply (non-zero to avoid MathError) + 1_000_000, // expected_lp_amount + 0, // expected_lp_fee + 0, // expected_in_fee_amount + ); + } + + #[test] + fn test_get_add_liquidity_mint_amount_with_existing_aum() { + get_add_liquidity_mint_amount_scenario( + 10_000_000_000, // last_aum ($10,000) + 0, // now + 6, // in_decimals + 1_000_000, // in_amount (1 token) = $1 + 10_000_000_000, // dlp_total_supply + 1_000_000, // expected_lp_amount + 0, // expected_lp_fee + 0, // expected_in_fee_amount + ); + } + + // test with 8 decimal constituent + #[test] + fn test_get_add_liquidity_mint_amount_with_zero_aum_8_decimals() { + get_add_liquidity_mint_amount_scenario( + 0, // last_aum + 0, // now + 8, // in_decimals + 100_000_000, // in_amount (1 token) = $1 + 0, // dlp_total_supply + 1_000_000, // expected_lp_amount + 0, // expected_lp_fee + 0, // expected_in_fee_amount + ); + } + + #[test] + fn test_get_add_liquidity_mint_amount_with_existing_aum_8_decimals() { + get_add_liquidity_mint_amount_scenario( + 10_000_000_000, // last_aum ($10,000) + 0, // now + 8, // in_decimals + 100_000_000, // in_amount (1 token) = $1 + 10_000_000_000, // dlp_total_supply + 1_000_000, // expected_lp_amount + 0, // expected_lp_fee + 0, // expected_in_fee_amount + ); + } + + // test with 4 decimal constituent + #[test] + fn test_get_add_liquidity_mint_amount_with_zero_aum_4_decimals() { + get_add_liquidity_mint_amount_scenario( + 0, // last_aum + 0, // now + 4, // in_decimals + 10_000, // in_amount (1 token) = $1 + 0, // dlp_total_supply + 1_000_000, // expected_lp_amount + 0, // expected_lp_fee + 0, // expected_in_fee_amount + ); + } + + #[test] + fn test_get_add_liquidity_mint_amount_with_existing_aum_4_decimals() { + get_add_liquidity_mint_amount_scenario( + 10_000_000_000, // last_aum ($10,000) + 0, // now + 4, // in_decimals + 10_000, // in_amount (1 token) = $1 + 10_000_000_000, // dlp_total_supply + 1_000_000, // expected_lp_amount + 0, // expected_lp_fee + 0, // expected_in_fee_amount + ); + } + + fn get_remove_liquidity_mint_amount_scenario( + last_aum: u128, + now: i64, + in_decimals: u32, + lp_burn_amount: u64, + dlp_total_supply: u64, + expected_out_amount: u64, + expected_lp_fee: i64, + expected_out_fee_amount: i64, + ) { + let lp_pool = LPPool { + last_aum, + last_revenue_rebalance_ts: 0, + revenue_rebalance_period: 3600, + max_mint_fee_premium: 0, + min_mint_fee: 0, + ..LPPool::default() + }; + + let spot_market = SpotMarket { + decimals: in_decimals, + ..SpotMarket::default() + }; + + let token_balance = if in_decimals > 6 { + last_aum.safe_mul(10_u128.pow(in_decimals - 6)).unwrap() + } else { + last_aum.safe_div(10_u128.pow(6 - in_decimals)).unwrap() + }; + + let constituent = Constituent { + decimals: in_decimals as u8, + swap_fee_min: 0, + swap_fee_max: 0, + max_weight_deviation: PERCENTAGE_PRECISION_I64 / 10, + spot_market_index: 0, + spot_balance: BLPosition { + scaled_balance: 0, + cumulative_deposits: 0, + balance_type: SpotBalanceType::Deposit, + market_index: 0, + ..BLPosition::default() + }, + token_balance: token_balance as u64, + ..Constituent::default() + }; + + let oracle = OraclePriceData { + price: PRICE_PRECISION_I64, // $1 + ..OraclePriceData::default() + }; + + let (lp_amount_1, out_amount, lp_fee, out_fee_amount) = lp_pool + .get_remove_liquidity_amount( + now, + &spot_market, + &constituent, + lp_burn_amount, + &oracle, + PERCENTAGE_PRECISION_I64, // 100% target weight, to minimize fee for this test + dlp_total_supply, + ) + .unwrap(); + + assert_eq!(lp_amount_1, lp_burn_amount); + assert_eq!(lp_fee, expected_lp_fee); + assert_eq!(out_amount, expected_out_amount); + assert_eq!(out_fee_amount, expected_out_fee_amount); + } + + // test with 6 decimal constituent (matches dlp precision) + #[test] + fn test_get_remove_liquidity_mint_amount_with_existing_aum() { + get_remove_liquidity_mint_amount_scenario( + 10_000_000_000, // last_aum ($10,000) + 0, // now + 6, // in_decimals + 1_000_000, // in_amount (1 token) = $1 + 10_000_000_000, // dlp_total_supply + 1_000_000, // expected_out_amount + 0, // expected_lp_fee + 0, // expected_out_fee_amount + ); + } + + // test with 8 decimal constituent + #[test] + fn test_get_remove_liquidity_mint_amount_with_existing_aum_8_decimals() { + get_remove_liquidity_mint_amount_scenario( + 10_000_000_000, // last_aum ($10,000) + 0, // now + 8, // in_decimals + 100_000_000, // in_amount (1 token) = $1 + 10_000_000_000, // dlp_total_supply + 100_000_000, // expected_out_amount + 0, // expected_lp_fee + 0, // expected_out_fee_amount + ); + } + + // test with 4 decimal constituent + // there will be a problem with 4 decimal constituents with aum ~10M + #[test] + fn test_get_remove_liquidity_mint_amount_with_existing_aum_4_decimals() { + get_remove_liquidity_mint_amount_scenario( + 10_000_000_000, // last_aum ($10,000) + 0, // now + 4, // in_decimals + 10_000, // in_amount (1 token) = 1/10000 + 10_000_000_000, // dlp_total_supply + 10_000, // expected_out_amount = 1 + 0, // expected_lp_fee + 0, // expected_out_fee_amount + ); + } + + #[test] + fn test_get_remove_liquidity_mint_amount_with_existing_aum_5_decimals_large_aum() { + get_remove_liquidity_mint_amount_scenario( + 100_000_000_000 * 1_000_000, // last_aum ($100,000,000,000) + 0, // now + 5, // in_decimals + 100_000_000_000 * 100_000, // in_amount + 100_000_000_000 * 1_000_000, // dlp_total_supply + 100_000_000_000 * 100_000, // expected_out_amount + 0, // expected_lp_fee + 0, // expected_out_fee_amount + ); + } + + #[test] + fn test_get_remove_liquidity_mint_amount_with_existing_aum_6_decimals_large_aum() { + get_remove_liquidity_mint_amount_scenario( + 100_000_000_000 * 1_000_000, // last_aum ($100,000,000,000) + 0, // now + 6, // in_decimals + 100_000_000_000 * 1_000_000, // in_amount + 100_000_000_000 * 1_000_000, // dlp_total_supply + 100_000_000_000 * 1_000_000, // expected_out_amount + 0, // expected_lp_fee + 0, // expected_out_fee_amount + ); + } + + #[test] + fn test_get_remove_liquidity_mint_amount_with_existing_aum_8_decimals_large_aum() { + get_remove_liquidity_mint_amount_scenario( + 10_000_000_000 * 1_000_000, // last_aum ($10,000,000,000) + 0, // now + 8, // in_decimals + 10_000_000_000 * 100_000_000, // in_amount + 10_000_000_000 * 1_000_000, // dlp_total_supply + 10_000_000_000 * 100_000_000, // expected_out_amount + 0, // expected_lp_fee + 0, // expected_out_fee_amount + ); + } } diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index 17a5ec894..4a4efcaac 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -393,6 +393,18 @@ export function getLpPoolPublicKey( )[0]; } +export function getLpPoolTokenVaultPublicKey( + programId: PublicKey, + lpPool: PublicKey +): PublicKey { + return PublicKey.findProgramAddressSync( + [ + Buffer.from(anchor.utils.bytes.utf8.encode('LP_POOL_TOKEN_VAULT')), + lpPool.toBuffer(), + ], + programId + )[0]; +} export function getAmmConstituentMappingPublicKey( programId: PublicKey, lpPoolPublicKey: PublicKey diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index a6cc72dbc..526faa332 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -1,5 +1,6 @@ import { Keypair, + LAMPORTS_PER_SOL, PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, @@ -46,11 +47,12 @@ import { getConstituentPublicKey, getConstituentVaultPublicKey, getAmmCachePublicKey, + getLpPoolTokenVaultPublicKey, } from './addresses/pda'; import { squareRootBN } from './math/utils'; import { - createAssociatedTokenAccountInstruction, - getAssociatedTokenAddressSync, + createInitializeMint2Instruction, + MINT_SIZE, TOKEN_PROGRAM_ID, } from '@solana/spl-token'; import { DriftClient } from './driftClient'; @@ -4365,10 +4367,20 @@ export class AdminClient extends DriftClient { public async initializeLpPool( name: string, + minMintFee: BN, + maxMintFee: BN, + revenueRebalancePeriod: BN, maxAum: BN, mint: Keypair ): Promise { - const ixs = await this.getInitializeLpPoolIx(name, maxAum, mint); + const ixs = await this.getInitializeLpPoolIx( + name, + minMintFee, + maxMintFee, + revenueRebalancePeriod, + maxAum, + mint + ); const tx = await this.buildTransaction(ixs); const { txSig } = await this.sendTransaction(tx, [mint]); return txSig; @@ -4376,6 +4388,9 @@ export class AdminClient extends DriftClient { public async getInitializeLpPoolIx( name: string, + minMintFee: BN, + maxMintFee: BN, + revenueRebalancePeriod: BN, maxAum: BN, mint: Keypair ): Promise { @@ -4388,38 +4403,55 @@ export class AdminClient extends DriftClient { this.program.programId, lpPool ); - const lpPoolAta = getAssociatedTokenAddressSync( - mint.publicKey, - lpPool, - true, - TOKEN_PROGRAM_ID - ); - const createAtaIx = createAssociatedTokenAccountInstruction( - this.wallet.publicKey, - lpPoolAta, - lpPool, + + const lamports = + await this.program.provider.connection.getMinimumBalanceForRentExemption( + MINT_SIZE + ); + const createMintAccountIx = SystemProgram.createAccount({ + fromPubkey: this.wallet.publicKey, + newAccountPubkey: mint.publicKey, + space: MINT_SIZE, + lamports: Math.min(0.05 * LAMPORTS_PER_SOL, lamports), // should be 0.0014616 ? but bankrun returns 10 SOL + programId: TOKEN_PROGRAM_ID, + }); + const createMintIx = createInitializeMint2Instruction( mint.publicKey, + 6, + this.getSignerPublicKey(), + null, TOKEN_PROGRAM_ID ); - const state = await this.getStatePublicKey(); - return [ - this.program.instruction.initializeLpPool(encodeName(name), maxAum, { - accounts: { - admin: this.wallet.publicKey, - lpPool, - ammConstituentMapping, - constituentTargetWeights, - mint: mint.publicKey, - state, - tokenProgram: TOKEN_PROGRAM_ID, - rent: SYSVAR_RENT_PUBKEY, - systemProgram: SystemProgram.programId, - }, - signers: [mint], - }), - createAtaIx, + createMintAccountIx, + createMintIx, + this.program.instruction.initializeLpPool( + encodeName(name), + minMintFee, + maxMintFee, + revenueRebalancePeriod, + maxAum, + { + accounts: { + admin: this.wallet.publicKey, + lpPool, + lpPoolTokenVault: getLpPoolTokenVaultPublicKey( + this.program.programId, + lpPool + ), + ammConstituentMapping, + constituentTargetWeights, + mint: mint.publicKey, + state: await this.getStatePublicKey(), + driftSigner: this.getSignerPublicKey(), + tokenProgram: TOKEN_PROGRAM_ID, + rent: SYSVAR_RENT_PUBKEY, + systemProgram: SystemProgram.programId, + }, + signers: [mint], + } + ), ]; } diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index ca1aee9ce..8eda66832 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -111,6 +111,7 @@ import { getLpPoolPublicKey, getConstituentPublicKey, getAmmCachePublicKey, + getLpPoolTokenVaultPublicKey, } from './addresses/pda'; import { DataAndSlot, @@ -9769,10 +9770,7 @@ export class DriftClient { ): Promise { const { txSig } = await this.sendTransaction( await this.buildTransaction( - await this.getUpdateLpPoolAumIxs( - lpPool, - spotMarketIndexOfConstituents - ), + await this.getUpdateLpPoolAumIxs(lpPool, spotMarketIndexOfConstituents), txParams ), [], @@ -9938,6 +9936,235 @@ export class DriftClient { } ); } + + public async lpPoolAddLiquidity({ + lpPoolName, + inMarketIndex, + inAmount, + minMintAmount, + lpPool, + lpMint, + constituentTargetWeights, + constituentInTokenAccount, + userInTokenAccount, + userLpTokenAccount, + inMarketMint, + inConstituent, + txParams, + }: { + lpPoolName: number[]; + inMarketIndex: number; + inAmount: BN; + minMintAmount: BN; + lpPool: PublicKey; + lpMint: PublicKey; + constituentTargetWeights: PublicKey; + constituentInTokenAccount: PublicKey; + userInTokenAccount: PublicKey; + userLpTokenAccount: PublicKey; + inMarketMint: PublicKey; + inConstituent: PublicKey; + txParams?: TxParams; + }): Promise { + const { txSig } = await this.sendTransaction( + await this.buildTransaction( + await this.getLpPoolAddLiquidityIx({ + lpPoolName, + inMarketIndex, + inAmount, + minMintAmount, + lpPool, + lpMint, + constituentTargetWeights, + constituentInTokenAccount, + userInTokenAccount, + userLpTokenAccount, + inMarketMint, + inConstituent, + }), + txParams + ), + [], + this.opts + ); + return txSig; + } + + public async getLpPoolAddLiquidityIx({ + lpPoolName, + inMarketIndex, + inAmount, + minMintAmount, + lpPool, + lpMint, + constituentTargetWeights, + constituentInTokenAccount, + userInTokenAccount, + userLpTokenAccount, + inMarketMint, + inConstituent, + }: { + lpPoolName: number[]; + inMarketIndex: number; + inAmount: BN; + minMintAmount: BN; + lpPool: PublicKey; + lpMint: PublicKey; + constituentTargetWeights: PublicKey; + constituentInTokenAccount: PublicKey; + userInTokenAccount: PublicKey; + userLpTokenAccount: PublicKey; + inMarketMint: PublicKey; + inConstituent: PublicKey; + }): Promise { + const remainingAccounts = this.getRemainingAccounts({ + userAccounts: [], + writableSpotMarketIndexes: [inMarketIndex], + }); + + return this.program.instruction.lpPoolAddLiquidity( + lpPoolName, + inMarketIndex, + inAmount, + minMintAmount, + { + remainingAccounts, + accounts: { + driftSigner: this.getSignerPublicKey(), + state: await this.getStatePublicKey(), + lpPool, + authority: this.wallet.publicKey, + inMarketMint, + inConstituent, + userInTokenAccount, + constituentInTokenAccount, + userLpTokenAccount, + lpMint, + lpPoolTokenVault: getLpPoolTokenVaultPublicKey( + this.program.programId, + lpPool + ), + constituentTargetWeights, + tokenProgram: TOKEN_PROGRAM_ID, + }, + } + ); + } + + public async lpPoolRemoveLiquidity({ + lpPoolName, + outMarketIndex, + lpToBurn, + minAmountOut, + lpPool, + lpMint, + constituentTargetWeights, + constituentOutTokenAccount, + userOutTokenAccount, + userLpTokenAccount, + outMarketMint, + outConstituent, + txParams, + }: { + lpPoolName: number[]; + outMarketIndex: number; + lpToBurn: BN; + minAmountOut: BN; + lpPool: PublicKey; + lpMint: PublicKey; + constituentTargetWeights: PublicKey; + constituentOutTokenAccount: PublicKey; + userOutTokenAccount: PublicKey; + userLpTokenAccount: PublicKey; + outMarketMint: PublicKey; + outConstituent: PublicKey; + txParams?: TxParams; + }): Promise { + const { txSig } = await this.sendTransaction( + await this.buildTransaction( + await this.getLpPoolRemoveLiquidityIx({ + lpPoolName, + outMarketIndex, + lpToBurn, + minAmountOut, + lpPool, + lpMint, + constituentTargetWeights, + constituentOutTokenAccount, + userOutTokenAccount, + userLpTokenAccount, + outMarketMint, + outConstituent, + }), + txParams + ), + [], + this.opts + ); + return txSig; + } + + public async getLpPoolRemoveLiquidityIx({ + lpPoolName, + outMarketIndex, + lpToBurn, + minAmountOut, + lpPool, + lpMint, + constituentTargetWeights, + constituentOutTokenAccount, + userOutTokenAccount, + userLpTokenAccount, + outMarketMint, + outConstituent, + }: { + lpPoolName: number[]; + outMarketIndex: number; + lpToBurn: BN; + minAmountOut: BN; + lpPool: PublicKey; + lpMint: PublicKey; + constituentTargetWeights: PublicKey; + constituentOutTokenAccount: PublicKey; + userOutTokenAccount: PublicKey; + userLpTokenAccount: PublicKey; + outMarketMint: PublicKey; + outConstituent: PublicKey; + }): Promise { + const remainingAccounts = this.getRemainingAccounts({ + userAccounts: [], + writableSpotMarketIndexes: [outMarketIndex], + }); + + return this.program.instruction.lpPoolRemoveLiquidity( + lpPoolName, + outMarketIndex, + lpToBurn, + minAmountOut, + { + remainingAccounts, + accounts: { + driftSigner: this.getSignerPublicKey(), + state: await this.getStatePublicKey(), + lpPool, + authority: this.wallet.publicKey, + outMarketMint, + outConstituent, + userOutTokenAccount, + constituentOutTokenAccount, + userLpTokenAccount, + lpMint, + lpPoolTokenVault: getLpPoolTokenVaultPublicKey( + this.program.programId, + lpPool + ), + constituentTargetWeights, + tokenProgram: TOKEN_PROGRAM_ID, + }, + } + ); + } + /** * Below here are the transaction sending functions */ diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index ee0c41e71..279025e20 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7077,8 +7077,13 @@ }, { "name": "mint", + "isMut": false, + "isSigner": false + }, + { + "name": "lpPoolTokenVault", "isMut": true, - "isSigner": true + "isSigner": false }, { "name": "ammConstituentMapping", @@ -7095,6 +7100,11 @@ "isMut": false, "isSigner": false }, + { + "name": "driftSigner", + "isMut": false, + "isSigner": false + }, { "name": "tokenProgram", "isMut": false, @@ -7121,6 +7131,18 @@ ] } }, + { + "name": "minMintFee", + "type": "i64" + }, + { + "name": "maxMintFee", + "type": "i64" + }, + { + "name": "revenueRebalancePeriod", + "type": "u64" + }, { "name": "maxAum", "type": "u128" @@ -7668,7 +7690,7 @@ }, { "name": "constituentTargetWeights", - "isMut": true, + "isMut": false, "isSigner": false }, { @@ -7740,6 +7762,192 @@ "type": "u64" } ] + }, + { + "name": "lpPoolAddLiquidity", + "accounts": [ + { + "name": "driftSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "lpPool", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "inMarketMint", + "isMut": false, + "isSigner": false + }, + { + "name": "inConstituent", + "isMut": true, + "isSigner": false + }, + { + "name": "userInTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentInTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userLpTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentTargetWeights", + "isMut": false, + "isSigner": false + }, + { + "name": "lpPoolTokenVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "inMarketIndex", + "type": "u16" + }, + { + "name": "inAmount", + "type": "u64" + }, + { + "name": "minMintAmount", + "type": "u64" + } + ] + }, + { + "name": "lpPoolRemoveLiquidity", + "accounts": [ + { + "name": "driftSigner", + "isMut": false, + "isSigner": false + }, + { + "name": "state", + "isMut": false, + "isSigner": false + }, + { + "name": "lpPool", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "outMarketMint", + "isMut": false, + "isSigner": false + }, + { + "name": "outConstituent", + "isMut": true, + "isSigner": false + }, + { + "name": "userOutTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentOutTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "userLpTokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "lpMint", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentTargetWeights", + "isMut": false, + "isSigner": false + }, + { + "name": "lpPoolTokenVault", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "inMarketIndex", + "type": "u16" + }, + { + "name": "inAmount", + "type": "u64" + }, + { + "name": "minOutAmount", + "type": "u64" + } + ] } ], "accounts": [ @@ -8097,7 +8305,6 @@ { "name": "maxAum", "docs": [ - "LPPool's token account", "token_supply? to simplify NAV calculation, or load from mint account", "token_total_supply: u64", "The current number of VaultConstituents in the vault, each constituent is pda(LPPool.address, constituent_index)", @@ -8142,6 +8349,17 @@ ], "type": "u64" }, + { + "name": "revenueRebalancePeriod", + "type": "u64" + }, + { + "name": "nextMintRedeemId", + "docs": [ + "Every mint/redeem has a monotonically increasing id. This is the next id to use" + ], + "type": "u64" + }, { "name": "totalFeesReceived", "docs": [ @@ -8156,6 +8374,18 @@ ], "type": "u128" }, + { + "name": "totalMintRedeemFeesPaid", + "type": "i128" + }, + { + "name": "minMintFee", + "type": "i64" + }, + { + "name": "maxMintFeePremium", + "type": "i64" + }, { "name": "constituents", "type": "u16" @@ -14917,6 +15147,81 @@ "index": false } ] + }, + { + "name": "LPMintRedeemRecord", + "fields": [ + { + "name": "ts", + "type": "i64", + "index": false + }, + { + "name": "authority", + "type": "publicKey", + "index": false + }, + { + "name": "isMinting", + "type": "bool", + "index": false + }, + { + "name": "amount", + "type": "u64", + "index": false + }, + { + "name": "fee", + "type": "i64", + "index": false + }, + { + "name": "spotMarketIndex", + "type": "u16", + "index": false + }, + { + "name": "constituentIndex", + "type": "u16", + "index": false + }, + { + "name": "oraclePrice", + "type": "i64", + "index": false + }, + { + "name": "mint", + "type": "publicKey", + "index": false + }, + { + "name": "lpMint", + "type": "publicKey", + "index": false + }, + { + "name": "lpAmount", + "type": "u64", + "index": false + }, + { + "name": "lpFee", + "type": "i64", + "index": false + }, + { + "name": "lpNav", + "type": "u128", + "index": false + }, + { + "name": "mintRedeemId", + "type": "u64", + "index": false + } + ] } ], "errors": [ diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 480bc0903..154ae5be6 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -26,6 +26,7 @@ import { SPOT_MARKET_RATE_PRECISION, getAmmCachePublicKey, AmmCache, + ZERO, } from '../sdk/src'; import { @@ -190,7 +191,10 @@ describe('LP Pool', () => { await adminClient.initializeLpPool( lpPoolName, - new BN(100_000_000).mul(QUOTE_PRECISION), + ZERO, + ZERO, + new BN(3600), + new BN(1_000_000).mul(QUOTE_PRECISION), Keypair.generate() ); }); @@ -232,7 +236,9 @@ describe('LP Pool', () => { ); expect(mintInfo.decimals).to.equal(tokenDecimals); expect(Number(mintInfo.supply)).to.equal(0); - expect(mintInfo.mintAuthority!.toBase58()).to.equal(lpPoolKey.toBase58()); + expect(mintInfo.mintAuthority!.toBase58()).to.equal( + adminClient.getSignerPublicKey().toBase58() + ); }); it('can add constituent to LP Pool', async () => { diff --git a/tests/lpPoolSwap.ts b/tests/lpPoolSwap.ts index 021058ab3..2f11ec8d5 100644 --- a/tests/lpPoolSwap.ts +++ b/tests/lpPoolSwap.ts @@ -21,6 +21,7 @@ import { getConstituentVaultPublicKey, getConstituentPublicKey, ConstituentAccount, + ZERO, } from '../sdk/src'; import { initializeQuoteSpotMarket, @@ -31,6 +32,7 @@ import { overWriteTokenAccountBalance, overwriteConstituentAccount, mockAtaTokenAccountForMint, + overWriteMintAccount, } from './testHelpers'; import { startAnchor } from 'solana-bankrun'; import { TestBulkAccountLoader } from '../sdk/src/accounts/testBulkAccountLoader'; @@ -167,6 +169,9 @@ describe('LP Pool', () => { await adminClient.initializeLpPool( lpPoolName, + new BN(100), // 1 bps + ZERO, // 1 bps + new BN(3600), new BN(100_000_000).mul(QUOTE_PRECISION), Keypair.generate() // dlp mint ); @@ -292,7 +297,7 @@ describe('LP Pool', () => { )) as LPPoolAccount; expect(lpPool1.lastAumSlot.toNumber()).to.be.equal(0); - await adminClient.updateDlpPoolAum(lpPool1, [1, 0]); + await adminClient.updateLpPoolAum(lpPool1, [1, 0]); const lpPool2 = (await adminClient.program.account.lpPool.fetch( lpPoolKey @@ -323,16 +328,6 @@ describe('LP Pool', () => { adminAuth ); - // console.log(`0 mint: ${usdcMint.publicKey.toBase58()}`) - // console.log(`const0:`, await adminClient.program.account.constituent.fetch(const0Key)) - // console.log(`1 mint: ${spotTokenMint.publicKey.toBase58()}`) - // console.log(`const1:`, await adminClient.program.account.constituent.fetch(const1Key)) - - // const m0 = await adminClient.getSpotMarketAccount(0); - // const m1 = await adminClient.getSpotMarketAccount(1); - // console.log(`m0 ${m0.pubkey.toBase58()}, ${m0.oracle.toBase58()}`) - // console.log(`m1 ${m1.pubkey.toBase58()}, ${m1.oracle.toBase58()}`) - const inTokenBalanceBefore = await bankrunContextWrapper.connection.getTokenAccount( c0UserTokenAccount @@ -387,4 +382,139 @@ describe('LP Pool', () => { } (${Number(diffOutToken) / 1e6})` ); }); + + it('lp pool add and remove liquidity', async () => { + const const0Key = getConstituentPublicKey(program.programId, lpPoolKey, 0); + + const c0 = (await adminClient.program.account.constituent.fetch( + const0Key + )) as ConstituentAccount; + + // add c0 liquidity + const adminAuth = adminClient.wallet.publicKey; + const c0UserTokenAccount = await mockAtaTokenAccountForMint( + bankrunContextWrapper, + usdcMint.publicKey, + new BN(1_000_000_000_000), + adminAuth + ); + + let lpPool = (await adminClient.program.account.lpPool.fetch( + lpPoolKey + )) as LPPoolAccount; + const lpPoolAumBefore = lpPool.lastAum; + const constituentTargetWeightsPublicKey = + getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + + const userLpTokenAccount = await mockAtaTokenAccountForMint( + bankrunContextWrapper, + lpPool.mint, + new BN(0), + adminAuth + ); + + const userC0TokenBalanceBefore = + await bankrunContextWrapper.connection.getTokenAccount( + c0UserTokenAccount + ); + const userLpTokenBalanceBefore = + await bankrunContextWrapper.connection.getTokenAccount( + userLpTokenAccount + ); + + await overWriteMintAccount( + bankrunContextWrapper, + lpPool.mint, + BigInt(lpPool.lastAum.toNumber()) + ); + + const tokensAdded = new BN(1_000_000_000_000); + const c0TokenAccount = getConstituentVaultPublicKey( + program.programId, + lpPoolKey, + 0 + ); + await adminClient.lpPoolAddLiquidity({ + lpPoolName: encodeName(lpPoolName), + inMarketIndex: 0, + inAmount: tokensAdded, + minMintAmount: new BN(1), + lpPool: lpPoolKey, + lpMint: lpPool.mint, + constituentTargetWeights: constituentTargetWeightsPublicKey, + constituentInTokenAccount: c0TokenAccount, + userInTokenAccount: c0UserTokenAccount, + userLpTokenAccount: userLpTokenAccount, + inMarketMint: c0.mint, + inConstituent: const0Key, + }); + + const userC0TokenBalanceAfter = + await bankrunContextWrapper.connection.getTokenAccount( + c0UserTokenAccount + ); + const userLpTokenBalanceAfter = + await bankrunContextWrapper.connection.getTokenAccount( + userLpTokenAccount + ); + lpPool = (await adminClient.program.account.lpPool.fetch( + lpPoolKey + )) as LPPoolAccount; + const lpPoolAumAfter = lpPool.lastAum; + const lpPoolAumDiff = lpPoolAumAfter.sub(lpPoolAumBefore); + expect(lpPoolAumDiff.toString()).to.be.equal(tokensAdded.toString()); + + const userC0TokenBalanceDiff = + Number(userC0TokenBalanceAfter.amount) - + Number(userC0TokenBalanceBefore.amount); + expect(Number(userC0TokenBalanceDiff)).to.be.equal( + -1 * tokensAdded.toNumber() + ); + + const userLpTokenBalanceDiff = + Number(userLpTokenBalanceAfter.amount) - + Number(userLpTokenBalanceBefore.amount); + expect(userLpTokenBalanceDiff).to.be.equal( + (((tokensAdded.toNumber() * 99) / 100) * 9999) / 10000 + ); // max weight deviation: expect 1% fee on constituent, + 0.01% lp mint fee + + // remove liquidity + await adminClient.lpPoolRemoveLiquidity({ + lpPoolName: encodeName(lpPoolName), + outMarketIndex: 0, + lpToBurn: new BN(userLpTokenBalanceAfter.amount.toString()), + minAmountOut: new BN(1), + lpPool: lpPoolKey, + lpMint: lpPool.mint, + constituentTargetWeights: constituentTargetWeightsPublicKey, + constituentOutTokenAccount: c0TokenAccount, + userOutTokenAccount: c0UserTokenAccount, + userLpTokenAccount: userLpTokenAccount, + outMarketMint: c0.mint, + outConstituent: const0Key, + }); + + const userC0TokenBalanceAfterBurn = + await bankrunContextWrapper.connection.getTokenAccount( + c0UserTokenAccount + ); + const userLpTokenBalanceAfterBurn = + await bankrunContextWrapper.connection.getTokenAccount( + userLpTokenAccount + ); + + const userC0TokenBalanceAfterBurnDiff = + Number(userC0TokenBalanceAfterBurn.amount) - + Number(userC0TokenBalanceAfter.amount); + + expect(userC0TokenBalanceAfterBurnDiff).to.be.greaterThan(0); + expect(Number(userLpTokenBalanceAfterBurn.amount)).to.be.equal(0); + + const totalC0TokensLost = new BN( + userC0TokenBalanceAfterBurn.amount.toString() + ).sub(tokensAdded); + const totalC0TokensLostPercent = + Number(totalC0TokensLost) / Number(tokensAdded); + expect(totalC0TokensLostPercent).to.be.approximately(-0.013, 0.001); // lost about 1.3 swapping in an out + }); }); diff --git a/tests/testHelpers.ts b/tests/testHelpers.ts index 6738c476a..7b10cf3d1 100644 --- a/tests/testHelpers.ts +++ b/tests/testHelpers.ts @@ -18,6 +18,8 @@ import { unpackAccount, type RawAccount, AccountState, + unpackMint, + RawMint, } from '@solana/spl-token'; import { AccountInfo, @@ -1207,6 +1209,36 @@ export async function overWriteTokenAccountBalance( }); } +export async function overWriteMintAccount( + bankrunContextWrapper: BankrunContextWrapper, + mintAccount: PublicKey, + newSupply: bigint +) { + const info = await bankrunContextWrapper.connection.getAccountInfo( + mintAccount + ); + const mint = unpackMint(mintAccount, info, info.owner); + mint.supply = newSupply; + const data = Buffer.alloc(MintLayout.span); + const rawMint: RawMint = { + mintAuthorityOption: mint.mintAuthority ? 1 : 0, + mintAuthority: mint.mintAuthority || PublicKey.default, + supply: mint.supply, + decimals: mint.decimals, + isInitialized: mint.isInitialized, + freezeAuthorityOption: mint.freezeAuthority ? 1 : 0, + freezeAuthority: mint.freezeAuthority || PublicKey.default, + }; + MintLayout.encode(rawMint, data); + bankrunContextWrapper.context.setAccount(mintAccount, { + executable: info.executable, + owner: info.owner, + lamports: info.lamports, + data: data, + rentEpoch: info.rentEpoch, + }); +} + export async function overwriteConstituentAccount( bankrunContextWrapper: BankrunContextWrapper, program: Program, From 8f19f611f57d53b1d4e3e69c7357301f8c85b4d4 Mon Sep 17 00:00:00 2001 From: bigz_Pubkey <83473873+0xbigz@users.noreply.github.com> Date: Mon, 12 May 2025 15:06:44 -0400 Subject: [PATCH 48/50] program: lp-pool-to-use-target-base-vector (#1615) * init lp pool target-base matrix * working target-base logic * add todos for add/remove liquidity aum * add renames + fix test --- programs/drift/src/error.rs | 2 +- programs/drift/src/instructions/admin.rs | 48 +++--- programs/drift/src/instructions/lp_pool.rs | 101 ++++++------ programs/drift/src/lib.rs | 6 +- programs/drift/src/math/oracle.rs | 4 +- programs/drift/src/state/lp_pool.rs | 170 +++++++++++++-------- programs/drift/src/state/lp_pool/tests.rs | 104 ++++--------- 7 files changed, 223 insertions(+), 212 deletions(-) diff --git a/programs/drift/src/error.rs b/programs/drift/src/error.rs index 33947c5df..3c644b074 100644 --- a/programs/drift/src/error.rs +++ b/programs/drift/src/error.rs @@ -642,7 +642,7 @@ pub enum ErrorCode { #[msg("Invalid Amm Constituent Mapping argument")] InvalidAmmConstituentMappingArgument, #[msg("Invalid update constituent update target weights argument")] - InvalidUpdateConstituentTargetWeightsArgument, + InvalidUpdateConstituentTargetBaseArgument, #[msg("Constituent not found")] ConstituentNotFound, #[msg("Constituent could not load")] diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 4b02054af..31b4ac87e 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -3,8 +3,8 @@ use std::mem::size_of; use crate::msg; use crate::state::lp_pool::{ - AmmConstituentDatum, AmmConstituentMapping, Constituent, ConstituentTargetWeights, LPPool, - WeightDatum, AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, + AmmConstituentDatum, AmmConstituentMapping, Constituent, ConstituentTargetBase, LPPool, + TargetsDatum, AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, CONSTITUENT_VAULT_PDA_SEED, }; use anchor_lang::prelude::*; @@ -4517,12 +4517,12 @@ pub fn handle_initialize_lp_pool( .resize_with(0 as usize, AmmConstituentDatum::default); amm_constituent_mapping.validate()?; - let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; - constituent_target_weights.bump = ctx.bumps.constituent_target_weights; - constituent_target_weights - .weights - .resize_with(0 as usize, WeightDatum::default); - constituent_target_weights.validate()?; + let constituent_target_base = &mut ctx.accounts.constituent_target_base; + constituent_target_base.bump = ctx.bumps.constituent_target_base; + constituent_target_base + .targets + .resize_with(0 as usize, TargetsDatum::default); + constituent_target_base.validate()?; Ok(()) } @@ -4734,13 +4734,13 @@ pub fn handle_initialize_constituent<'info>( let mut constituent = ctx.accounts.constituent.load_init()?; let mut lp_pool = ctx.accounts.lp_pool.load_mut()?; - let constituent_target_weights = &mut ctx.accounts.constituent_target_weights; - let current_len = constituent_target_weights.weights.len(); + let constituent_target_base = &mut ctx.accounts.constituent_target_base; + let current_len = constituent_target_base.targets.len(); - constituent_target_weights - .weights - .resize_with((current_len + 1) as usize, WeightDatum::default); - constituent_target_weights.validate()?; + constituent_target_base + .targets + .resize_with((current_len + 1) as usize, TargetsDatum::default); + constituent_target_base.validate()?; msg!( "initializing constituent {} with spot market index {}", @@ -4759,7 +4759,7 @@ pub fn handle_initialize_constituent<'info>( constituent.mint = ctx.accounts.spot_market_mint.key(); constituent.bump = ctx.bumps.constituent; constituent.lp_pool = lp_pool.pubkey; - constituent.constituent_index = (constituent_target_weights.weights.len() - 1) as u16; + constituent.constituent_index = (constituent_target_base.targets.len() - 1) as u16; lp_pool.constituents += 1; Ok(()) @@ -4890,7 +4890,7 @@ pub fn handle_add_amm_constituent_data<'info>( init_amm_constituent_mapping_data: Vec, ) -> Result<()> { let amm_mapping = &mut ctx.accounts.amm_constituent_mapping; - let constituent_target_weights = &ctx.accounts.constituent_target_weights; + let constituent_target_base = &ctx.accounts.constituent_target_base; let state = &ctx.accounts.state; let mut current_len = amm_mapping.weights.len(); @@ -4904,7 +4904,7 @@ pub fn handle_add_amm_constituent_data<'info>( )?; validate!( - (init_datum.constituent_index as usize) < constituent_target_weights.weights.len(), + (init_datum.constituent_index as usize) < constituent_target_base.targets.len(), ErrorCode::InvalidAmmConstituentMappingArgument, "constituent_index too large compared to number of constituents in target weights" )?; @@ -5796,10 +5796,10 @@ pub struct InitializeLpPool<'info> { init, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, - space = ConstituentTargetWeights::space(0 as usize), + space = ConstituentTargetBase::space(0 as usize), payer = admin, )] - pub constituent_target_weights: Box>, + pub constituent_target_base: Box>, #[account( has_one = admin @@ -5838,12 +5838,12 @@ pub struct InitializeConstituent<'info> { #[account( mut, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], - bump = constituent_target_weights.bump, - realloc = ConstituentTargetWeights::space(constituent_target_weights.weights.len() + 1 as usize), + bump = constituent_target_base.bump, + realloc = ConstituentTargetBase::space(constituent_target_base.targets.len() + 1 as usize), realloc::payer = admin, realloc::zero = false, )] - pub constituent_target_weights: Box>, + pub constituent_target_base: Box>, #[account( init, @@ -5923,11 +5923,11 @@ pub struct AddAmmConstituentMappingData<'info> { mut, seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, - realloc = ConstituentTargetWeights::space(constituent_target_weights.weights.len() + 1 as usize), + realloc = ConstituentTargetBase::space(constituent_target_base.targets.len() + 1 as usize), realloc::payer = admin, realloc::zero = false, )] - pub constituent_target_weights: Box>, + pub constituent_target_base: Box>, pub state: Box>, pub system_program: Program<'info, System>, } diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 725344d2e..34dbbcb03 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -17,7 +17,7 @@ use crate::{ events::{LPMintRedeemRecord, LPSwapRecord}, lp_pool::{ AmmConstituentDatum, AmmConstituentMappingFixed, Constituent, - ConstituentTargetWeightsFixed, LPPool, WeightDatum, WeightValidationFlags, + ConstituentTargetBaseFixed, LPPool, TargetsDatum, WeightValidationFlags, }, oracle::OraclePriceData, perp_market::{AmmCacheFixed, CacheInfo, AMM_POSITIONS_CACHE}, @@ -41,8 +41,8 @@ use crate::state::lp_pool::{ LP_POOL_TOKEN_VAULT_PDA_SEED, }; -pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( - ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetWeights<'info>>, +pub fn handle_update_constituent_target_base<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetBase<'info>>, lp_pool_name: [u8; 32], constituent_indexes: Vec, ) -> Result<()> { @@ -68,7 +68,7 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( )?; let state = &ctx.accounts.state; - let constituent_target_weights_key = &ctx.accounts.constituent_target_weights.key(); + let constituent_target_base_key = &ctx.accounts.constituent_target_base.key(); let amm_mapping_key = &ctx.accounts.amm_constituent_mapping.key(); // Validate lp pool pda @@ -87,13 +87,13 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( "Lp pool PDA does not match expected PDA" )?; - let mut constituent_target_weights: AccountZeroCopyMut< + let mut constituent_target_base: AccountZeroCopyMut< '_, - WeightDatum, - ConstituentTargetWeightsFixed, - > = ctx.accounts.constituent_target_weights.load_zc_mut()?; + TargetsDatum, + ConstituentTargetBaseFixed, + > = ctx.accounts.constituent_target_base.load_zc_mut()?; - let bump = constituent_target_weights.fixed.bump; + let bump = constituent_target_base.fixed.bump; let expected_pda = &Pubkey::create_program_address( &[ CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), @@ -104,13 +104,13 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( ) .map_err(|_| ErrorCode::InvalidPDA)?; validate!( - expected_pda.eq(constituent_target_weights_key), + expected_pda.eq(constituent_target_base_key), ErrorCode::InvalidPDA, "Constituent target weights PDA does not match expected PDA" )?; - let num_constituents = constituent_target_weights.len(); - for datum in constituent_target_weights.iter() { + let num_constituents = constituent_target_base.len(); + for datum in constituent_target_base.iter() { msg!("weight datum: {:?}", datum); } @@ -120,7 +120,7 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( validate!( !exists_invalid_constituent_index, - ErrorCode::InvalidUpdateConstituentTargetWeightsArgument, + ErrorCode::InvalidUpdateConstituentTargetBaseArgument, "Constituent index larger than number of constituent target weights" )?; @@ -171,7 +171,7 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( if !is_oracle_valid_for_action( oracle_validity, - Some(DriftAction::UpdateLpConstituentTargetWeights), + Some(DriftAction::UpdateLpConstituentTargetBase), )? { msg!("Oracle data for perp market {} and constituent index {} is invalid. Skipping update", datum.perp_market_index, datum.constituent_index); @@ -187,14 +187,11 @@ pub fn handle_update_constituent_target_weights<'c: 'info, 'info>( return Ok(()); } - constituent_target_weights.update_target_weights( + constituent_target_base.update_target_base( &amm_constituent_mapping, amm_inventories.as_slice(), constituent_indexes.as_slice(), - &oracle_prices.as_slice(), - lp_pool.last_aum, slot, - WeightValidationFlags::NONE, )?; Ok(()) @@ -324,23 +321,23 @@ pub fn handle_lp_pool_swap<'c: 'info, 'info>( let mut in_constituent = ctx.accounts.in_constituent.load_mut()?; let mut out_constituent = ctx.accounts.out_constituent.load_mut()?; - let constituent_target_weights_key = &ctx.accounts.constituent_target_weights.key(); - let constituent_target_weights: AccountZeroCopy< + let constituent_target_base_key = &ctx.accounts.constituent_target_base.key(); + let constituent_target_base: AccountZeroCopy< '_, - WeightDatum, - ConstituentTargetWeightsFixed, - > = ctx.accounts.constituent_target_weights.load_zc()?; + TargetsDatum, + ConstituentTargetBaseFixed, + > = ctx.accounts.constituent_target_base.load_zc()?; let expected_pda = &Pubkey::create_program_address( &[ CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.pubkey.as_ref(), - constituent_target_weights.fixed.bump.to_le_bytes().as_ref(), + constituent_target_base.fixed.bump.to_le_bytes().as_ref(), ], &crate::ID, ) .map_err(|_| ErrorCode::InvalidPDA)?; validate!( - expected_pda.eq(constituent_target_weights_key), + expected_pda.eq(constituent_target_base_key), ErrorCode::InvalidPDA, "Constituent target weights PDA does not match expected PDA" )?; @@ -401,10 +398,18 @@ pub fn handle_lp_pool_swap<'c: 'info, 'info>( update_spot_market_cumulative_interest(&mut in_spot_market, Some(&in_oracle), now)?; update_spot_market_cumulative_interest(&mut out_spot_market, Some(&out_oracle), now)?; - let in_target_weight = - constituent_target_weights.get_target_weight(in_constituent.constituent_index)?; - let out_target_weight = - constituent_target_weights.get_target_weight(out_constituent.constituent_index)?; + let in_target_weight = constituent_target_base.get_target_weight( + in_constituent.constituent_index, + &in_spot_market, + in_oracle.price, + lp_pool.last_aum, + )?; + let out_target_weight = constituent_target_base.get_target_weight( + out_constituent.constituent_index, + &out_spot_market, + out_oracle.price, + lp_pool.last_aum, + )?; let (in_amount, out_amount, in_fee, out_fee) = lp_pool.get_swap_amount( &in_oracle, @@ -514,7 +519,7 @@ pub fn handle_lp_pool_add_liquidity<'c: 'info, 'info>( let mut in_constituent = ctx.accounts.in_constituent.load_mut()?; - let constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc()?; + let constituent_target_base = ctx.accounts.constituent_target_base.load_zc()?; let AccountMaps { perp_market_map: _, @@ -553,8 +558,12 @@ pub fn handle_lp_pool_add_liquidity<'c: 'info, 'info>( update_spot_market_cumulative_interest(&mut in_spot_market, Some(&in_oracle), now)?; - let in_target_weight = - constituent_target_weights.get_target_weight(in_constituent.constituent_index)?; + let in_target_weight = constituent_target_base.get_target_weight( + in_constituent.constituent_index, + &in_spot_market, + in_oracle.price, + lp_pool.last_aum, // TODO: add in_amount * in_oracle to est post add_liquidity aum + )?; let dlp_total_supply = ctx.accounts.lp_mint.supply; @@ -682,7 +691,7 @@ pub fn handle_lp_pool_remove_liquidity<'c: 'info, 'info>( let mut out_constituent = ctx.accounts.out_constituent.load_mut()?; - let constituent_target_weights = ctx.accounts.constituent_target_weights.load_zc()?; + let constituent_target_base = ctx.accounts.constituent_target_base.load_zc()?; let AccountMaps { perp_market_map: _, @@ -723,8 +732,12 @@ pub fn handle_lp_pool_remove_liquidity<'c: 'info, 'info>( update_spot_market_cumulative_interest(&mut out_spot_market, Some(&out_oracle), now)?; - let out_target_weight = - constituent_target_weights.get_target_weight(out_constituent.constituent_index)?; + let out_target_weight = constituent_target_base.get_target_weight( + out_constituent.constituent_index, + &out_spot_market, + out_oracle.price, + lp_pool.last_aum, // TODO: remove out_amount * out_oracle to est post remove_liquidity aum + )?; let dlp_total_supply = ctx.accounts.lp_mint.supply; @@ -843,14 +856,14 @@ pub fn handle_lp_pool_remove_liquidity<'c: 'info, 'info>( #[instruction( lp_pool_name: [u8; 32], )] -pub struct UpdateConstituentTargetWeights<'info> { +pub struct UpdateConstituentTargetBase<'info> { pub state: Box>, #[account(mut)] pub keeper: Signer<'info>, /// CHECK: checked in AmmConstituentMappingZeroCopy checks pub amm_constituent_mapping: AccountInfo<'info>, - /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks - pub constituent_target_weights: AccountInfo<'info>, + /// CHECK: checked in ConstituentTargetBaseZeroCopy checks + pub constituent_target_base: AccountInfo<'info>, /// CHECK: checked in AmmCacheZeroCopy checks pub amm_cache: AccountInfo<'info>, #[account( @@ -892,8 +905,8 @@ pub struct LPPoolSwap<'info> { seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, )] - /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks - pub constituent_target_weights: AccountInfo<'info>, + /// CHECK: checked in ConstituentTargetBaseZeroCopy checks + pub constituent_target_base: AccountInfo<'info>, #[account(mut)] pub constituent_in_token_account: Box>, @@ -991,8 +1004,8 @@ pub struct LPPoolAddLiquidity<'info> { seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, )] - /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks - pub constituent_target_weights: AccountInfo<'info>, + /// CHECK: checked in ConstituentTargetBaseZeroCopy checks + pub constituent_target_base: AccountInfo<'info>, #[account( mut, @@ -1052,8 +1065,8 @@ pub struct LPPoolRemoveLiquidity<'info> { seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, )] - /// CHECK: checked in ConstituentTargetWeightsZeroCopy checks - pub constituent_target_weights: AccountInfo<'info>, + /// CHECK: checked in ConstituentTargetBaseZeroCopy checks + pub constituent_target_base: AccountInfo<'info>, #[account( mut, diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 6785ceeb3..0fe28bae9 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1790,12 +1790,12 @@ pub mod drift { handle_remove_amm_constituent_mapping_data(ctx, perp_market_index, constituent_index) } - pub fn update_lp_constituent_target_weights<'c: 'info, 'info>( - ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetWeights<'info>>, + pub fn update_lp_constituent_target_base<'c: 'info, 'info>( + ctx: Context<'_, '_, 'c, 'info, UpdateConstituentTargetBase<'info>>, lp_pool_name: [u8; 32], constituent_indexes: Vec, ) -> Result<()> { - handle_update_constituent_target_weights(ctx, lp_pool_name, constituent_indexes) + handle_update_constituent_target_base(ctx, lp_pool_name, constituent_indexes) } pub fn update_lp_pool_aum<'c: 'info, 'info>( diff --git a/programs/drift/src/math/oracle.rs b/programs/drift/src/math/oracle.rs index 09d18d817..fcd5eae35 100644 --- a/programs/drift/src/math/oracle.rs +++ b/programs/drift/src/math/oracle.rs @@ -69,7 +69,7 @@ pub enum DriftAction { UpdateTwap, UpdateAMMCurve, OracleOrderPrice, - UpdateLpConstituentTargetWeights, + UpdateLpConstituentTargetBase, UpdateLpPoolAum, LpPoolSwap, } @@ -131,7 +131,7 @@ pub fn is_oracle_valid_for_action( ), DriftAction::UpdateTwap => !matches!(oracle_validity, OracleValidity::NonPositive), DriftAction::UpdateAMMCurve => !matches!(oracle_validity, OracleValidity::NonPositive), - DriftAction::UpdateLpConstituentTargetWeights | DriftAction::UpdateLpPoolAum => { + DriftAction::UpdateLpConstituentTargetBase | DriftAction::UpdateLpPoolAum => { !matches!(oracle_validity, OracleValidity::NonPositive) } DriftAction::LpPoolSwap => !matches!( diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index b43cc0461..e817090c9 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -10,7 +10,8 @@ use anchor_spl::token::Mint; use borsh::{BorshDeserialize, BorshSerialize}; use super::oracle::OraclePriceData; -use super::spot_market::SpotMarket; +use super::oracle_map::OracleMap; +use super::spot_market::{self, SpotMarket}; use super::zero_copy::{AccountZeroCopy, AccountZeroCopyMut, HasLen}; use crate::state::spot_market::{SpotBalance, SpotBalanceType}; use crate::state::traits::Size; @@ -18,7 +19,7 @@ use crate::{impl_zero_copy_loader, validate}; pub const AMM_MAP_PDA_SEED: &str = "AMM_MAP"; pub const CONSTITUENT_PDA_SEED: &str = "CONSTITUENT"; -pub const CONSTITUENT_TARGET_WEIGHT_PDA_SEED: &str = "CONSTITUENT_TARGET_WEIGHTS"; +pub const CONSTITUENT_TARGET_WEIGHT_PDA_SEED: &str = "constituent_target_base"; pub const CONSTITUENT_VAULT_PDA_SEED: &str = "CONSTITUENT_VAULT"; pub const LP_POOL_TOKEN_VAULT_PDA_SEED: &str = "LP_POOL_TOKEN_VAULT"; @@ -623,17 +624,28 @@ pub struct WeightDatum { pub weight: i64, } + +#[zero_copy] +#[derive(Debug, Default, BorshDeserialize, BorshSerialize)] +#[repr(C)] +pub struct TargetsDatum { + pub last_slot: u64, + pub target_base: i64, + // pub correlation_scalar: i32, + // pub cost_to_trade: i32, +} + #[zero_copy] #[derive(Debug, Default)] #[repr(C)] -pub struct ConstituentTargetWeightsFixed { +pub struct ConstituentTargetBaseFixed { pub bump: u8, _pad: [u8; 3], /// total elements in the flattened `data` vec pub len: u32, } -impl HasLen for ConstituentTargetWeightsFixed { +impl HasLen for ConstituentTargetBaseFixed { fn len(&self) -> u32 { self.len } @@ -642,21 +654,21 @@ impl HasLen for ConstituentTargetWeightsFixed { #[account] #[derive(Debug)] #[repr(C)] -pub struct ConstituentTargetWeights { +pub struct ConstituentTargetBase { pub bump: u8, _padding: [u8; 3], // PERCENTAGE_PRECISION. The weights of the target weight matrix. Updated async - pub weights: Vec, + pub targets: Vec, } -impl ConstituentTargetWeights { +impl ConstituentTargetBase { pub fn space(num_constituents: usize) -> usize { 8 + 8 + 4 + num_constituents * 16 } pub fn validate(&self) -> DriftResult<()> { validate!( - self.weights.len() <= 128, + self.targets.len() <= 128, ErrorCode::DefaultError, "Number of constituents len must be between 1 and 128" )?; @@ -665,18 +677,18 @@ impl ConstituentTargetWeights { } impl_zero_copy_loader!( - ConstituentTargetWeights, + ConstituentTargetBase, crate::id, - ConstituentTargetWeightsFixed, - WeightDatum + ConstituentTargetBaseFixed, + TargetsDatum ); -impl Default for ConstituentTargetWeights { +impl Default for ConstituentTargetBase { fn default() -> Self { - ConstituentTargetWeights { + ConstituentTargetBase { bump: 0, _padding: [0; 3], - weights: Vec::with_capacity(0), + targets: Vec::with_capacity(0), } } } @@ -689,92 +701,118 @@ pub enum WeightValidationFlags { NoOverweight = 0b0000_0100, } -impl<'a> AccountZeroCopy<'a, WeightDatum, ConstituentTargetWeightsFixed> { - pub fn get_target_weight(&self, constituent_index: u16) -> DriftResult { +impl<'a> AccountZeroCopy<'a, TargetsDatum, ConstituentTargetBaseFixed> { + pub fn get_target_weight( + &self, + constituent_index: u16, + spot_market: &SpotMarket, + price: i64, + aum: u128, + ) -> DriftResult { validate!( constituent_index < self.len() as u16, ErrorCode::InvalidConstituent, - "Invalid constituent_index = {}, ConstituentTargetWeights len = {}", + "Invalid constituent_index = {}, ConstituentTargetBase len = {}", constituent_index, self.len() )?; + // TODO: validate spot market let datum = self.get(constituent_index as u32); - Ok(datum.weight) + let target_weight = calculate_target_weight( + datum.target_base, + &spot_market, + price, + aum, + WeightValidationFlags::NONE, + )?; + Ok(target_weight) } } -/// Update target weights based on amm_inventory and mapping -impl<'a> AccountZeroCopyMut<'a, WeightDatum, ConstituentTargetWeightsFixed> { - pub fn update_target_weights( +pub fn calculate_target_weight( + target_base: i64, + spot_market: &SpotMarket, + price: i64, + lp_pool_aum: u128, + validation_flags: WeightValidationFlags, +) -> DriftResult { + //.clamp(-PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I128) as i64; + + // assumes PRICE_PRECISION = PERCENTAGE_PRECISION + let token_precision = 10_i128.pow(spot_market.decimals as u32); + + let value_usd = target_base + .cast::()? + .safe_mul(price.cast::()?)?; + + let target_weight = value_usd + .cast::()? + .safe_mul(PERCENTAGE_PRECISION_I64.cast::()?)? + .safe_div(lp_pool_aum.cast::()?.safe_mul(token_precision)?)? + .cast::()?; + + // if (validation_flags as u8 & (WeightValidationFlags::NoNegativeWeights as u8) != 0) + // && target_weight < 0 + // { + // return Err(ErrorCode::DefaultError); + // } + // if (validation_flags as u8 & (WeightValidationFlags::NoOverweight as u8) != 0) + // && target_weight > PERCENTAGE_PRECISION_I64 as i128 + // { + // return Err(ErrorCode::DefaultError); + // } + + // if (validation_flags as u8) & WeightValidationFlags::EnforceTotalWeight100 as u8 != 0 { + // let deviation = (total_weight - PERCENTAGE_PRECISION_I128).abs(); + // let tolerance = 100; + // if deviation > tolerance { + // return Err(ErrorCode::DefaultError); + // } + // } + + Ok(target_weight) +} + +/// Update target base based on amm_inventory and mapping +impl<'a> AccountZeroCopyMut<'a, TargetsDatum, ConstituentTargetBaseFixed> { + pub fn update_target_base( &mut self, mapping: &AccountZeroCopy<'a, AmmConstituentDatum, AmmConstituentMappingFixed>, // (perp market index, inventory, price) amm_inventory: &[(u16, i64)], constituents_indexes: &[u16], - prices: &[i64], - aum: u128, slot: u64, - validation_flags: WeightValidationFlags, - ) -> DriftResult { - let mut total_weight: i128 = 0; - let aum_i128 = aum.cast::()?; + ) -> DriftResult> { + let mut results = Vec::with_capacity(constituents_indexes.len()); + for (i, constituent_index) in constituents_indexes.iter().enumerate() { let mut target_amount = 0i128; - + for (perp_market_index, inventory) in amm_inventory.iter() { let idx = mapping .iter() .position(|d| &d.perp_market_index == perp_market_index) .expect("missing mapping for this market index"); let weight = mapping.get(idx as u32).weight; // PERCENTAGE_PRECISION - + target_amount += (*inventory as i128) .saturating_mul(weight as i128) .saturating_div(PERCENTAGE_PRECISION_I64 as i128); } - - let price = prices[i] as i128; - - // assumes PRICE_PRECISION = PERCENTAGE_PRECISION - let target_weight: i128 = if aum > 0 { - target_amount.saturating_mul(price).saturating_div(aum_i128) - } else { - 0 - }; - - if (validation_flags as u8 & (WeightValidationFlags::NoNegativeWeights as u8) != 0) - && target_weight < 0 - { - return Err(ErrorCode::DefaultError); - } - if (validation_flags as u8 & (WeightValidationFlags::NoOverweight as u8) != 0) - && target_weight > PERCENTAGE_PRECISION_I64 as i128 - { - return Err(ErrorCode::DefaultError); - } - + let cell = self.get_mut(i as u32); msg!( - "updating constituent index {} target weight to {}", + "updating constituent index {} target amount to {}", constituent_index, - target_weight + target_amount ); - cell.weight = - target_weight.clamp(-PERCENTAGE_PRECISION_I128, PERCENTAGE_PRECISION_I128) as i64; + cell.target_base = target_amount as i64; cell.last_slot = slot; - - total_weight = total_weight.saturating_add(target_weight); - } - - if (validation_flags as u8) & WeightValidationFlags::EnforceTotalWeight100 as u8 != 0 { - let deviation = (total_weight - PERCENTAGE_PRECISION_I128).abs(); - let tolerance = 100; - if deviation > tolerance { - return Err(ErrorCode::DefaultError); - } + + results.push(target_amount); } - - Ok(total_weight) + + Ok(results) } } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index d14cdf999..fb42ab222 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -53,33 +53,25 @@ mod tests { let aum = 1_000_000; let now_ts = 1000; - let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + let target_fixed = RefCell::new(ConstituentTargetBaseFixed { len: 1, - ..ConstituentTargetWeightsFixed::default() + ..ConstituentTargetBaseFixed::default() }); let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = - AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { fixed: target_fixed.borrow_mut(), data: target_data.borrow_mut(), - _marker: PhantomData::, + _marker: PhantomData::, }; let totalw = target_zc_mut - .update_target_weights( - &mapping_zc, - &amm_inventory, - &constituent_indexes, - &prices, - aum, - now_ts, - WeightValidationFlags::NONE, - ) + .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) .unwrap(); - assert_eq!(totalw, 0); + assert!(totalw.iter().all(|&x| x == 0)); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).weight, 0); + assert_eq!(target_zc_mut.get(0).target_base, 0); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } @@ -117,34 +109,26 @@ mod tests { let aum = 1_000_000; let now_ts = 1234; - let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + let target_fixed = RefCell::new(ConstituentTargetBaseFixed { len: 1, - ..ConstituentTargetWeightsFixed::default() + ..ConstituentTargetBaseFixed::default() }); let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = - AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { fixed: target_fixed.borrow_mut(), data: target_data.borrow_mut(), - _marker: PhantomData::, + _marker: PhantomData::, }; let totalw = target_zc_mut - .update_target_weights( - &mapping_zc, - &amm_inventory, - &constituent_indexes, - &prices, - aum, - now_ts, - WeightValidationFlags::NONE, - ) + .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) .unwrap(); - assert_eq!(totalw, 1000000); + assert_eq!(totalw, [1000000]); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).weight, PERCENTAGE_PRECISION_I64); + assert_eq!(target_zc_mut.get(0).target_base, PERCENTAGE_PRECISION_I64); assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } @@ -193,34 +177,26 @@ mod tests { let aum = 1_000_000; let now_ts = 999; - let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + let target_fixed = RefCell::new(ConstituentTargetBaseFixed { len: amm_mapping_data.len() as u32, - ..ConstituentTargetWeightsFixed::default() + ..ConstituentTargetBaseFixed::default() }); let target_data = RefCell::new([0u8; 32]); let mut target_zc_mut = - AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { fixed: target_fixed.borrow_mut(), data: target_data.borrow_mut(), - _marker: PhantomData::, + _marker: PhantomData::, }; target_zc_mut - .update_target_weights( - &mapping_zc, - &amm_inventory, - &constituent_indexes, - &prices, - aum, - now_ts, - WeightValidationFlags::NONE, - ) + .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) .unwrap(); assert_eq!(target_zc_mut.len(), 2); for i in 0..target_zc_mut.len() { - assert_eq!(target_zc_mut.get(i).weight, PERCENTAGE_PRECISION_I64 / 2); + assert_eq!(target_zc_mut.get(i).target_base, PERCENTAGE_PRECISION_I64 / 2); assert_eq!(target_zc_mut.get(i).last_slot, now_ts); } } @@ -259,32 +235,24 @@ mod tests { let aum = 0; let now_ts = 111; - let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + let target_fixed = RefCell::new(ConstituentTargetBaseFixed { len: 1, - ..ConstituentTargetWeightsFixed::default() + ..ConstituentTargetBaseFixed::default() }); let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = - AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { fixed: target_fixed.borrow_mut(), data: target_data.borrow_mut(), - _marker: PhantomData::, + _marker: PhantomData::, }; target_zc_mut - .update_target_weights( - &mapping_zc, - &amm_inventory, - &constituent_indexes, - &prices, - aum, - now_ts, - WeightValidationFlags::NONE, - ) + .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert_eq!(target_zc_mut.get(0).weight, 0); // no target + assert_eq!(target_zc_mut.get(0).target_base, 1_000_000); // despite no aum, desire to reach target assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } @@ -322,32 +290,24 @@ mod tests { let aum = 1; let now_ts = 222; - let target_fixed = RefCell::new(ConstituentTargetWeightsFixed { + let target_fixed = RefCell::new(ConstituentTargetBaseFixed { len: 1, - ..ConstituentTargetWeightsFixed::default() + ..ConstituentTargetBaseFixed::default() }); let target_data = RefCell::new([0u8; 16]); let mut target_zc_mut = - AccountZeroCopyMut::<'_, WeightDatum, ConstituentTargetWeightsFixed> { + AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { fixed: target_fixed.borrow_mut(), data: target_data.borrow_mut(), - _marker: PhantomData::, + _marker: PhantomData::, }; target_zc_mut - .update_target_weights( - &mapping_zc, - &amm_inventory, - &constituent_indexes, - &prices, - aum, - now_ts, - WeightValidationFlags::NONE, - ) + .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) .unwrap(); assert_eq!(target_zc_mut.len(), 1); - assert!(target_zc_mut.get(0).weight <= PERCENTAGE_PRECISION_I64); + assert!(target_zc_mut.get(0).target_base < i64::MAX); // rounding sat div assert_eq!(target_zc_mut.get(0).last_slot, now_ts); } From acab7f54a1479a229ca2af98fadc480af7db4f14 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Mon, 12 May 2025 16:15:04 -0700 Subject: [PATCH 49/50] add beta and cost to trade in bps to target datum --- programs/drift/src/instructions/admin.rs | 58 ++++++++++++- programs/drift/src/instructions/lp_pool.rs | 19 ++--- programs/drift/src/lib.rs | 5 ++ programs/drift/src/state/constituent_map.rs | 2 +- programs/drift/src/state/lp_pool.rs | 39 ++++++--- programs/drift/src/state/lp_pool/tests.rs | 70 ++++++++-------- sdk/src/addresses/pda.ts | 4 +- sdk/src/adminClient.ts | 44 +++++++--- sdk/src/driftClient.ts | 46 +++++------ sdk/src/idl/drift.json | 91 +++++++++++++++++---- sdk/src/types.ts | 10 ++- tests/lpPool.ts | 69 +++++++++------- tests/lpPoolSwap.ts | 16 ++-- 13 files changed, 321 insertions(+), 152 deletions(-) diff --git a/programs/drift/src/instructions/admin.rs b/programs/drift/src/instructions/admin.rs index 31b4ac87e..2d12effcf 100644 --- a/programs/drift/src/instructions/admin.rs +++ b/programs/drift/src/instructions/admin.rs @@ -4,7 +4,7 @@ use std::mem::size_of; use crate::msg; use crate::state::lp_pool::{ AmmConstituentDatum, AmmConstituentMapping, Constituent, ConstituentTargetBase, LPPool, - TargetsDatum, AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, + TargetsDatum, AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_BASE_PDA_SEED, CONSTITUENT_VAULT_PDA_SEED, }; use anchor_lang::prelude::*; @@ -4730,6 +4730,8 @@ pub fn handle_initialize_constituent<'info>( swap_fee_min: i64, swap_fee_max: i64, oracle_staleness_threshold: u64, + beta: i32, + cost_to_trade_bps: i32, ) -> Result<()> { let mut constituent = ctx.accounts.constituent.load_init()?; let mut lp_pool = ctx.accounts.lp_pool.load_mut()?; @@ -4740,6 +4742,13 @@ pub fn handle_initialize_constituent<'info>( constituent_target_base .targets .resize_with((current_len + 1) as usize, TargetsDatum::default); + + let new_target = constituent_target_base + .targets + .get_mut(current_len) + .unwrap(); + new_target.beta = beta; + new_target.cost_to_trade_bps = cost_to_trade_bps; constituent_target_base.validate()?; msg!( @@ -4771,6 +4780,8 @@ pub struct ConstituentParams { pub swap_fee_min: Option, pub swap_fee_max: Option, pub oracle_staleness_threshold: Option, + pub beta: Option, + pub cost_to_trade_bps: Option, } pub fn handle_update_constituent_params<'info>( @@ -4815,6 +4826,29 @@ pub fn handle_update_constituent_params<'info>( constituent_params.oracle_staleness_threshold.unwrap(); } + if constituent_params.beta.is_some() || constituent_params.cost_to_trade_bps.is_some() { + let constituent_target_base = &mut ctx.accounts.constituent_target_base; + + let target = constituent_target_base + .targets + .get_mut(constituent.constituent_index as usize) + .unwrap(); + + if constituent_params.cost_to_trade_bps.is_some() { + msg!( + "cost_to_trade: {:?} -> {:?}", + target.cost_to_trade_bps, + constituent_params.cost_to_trade_bps + ); + target.cost_to_trade_bps = constituent_params.cost_to_trade_bps.unwrap(); + } + + if constituent_params.beta.is_some() { + msg!("beta: {:?} -> {:?}", target.beta, constituent_params.beta); + target.beta = constituent_params.beta.unwrap(); + } + } + Ok(()) } @@ -5794,7 +5828,7 @@ pub struct InitializeLpPool<'info> { #[account( init, - seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + seeds = [CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, space = ConstituentTargetBase::space(0 as usize), payer = admin, @@ -5837,7 +5871,7 @@ pub struct InitializeConstituent<'info> { #[account( mut, - seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + seeds = [CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump = constituent_target_base.bump, realloc = ConstituentTargetBase::space(constituent_target_base.targets.len() + 1 as usize), realloc::payer = admin, @@ -5874,7 +5908,23 @@ pub struct InitializeConstituent<'info> { } #[derive(Accounts)] +#[instruction( + lp_pool_name: [u8; 32], +)] pub struct UpdateConstituentParams<'info> { + #[account( + mut, + seeds = [b"lp_pool", lp_pool_name.as_ref()], + bump = lp_pool.load()?.bump, + )] + pub lp_pool: AccountLoader<'info, LPPool>, + #[account( + mut, + seeds = [CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + bump = constituent_target_base.bump, + constraint = constituent.load()?.lp_pool == lp_pool.key() + )] + pub constituent_target_base: Box>, #[account( mut, constraint = admin.key() == admin_hot_wallet::id() || admin.key() == state.admin @@ -5921,7 +5971,7 @@ pub struct AddAmmConstituentMappingData<'info> { pub amm_constituent_mapping: Box>, #[account( mut, - seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + seeds = [CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, realloc = ConstituentTargetBase::space(constituent_target_base.targets.len() + 1 as usize), realloc::payer = admin, diff --git a/programs/drift/src/instructions/lp_pool.rs b/programs/drift/src/instructions/lp_pool.rs index 34dbbcb03..d0e35c0d9 100644 --- a/programs/drift/src/instructions/lp_pool.rs +++ b/programs/drift/src/instructions/lp_pool.rs @@ -37,7 +37,7 @@ use crate::controller::spot_balance::update_spot_market_cumulative_interest; use crate::controller::token::{receive, send_from_program_vault}; use crate::instructions::constraints::*; use crate::state::lp_pool::{ - AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_WEIGHT_PDA_SEED, + AMM_MAP_PDA_SEED, CONSTITUENT_PDA_SEED, CONSTITUENT_TARGET_BASE_PDA_SEED, LP_POOL_TOKEN_VAULT_PDA_SEED, }; @@ -96,7 +96,7 @@ pub fn handle_update_constituent_target_base<'c: 'info, 'info>( let bump = constituent_target_base.fixed.bump; let expected_pda = &Pubkey::create_program_address( &[ - CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), + CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.pubkey.as_ref(), bump.to_le_bytes().as_ref(), ], @@ -322,14 +322,11 @@ pub fn handle_lp_pool_swap<'c: 'info, 'info>( let mut out_constituent = ctx.accounts.out_constituent.load_mut()?; let constituent_target_base_key = &ctx.accounts.constituent_target_base.key(); - let constituent_target_base: AccountZeroCopy< - '_, - TargetsDatum, - ConstituentTargetBaseFixed, - > = ctx.accounts.constituent_target_base.load_zc()?; + let constituent_target_base: AccountZeroCopy<'_, TargetsDatum, ConstituentTargetBaseFixed> = + ctx.accounts.constituent_target_base.load_zc()?; let expected_pda = &Pubkey::create_program_address( &[ - CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), + CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.pubkey.as_ref(), constituent_target_base.fixed.bump.to_le_bytes().as_ref(), ], @@ -902,7 +899,7 @@ pub struct LPPoolSwap<'info> { pub state: Box>, pub lp_pool: AccountLoader<'info, LPPool>, #[account( - seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + seeds = [CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, )] /// CHECK: checked in ConstituentTargetBaseZeroCopy checks @@ -1001,7 +998,7 @@ pub struct LPPoolAddLiquidity<'info> { )] pub lp_mint: Box>, #[account( - seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + seeds = [CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, )] /// CHECK: checked in ConstituentTargetBaseZeroCopy checks @@ -1062,7 +1059,7 @@ pub struct LPPoolRemoveLiquidity<'info> { )] pub lp_mint: Box>, #[account( - seeds = [CONSTITUENT_TARGET_WEIGHT_PDA_SEED.as_ref(), lp_pool.key().as_ref()], + seeds = [CONSTITUENT_TARGET_BASE_PDA_SEED.as_ref(), lp_pool.key().as_ref()], bump, )] /// CHECK: checked in ConstituentTargetBaseZeroCopy checks diff --git a/programs/drift/src/lib.rs b/programs/drift/src/lib.rs index 0fe28bae9..d2b0fddeb 100644 --- a/programs/drift/src/lib.rs +++ b/programs/drift/src/lib.rs @@ -1746,6 +1746,8 @@ pub mod drift { swap_fee_min: i64, swap_fee_max: i64, oracle_staleness_threshold: u64, + beta: i32, + cost_to_trade: i32, ) -> Result<()> { handle_initialize_constituent( ctx, @@ -1755,11 +1757,14 @@ pub mod drift { swap_fee_min, swap_fee_max, oracle_staleness_threshold, + beta, + cost_to_trade, ) } pub fn update_constituent_params( ctx: Context, + lp_pool_name: [u8; 32], constituent_params: ConstituentParams, ) -> Result<()> { handle_update_constituent_params(ctx, constituent_params) diff --git a/programs/drift/src/state/constituent_map.rs b/programs/drift/src/state/constituent_map.rs index e8adee9ba..57a37dfc5 100644 --- a/programs/drift/src/state/constituent_map.rs +++ b/programs/drift/src/state/constituent_map.rs @@ -130,7 +130,7 @@ impl<'a> ConstituentMap<'a> { &constituent_lp_key == lp_pool_key, ErrorCode::InvalidConstituent, "Constituent lp pool pubkey does not match lp pool pubkey" - ); + )?; // constituent index 42 bytes from front of account let constituent_index = u16::from_le_bytes(*array_ref![data, 42, 2]); diff --git a/programs/drift/src/state/lp_pool.rs b/programs/drift/src/state/lp_pool.rs index e817090c9..867f66233 100644 --- a/programs/drift/src/state/lp_pool.rs +++ b/programs/drift/src/state/lp_pool.rs @@ -19,7 +19,7 @@ use crate::{impl_zero_copy_loader, validate}; pub const AMM_MAP_PDA_SEED: &str = "AMM_MAP"; pub const CONSTITUENT_PDA_SEED: &str = "CONSTITUENT"; -pub const CONSTITUENT_TARGET_WEIGHT_PDA_SEED: &str = "constituent_target_base"; +pub const CONSTITUENT_TARGET_BASE_PDA_SEED: &str = "constituent_target_base"; pub const CONSTITUENT_VAULT_PDA_SEED: &str = "CONSTITUENT_VAULT"; pub const LP_POOL_TOKEN_VAULT_PDA_SEED: &str = "LP_POOL_TOKEN_VAULT"; @@ -624,15 +624,14 @@ pub struct WeightDatum { pub weight: i64, } - #[zero_copy] #[derive(Debug, Default, BorshDeserialize, BorshSerialize)] #[repr(C)] pub struct TargetsDatum { pub last_slot: u64, pub target_base: i64, - // pub correlation_scalar: i32, - // pub cost_to_trade: i32, + pub beta: i32, + pub cost_to_trade_bps: i32, } #[zero_copy] @@ -663,7 +662,7 @@ pub struct ConstituentTargetBase { impl ConstituentTargetBase { pub fn space(num_constituents: usize) -> usize { - 8 + 8 + 4 + num_constituents * 16 + 8 + 8 + 4 + num_constituents * 24 } pub fn validate(&self) -> DriftResult<()> { @@ -672,6 +671,13 @@ impl ConstituentTargetBase { ErrorCode::DefaultError, "Number of constituents len must be between 1 and 128" )?; + + validate!( + !self.targets.iter().any(|t| t.cost_to_trade_bps == 0), + ErrorCode::DefaultError, + "cost_to_trade_bps must be non-zero" + )?; + Ok(()) } } @@ -716,10 +722,13 @@ impl<'a> AccountZeroCopy<'a, TargetsDatum, ConstituentTargetBaseFixed> { constituent_index, self.len() )?; + // TODO: validate spot market let datum = self.get(constituent_index as u32); let target_weight = calculate_target_weight( datum.target_base, + datum.beta, + datum.cost_to_trade_bps, &spot_market, price, aum, @@ -731,6 +740,8 @@ impl<'a> AccountZeroCopy<'a, TargetsDatum, ConstituentTargetBaseFixed> { pub fn calculate_target_weight( target_base: i64, + beta: i32, + cost_to_trade_bps: i32, spot_market: &SpotMarket, price: i64, lp_pool_aum: u128, @@ -743,7 +754,11 @@ pub fn calculate_target_weight( let value_usd = target_base .cast::()? - .safe_mul(price.cast::()?)?; + .safe_mul(price.cast::()?)? + .safe_mul( + beta.cast::()? + .safe_div(cost_to_trade_bps.cast::()?.safe_div(10000)?)?, + )?; let target_weight = value_usd .cast::()? @@ -784,22 +799,22 @@ impl<'a> AccountZeroCopyMut<'a, TargetsDatum, ConstituentTargetBaseFixed> { slot: u64, ) -> DriftResult> { let mut results = Vec::with_capacity(constituents_indexes.len()); - + for (i, constituent_index) in constituents_indexes.iter().enumerate() { let mut target_amount = 0i128; - + for (perp_market_index, inventory) in amm_inventory.iter() { let idx = mapping .iter() .position(|d| &d.perp_market_index == perp_market_index) .expect("missing mapping for this market index"); let weight = mapping.get(idx as u32).weight; // PERCENTAGE_PRECISION - + target_amount += (*inventory as i128) .saturating_mul(weight as i128) .saturating_div(PERCENTAGE_PRECISION_I64 as i128); } - + let cell = self.get_mut(i as u32); msg!( "updating constituent index {} target amount to {}", @@ -808,10 +823,10 @@ impl<'a> AccountZeroCopyMut<'a, TargetsDatum, ConstituentTargetBaseFixed> { ); cell.target_base = target_amount as i64; cell.last_slot = slot; - + results.push(target_amount); } - + Ok(results) } } diff --git a/programs/drift/src/state/lp_pool/tests.rs b/programs/drift/src/state/lp_pool/tests.rs index fb42ab222..e39f57e34 100644 --- a/programs/drift/src/state/lp_pool/tests.rs +++ b/programs/drift/src/state/lp_pool/tests.rs @@ -57,13 +57,12 @@ mod tests { len: 1, ..ConstituentTargetBaseFixed::default() }); - let target_data = RefCell::new([0u8; 16]); - let mut target_zc_mut = - AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { - fixed: target_fixed.borrow_mut(), - data: target_data.borrow_mut(), - _marker: PhantomData::, - }; + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; let totalw = target_zc_mut .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) @@ -113,13 +112,12 @@ mod tests { len: 1, ..ConstituentTargetBaseFixed::default() }); - let target_data = RefCell::new([0u8; 16]); - let mut target_zc_mut = - AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { - fixed: target_fixed.borrow_mut(), - data: target_data.borrow_mut(), - _marker: PhantomData::, - }; + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; let totalw = target_zc_mut .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) @@ -181,13 +179,12 @@ mod tests { len: amm_mapping_data.len() as u32, ..ConstituentTargetBaseFixed::default() }); - let target_data = RefCell::new([0u8; 32]); - let mut target_zc_mut = - AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { - fixed: target_fixed.borrow_mut(), - data: target_data.borrow_mut(), - _marker: PhantomData::, - }; + let target_data = RefCell::new([0u8; 48]); + let mut target_zc_mut = AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; target_zc_mut .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) @@ -196,7 +193,10 @@ mod tests { assert_eq!(target_zc_mut.len(), 2); for i in 0..target_zc_mut.len() { - assert_eq!(target_zc_mut.get(i).target_base, PERCENTAGE_PRECISION_I64 / 2); + assert_eq!( + target_zc_mut.get(i).target_base, + PERCENTAGE_PRECISION_I64 / 2 + ); assert_eq!(target_zc_mut.get(i).last_slot, now_ts); } } @@ -239,13 +239,12 @@ mod tests { len: 1, ..ConstituentTargetBaseFixed::default() }); - let target_data = RefCell::new([0u8; 16]); - let mut target_zc_mut = - AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { - fixed: target_fixed.borrow_mut(), - data: target_data.borrow_mut(), - _marker: PhantomData::, - }; + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; target_zc_mut .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) @@ -294,13 +293,12 @@ mod tests { len: 1, ..ConstituentTargetBaseFixed::default() }); - let target_data = RefCell::new([0u8; 16]); - let mut target_zc_mut = - AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { - fixed: target_fixed.borrow_mut(), - data: target_data.borrow_mut(), - _marker: PhantomData::, - }; + let target_data = RefCell::new([0u8; 24]); + let mut target_zc_mut = AccountZeroCopyMut::<'_, TargetsDatum, ConstituentTargetBaseFixed> { + fixed: target_fixed.borrow_mut(), + data: target_data.borrow_mut(), + _marker: PhantomData::, + }; target_zc_mut .update_target_base(&mapping_zc, &amm_inventory, &constituent_indexes, now_ts) diff --git a/sdk/src/addresses/pda.ts b/sdk/src/addresses/pda.ts index 4a4efcaac..632379414 100644 --- a/sdk/src/addresses/pda.ts +++ b/sdk/src/addresses/pda.ts @@ -418,13 +418,13 @@ export function getAmmConstituentMappingPublicKey( )[0]; } -export function getConstituentTargetWeightsPublicKey( +export function getConstituentTargetBasePublicKey( programId: PublicKey, lpPoolPublicKey: PublicKey ): PublicKey { return PublicKey.findProgramAddressSync( [ - Buffer.from(anchor.utils.bytes.utf8.encode('CONSTITUENT_TARGET_WEIGHTS')), + Buffer.from(anchor.utils.bytes.utf8.encode('constituent_target_base')), lpPoolPublicKey.toBuffer(), ], programId diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 526faa332..8ec93abb0 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -43,7 +43,7 @@ import { getTokenProgramForSpotMarket, getLpPoolPublicKey, getAmmConstituentMappingPublicKey, - getConstituentTargetWeightsPublicKey, + getConstituentTargetBasePublicKey, getConstituentPublicKey, getConstituentVaultPublicKey, getAmmCachePublicKey, @@ -4399,7 +4399,7 @@ export class AdminClient extends DriftClient { this.program.programId, lpPool ); - const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + const constituentTargetBase = getConstituentTargetBasePublicKey( this.program.programId, lpPool ); @@ -4441,7 +4441,7 @@ export class AdminClient extends DriftClient { lpPool ), ammConstituentMapping, - constituentTargetWeights, + constituentTargetBase, mint: mint.publicKey, state: await this.getStatePublicKey(), driftSigner: this.getSignerPublicKey(), @@ -4462,7 +4462,9 @@ export class AdminClient extends DriftClient { maxWeightDeviation: BN, swapFeeMin: BN, swapFeeMax: BN, - oracleStalenessThreshold: BN + oracleStalenessThreshold: BN, + beta: BN, + costToTrade: BN ): Promise { const ixs = await this.getInitializeConstituentIx( lpPoolName, @@ -4471,7 +4473,9 @@ export class AdminClient extends DriftClient { maxWeightDeviation, swapFeeMin, swapFeeMax, - oracleStalenessThreshold + oracleStalenessThreshold, + beta, + costToTrade ); const tx = await this.buildTransaction(ixs); const { txSig } = await this.sendTransaction(tx, []); @@ -4485,10 +4489,12 @@ export class AdminClient extends DriftClient { maxWeightDeviation: BN, swapFeeMin: BN, swapFeeMax: BN, - oracleStalenessThreshold: BN + oracleStalenessThreshold: BN, + beta: BN, + costToTrade: BN ): Promise { const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); - const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + const constituentTargetBase = getConstituentTargetBasePublicKey( this.program.programId, lpPool ); @@ -4508,11 +4514,13 @@ export class AdminClient extends DriftClient { swapFeeMin, swapFeeMax, oracleStalenessThreshold, + beta, + costToTrade, { accounts: { admin: this.wallet.publicKey, lpPool, - constituentTargetWeights, + constituentTargetBase, constituent, rent: SYSVAR_RENT_PUBKEY, systemProgram: SystemProgram.programId, @@ -4533,15 +4541,19 @@ export class AdminClient extends DriftClient { } public async updateConstituentParams( + lpPoolName: number[], constituentPublicKey: PublicKey, updateConstituentParams: { maxWeightDeviation?: BN; swapFeeMin?: BN; swapFeeMax?: BN; oracleStalenessThreshold?: BN; + beta?: BN; + costToTrade?: BN; } ): Promise { const ixs = await this.getUpdateConstituentParamsIx( + lpPoolName, constituentPublicKey, updateConstituentParams ); @@ -4551,22 +4563,29 @@ export class AdminClient extends DriftClient { } public async getUpdateConstituentParamsIx( + lpPoolName: number[], constituentPublicKey: PublicKey, updateConstituentParams: { maxWeightDeviation?: BN; swapFeeMin?: BN; swapFeeMax?: BN; oracleStalenessThreshold?: BN; + beta?: BN; + costToTrade?: BN; } ): Promise { + const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); return [ this.program.instruction.updateConstituentParams( + lpPoolName, Object.assign( { maxWeightDeviation: null, swapFeeMin: null, swapFeeMax: null, oracleStalenessThreshold: null, + beta: null, + costToTrade: null, }, updateConstituentParams ), @@ -4575,6 +4594,11 @@ export class AdminClient extends DriftClient { admin: this.wallet.publicKey, constituent: constituentPublicKey, state: await this.getStatePublicKey(), + lpPool, + constituentTargetBase: getConstituentTargetBasePublicKey( + this.program.programId, + lpPool + ), }, signers: [], } @@ -4604,7 +4628,7 @@ export class AdminClient extends DriftClient { this.program.programId, lpPool ); - const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + const constituentTargetBase = getConstituentTargetBasePublicKey( this.program.programId, lpPool ); @@ -4617,7 +4641,7 @@ export class AdminClient extends DriftClient { admin: this.wallet.publicKey, lpPool, ammConstituentMapping, - constituentTargetWeights, + constituentTargetBase, rent: SYSVAR_RENT_PUBKEY, systemProgram: SystemProgram.programId, state: await this.getStatePublicKey(), diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index 8eda66832..305157fff 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -106,7 +106,7 @@ import { getUserAccountPublicKeySync, getUserStatsAccountPublicKey, getSignedMsgWsDelegatesAccountPublicKey, - getConstituentTargetWeightsPublicKey, + getConstituentTargetBasePublicKey, getAmmConstituentMappingPublicKey, getLpPoolPublicKey, getConstituentPublicKey, @@ -9711,7 +9711,7 @@ export class DriftClient { return txSig; } - public async updateLpConstituentTargetWeights( + public async updateLpConstituentTargetBase( lpPoolName: number[], constituentIndexesToUpdate: number[], ammConstituentMapping: AmmConstituentMapping, @@ -9719,7 +9719,7 @@ export class DriftClient { ): Promise { const { txSig } = await this.sendTransaction( await this.buildTransaction( - await this.getUpdateLpConstituentTargetWeightsIx( + await this.getUpdateLpConstituentTargetBaseIx( lpPoolName, constituentIndexesToUpdate ), @@ -9731,7 +9731,7 @@ export class DriftClient { return txSig; } - public async getUpdateLpConstituentTargetWeightsIx( + public async getUpdateLpConstituentTargetBaseIx( lpPoolName: number[], constituentIndexesToUpdate: number[] ): Promise { @@ -9740,14 +9740,14 @@ export class DriftClient { this.program.programId, lpPool ); - const constituentTargetWeights = getConstituentTargetWeightsPublicKey( + const constituentTargetBase = getConstituentTargetBasePublicKey( this.program.programId, lpPool ); const ammCache = getAmmCachePublicKey(this.program.programId); - return this.program.instruction.updateLpConstituentTargetWeights( + return this.program.instruction.updateLpConstituentTargetBase( lpPoolName, constituentIndexesToUpdate, { @@ -9755,7 +9755,7 @@ export class DriftClient { keeper: this.wallet.publicKey, lpPool, ammConstituentMapping: ammConstituentMappingPublicKey, - constituentTargetWeights, + constituentTargetBase, state: await this.getStatePublicKey(), ammCache, }, @@ -9852,7 +9852,7 @@ export class DriftClient { inAmount: BN, minOutAmount: BN, lpPool: PublicKey, - constituentTargetWeights: PublicKey, + constituentTargetBase: PublicKey, constituentInTokenAccount: PublicKey, constituentOutTokenAccount: PublicKey, userInTokenAccount: PublicKey, @@ -9871,7 +9871,7 @@ export class DriftClient { inAmount, minOutAmount, lpPool, - constituentTargetWeights, + constituentTargetBase, constituentInTokenAccount, constituentOutTokenAccount, userInTokenAccount, @@ -9895,7 +9895,7 @@ export class DriftClient { inAmount: BN, minOutAmount: BN, lpPool: PublicKey, - constituentTargetWeights: PublicKey, + constituentTargetBase: PublicKey, constituentInTokenAccount: PublicKey, constituentOutTokenAccount: PublicKey, userInTokenAccount: PublicKey, @@ -9921,7 +9921,7 @@ export class DriftClient { driftSigner: this.getSignerPublicKey(), state: await this.getStatePublicKey(), lpPool, - constituentTargetWeights, + constituentTargetBase, constituentInTokenAccount, constituentOutTokenAccount, userInTokenAccount, @@ -9944,7 +9944,7 @@ export class DriftClient { minMintAmount, lpPool, lpMint, - constituentTargetWeights, + constituentTargetBase, constituentInTokenAccount, userInTokenAccount, userLpTokenAccount, @@ -9958,7 +9958,7 @@ export class DriftClient { minMintAmount: BN; lpPool: PublicKey; lpMint: PublicKey; - constituentTargetWeights: PublicKey; + constituentTargetBase: PublicKey; constituentInTokenAccount: PublicKey; userInTokenAccount: PublicKey; userLpTokenAccount: PublicKey; @@ -9975,7 +9975,7 @@ export class DriftClient { minMintAmount, lpPool, lpMint, - constituentTargetWeights, + constituentTargetBase, constituentInTokenAccount, userInTokenAccount, userLpTokenAccount, @@ -9997,7 +9997,7 @@ export class DriftClient { minMintAmount, lpPool, lpMint, - constituentTargetWeights, + constituentTargetBase, constituentInTokenAccount, userInTokenAccount, userLpTokenAccount, @@ -10010,7 +10010,7 @@ export class DriftClient { minMintAmount: BN; lpPool: PublicKey; lpMint: PublicKey; - constituentTargetWeights: PublicKey; + constituentTargetBase: PublicKey; constituentInTokenAccount: PublicKey; userInTokenAccount: PublicKey; userLpTokenAccount: PublicKey; @@ -10044,7 +10044,7 @@ export class DriftClient { this.program.programId, lpPool ), - constituentTargetWeights, + constituentTargetBase, tokenProgram: TOKEN_PROGRAM_ID, }, } @@ -10058,7 +10058,7 @@ export class DriftClient { minAmountOut, lpPool, lpMint, - constituentTargetWeights, + constituentTargetBase, constituentOutTokenAccount, userOutTokenAccount, userLpTokenAccount, @@ -10072,7 +10072,7 @@ export class DriftClient { minAmountOut: BN; lpPool: PublicKey; lpMint: PublicKey; - constituentTargetWeights: PublicKey; + constituentTargetBase: PublicKey; constituentOutTokenAccount: PublicKey; userOutTokenAccount: PublicKey; userLpTokenAccount: PublicKey; @@ -10089,7 +10089,7 @@ export class DriftClient { minAmountOut, lpPool, lpMint, - constituentTargetWeights, + constituentTargetBase, constituentOutTokenAccount, userOutTokenAccount, userLpTokenAccount, @@ -10111,7 +10111,7 @@ export class DriftClient { minAmountOut, lpPool, lpMint, - constituentTargetWeights, + constituentTargetBase, constituentOutTokenAccount, userOutTokenAccount, userLpTokenAccount, @@ -10124,7 +10124,7 @@ export class DriftClient { minAmountOut: BN; lpPool: PublicKey; lpMint: PublicKey; - constituentTargetWeights: PublicKey; + constituentTargetBase: PublicKey; constituentOutTokenAccount: PublicKey; userOutTokenAccount: PublicKey; userLpTokenAccount: PublicKey; @@ -10158,7 +10158,7 @@ export class DriftClient { this.program.programId, lpPool ), - constituentTargetWeights, + constituentTargetBase, tokenProgram: TOKEN_PROGRAM_ID, }, } diff --git a/sdk/src/idl/drift.json b/sdk/src/idl/drift.json index 279025e20..18d653c24 100644 --- a/sdk/src/idl/drift.json +++ b/sdk/src/idl/drift.json @@ -7091,7 +7091,7 @@ "isSigner": false }, { - "name": "constituentTargetWeights", + "name": "constituentTargetBase", "isMut": true, "isSigner": false }, @@ -7315,7 +7315,7 @@ "isSigner": false }, { - "name": "constituentTargetWeights", + "name": "constituentTargetBase", "isMut": true, "isSigner": false }, @@ -7388,12 +7388,30 @@ { "name": "oracleStalenessThreshold", "type": "u64" + }, + { + "name": "beta", + "type": "i32" + }, + { + "name": "costToTrade", + "type": "i32" } ] }, { "name": "updateConstituentParams", "accounts": [ + { + "name": "lpPool", + "isMut": true, + "isSigner": false + }, + { + "name": "constituentTargetBase", + "isMut": true, + "isSigner": false + }, { "name": "admin", "isMut": true, @@ -7411,6 +7429,15 @@ } ], "args": [ + { + "name": "lpPoolName", + "type": { + "array": [ + "u8", + 32 + ] + } + }, { "name": "constituentParams", "type": { @@ -7438,7 +7465,7 @@ "isSigner": false }, { - "name": "constituentTargetWeights", + "name": "constituentTargetBase", "isMut": true, "isSigner": false }, @@ -7572,7 +7599,7 @@ ] }, { - "name": "updateLpConstituentTargetWeights", + "name": "updateLpConstituentTargetBase", "accounts": [ { "name": "state", @@ -7590,7 +7617,7 @@ "isSigner": false }, { - "name": "constituentTargetWeights", + "name": "constituentTargetBase", "isMut": false, "isSigner": false }, @@ -7689,7 +7716,7 @@ "isSigner": false }, { - "name": "constituentTargetWeights", + "name": "constituentTargetBase", "isMut": false, "isSigner": false }, @@ -7817,7 +7844,7 @@ "isSigner": false }, { - "name": "constituentTargetWeights", + "name": "constituentTargetBase", "isMut": false, "isSigner": false }, @@ -7910,7 +7937,7 @@ "isSigner": false }, { - "name": "constituentTargetWeights", + "name": "constituentTargetBase", "isMut": false, "isSigner": false }, @@ -8559,7 +8586,7 @@ } }, { - "name": "ConstituentTargetWeights", + "name": "ConstituentTargetBase", "type": { "kind": "struct", "fields": [ @@ -8577,10 +8604,10 @@ } }, { - "name": "weights", + "name": "targets", "type": { "vec": { - "defined": "WeightDatum" + "defined": "TargetsDatum" } } } @@ -10284,6 +10311,18 @@ "type": { "option": "u64" } + }, + { + "name": "beta", + "type": { + "option": "i32" + } + }, + { + "name": "costToTradeBps", + "type": { + "option": "i32" + } } ] } @@ -10659,7 +10698,31 @@ } }, { - "name": "ConstituentTargetWeightsFixed", + "name": "TargetsDatum", + "type": { + "kind": "struct", + "fields": [ + { + "name": "lastSlot", + "type": "u64" + }, + { + "name": "targetBase", + "type": "i64" + }, + { + "name": "beta", + "type": "i32" + }, + { + "name": "costToTradeBps", + "type": "i32" + } + ] + } + }, + { + "name": "ConstituentTargetBaseFixed", "type": { "kind": "struct", "fields": [ @@ -12843,7 +12906,7 @@ "name": "OracleOrderPrice" }, { - "name": "UpdateLpConstituentTargetWeights" + "name": "UpdateLpConstituentTargetBase" }, { "name": "UpdateLpPoolAum" @@ -16812,7 +16875,7 @@ }, { "code": 6317, - "name": "InvalidUpdateConstituentTargetWeightsArgument", + "name": "InvalidUpdateConstituentTargetBaseArgument", "msg": "Invalid update constituent update target weights argument" }, { diff --git a/sdk/src/types.ts b/sdk/src/types.ts index f1d3f2f23..05ff07284 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1500,14 +1500,16 @@ export type AmmConstituentMapping = { weights: AmmConstituentDatum[]; }; -export type WeightDatum = { - weight: BN; +export type TargetDatum = { + target_base: BN; + beta: BN; + costToTradeBps: BN; lastSlot: BN; }; -export type ConstituentTargetWeights = { +export type ConstituentTargetBase = { bump: number; - weights: WeightDatum[]; + targets: TargetDatum[]; }; export type LPPoolAccount = { diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 154ae5be6..2ae3bcb18 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -13,11 +13,11 @@ import { getLpPoolPublicKey, getAmmConstituentMappingPublicKey, encodeName, - getConstituentTargetWeightsPublicKey, + getConstituentTargetBasePublicKey, PERCENTAGE_PRECISION, PRICE_PRECISION, PEG_PRECISION, - ConstituentTargetWeights, + ConstituentTargetBase, AmmConstituentMapping, LPPoolAccount, getConstituentVaultPublicKey, @@ -27,6 +27,7 @@ import { getAmmCachePublicKey, AmmCache, ZERO, + ONE, } from '../sdk/src'; import { @@ -220,14 +221,16 @@ describe('LP Pool', () => { assert(ammConstituentMap.weights.length == 0); // check constituent target weights exists - const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); - const constituentTargetWeights = - (await adminClient.program.account.constituentTargetWeights.fetch( - constituentTargetWeightsPublicKey - )) as ConstituentTargetWeights; - expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.weights.length == 0); + const constituentTargetBasePublicKey = getConstituentTargetBasePublicKey( + program.programId, + lpPoolKey + ); + const constituentTargetBase = + (await adminClient.program.account.constituentTargetBase.fetch( + constituentTargetBasePublicKey + )) as ConstituentTargetBase; + expect(constituentTargetBase).to.not.be.null; + assert(constituentTargetBase.targets.length == 0); // check mint created correctly const mintInfo = await getMint( @@ -249,14 +252,18 @@ describe('LP Pool', () => { new BN(10).mul(PERCENTAGE_PRECISION), new BN(1).mul(PERCENTAGE_PRECISION), new BN(2).mul(PERCENTAGE_PRECISION), - new BN(400) + new BN(400), + ONE, + ONE ); - const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); - const constituentTargetWeights = - (await adminClient.program.account.constituentTargetWeights.fetch( - constituentTargetWeightsPublicKey - )) as ConstituentTargetWeights; + const constituentTargetBasePublicKey = getConstituentTargetBasePublicKey( + program.programId, + lpPoolKey + ); + const constituentTargetBase = + (await adminClient.program.account.constituentTargetBase.fetch( + constituentTargetBasePublicKey + )) as ConstituentTargetBase; const lpPool = (await adminClient.program.account.lpPool.fetch( lpPoolKey @@ -264,8 +271,8 @@ describe('LP Pool', () => { assert(lpPool.constituents == 1); - expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.weights.length == 1); + expect(constituentTargetBase).to.not.be.null; + assert(constituentTargetBase.targets.length == 1); const constituentVaultPublicKey = getConstituentVaultPublicKey( program.programId, @@ -385,19 +392,21 @@ describe('LP Pool', () => { ammConstituentMappingPublicKey )) as AmmConstituentMapping; - await adminClient.updateLpConstituentTargetWeights( + await adminClient.updateLpConstituentTargetBase( encodeName(lpPoolName), [0], ammMapping ); - const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); - const constituentTargetWeights = - (await adminClient.program.account.constituentTargetWeights.fetch( - constituentTargetWeightsPublicKey - )) as ConstituentTargetWeights; - expect(constituentTargetWeights).to.not.be.null; - assert(constituentTargetWeights.weights.length == 1); + const constituentTargetBasePublicKey = getConstituentTargetBasePublicKey( + program.programId, + lpPoolKey + ); + const constituentTargetBase = + (await adminClient.program.account.constituentTargetBase.fetch( + constituentTargetBasePublicKey + )) as ConstituentTargetBase; + expect(constituentTargetBase).to.not.be.null; + assert(constituentTargetBase.targets.length == 1); }); it('can update pool aum', async () => { @@ -416,7 +425,9 @@ describe('LP Pool', () => { new BN(10).mul(PERCENTAGE_PRECISION), new BN(1).mul(PERCENTAGE_PRECISION), new BN(2).mul(PERCENTAGE_PRECISION), - new BN(400) + new BN(400), + ONE, + ONE ); try { diff --git a/tests/lpPoolSwap.ts b/tests/lpPoolSwap.ts index 2f11ec8d5..0b9d680e1 100644 --- a/tests/lpPoolSwap.ts +++ b/tests/lpPoolSwap.ts @@ -8,7 +8,7 @@ import { QUOTE_PRECISION, getLpPoolPublicKey, encodeName, - getConstituentTargetWeightsPublicKey, + getConstituentTargetBasePublicKey, PERCENTAGE_PRECISION, PRICE_PRECISION, PEG_PRECISION, @@ -212,7 +212,7 @@ describe('LP Pool', () => { try { const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + getConstituentTargetBasePublicKey(program.programId, lpPoolKey); const constituentTargetWeights = (await adminClient.program.account.constituentTargetWeights.fetch( constituentTargetWeightsPublicKey @@ -307,8 +307,10 @@ describe('LP Pool', () => { expect(lpPool2.lastAum.gt(lpPool1.lastAum)).to.be.true; console.log(`AUM: ${convertToNumber(lpPool2.lastAum, QUOTE_PRECISION)}`); - const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeightsPublicKey = getConstituentTargetBasePublicKey( + program.programId, + lpPoolKey + ); // swap c0 for c1 @@ -403,8 +405,10 @@ describe('LP Pool', () => { lpPoolKey )) as LPPoolAccount; const lpPoolAumBefore = lpPool.lastAum; - const constituentTargetWeightsPublicKey = - getConstituentTargetWeightsPublicKey(program.programId, lpPoolKey); + const constituentTargetWeightsPublicKey = getConstituentTargetBasePublicKey( + program.programId, + lpPoolKey + ); const userLpTokenAccount = await mockAtaTokenAccountForMint( bankrunContextWrapper, From 9f99b1d1474ae0299071ac649a61f96dc671780f Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Mon, 12 May 2025 16:33:59 -0700 Subject: [PATCH 50/50] add more tests --- sdk/src/adminClient.ts | 18 +++++++++--------- sdk/src/types.ts | 6 +++--- tests/lpPool.ts | 42 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 49 insertions(+), 17 deletions(-) diff --git a/sdk/src/adminClient.ts b/sdk/src/adminClient.ts index 8ec93abb0..3ac7723f1 100644 --- a/sdk/src/adminClient.ts +++ b/sdk/src/adminClient.ts @@ -4463,8 +4463,8 @@ export class AdminClient extends DriftClient { swapFeeMin: BN, swapFeeMax: BN, oracleStalenessThreshold: BN, - beta: BN, - costToTrade: BN + beta: number, + costToTrade: number ): Promise { const ixs = await this.getInitializeConstituentIx( lpPoolName, @@ -4490,8 +4490,8 @@ export class AdminClient extends DriftClient { swapFeeMin: BN, swapFeeMax: BN, oracleStalenessThreshold: BN, - beta: BN, - costToTrade: BN + beta: number, + costToTrade: number ): Promise { const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); const constituentTargetBase = getConstituentTargetBasePublicKey( @@ -4548,8 +4548,8 @@ export class AdminClient extends DriftClient { swapFeeMin?: BN; swapFeeMax?: BN; oracleStalenessThreshold?: BN; - beta?: BN; - costToTrade?: BN; + beta?: number; + costToTradeBps?: number; } ): Promise { const ixs = await this.getUpdateConstituentParamsIx( @@ -4570,8 +4570,8 @@ export class AdminClient extends DriftClient { swapFeeMin?: BN; swapFeeMax?: BN; oracleStalenessThreshold?: BN; - beta?: BN; - costToTrade?: BN; + beta?: number; + costToTradeBps?: number; } ): Promise { const lpPool = getLpPoolPublicKey(this.program.programId, lpPoolName); @@ -4585,7 +4585,7 @@ export class AdminClient extends DriftClient { swapFeeMax: null, oracleStalenessThreshold: null, beta: null, - costToTrade: null, + costToTradeBps: null, }, updateConstituentParams ), diff --git a/sdk/src/types.ts b/sdk/src/types.ts index 05ff07284..4b772b6be 100644 --- a/sdk/src/types.ts +++ b/sdk/src/types.ts @@ -1501,9 +1501,9 @@ export type AmmConstituentMapping = { }; export type TargetDatum = { - target_base: BN; - beta: BN; - costToTradeBps: BN; + costToTradeBps: number; + beta: number; + targetBase: BN; lastSlot: BN; }; diff --git a/tests/lpPool.ts b/tests/lpPool.ts index 2ae3bcb18..f321e3d86 100644 --- a/tests/lpPool.ts +++ b/tests/lpPool.ts @@ -27,7 +27,8 @@ import { getAmmCachePublicKey, AmmCache, ZERO, - ONE, + getConstituentPublicKey, + ConstituentAccount, } from '../sdk/src'; import { @@ -253,8 +254,8 @@ describe('LP Pool', () => { new BN(1).mul(PERCENTAGE_PRECISION), new BN(2).mul(PERCENTAGE_PRECISION), new BN(400), - ONE, - ONE + 1, + 1 ); const constituentTargetBasePublicKey = getConstituentTargetBasePublicKey( program.programId, @@ -311,6 +312,37 @@ describe('LP Pool', () => { assert(ammMapping.weights.length == 2); }); + it('can update constituent beta and cost to trade', async () => { + const constituentPublicKey = getConstituentPublicKey( + program.programId, + lpPoolKey, + 0, + ); + + const constituent = await adminClient.program.account.constituent.fetch( + constituentPublicKey + ) as ConstituentAccount; + + await adminClient.updateConstituentParams(encodeName(lpPoolName), + constituentPublicKey, + { + beta: 2, + costToTradeBps: 10, + }); + const constituentTargetBase = getConstituentTargetBasePublicKey( + program.programId, + lpPoolKey + ); + const targets = + (await adminClient.program.account.constituentTargetBase.fetch( + constituentTargetBase + )) as ConstituentTargetBase; + expect(targets).to.not.be.null; + console.log(targets.targets[constituent.constituentIndex]); + assert(targets.targets[constituent.constituentIndex].beta == 2); + assert(targets.targets[constituent.constituentIndex].costToTradeBps == 10); + }); + it('fails adding datum with bad params', async () => { // Bad perp market index try { @@ -426,8 +458,8 @@ describe('LP Pool', () => { new BN(1).mul(PERCENTAGE_PRECISION), new BN(2).mul(PERCENTAGE_PRECISION), new BN(400), - ONE, - ONE + 1, + 1 ); try {