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
11 changes: 11 additions & 0 deletions contracts/pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ impl NodusAmm {

// ── Protocol fee collector ──────────────────────────────────────────────

/// Sets the recipient of the protocol fee.
///
/// # Important
/// Protocol fee collection is currently **not implemented** in the pool.
/// This is a reserved administrative endpoint; setting this value updates the configuration
/// but has no functional impact and no fees will accrue to the configured address.
pub fn set_fee_to(env: Env, caller: Address, new_fee_to: Option<Address>) -> Result<(), Error> {
require_fee_to_setter(&env, &caller)?;
match &new_fee_to {
Expand All @@ -675,6 +681,11 @@ impl NodusAmm {
Ok(())
}

/// Returns the protocol fee recipient address, if configured.
///
/// # Important
/// Protocol fee collection is currently **not implemented** in the pool.
/// This function is non-functional/inert and is only a configuration query.
pub fn fee_to(env: Env) -> Option<Address> {
env.storage().instance().get(&DataKey::FeeTo)
}
Expand Down
1 change: 0 additions & 1 deletion contracts/pool/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub enum DataKey {
TimestampLast,
Price0CumulativeLast,
Price1CumulativeLast,
KLast,
Locked,
Initialized,
FeeTo,
Expand Down
3 changes: 1 addition & 2 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ These contracts communicate through cross-contract calls. The pool is the sole a
│ │
│ reserve_0 (token_0 balance) │
│ reserve_1 (token_1 balance) │
│ k_last (fee accumulator) │
│ price_X_cumulative (TWAP oracle) │
│ │
│ add_liquidity() ─────────────────── │──► mint LP tokens
Expand Down Expand Up @@ -149,7 +148,7 @@ The swap fee is 0.3% (30 basis points), implemented implicitly:
- The output formula uses a 997/1000 multiplier on `amount_in`.
- Fees remain in the reserves; they are not extracted to a separate address.
- LP token holders capture fees proportionally when they burn their shares.
- Protocol fee (if enabled) would redirect a fraction of fees to a `fee_to` address by comparing `k_last` before and after.
- The protocol fee mechanism (which would redirect a fraction of fees to a `fee_to` address) is **not implemented**. The `fee_to` address and setter methods exist as reserved placeholders, but no protocol fees are collected or accrued.

---

Expand Down
Loading