agtrUSD Token
The agtrUSD token is the native rebasing stablecoin of the ecosystem. It is designed to maintain a 1:1 ratio with USDC while distributing yield to all holders passively through a rebase mechanism.
Rebasing Mechanism
How it works
The token uses a "shares" system similar to a liquid staking token (e.g., stETH shares). Users hold a fixed amount of shares, but the totalSupply is variable. Your balance is calculated dynamically:
Balance = (YourShares * TotalSupply) / TotalShares
Functions
distributeYield
function distributeYield(uint256 amount) external onlyOwner
Called by the AgentTresor when new yield is harvested. This function increases the totalSupply without minting new shares, effectively increasing the balance of every token holder proportionally.
Parameters
amount: The amount of new agtrUSD to add to the supply (representing the harvested yield).
mint
Mints new tokens and assigns them to an account. Calculates the correct amount of shares to issue based on the current exchange rate.
Events
- YieldDistributed(uint256 amount, uint256 newTotalSupply)
- Transfer(address indexed from, address indexed to, uint256 value)
