Obtaining RWA Underlying
Some Gearbox RWA pools use
DefaultRWAUnderlying as their
underlying. Obtain it by depositing the wrapper's configured ERC-20 asset.
This does not require KYC or an allowlist step.
After obtaining the token, use the standard Pool Integration flow without changing the pool logic.
Before continuing, install and attach the Gearbox SDK. The examples use these inputs:
| Variable | Type | Meaning |
|---|---|---|
sdk | OnchainSDK | Attached Gearbox SDK instance |
poolAddress | Address | RWA pool whose underlying must be obtained |
lender | Address | Wallet supplying the configured asset and receiving the RWA underlying |
assetAmount | bigint | ERC-20 asset amount to deposit, in native token units |
rwaUnderlyingAmount | bigint | RWA underlying amount to redeem, in native token units |
Resolve the wrapper
Resolve the RWA underlying and its ERC-20 asset from the pool:
import { BaseContract, RWA_UNDERLYING_DEFAULT, } from "@gearbox-protocol/sdk"; import { iRWAUnderlyingAbi } from "@gearbox-protocol/sdk/abi/rwa/iRWAUnderlying"; const market = sdk.marketRegister.findByPool(poolAddress); const meta = sdk.tokensMeta.mustGet(market.underlying); if ( !sdk.tokensMeta.isRWAUnderlying(meta) || meta.contractType !== RWA_UNDERLYING_DEFAULT ) { throw new Error("Pool does not use DefaultRWAUnderlying"); } const underlyingAsset = meta.asset; const rwaUnderlying = new BaseContract(sdk, { addr: market.underlying, abi: iRWAUnderlyingAbi, name: "DefaultRWAUnderlying", });
underlyingAsset is the token supplied to and returned by the wrapper.
rwaUnderlying.address is the token used by the Gearbox pool.
Obtain RWA underlying
Preview deposit
const expectedRwaUnderlying = await rwaUnderlying.contract.read.previewDeposit([assetAmount]);
The wrapper converts its configured asset 1:1, but use the preview rather than hardcoding that result.
Generate deposit transaction
const depositTransaction = rwaUnderlying.createRawTx({ functionName: "deposit", args: [assetAmount, lender], });
Approve underlyingAsset for rwaUnderlying.address with an allowance of at
least assetAmount. depositTransaction is the unsigned wrapper deposit call.
After execution, approve the received RWA underlying to the Gearbox pool and continue with Pool Integration.
Check how much can be redeemed
const [withdrawableAsset, redeemableRwaUnderlying] = await Promise.all([ rwaUnderlying.contract.read.maxWithdraw([lender]), rwaUnderlying.contract.read.maxRedeem([lender]), ]);
withdrawableAsset is the asset-denominated limit.
redeemableRwaUnderlying is the share-denominated limit.
Redeem to the underlying asset
Preview redemption
const expectedAsset = await rwaUnderlying.contract.read.previewRedeem([ rwaUnderlyingAmount, ]);
Generate redemption transaction
const redeemTransaction = rwaUnderlying.createRawTx({ functionName: "redeem", args: [rwaUnderlyingAmount, lender, lender], });
No approval is required when lender submits the redemption. If another
address submits it, lender must approve that address to spend the RWA
underlying. redeemTransaction is the unsigned wrapper redemption call.
Pricing
const [rwaUnderlyingOut, assetOut] = await Promise.all([ rwaUnderlying.contract.read.convertToShares([assetAmount]), rwaUnderlying.contract.read.convertToAssets([rwaUnderlyingAmount]), ]);
DefaultRWAUnderlying currently defines a 1:1 conversion in both directions.
Use previewDeposit and previewRedeem when preparing an actual transaction.
Integration boundary
This page provides Gearbox address resolution, limits, previews, approval targets, and unsigned calldata. The lender's existing infrastructure owns allowance state, simulation, signing, submission, and monitoring.
For why this token exists, how freeze authority works, and why it does not add direct freeze risk to LP wallets, see Default RWA Underlying.