deposit; the contract mints sUSDG to itself and tracks the principal. That principal cannot leave before lockUntil. After the lock, only the Timelock can take it out, and only after a notice period, in tranches capped per period. Those three rules are immutable. harvest is permissionless and sends yield above principal to AuctionYield while the yield term runs, then to the treasury. A Guardian pause blocks withdraw and harvest like any other pool withdrawal.
ProtocolSupply lets you:
- Deposit treasury USDG into the pool as protocol-owned supply
- Move interest above principal to AuctionYield, then to the treasury after the term
- Withdraw principal through the Timelock only, after lock, notice, and per-period cap
- Read the lock date, notice period, tranche cap, and tracked principal
The source code is
src/token/ProtocolSupply.sol on GitHub. The ABI is /abis/ProtocolSupply.json.
Write methods
deposit
amount USDG from the caller, deposits it into USDGPool for sUSDG held by this contract, and raises principal. Only the treasury or the Timelock can call it. Reverts with NotAuthorized otherwise and ZeroAmount for 0.
Input parameters
notice
amount. Timelock only, and only at or after lockUntil. Records the notice time; withdraw becomes possible noticeDays later. Reverts with Locked before the lock date.
Input parameters
withdraw
maxTranchePct of the current position), remaining principal, and pool cash. Reverts with NoNotice, NoticePending, or CapExceeded when nothing can move.
harvest
principal, capped by pool cash. Before yieldTermEnd the USDG goes to AuctionYield through notifyReward; after, it goes to the treasury. Permissionless. Reverts with NothingToHarvest when the position is at or below principal.
A Guardian pause reverts this call. A pause that spans
yieldTermEnd sends the next harvest to the treasury. The amount can be 1 wei below the economic yield because of ERC-4626 rounding.