Skip to main content
USDGPool is the shared ERC-4626 vault that funds every book. Suppliers deposit USDG and receive sUSDG, a share token whose price rises as borrowers pay interest. Stockline (the core) is the only borrower; it pulls idle cash and reports interest and repayments. Withdrawals are synchronous and limited by idle cash, and the guardian pause sets the withdrawal limit to zero. USDGPool lets you:
  • Deposit USDG and receive sUSDG shares
  • Withdraw or redeem USDG when idle cash allows and the protocol is not paused
  • Read cash, borrowed principal, and accrued interest that back the shares
  • Receive donated yield from CreatorFeeRouter with no new shares minted
  • Receive reserve top-ups from FeeCollector after a bad-debt write-off
Addresses per network. Every address is also on Addresses. The source code is src/core/USDGPool.sol on GitHub. The ABI is /abis/USDGPool.json.

Write methods

borrow

Moves amount idle USDG to the core and books it as borrowed principal. Only Stockline can call it. Reverts with InsufficientCash when amount exceeds cash. Total assets do not change.
Core only. Reverts with NotCore for any other caller.
Core pulls idle USDG. totalAssets stays flat: cash down, borrowed up.
Input parameters

repay

Pulls USDG from the core and applies it to accrued interest first, then principal. Only Stockline can call it. Reverts with RepayExceedsDebt if the received amount exceeds borrowed plus accrued interest.
Core only.
Pays accrued interest first, then principal. totalAssets unchanged.
Input parameters

accrue

Records interest USDG as owed by borrowers. Only Stockline can call it, after the reserve-factor split. The share price rises immediately even though the cash arrives later on repay.
Core only.
Core reports interest after the reserve-factor split. Share price rises.
Input parameters

realizeBadDebt

Removes amount from what the pool expects back, accrued interest first, then principal. Only Stockline can call it. The share price falls. FeeCollector.coverBadDebt can later restore cash from the reserve.
Core only. This is the last step of the bad-debt waterfall and reduces every holder’s claim pro rata.
Socializes a recognized shortfall. Accrued interest first, then principal. Share price falls. SPEC: Reserve and Backstop absorb first once they exist; this is the last waterfall step.
Input parameters
Pulls amount USDG from the yield distributor and adds it to cash without minting shares. Only the configured yieldDistributor (CreatorFeeRouter) can call it. Every sUSDG holder gains pro rata.
Distributor only. Reverts with NotDistributor otherwise.
CreatorFeeRouter path. Increases cash with no new shares, so every holder earns pro rata.
Input parameters

restore

Pulls amount USDG from the caller and adds it to cash without minting shares. Permissionless. FeeCollector uses it to spend reserve on bad debt.
The caller must approve USDGPool for the amount. USDG sent here is given to all share holders and cannot be recovered.
Permissionless cash add, no new shares. FeeCollector uses this to spend reserve on bad debt.
Input parameters

Read methods

totalAssets

Returns cash plus borrowed principal plus accrued interest. Backing is tracked internally, so a raw USDG transfer to the pool does not change the share price. Return values

maxWithdraw

Returns the most USDG owner can withdraw right now: the lesser of their share value and idle cash, or 0 while the guardian pause is active.
Cap assets by idle cash. Guardian pause (via core) returns 0.
Input parameters Return values

maxRedeem

Returns the most shares owner can redeem right now, capped by idle cash and 0 while paused, so redeem and withdraw stay consistent.
Same cash/pause cap, in shares, so redeem and withdraw stay consistent.
Input parameters Return values

Events

Borrow

Fires when the core draws idle USDG.

Repay

Fires when the core repays, with the split between interest and principal.

Accrue

Fires when the core reports new supplier interest.
Fires when the yield distributor adds USDG without minting shares.

Restore

Fires when anyone adds USDG through restore, typically FeeCollector covering bad debt.

BadDebt

Fires when a shortfall is socialized, with the total removed from interest and principal.

Errors

NotCore

Only Stockline can borrow, repay, accrue, or realize bad debt.

NotDistributor

Only the yield distributor can donate.

ZeroAddress

The core or distributor address was zero at deployment.

ZeroAmount

An amount was zero, or a transfer delivered zero tokens.

InsufficientCash

The requested amount exceeds idle cash.

RepayExceedsDebt

The core tried to repay more than borrowed plus accrued interest.