On this page

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.

Pending, Active and Settled notes
Pending, Active and Settled notes

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.

ContractEthereum identity in the fixture
dUSDC wrapper0x444868B6e8079ac2c55eea115250f92C2b2c4D14
DolomiteMargin0x003Ca23Fd5F0ca87D01F6eC6CD14A8AE60c2b97D
Dolomite registry0x0F38bFBd9c1450BCF7A758e80E148CE78cfE09fD
Account registry0xFee366CECA2472B99d0A501b6B3d01351c24dAaE
USDC underlying0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Market ID and unitsMarket 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.

typescript
// 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.

Check who can receive a share withdrawal#

The ordinary screened withdrawal can send dUSDC to a public address without redeeming it. Before proving, the UI calls isValidReceiver(destination) through the selected RPC. Check again near submission because recipient permissions can change. The wallet that receives dUSDC must redeem through Dolomite when cash and permissions allow.

The invalid-recipient browser case remains an acceptance gap in the source. Test the user-facing error when a destination is rejected, including a permission change after preflight. If submission loses its response, keep the input notes reserved until receipts show what happened; a client error can occur after a transaction was broadcast.

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.