# Custom Integrations

Interface: [ICustomIntegration.sol](https://github.com/babylon-finance/core-interfaces/blob/main/contracts/interfaces/ICustomIntegration.sol)

Base Classes: [CustomIntegration.sol](https://github.com/babylon-finance/core-interfaces/blob/main/contracts/integrations/custom/CustomIntegration.sol) [BaseIntegration.sol](https://github.com/babylon-finance/core-interfaces/blob/main/contracts/integrations/BaseIntegration.sol)

Template: [CustomIntegrationTemplate.sol](https://github.com/babylon-finance/core-interfaces/blob/main/contracts/integrations/custom/CustomIntegrationTemplate.sol)

Example (Yearn): [CustomIntegrationYearn.sol](https://github.com/babylon-finance/core-interfaces/blob/main/contracts/integrations/custom/CustomIntegrationYearn.sol)

## Functions

The following functions can be called by anyone. Strategy operations call it to execute them within its context.

```
function enter(
    address _strategy,
    bytes calldata _data,
    uint256 _resultTokensOut,
    address[] memory _inputTokens,
    uint256[] memory _maxAmountsIn
) external;

function exit(
    address _strategy,
    bytes calldata _data,
    uint256 _resultTokensIn,
    address[] memory _inputTokens,
    uint256[] memory _minAmountsOut
) external;

function isValid(bytes calldata _data) external view returns (bool);

function getInputTokensAndWeights(bytes calldata _data) external view returns (address[] memory, uint256[] memory);

function getResultToken(address _data) external view returns (address);

function getPriceResultToken(bytes calldata _data, address _tokenAddress) external view returns (uint256);

function getOutputTokensAndMinAmountOut(address _strategy, bytes calldata _data, uint256 _resultTokenAmount)
    external
    view
    returns (address[] memory exitTokens, uint256[] memory _minAmountsOut);

function getRewardTokens(bytes calldata _data) external view returns (address[] memory);
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.babylon.finance/developers/smart-contract-api/custom-integrations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
