The EngagementDrivenConverter is the current AMM that pairs the rewards token (YCR) to the value token (YCE). The rate is driven by network engagement (an internal X parameter that adjusts with activity), not a pure constant-product curve. Every swap still pays a 2% fee that is permanently burned, keeping YCR structurally deflationary.
This contract replaces the legacy YCEYCRPool (0x288b3e…51b1). The function names are the same; the read surface differs — see below.

Read methods

reserves() → (uint256 r_ycr, uint256 r_yce)

Returns both reserves at once. Both values are in wei (1e18 base).

currentXWad() → uint256

Current engagement-driven price parameter (1e18-scaled). Lower X means cheaper YCE in YCR terms; rises with engagement. Bounded by ammMinRate=25 and ammMaxRate=1000.

quoteYCRForYCE(uint256 ycrIn) → uint256

Returns how much YCE the user would receive for ycrIn YCR, after the 2% burn. Pure view.

quoteYCEForYCR(uint256 yceIn) → uint256

Returns how much YCR the user would receive for yceIn YCE, after the 2% burn.

Write methods

swapYCRForYCE(uint256 ycrIn, uint256 minYceOut) → uint256

Swap ycrIn YCR for at least minYceOut YCE. Pre-conditions: caller must have called YCR.approve(converter, ycrIn) first. Reverts:
  • InsufficientOutput() — quote below minYceOut
  • TransferFailed() — approval missing or balance too low

swapYCEForYCR(uint256 yceIn, uint256 minYcrOut) → uint256

Swap yceIn YCE for at least minYcrOut YCR. Same approval requirement on the YCE side.

Mobile integration example

Burn mechanism

Each swap burns 2% of the input token. The burn flows through BurnManager and emits a Burn(address token, uint256 amount, Source source) event. Track totals via YCR.totalBurned() / YCE.totalBurned().