🌴
Babylon.finance
  • Getting Started
    • Introduction
    • Terminology
    • User Guides
      • 1. Funding a Web3 Wallet:
      • 2. Joining a Garden:
      • 3. Creating a Garden:
      • 4. Growing Your Garden:
      • 5. Buying BABL Tokens:
      • 6. Staking BABL Tokens:
      • 7. Bonding ETH/BABL:
    • 📹Video Guides
      • Deposit into a Garden
      • Creating a strategy
    • FAQ
      • Supported Software and Devices
    • Links
      • Media Appearances
      • Press Releases
      • Research Threads / Articles
  • Protocol
    • Litepaper
      • Participants
    • Gas Optimizations
      • 🪄Gasless Deposits
    • Integrations
    • Roadmap
  • 🖥️Developers
    • Building on Babylon
    • 🛠️Custom Integrations
    • Smart Contract API
      • BabController
      • Garden
      • Strategy
      • Custom Integrations
    • Error codes
    • Deployments
  • BABL
    • Tokenomics
    • 🫀 Heart
      • Heart Bonds
    • BABL Mining Program
    • Governance
      • Babylon Governor
      • Proposals
  • Prophets
    • 🛡️ 2592 Prophets
    • The Prophets Arrival (Concluded)
      • Great Prophets Auction
  • Security
    • Security
    • Risks
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Smart Contract API

Custom Integrations

PreviousStrategyNextError codes

Last updated 3 years ago

Was this helpful?

Interface:

Base Classes:

Template:

Example (Yearn):

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);
🖥️
ICustomIntegration.sol
CustomIntegration.sol
BaseIntegration.sol
CustomIntegrationTemplate.sol
CustomIntegrationYearn.sol