> For the complete documentation index, see [llms.txt](https://docs.palliora.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.palliora.org/defi/learn/concepts/adaptors.md).

# Adaptors

An adaptor lets a private transaction use another protocol, such as a swap, a loan or a stake. The other protocol does not change. You only add a small contract that sits between the pool and that protocol.

## The idea

Most DeFi actions turn one token into another.

* Swapping ETH for USDC on Uniswap turns ETH into USDC.
* Supplying USDC on Aave turns USDC into a token that earns interest.
* Staking ETH on Lido turns ETH into stETH, then wstETH.

An adaptor does that one conversion. It takes the tokens in, calls the protocol, and returns the tokens out.

## Interface

```solidity
// From the protocol source. Illustrative: shown for reading, not compiled here.
struct AssetAmount {
    uint24 assetId;
    uint256 value;
}

abstract contract IAdaptor {
    function handleAssets(
        AssetAmount[] calldata inAssets,
        bytes calldata payload
    ) external payable virtual returns (AssetAmount[] memory outAssets);
}
```

`inAssets` are the tokens the transaction sends in. `payload` is whatever the adaptor needs to know, such as a slippage limit. `outAssets` are the tokens it returns.

## How a call runs

1. You build a transaction of the adaptor call kind. It names the adaptor, the tokens to send, and the payload. The proof spends your notes.
2. The pool checks the proof and releases the tokens to the adaptor handler.
3. The handler calls the adaptor with `delegatecall`, so the adaptor runs with the handler's balance.
4. The adaptor calls the other protocol and returns the output tokens.
5. The handler checks each output token is active in the pool and that it holds at least the amount returned. It then lets the pool pull the output.
6. The pool creates a note for each output token. The notes belong to the refund address you named in the transaction. A memo on each note lets only you recover its blinding, so only you can spend it. The amounts are public, because the pool builds the commitments from what the adaptor returned.

The tokens in and out, and the payload, are public. Who made the call, and who owns the new notes, is not.

## What an adaptor is

* **Stateless.** It keeps no balances. It holds immutable addresses of the protocol it talks to.
* **Registered.** Only the pool owner can register an adaptor. An unregistered adaptor is rejected.
* **Limited.** The handler accepts only output tokens that are active in the pool and amounts it actually holds.

## Which adaptors exist

The protocol has adaptors for Aave v3, Uniswap v3, Curve, Ethena, Lido, Morpho vaults, 1inch v6, Rocket Pool and Beefy. Which are live differs by network. See [Network reference](https://github.com/palliora-org/palliora-docs-with-ai/tree/main/defi/reference/network-reference.md).

On HyperEVM, a different adaptor funds a Private Sub-account straight from the pool. See [Private Sub-accounts](/defi/learn/concepts/private-sub-accounts.md).

## Write your own

To add private access to a protocol, write an adaptor, then ask for it to be registered. See [Integrate a DeFi protocol](/defi/build/integrate-a-protocol.md).

## Next

* [Accountable privacy and disclosure](/defi/learn/concepts/accountable-privacy-and-disclosure.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.palliora.org/defi/learn/concepts/adaptors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
