Fee Sponsorship
By default, Smart Routing Address deducts usage fees from the user's transferred tokens. However, as a developer, you can sponsor these fees so your users receive the full amount they deposit.
Example: When a user deposits 10 USDC to their smart routing address, they will receive exactly 10 USDC on the destination chain, while your dapp pays the usage fees separately.
Sponsored Fee Configuration
To set up fee sponsorship, you must perform two steps:
- Configure SDK with Project ID: Add your ZeroDev project ID to the
baseUrlin your Smart Routing Address configuration. - Select Tokens in Dashboard: Go to the Smart Routing Address Dashboard and select the tokens you wish to sponsor for your project.
import {
createSmartRoutingAddress,
createCall,
FLEX,
SMART_ROUTING_ADDRESS_SERVER_URL,
} from "@zerodev/smart-routing-address";
const { smartRoutingAddress, estimatedFees } = await createSmartRoutingAddress({
destChain,
owner,
slippage,
actions: {
USDC: {
action: [erc20Call],
fallBack: [],
},
WRAPPED_NATIVE: {
action: [erc20Call],
fallBack: [],
},
NATIVE: {
action: [nativeCall],
fallBack: [],
},
},
srcTokens,
config: {
baseUrl: `${SMART_ROUTING_ADDRESS_SERVER_URL}/${ZERODEV_PROJECT_ID}`,
},
});Only tokens that are both configured with the project ID in the code and selected in the dashboard will be sponsored. For these tokens, usage fees are charged to your ZeroDev account, ensuring users receive the full deposit amount.
Notes
- Smart Routing Address integrates with bridges under the hood, so the usage pricing is on top of the underlying bridge fees.
- Pricing can be negotiated. Feel free to reach out.