Sponsor gas, bridging, and swap fees for your users
Rhinestone lets you cover the fees for your users with a single onchain deposit.You can deposit USDC on Base, and subsidise gas, bridge fees, and swap fees across all chains.
When your users make transactions, you can select which (if any) fees you are willing to sponsor. Rather than charging the user these costs, the Orchestrator instead applies them against your sponsorship balance. You can sponsor up to their deposited amount, after which point, fees will be applied to your users’ intents, ensuring continuity should you run out of funds.For any given intent, the orchestrator calculates 3 types of fees: swap, bridge, and gas. Swap fees are a fixed 50 basis point spread between the offer and ask tokens. Bridge fees are a fixed 3 basis points on the input token being bridged between chains. Gas fees are the sum of the estimated fill gas (including any deployment costs if the account is undeployed) and all claim transactions a relayer will need to execute to fulfill an intent.When calculating the sponsored amount in USD, we take the cumulative fees — that would otherwise be applied to the user — and convert them to a USD value at the time of an intent.
You can test fee sponsorship on testnets out of the box.Reach out to us if you need to set this up for production use. We will provide you with a wallet address to deposit to. Once you deposit, your sponsorship balance will automatically increase.Currently, we accept USDC deposits on Base. Reach out to us if you want to use fiat deposits.
Currently, the SDK doesn’t provide any policies out of the box. You can implement bespoke, flexible policies on your backend.Here’s one example, where we only sponsor transactions that interact with a specific contract:
Copy
Ask AI
// Sponsors a transaction only if it interacts with our appfunction isSponsored( sourceChains: Chain[], targetChain: Chain, calls: { to: string value: bigint data: string }[],): boolean { const appContractAddress = '0xbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef' return calls.some((call) => call.to === appContractAddress)}
You can then use that function when handling the user’s transaction request:
Copy
Ask AI
const calls = [ { to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045' as Address, value: 0n, data: '0xdeadbeef' as Hex, },]const transactionData = await rhinestoneAccount.prepareTransaction({ sourceChains: [sourceChain], targetChain, calls, sponsored: isSponsored([sourceChain], targetChain, calls),})