---
title: Pay Fees with Any Token
description:
  Learn how to pay transaction fees with any token using Solana's native fee
  payer and batching features.
---

## Overview

In order to improve UX for users, apps should consider allowing users to pay for
transactions using any token they have available in their wallet. This way apps
do not have to sponsor transaction fees for users, but still improve UX for end
users and not require them to hold SOL. This concept is often referred to as
"gas abstraction" on other blockchains. Paying transaction fees with any token
is enabled via two key native capabilities of Solana transactions:

- The `feePayer` field in the transaction message.
- The ability to batch instructions in a single transaction.

## How to pay transaction fees with any token

To pay transaction fees with any token, you'll need to have an EOA to use as the
fee payer and a transaction with an instruction that transfers tokens from the
user's wallet to the fee payer's wallet. The fee payer will then forward the
transaction to the Solana network and pay the transaction fees in SOL covered
monetarily by the tokens it received from the user.

This flow can be simplified by using a fee relayer, like
[Kora](/docs/tools/kora), that can process a transaction for end users only if
it is paid for in a configured token like USDC or USDT.

The following example shows how to pay transaction fees with any token.

<CodeTabs storage="pay-fees-with-any-token-ts" flags="r">

```ts !! title="Kit" file=packages/docs-examples/cookbook/transactions/pay-fees-with-any-token/kit.ts#region=pay-fees

```

```ts !! title="Legacy" file=packages/docs-examples/cookbook/transactions/pay-fees-with-any-token/legacy.ts#region=pay-fees

```

</CodeTabs>

## Recommended: Use a fee relayer service

It is recommended to use a fee relayer service to pay transaction fees with any
token. Kora is built to support such a use case and also includes additional
features like configuring which tokens are accepted as well as automatically
swapping the received tokens for SOL for continued operation.

Kora, by the Solana Foundation, is a fee relayer service that allows you to
relay transactions for other users. In addition to accepting fee payment for
configured tokens, it also provides full fee sponsorship for transactions. More
information can be found in the [Kora documentation](/docs/tools/kora).
