Skip to the article
Onchain Brief

News from across crypto

How Solana vault calls fit into aggregator swaps

A Solana vault call can put a cross-chain transfer inside a larger swap transaction, letting an aggregator combine a local trade with a Chainflip route.

The Onchain Brief Editors3 min read
How Solana vault calls fit into aggregator swaps

A Solana vault call lets an app place a cross-chain transfer instruction in the same transaction as a local swap. That gives an aggregator a way to join a trade on a Solana exchange to a transfer handled by Chainflip, provided the aggregator supports the route.

What does a Solana vault call do?

It calls a program that takes the swap details and input funds. Chainflip’s Solana Swap Endpoint has separate calls for native SOL and supported tokens. A token swap also needs the user’s token account and the token’s mint address.

The call stores swap details in a temporary on-chain account so Chainflip can process them. The user signs the Solana transaction and pays its fee. For the wider process and what to check when a swap gets stuck, see Chainflip swap flow and checks.

How can an aggregator combine it with a swap?

A Solana transaction can contain several instructions in order. An aggregator that builds a route could put a local token swap first, then call the vault program with the resulting supported token. A cross-program invocation, or CPI, is one program calling another program’s instruction while a transaction runs.

For example, a route might trade token A for a Chainflip-supported token B on Solana, then pass token B to the vault call for a cross-chain transfer. The aggregator can show that as one route, even though two programs handle the steps. The wallet still signs the transaction.

  • The first instruction swaps token A for token B.
  • The vault call sends token B into the cross-chain route.
  • Chainflip processes the swap and sends the destination asset to the specified address.

Because the instructions share one Solana transaction, a failure in one step can cause the transaction to fail as a whole. The cross-chain part still takes place after the Solana transaction; combining instructions does not make both networks settle at once.

What should a user check before signing?

Check that the route names the expected input token, destination address and minimum output. The token must be supported by Chainflip, or the call can fail. The program also needs correctly encoded swap details, including values that can change over time. Chainflip recommends getting the instruction parameters through its Broker API rather than assembling them by hand.

Not every aggregator supports this route, and a displayed quote alone does not show that the vault call is included. Review the transaction details before signing. The useful idea is simple: a vault call gives a route builder another instruction it can compose with a local swap, while each step keeps its own program rules and failure conditions.