Skip to main content
ProtocolSupply holds the protocol-owned dollars in the lending pool. After the STK auction, the treasury swaps ETH proceeds to USDG and calls 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
This contract is not deployed on a listed network yet. Watch Addresses. The source code is src/token/ProtocolSupply.sol on GitHub. The ABI is /abis/ProtocolSupply.json.

Write methods

deposit

Pulls 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.
Treasury or Timelock only. The caller must approve ProtocolSupply for amount.
Input parameters

notice

Queues a principal withdrawal of 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.
Timelock only. A new notice replaces the pending one and restarts the wait.
Input parameters

withdraw

Takes principal after a notice has matured. Timelock only. The amount is the smallest of the noticed amount, the unused tranche room for this period (maxTranchePct of the current position), remaining principal, and pool cash. Reverts with NoNotice, NoticePending, or CapExceeded when nothing can move.
Timelock only. Cannot exceed the per-period cap. Never touches yield.

harvest

Redeems the yield above 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.

sweep

Sends the full balance of any stray ERC-20 held here to the treasury. Timelock only. Cannot sweep sUSDG. Reverts with InvalidParams for the pool token or the zero address.
Timelock only.
Input parameters

Events

Deposited

Fires on each deposit with the caller, USDG in, and sUSDG minted.

NoticeQueued

Fires when the Timelock queues a withdrawal.

Withdrawn

Fires when principal leaves to the Timelock.

Harvested

Fires on each harvest with the amount and the recipient (AuctionYield or treasury).

Swept

Fires when a stray token is recovered.

Errors

ZeroAddress

A constructor address was zero.

ZeroAmount

An amount was zero.

InvalidParams

Bad constructor values, or sweep targeted sUSDG or the zero address.

NotTimelock

Only the Timelock can notice, withdraw, or sweep.

NotAuthorized

Only the treasury or the Timelock can deposit.

Locked

The lock date has not passed.

NoNotice

withdraw was called without a queued notice.

NoticePending

The notice period has not elapsed.

CapExceeded

No principal can move: the tranche cap, principal, or pool cash is exhausted.

NothingToHarvest

The position is at or below principal, or the pool has no cash.