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

# Relayers

> Opt-in contracts that call the Vault on behalf of users for multi-step operations.

Relayers are opt-in, audited contracts that can make calls to the Vault on your behalf. They can use the sender's ERC20 vault allowance, internal balance, or BPTs after being approved.

## Types of relayers

### BalancerRelayer

The BalancerRelayer allows you to execute multiple vault actions in a single transaction by chaining them together. This improves UX by reducing the number of transactions needed for complex operations.

Example of chaining multiple actions:

```js theme={null}
// Approve relayer
const approval = buildApproval(signature);

// Chain exit pool and swap
const exitPoolCallData = buildExitPool(poolId, bptAmount);
const swapCallData = buildSwap(params);

// Execute all actions in one transaction
const tx = await relayer.multicall([approval, exitPoolCallData, swapCallData]);
```

### PoolCreationHelper

The PoolCreationHelper is a specialized relayer that simplifies pool creation and initial liquidity provision. See the PoolCreationHelper documentation for details.

Key features:

* Creates and joins pools in a single transaction
* Supports joining WBERA pools with either WBERA or BERA
* Handles both weighted and stable pool creation

## Approving a relayer

Before a relayer can act on your behalf, you must approve it using the Vault's `setRelayerApproval` function:

```solidity theme={null}
function setRelayerApproval(
    address sender,
    address relayer,
    bool approved
) external;
```

For example, to approve the PoolCreationHelper:

```js theme={null}
const vault = new ethers.Contract(VAULT_ADDRESS, vaultAbi, wallet);
await vault.setRelayerApproval(
  wallet.address, // sender
  RELAYER_ADDRESS, // relayer
  true // approved
);
```

<Info>
  Only approve relayers that have been audited and are part of the official BEX deployment.
</Info>
