Skip to content

feat: configurable minimum deposit size to prevent dust LP positions #279

Description

@abayomicornelius

Summary

Very small deposits (e.g., 0.01 USD) create market token entries that cost more in rent than their pool contribution. A minimum deposit size prevents dust accumulation and simplifies keeper economics.

Proposed Design

Store min_deposit_usd_key(market) in data_store (admin-configurable, default 0 = no minimum).

In exchange_router::create_deposit, compute the USD value of the deposited tokens and revert with DepositError::BelowMinimumDeposit if below the minimum.

Acceptance Criteria

  • Deposit below minimum reverts before vault transfer (no tokens moved)
  • Minimum of 0 allows any deposit size (no regression)
  • USD value computed using current oracle price at creation time
  • Integration test: min deposit = 100 USD, deposit 50 USD — revert
  • Integration test: deposit exactly 100 USD — succeeds

Affected Contracts

exchange_router, data_store

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions