diff --git a/programs/amm/core/src/lib.rs b/programs/amm/core/src/lib.rs index 85efd00d..15791f0d 100644 --- a/programs/amm/core/src/lib.rs +++ b/programs/amm/core/src/lib.rs @@ -200,4 +200,4 @@ pub fn compute_liquidity_token_pda_seed(pool_id: AccountId) -> PdaSeed { .try_into() .expect("Hash output must be exactly 32 bytes long"), ) -} +} \ No newline at end of file diff --git a/programs/amm/src/new_definition.rs b/programs/amm/src/new_definition.rs index 366eb747..0b94f02e 100644 --- a/programs/amm/src/new_definition.rs +++ b/programs/amm/src/new_definition.rs @@ -129,6 +129,18 @@ pub fn new_definition( }, ); + // Chain call for liquidity token (TokenLP definition -> User LP Holding) + let instruction = if pool.account == Account::default() { + token_core::Instruction::NewFungibleDefinition { + name: String::from("LP Token"), + total_supply: initial_lp, + } + } else { + token_core::Instruction::Mint { + amount_to_mint: initial_lp, + } + }; + let mut pool_lp_auth = pool_definition_lp.clone(); pool_lp_auth.is_authorized = true;