Dolomite dUSDC
Use dUSDC shares for the USDC market-2 route. Check wrapper implementations, receiver permissions and available cash before execution.
Use the dUSDC share token#
The route deposits USDC into the dUSDC ERC-4626 wrapper for Dolomite market 2 and receives transferable shares. A Dolomite margin-account balance has different accounting and cannot become the share token used by this private note. Redemption spends dUSDC for USDC, subject to the wrapper's cash and receiver rules.
Set FUYU_QUEUE_DOLOMITE_DUSDC=1 to add this optional pair to a fresh Queue fork. DolomiteDUSDCGuardedAdapter accepts only its configured Pool on chain 31350. The documentation mentions WLFI Markets as context; this route connects directly to Dolomite and carries no WLFI partnership, retail integration, points or rewards entitlement.
Identify the wrapper and registries#
The wrapper and both registries can be upgraded. The runtime validator checks proxy slots and implementations, market mapping, asset, decimals, receiver permissions and the enabled Pool route at one block. During execute, the adapter also checks the implementation getters and code hashes it stored for the venue.
| Contract | Ethereum identity in the fixture |
|---|---|
| dUSDC wrapper | 0x444868B6e8079ac2c55eea115250f92C2b2c4D14 |
| DolomiteMargin | 0x003Ca23Fd5F0ca87D01F6eC6CD14A8AE60c2b97D |
| Dolomite registry | 0x0F38bFBd9c1450BCF7A758e80E148CE78cfE09fD |
| Account registry | 0xFee366CECA2472B99d0A501b6B3d01351c24dAaE |
| USDC underlying | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
| Market ID and units | Market 2; underlying and shares both use 6 decimals |
Recheck receiver permissions during execute#
The adapter checks the dUSDC proxy/implementation, registry and account-registry implementations, margin market mapping, asset, symbol and decimals. It checks Pool and adapter receiver permissions and their account-registry state too. Any mismatch produces VenueChanged, so a changed recipient rule can stop execution even after a successful quote.
The callback pulls the full input and checks that the Pool's input allowance was consumed. Supply approves that amount to the wrapper and clears the approval after deposit. Redeem sends USDC to the Pool. Starting balances are compared with ending balances, and underlying allowance must be zero. These checks catch short pulls, retained tokens and output below minOut.
Quote supply or redeem#
dolomite-usdc-supply uses operation 0 for USDC to dUSDC. dolomite-usdc-redeem uses operation 1 for dUSDC to USDC. Admit both tokens and register both action tuples. Calls need zero actionData, positive input/output minimum and a deadline that has not passed.
maxRedeem can report an account's share balance even when the market lacks cash. The quote path runs a gas-bounded redeem simulation for the requested amount. It skips the adapter's share transfer and the rest of the Pool call, so estimate the whole action afterwards and check again at the head. Utilization, pauses and recipient restrictions can stop a quoted redemption.
// Read-only recipient and vault check; ethers v5.
const dUSDC = new ethers.Contract(
'0x444868B6e8079ac2c55eea115250f92C2b2c4D14',
[
'function asset() view returns (address)',
'function marketId() view returns (uint256)',
'function implementation() view returns (address)',
'function isValidReceiver(address) view returns (bool)',
'function previewRedeem(uint256) view returns (uint256)',
], provider,
);
const at = { blockTag: authenticatedBlock };
const validReceiver = await dUSDC.isValidReceiver(destination, at);
if (!validReceiver) throw new Error('Choose a permitted dUSDC recipient');
// Recheck at the head and use the complete reviewed withdrawal path.Show dUSDC shares and USDC value#
USDC and dUSDC both use six decimals, but a dUSDC unit is a share in the market. Store and display the share count as the private balance. If you show a USDC estimate, include its snapshot time and use the redemption preview. Issuer upgrades and market exposure still affect the shares held inside the Pool.
Supply reveals its venue and public amount. The private dUSDC balance appears after settlement and scan recovery. Keep pending output separate from spendable shares. Add yield percentages or incentive amounts only when your app has a source for that value and knows how to refresh it.
Distinguish a guard failure from a liquidity failure#
For VenueChanged, compare the wrapper, implementation, registry, market and receiver state with the configuration. Keep the per-call guards in place when investigating. InsufficientOutput means output failed the minimum. InexactInput and InexactConsumption point to token movements or allowance changes that the adapter did not expect.
queue-dolomite.cjs provides venue diagnostics. DolomiteMainnetFork and DolomiteGuardBoundariesFork cover the fixture's checks. Before offering another deployment, check source/artifact identities, market cash, Pool/adapter/recipient permissions, full action execution, share withdrawal and private recovery.