SteakHut Finance
SteakHut
  • Welcome to SteakHut
  • Getting Started
    • 🐮SteakHut Benefits
    • ⚙️Mechanics
      • SteakHut for DEX V2 Pools
      • SteakHut for DEX V1 Pools
      • SteakHut for JOE Zappers
      • SteakHut for STEAK-Holders
    • 🥩STEAKING
      • Rewards
    • 🌊Liquidity
      • Passive Strategies
        • Stable Strategy
        • Dynamic Range Strategy
        • Pegged Pair Strategy
      • Active Strategies
      • Liquidity as a service
      • Structuring Liquidity
      • Concentrated Reward Farms (Boost)
      • Risks
    • 🌱ve JOE Farms
      • 👨‍🌾veJOE Boosted Farms
        • Understanding veJOE
    • ♻️Auto-compounding Vaults
      • 🪣sJOE Compounder
  • ☕Developer Docs
    • LBVault (Incl. Native)
    • LBStrategy
      • Strategist Role
    • Deployed Liquidity Contracts
    • Integrating SteakHut Liquidity
    • Subgraph
    • More Coming Soon
  • Basics
    • Depositing tokens into SteakHut liquidity
    • STEAKING Applications
    • Bridging $STEAK
    • Depositing your JLP Tokens
      • Redeeming Rewards
      • Creating LP Tokens on SteakHut
    • Zapping JOE and Staking hJOE
  • STEAK-O-Nomics
    • Tokens
      • Understanding $STEAK
      • Understanding xSTEAK
      • Understanding hJOE
    • $STEAK
    • Token Distribution
      • Emission Schedule
      • SteakHut Promotions
    • Token launch
  • SteakHut Protocol
    • Fees and Rewards
    • Smart Contracts
    • Security
      • Audits
      • Multi-Sig
  • References
    • Glossary
    • General FAQ
    • Brand Assets
  • Learn & Connect
    • SteakHut
    • Twitter
    • Discord
    • Medium
    • Trader Joe
Powered by GitBook
On this page
  • Receipt Token:
  • Underlying Assets
  • Questions Regarding Integrations
  1. Developer Docs

Integrating SteakHut Liquidity

Receipt Token:

SteakHut Liquidity pools automatically issue an ERC20 receipt token which represents the users underlying position.

The receipt token may be used to review the underlying shares in the vault and also hence the underlying tokens that a user may withdraw at any time.

Underlying Assets

In the Vault contracts there exists a function named getUnderlyingAssets(). If you pass in the amount of shares that a user holds the function will output the amount of tokenX and tokenY which is redeemable with that proportion of shares.

This returns all of the underlying assets including both the assets currently at work in the Liquidity Book and those assets which are sitting idle (waiting to be put to work) in the Strategy Contract.

    /// @notice Gets the underlying assets in the vault i.e tokenX and tokenY
    /// includes all tokenX and tokenY idle in the strategy and supplied as liquidity
    /// @param _shares amount of shares
    /// @return totalX amounts of tokenX
    /// @return totalY amounts of tokenY
    function getUnderlyingAssets(
        uint256 _shares
    ) external view returns (uint256 totalX, uint256 totalY) {
        uint256 _totalSupply = totalSupply();
        if (_totalSupply == 0) {
            return (0, 0);
        }

        //add currently active tokens supplied as liquidity
        (totalX, totalY) = LiquidityAmounts.getAmountsOf(
            address(strategy),
            strategy.strategyActiveBins(),
            address(strategy.lbPair())
        );

        //add currently unused tokens in the strategy
        totalX += strategy.getBalanceX();
        totalY += strategy.getBalanceY();

        totalX = (totalX * _shares) / _totalSupply;
        totalY = (totalY * _shares) / _totalSupply;
    }

Questions Regarding Integrations

If you need any assistance in integrating with SteakHut Liquidity, feel free to reach out at anytime on any of our social links and a member of our development team will be in touch.

PreviousDeployed Liquidity ContractsNextSubgraph

Last updated 2 years ago

☕