> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rhinestone.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Sponsor gas, bridging, and swap costs for your users

Rhinestone lets you cover the fees for your users, billed to your organization monthly.

You can subsidise gas, bridge fees, and swap fees across all chains.

All projects in your organization share the same sponsorship.

## Fee Types

You can sponsor user fees in three ways:

1. Cover the transaction gas
2. Cover the bridging fee
3. Cover the swap fee (when using [swaps](../chain-abstraction/swaps))

Sponsorship can be applied to all transactions or handled on a case-by-case basis.

You can sponsor both cross-chain and same-chain transactions.

## How it Works

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 adds them to your monthly sponsorship usage. Once your coverage is exhausted — for example, when you hit your [monthly usage limit](/dashboard/billing#monthly-usage-limit) — fees will be applied to your users' intents, ensuring continuity.

The sponsored amount is calculated in USD at the time of the intent, based on the cumulative fees that would otherwise be charged to the user.

## Setup

You can test fee sponsorship on testnets out of the box.

For mainnet, save a card in **Settings → Sponsorship** in the [Dashboard](https://dashboard.rhinestone.dev). See [Billing](/dashboard/billing) for how sponsorship is invoiced and how to cap your monthly spend.

## Usage

To sponsor a transaction:

```ts {11} theme={null}
const transactionData = await rhinestoneAccount.prepareTransaction({
  sourceChains: [sourceChain],
  targetChain,
  calls: [
    {
      to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
      value: 0n,
      data: '0xdeadbeef',
    },
  ],
  sponsored: true,
})
```

You can also choose which fee types to sponsor individually:

```ts {11-15} theme={null}
const transactionData = await rhinestoneAccount.prepareTransaction({
  sourceChains: [sourceChain],
  targetChain,
  calls: [
    {
      to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
      value: 0n,
      data: '0xdeadbeef',
    },
  ],
  sponsored: {
    gas: true,
    bridging: true,
    swaps: false,
  },
})
```

## Sponsorship Policies

If you use [JWT authentication](/intents/configuration/jwt-authentication), you can restrict sponsorship declaratively with the built-in `shouldSponsor` filter — match by chain, account, or calls, evaluated at signing time on your backend.

With API keys, you'll need to enforce the policy yourself. Here's one example, where we only sponsor transactions that interact with a specific contract:

```ts theme={null}
// Sponsors a transaction only if it interacts with our app
function 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:

```ts {12} theme={null}
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),
})
```
