# Sponsor Fees

Fordefi supports fee sponsorship across multiple chains. With fee sponsorship, a designated *fee payer vault* covers the transaction fees on behalf of the *origin vault* that initiates the transaction.

This is useful when you want to abstract gas costs away from your users or consolidate fee payments into a single Fordefi vault.

Fordefi supports sponsorship on the following chains:

| Chain | Additional setup |
|  --- | --- |
| EVM* | Origin vault must first be upgraded to an EIP-7702 smart account |
| Solana | No setup required |
| Aptos | No setup required |
| Sui | No setup required |


**EVM fee sponsorship is currently supported on: Ethereum, Arbitrum Sepolia, Avalanche, Base, Blast, BNB Chain, Flare, Gnosis Chain, Linea, Ink, Plasma, Polygon, Scroll, Sei V2, Sonic, Unichain and ZetaChain.*

## How it works

All sponsored transactions follow the same pattern across supported chains:

1. Build a transaction request that includes a `fee_payer` field pointing to the fee payer vault. This field is added inside the `details` object of the transaction request body.
2. Sign the request payload with your API User's private key.
3. Broadcast the transaction using the Fordefi API.


The `fee_payer` field is the key difference from a standard transfer:


```json
"fee_payer": {
    "type": "vault",
    "vault_id": "<FEE_PAYER_VAULT_ID>"
}
```

## Examples

Examples have been provided for each of the supported chain types:

- [EVM](https://github.com/FordefiHQ/api-examples/blob/main/python/simple-api-transfers/evm/sponsored_transactions_7702/sponsored_token_transfer_evm.py)
- [Solana](https://github.com/FordefiHQ/api-examples/blob/main/python/simple-api-transfers/solana/sponsored_token_transfer_solana.py)
- [Aptos](https://github.com/FordefiHQ/api-examples/blob/main/python/simple-api-transfers/move-chains/aptos/sponsored_fungible_assets_aptos.py)
- [Sui](https://github.com/FordefiHQ/api-examples/blob/main/python/simple-api-transfers/move-chains/sui/sponsored_token_transfer_sui.py)


## Prerequisites

There are four steps to take:

### Fordefi API setup

Set up an API User and an API signer by following the [Fordefi API Signer documentation](https://docs.fordefi.com/developers/getting-started/set-up-an-api-signer/api-signer-docker).

### Fordefi vaults

You need **two Fordefi vaults** on the target chain:

- **Origin vault**: The vault initiating the transaction
- **Fee payer vault**: The vault that holds the gas token (ETH, SOL, APT or SUI) and that will pay transaction fees on behalf of the origin vault


### Enable fee sponsorship

Enable fee sponsorship in your organization settings through the [Fordefi web console](https://docs.fordefi.com/user-guide/fee_sponsorship#activate-the-feature). Fee sponsorship is always enabled via the Fordefi workspace settings, this requires admin access.

### EVM only: upgrade to Smart Account

For **EVM chains only**, the origin vault must be upgraded to an EIP-7702 smart account before it can use fee sponsorship. The fee payer vault does not require any upgrade. See the [this code example](https://github.com/FordefiHQ/api-examples/blob/main/python/simple-api-transfers/evm/sponsored_transactions_7702/upgrade_vault_to_smart_account.py) for details on how to upgrade an EVM vault programmatically.