Swap Limits & Stability Trigger

Module Name: SwapLimiter (internal component) Associated With: TRNUsageOracle, TrnUsdAMM, StabilityVault, MintThrottleController Purpose: Enforce safety boundaries on TRN swaps and prevent instability across the internal pegged AMMs.

This system ensures that large token swaps—especially those routed through internal AMMs like TRN↔USD or TRN↔BRN—do not destabilize the economy, de-peg tokens, or front-run oracle settlement mechanisms. It applies hard-coded limits, delayed execution logic, and trigger points that defer or reject actions under high-pressure conditions.


🎯 Core Functions

  • Prevent individual or collective swaps from exceeding allowed market pressure

  • Ensure that TRN price peg (to USD) and TRN↔BRN 1:1 swap mechanics remain stable

  • Route excess liquidity events into the StabilityVault for mitigation

  • Limit flash loan arbitrage until the vault reaches a secure threshold

  • Block transactions that would shift internal peg more than ±2%


🧱 Hard Swap Limits

🔒 Per-Transaction Cap

  • Max TRN swap per transaction: 333,333 TRN

  • This equals approximately $1,000 USD at a $0.003 peg

  • This cap is enforced at the oracle + AMM level

  • Attempts to exceed this amount result in an automatic rejection

solidityCopyEditrequire(amount <= 333_333 * 1e18, "Swap amount exceeds allowed limit");

🔁 Aggregate Swap Monitoring

  • The system monitors total daily AMM traffic

  • If cumulative swaps begin to approach thresholds capable of moving the peg ±2%, the oracle:

    • Rejects pending swaps

    • Delays settlement to the next cycle

    • Or initiates arbitrage balancing from the StabilityVault


⚠️ Peg Stability Enforcement

The TRN platform must maintain tight adherence to two peg boundaries:

Pool
Peg Target
Max Allowed Drift

TRN ↔ USD AMM

$0.003

±2%

TRN ↔ BRN AMM

1:1

No slippage

Swaps are only permitted if:

  • Post-swap price stays within the allowed peg

  • The Merkle ledger and oracle remain synchronized

  • No delayed debt or front-running risk exists


🧰 Flash Loan & Stability Trigger

✅ Trigger Behavior

Once AMM pressure exceeds pre-set thresholds, the system:

  1. Pauses large swaps

  2. Activates StabilityVault flash liquidity protocol

  3. Executes auto-arbitrage swaps to restore peg integrity

  4. Logs and forwards any profits to the DAO Vault

🚫 Flash Loans Only Allowed After:

  • StabilityVault is fully funded to minimum DAO-approved threshold

  • The trigger is not enabled during bootstrapping or early launch phase

Until then:

  • All large swaps are rejected or rate-limited

  • Flash balancing is disabled to prevent liquidity drain

  • System operates in conservative mode to prioritize consistency


🧾 Merkle Reconciliation Safety

All swap logic flows through the TRNUsageOracle, which ensures:

  • No user can initiate a swap without first reconciling fruit balance

  • The AMM price and Merkle-based accounting are always in alignment

  • No action can result in unbacked TRN minting or negative net exposure


🏦 DAO Oversight

The DAO is responsible for:

  • Setting swap caps, thresholds, and trigger behavior

  • Approving vault size required before enabling flash arbitration

  • Enabling or disabling advanced rebalancing logic

All controls are subject to ProposalFactory governance rules and can only be adjusted through a formal on-chain vote.


  • TRNUsageOracle

  • TrnUsdAMM

  • StabilityVault

  • MintThrottleController

  • ProposalFactory

Last updated