TRN↔USD Internal AMM

The TRN↔USD Internal AMM serves as the pricing backbone of the TRN platform. Unlike the TRN↔BRN AMM (which supports engagement mechanics), this AMM governs the platform’s economic interface by anchoring TRN to a USD-based internal reference. It allows for stable and deterministic pricing of all actions denominated in TRN, including boosts, subscriptions, and post views.

This AMM is entirely private and does not support external swaps. It exists solely to provide internal conversions for cost anchoring and liquidity balancing. All user-facing prices remain in TRN; this AMM allows those prices to track target fiat values for economic stability.


Purpose

  • Anchor TRN purchasing power to a target fiat value (e.g. $0.003 per TRN).

  • Prevent manipulation and volatility in content pricing and platform-wide economics.

  • Enable deterministic pricing of boosts, subscriptions, pinning (if used), and any USD-referenced mechanics.

  • Back internal accounting and withdrawals using off-chain settlement layers and KYC.


Key Properties

Property
Value

Peg Target

$0.003 USD per TRN

AMM Type

Private, non-external

Access Level

Restricted — only internal systems can invoke it

Price Movement Guard

Hard rejection on trades that would shift price > ±2%

Max Swap Cap

333,333 TRN per transaction (≈ $1,000 USD)

Oracle Integration

TRNUsageOracle, TRNVault, and sequencer-monitored

Stability Management

Uses private liquidity and stability pool (see below)

Flash Loan Handling

Flash resistance via DAO-triggered internal arbitrage + slippage controls

Fee Handling

Profits (e.g., arbitrage deltas) routed to the DAO vault

Launch Status

Enabled Day 1, but stability pool activation gated


Swap Flow

  1. User purchases or redeems TRN via internal fiat/KYC gateway:

    • The request is passed to the AMM contract for price anchoring.

    • The current TRN↔USD rate is compared to the peg ($0.003).

  2. Price Guarding:

    • If the transaction would shift price by more than ±2%, it is rejected.

    • If within bounds, the swap proceeds and the ledger is updated via TRNUsageOracle.

  3. Liquidity Balancing:

    • If imbalances arise, the AMM may request a flash stabilization loan from the Stability Pool.

    • Flash loans are internal and profitless; any gain is returned to the DAO vault.

  4. Swap Settlement:

    • All user-facing swaps are tracked on the indexer.

    • Actual fund movements occur after Merkle processing or via permissioned wallet hooks.


Flash Loan and Arbitrage Behavior

  • If a swap creates a price imbalance or deviates from peg:

    • The AMM listens for the swap.

    • If slippage exceeds 2%, the transaction is rejected.

    • If eligible, the AMM initiates a flash arbitrage stabilization loop:

      • Attempts to neutralize imbalance using internal pool buffers.

      • If arbitrage succeeds, proceeds go to DAO.

      • If no opportunity exists, pool rebalances automatically via Merkle-scheduled rebase.

  • Flash loans only activate once the Stability Pool reaches a DAO-configured threshold.

  • Until then, users are limited to 333,333 TRN (~$1,000) per swap.


DAO Control and Governance Parameters

Setting
Description

maxDailySwapAmount

Max amount of TRN that can be traded per user/day. Defaults to 333,333 TRN.

maxSlippageTolerance

Hard cap on price shift tolerance per swap. Set to ±2%.

stabilityPoolActivationCap

Minimum liquidity threshold for flash stabilization to activate. TBD by DAO.

oracleTWAPSyncInterval

Frequency of time-weighted average price updates. Sequencer enforced.

stabilizationProfitRouting

All flash loan profit goes to DAO treasury.

priceAnchorSource

TRN↔USD pricing is determined by internal view adapters, not public exchanges.


Modules Involved

Module
Purpose

TRNUsageOracle

Confirms balance availability, debt reconciliation, and transfer rules

TRNVaultSplitter

Receives stable-backed TRN swaps and redistributes per DAO allocations

PrivateUSDAdapter

Reads real-world peg reference and USD compliance filters

StabilityPoolManager

Tracks available pool for flash-based arbitrage, disables until funded

AMMThrottleController

Enforces max daily volume and price limits

Sequencer

Monitors batch syncs and ensures fair clearing across user activity


Behavior on Overspending or Debt

  • All actions that involve TRN deduction must pass through TRNUsageOracle.

  • If a user’s fruit balance and real-time TRN usage do not support the transaction:

    • The swap is blocked.

    • No negative balances are permitted.

    • Pending redemptions are queued until fruit balances are updated via the Merkle drop.


Stability and Market Protection

  • No trades allowed to impact peg more than ±2%.

  • If large coordinated swaps occur, the AMM holds them until the next block to reprice.

  • The Stability Pool is only used once the DAO confirms sufficient reserves.

  • Until then, price risk is managed via slippage control, swap caps, and scheduled rebalancing.


Additional Notes

  • All TRN prices shown to users in the UI are derived from this AMM’s peg enforcement.

  • No speculative token pricing is exposed to users.

  • Fiat → TRN onboarding occurs only after country-specific KYC compliance and passes through this AMM’s pricing engine.

Last updated