Requirements
Before you can start fast filling requests, you need:- An API key — Required to authenticate your fast fill requests. Request an API key.
- Enterprise Partnership — Reach out to the Relay team to become an Enterprise Partner. Learn more about the Enterprise Partner Program.
- A Linked Funding Address — A wallet address must be linked to your API key. This is the address that will fund your app balance. Reach out to the Relay team to link your wallet address.
- Sufficient App Balance — Your app balance must have enough funds to cover fast fills and fee sponsorship. When a fast fill is triggered, a hold is placed against your app balance for the fill amount. This hold is released once the user’s deposit lands onchain. While holds are active, they reduce the balance available for new fast fills and claims, but do not block fee sponsorship deductions.
How to use it?
To Fast Fill a request you simply need to call the Fast Fill API with the request ID of the request you want to fast fill after you’ve submitted it onchain but before it finalizes. When a fast fill is triggered, the transaction is instantly filled on the destination chain and a hold is placed against your app balance for the fill amount. Once the user’s deposit lands onchain and Relay indexes it, the hold is released.Example
This example demonstrates the full fast fill flow: getting a quote, submitting the transaction onchain, calling the fast fill API, and monitoring the status.You can use the
maxFillAmountUsd parameter to set a maximum USD value for a fast fill request. If the request’s value exceeds this limit, the fast fill will not be executed. This is useful for managing risk and controlling exposure, especially when dealing with volatile assets or large transaction volumes.Funding Your App Balance
There are two ways to deposit funds to your app balance:Option 1: Use the Relay App UI
The simplest way to deposit funds is through the Relay App Balance UI. This provides a user-friendly interface for managing your balance.Option 2: Direct On-Chain Deposit
You can programmatically deposit to your app balance by sending a transaction on Base to the Relay solver. This method involves appending specific calldata in place of the request ID to identify the deposit.How It Works
When you transfer funds to the solver using specific calldata, Relay treats it as a deposit to your app balance. This method uses a fixed 12-character prefix and suffix (012345abcdef) with the middle portion specifying which address to credit:
Calldata Format:
- Prefix:
012345abcdef - Address to Credit: The wallet address to deposit funds for (use
0000000000000000000000000000000000000000formsg.sender) - Suffix:
012345abcdef
Examples
| Calldata | Behavior |
|---|---|
0x012345abcdef0000000000000000000000000000000000000000012345abcdef | Credits msg.sender |
0x012345abcdefd5c0d17ccb9071d27a4f7ed8255f59989b9aee0d012345abcdef | Credits 0xd5c0d17ccb9071d27a4f7ed8255f59989b9aee0d |
Solver Address
Deposits should be sent to the Relay solver on Base:| Network | Address |
|---|---|
| Base | 0xf70da97812cb96acdf810712aa562db8dfa3dbef |
TypeScript Example
Checking Your App Balance
Verify your available balance using the Get App Fee Balances API:Caveats
- Slippage may lead to a surplus or shortage in your app balance. If you have a good estimate of the final amount you can use the
solverInputCurrencyAmountparameter to specify the exact amount of input currency you want to use for the fill, thus minimizing slippage. - We recommend protecting your API key on the backend by not exposing it to the client.
- Fast Fill holds, outstanding fast fills that are waiting to be indexed on the destination chain, reduce the balance available for new fast fills and claims, but do not block fee sponsorship.