Repay in USDG
Close your debt with the dollars you actually hold, in one transaction, without buying fyUSD on a market — and without the PSM cap getting in the way.
Most borrowers do not want to think about fyUSD. They borrowed dollars, they want to give dollars back. repayWithUSDG does exactly that.
PSM.repayWithUSDG(branch, onBehalfOf, usdgAmount, minDebtRepaid)The PSM takes your USDG, mints the corresponding fyUSD to itself, and calls repay on your position as the payer. You never hold fyUSD, never touch a decentralised exchange, and never care what fyUSD is trading at.
How it is calculated
debt repaid = USDG amount × (1 − 0.05%)
example: 10,005 USDG repays 10,000 fyUSD of debt
Rules R-1.1.4, R-8.3.1
Why this matters more than it looks
Two failure modes of stablecoin CDPs are closed by this one function.
The premium trap. If fyUSD trades at $1.03 because everyone wants to repay at once, buying it on a market to close your loan costs you 3%. Through repayWithUSDG it costs you 0.05%, whatever the market price is. The exit price of your debt does not depend on the liquidity of a pool.
The cap trap. The PSM's 30% intake cap exists to stop fyUSD from becoming wrapped USDG. Applying it to repayment would mean that in exactly the moment everyone wants out, the door narrows.
Guarantee
repayWithUSDG is exempt from the PSM's 30% cap. Repaying always works, however much of the
supply is already backed by USDG. The result is over-collateralisation of the remaining supply,
which is the direction you want it to fail in.
Rule R-8.3.2
Available in every market state
The hour does not matter, and neither does the regime. repay never calls the price oracle, and the PSM does not need an equity price to mint against USDG. This works at 3 a.m. on a Sunday exactly as it works at 11 a.m. on a Tuesday.
The one exception, while it exists: the Closer key can freeze PSM entry for at most 72 hours, which covers this function — because repayment in plain fyUSD is never freezable, so a door always remains. After the key expires at day 365, nothing can freeze anything.
Rules R-4.4.1, R-8.6.1, R-12.1.3, D57
Somebody else can repay for you
onBehalfOf means a third party — a friend, a treasury, a liquidation-avoidance service you hired — can reduce your debt without any authorisation from you and without gaining any right over your position. They cannot withdraw your collateral, change your rate, or close your position. Only you can.
Rule R-5.1.1
Where the fee goes
The 0.05% is minted in fyUSD and routed to the Stability Pool of the branch you repaid, at the current regime's share. Your exit pays the depositors who were standing behind your loan.
Rule R-8.3.4
A worked exit
You borrowed 5,000 fyUSD against 20 SPY at 4% and it has been 90 days.
| Debt now | 5,053.19 fyUSD |
| USDG needed | 5,055.72 |
| Fee | 2.53 USDG, routed to the SPY Stability Pool |
| Collateral returned | 20 SPY, in full |
Two transactions: approve on USDG, then repayWithUSDG for the full amount, which brings the debt to zero. Then close() returns the collateral — or call close() after any repayment path; it repays whatever remains from your own fyUSD balance and hands back the tokens.
Rules R-1.1.3, R-1.1.5, R-5.5.4
Risk
This function converts your USDG into fyUSD at par inside the transaction. If USDG itself is trading away from a dollar, you are paying that difference. There is no USDG oracle in the protocol and no mechanism that adjusts for it.
Rule R-2.3.1
Last reviewed: 2026-09-07 · Spec v0.4
Swap fyUSD and USDG (PSM)
The peg stability module — a fixed-price door in both directions, available 24 hours a day, whose exit nobody can close.
Markets never close — your guarantees
The protocol runs 24 hours a day on a composite price. What changes from hour to hour is how much confidence the protocol places in that price, not what you are allowed to do.