Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ v06-dump-daos-proposals = "yarn run tsx scripts/v0.6/dumpDaosProposals.ts"
v06-migrate-daos-proposals = "yarn run tsx scripts/v0.6/migrateDaosProposals.ts"
v06-create-dao = "yarn run tsx scripts/v0.6/createDao.ts"
v06-provide-liquidity = "yarn run tsx scripts/v0.6/provideLiquidity.ts"
v06-collect-meteora-damm-fees = "yarn run tsx scripts/v0.6/collectMeteoraDammFees.ts"
v07-collect-meteora-damm-fees = "yarn run tsx scripts/v0.7/collectMeteoraDammFees.ts"

[test]
startup_wait = 5000
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@metaplex-foundation/umi-signer-wallet-adapters": "^1.1.1",
"@metaplex-foundation/umi-uploader-bundlr": "^0.9.1",
"@metaplex-foundation/umi-web3js-adapters": "^1.1.1",
"@meteora-ag/cp-amm-sdk": "^1.2.6",
"@noble/ed25519": "^2.0.0",
"@noble/secp256k1": "^2.0.0",
"@solana/spl-token": "^0.3.7",
Expand Down
61 changes: 61 additions & 0 deletions programs/damm_v2_cpi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ pub mod damm_v2_cpi {
) -> Result<()> {
Ok(())
}

pub fn claim_position_fee(_ctx: Context<ClaimPositionFeeCtx>) -> Result<()> {
Ok(())
}
}

/// Information regarding fee charges
Expand Down Expand Up @@ -151,3 +155,60 @@ pub struct InitializePoolWithDynamicConfigCtx<'info> {
// Sysvar for program account
pub system_program: Program<'info, System>,
}

#[event_cpi]
#[derive(Accounts)]
pub struct ClaimPositionFeeCtx<'info> {
/// CHECK: pool authority
pub pool_authority: UncheckedAccount<'info>,

/// CHECK: CPI
pub pool: UncheckedAccount<'info>,

/// CHECK: CPI
#[account(mut)]
pub position: UncheckedAccount<'info>,

/// The user token a account
/// CHECK: CPI
#[account(mut)]
pub token_a_account: UncheckedAccount<'info>,

/// The user token b account
/// CHECK: CPI
#[account(mut)]
pub token_b_account: UncheckedAccount<'info>,

/// The vault token account for input token
/// CHECK: CPI
#[account(mut)]
pub token_a_vault: UncheckedAccount<'info>,

/// The vault token account for output token
/// CHECK: CPI
#[account(mut)]
pub token_b_vault: UncheckedAccount<'info>,

/// The mint of token a
/// CHECK: CPI
pub token_a_mint: UncheckedAccount<'info>,

/// The mint of token b
/// CHECK: CPI
pub token_b_mint: UncheckedAccount<'info>,

/// The token account for nft
/// CHECK: CPI
pub position_nft_account: UncheckedAccount<'info>,

/// owner of position
pub owner: Signer<'info>,

/// Token a program
/// CHECK: CPI
pub token_a_program: UncheckedAccount<'info>,

/// Token b program
/// CHECK: CPI
pub token_b_program: UncheckedAccount<'info>,
}
1 change: 1 addition & 0 deletions programs/futarchy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ anchor-spl = "^0.29.0"
solana-security-txt = "1.1.1"
conditional_vault = { path = "../conditional_vault", features = ["cpi"] }
squads-multisig-program = { git = "https://github.com/Squads-Protocol/v4", package = "squads-multisig-program", rev = "6d5235da621a2e9b7379ea358e48760e981053be", features = ["cpi"] }
damm_v2_cpi = { path = "../damm_v2_cpi", features = ["cpi"] }
2 changes: 2 additions & 0 deletions programs/futarchy/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ pub enum FutarchyError {
InvalidTeamSponsoredPassThreshold,
#[msg("Target K must be greater than the current K")]
InvalidTargetK,
#[msg("Failed to compile transaction message for Squads vault transaction")]
InvalidTransactionMessage,
}
13 changes: 13 additions & 0 deletions programs/futarchy/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,16 @@ pub struct SponsorProposalEvent {
pub dao: Pubkey,
pub team_address: Pubkey,
}

#[event]
pub struct CollectMeteoraDammFeesEvent {
pub common: CommonFields,
pub dao: Pubkey,
pub pool: Pubkey,
pub base_token_account: Pubkey,
pub quote_token_account: Pubkey,
pub quote_mint: Pubkey,
pub base_mint: Pubkey,
pub quote_fees_collected: u64,
pub base_fees_collected: u64,
}
Loading
Loading