Beanstalk
  • Agronomics Handbook
  • Farmers' Almanac
  • Whitepaper
  • Contract Addresses
  • 🌱Overview
    • Introduction
    • Development Ethos
    • EIP-2535 Diamond
    • App Storage
    • Internal Balances
  • 🌾Protocol
    • Overview
    • Louper
    • Sun
      • Season Facet
    • Silo
      • Silo Facet
      • BDV Facet
      • Whitelist Facet
      • Convert Facet
      • Convert Getters Facet
      • Enroot Facet
      • Approval Facet
      • Metadata Facet
      • Migration Facet
      • Legacy Claim Withdrawal Facet
    • Field
      • Field Facet
      • Fundraiser Facet
    • Barn
      • Fertilizer Facet
      • Unripe Facet
    • Market
      • Marketplace Facet
    • Farm
      • Farm Facet
      • Depot Facet
      • Token Facet
      • Token Support Facet
      • Curve Facet
    • Diamond
      • Diamond Cut Facet
      • Diamond Loupe Facet
      • Ownership Facet
      • Pause Facet
  • 📜Misc.
    • Technical Recordings
    • Upgrade History
    • FAQ
    • Terminology Discrepancies
Powered by GitBook
On this page
  • Call Functions
  • View Functions
  • Get Max Amount In
  • Get Amount Out
  • Events
Edit on GitHub
Export as PDF
  1. Protocol
  2. Silo

Convert Getters Facet

PreviousConvert FacetNextEnroot Facet

Last updated 6 months ago

Note that this page has not been updated to reflect the current state of Beanstalk, but is left here as a reference.

The Convert Getters Facet contains view functions for Convert data.

Call Functions

None.

View Functions

function getMaxAmountIn(address tokenIn, address tokenOut)
    external
    view
    returns (uint256 amountIn);

Estimate the maximum number of tokens that can currently be Converted from tokenIn to tokenOut.

Parameter
Type
Description

tokenIn

address

The whitelisted token to estimate Converting from.

tokenOut

address

The whitelisted token to estimate Converting to.

Return Value
Type
Description

amountIn

uint256

The maximum number of tokens that can currently be Converted from tokenIn to tokenOut.

function getAmountOut(
    address tokenIn,
    address tokenOut,
    uint256 amountIn
) external view returns (uint256 amountOut);

Estimate the amount of tokens received from Converting tokenIn to tokenOut given an amount of tokenIn.

Parameter
Type
Description

tokenIn

address

The whitelisted token to estimate Converting from.

tokenOut

address

The whitelisted token to estimate Converting to.

Return Value
Type
Description

amountOut

uint256

The amount of tokenOut received from a Conversion from tokenIn to tokenOut.

Events

None.

🌾
Get Max Amount In
Get Amount Out