Skip to content
Draft
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
17 changes: 6 additions & 11 deletions programs/soladrome/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ pub const DEFAULT_EXERCISE_FEE_BPS: u16 = 1_000; // 10 % of the gain
/// it is a guard against an authority setting a value that makes oSOLA worthless as an
/// LP incentive, which would be an economic self-inflicted wound, not an exploit.
pub const MAX_EXERCISE_FEE_BPS: u16 = 5_000; // 50 % of the gain
// (FOUNDER_BORROW_CAP_BPS removed 2026-07-18 with founder_borrow_usdc — the 7M are ve-escrowed,
// so the founder's only borrow path is borrow_against_locked at PARTNER_BORROW_CAP_BPS, 20%.)

// FOUNDER_BORROW_CAP_BPS removed 2026-07-18 with founder_borrow_usdc — the 7M are ve-escrowed,
// so the founder's only borrow path is borrow_against_locked at PARTNER_BORROW_CAP_BPS, 20%.

pub const FOUNDER_HI_VESTING_SEED: &[u8] = b"founder_hi_vesting";

Expand Down Expand Up @@ -660,11 +661,8 @@ pub mod soladrome {
} else {
// `staked_amount` is still the pre-stake figure here: this harvest settles
// what the OLD position earned, before the new deposit is recorded below.
let basis = math::fee_basis(
position.staked_amount,
old_balance,
position.vote_escrowed,
);
let basis =
math::fee_basis(position.staked_amount, old_balance, position.vote_escrowed);
math::pending_fees(acc, position.fees_debt, basis)
};
// Entry/exit point: debt = current accumulator (no retroactive claim).
Expand Down Expand Up @@ -1092,10 +1090,7 @@ pub mod soladrome {
.checked_mul(vu - vs)
.ok_or(SoladromeError::Overflow)?
/ vs;
let f = gain
.checked_mul(fee_bps)
.ok_or(SoladromeError::Overflow)?
/ 10_000;
let f = gain.checked_mul(fee_bps).ok_or(SoladromeError::Overflow)? / 10_000;
u64::try_from(f).map_err(|_| error!(SoladromeError::Overflow))?
}
};
Expand Down
8 changes: 3 additions & 5 deletions programs/soladrome/src/pol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ pub fn collect_to_pol(ctx: Context<CollectToPol>, amount: u64) -> Result<()> {
//
// The base is the uncredited growth, not the whole vault: everything at or below
// `last_market_vault_balance` is already promised to stakers and is not POL's to split.
let growth = market_balance.saturating_sub(ctx.accounts.protocol_state.last_market_vault_balance);
let growth =
market_balance.saturating_sub(ctx.accounts.protocol_state.last_market_vault_balance);
let max_skim = (growth as u128)
.checked_mul(ctx.accounts.pol_state.pol_split_bps as u128)
.ok_or(SoladromeError::Overflow)?
/ 10_000;
require!(
amount as u128 <= max_skim,
SoladromeError::PolSplitExceeded
);
require!(amount as u128 <= max_skim, SoladromeError::PolSplitExceeded);

// Credit stakers only on what the skim leaves behind. saturating_sub also covers the
// case where `amount` digs into fees already credited in a previous advance: the
Expand Down
Loading