LogoLogo
TwitterDiscordGitHubMedium
  • Introduction
    • About Tetu
    • Links
      • DeFi Integrations
    • Team
  • Protocol
    • Products
    • Tokenomics
    • Governance
      • Past governance proposals
    • Tetu FAQ
  • Tetu v1
    • Yield Farming
      • Strategies
        • Simple rewards farming
        • Single Asset Autocompound
        • Multi Strategy v2
          • AMB v1
        • tetuQi
        • tetuBAL
        • Tetu Boosted Pools
        • tetuMESH
      • SmartVault
      • Tetu Zap Solution
      • Strategy Splitter
      • Vault Shares
      • HardWorks
      • Reward Boosting System
  • Tetu v2
    • Introduction
    • veTETU
      • Utility
    • Delta-neutral strategies
    • Voting System
    • TetuVault V2
    • Security
    • Learning Station
  • PAWNSHOP
    • Introduction & Features
  • Technical
    • Updates
      • Tetu.io contracts update 1.1.0
      • Tetu.io contracts update 1.2.0
      • Tetu.io contracts update 1.3.0
      • Tetu.io contracts update 1.4.0
      • Tetu.io contracts update 1.5.0
      • Tetu.io contracts update 1.6.0
      • Tetu.io contracts update 1.7.0
    • Addresses
    • Security Overview
      • Tetu EOA Protection
      • Multi Sig
      • Time Lock
      • Pausing
      • Guides
      • Bug Bounty Program
      • Audits
  • Second Stage
  • Tetu' Second Stage
    • Investment Fund
  • Archive
  • Old Sections
    • Profit Sharing Pool xTETU
      • Protocol Owned Liquidity
    • Diamond Vault dxTETU
    • Fantom Addresses
    • Folding Strategies
    • LP incentives
    • xtetuQI
    • TetuSwap
      • Fees
    • APR calculation
Powered by GitBook
On this page
  • Zapping
  • Contracts
  • PriceCalculator
  • MultiSwap
  • ZapContract
  • Resources

Was this helpful?

Export as PDF
  1. Tetu v1
  2. Yield Farming

Tetu Zap Solution

PreviousSmartVaultNextStrategy Splitter

Last updated 3 years ago

Was this helpful?

Zapping

Zap solution converts a token to another using a defined route and can be used to deposit or withdraw from a vault.

Through the Zapping Function users can enjoy the efficiency of participating in a yield farming vault with just one transaction, in general with zapping users can perform only one transaction to enter and exit a yield farming vault. Without using zapping the user would have to perform between 6 ~ 8 transactions to deposit to a yield farming vault.

Withdraw and converting to the token is also possible.

The zapping function can cause slippage, when using it it is better to prioritize small amounts of deposits and withdrawals.

Contracts

This solution included three contracts

  • PriceCalculator

  • MultiSwap

  • ZapContract

PriceCalculator

In this solution Price Calculator will find the best liquidity pool across predefined Swap Platforms.

getLargestPool(address token, address[] memory usedLps)

For calculation price for any LiquidityPool pair using

getPriceFromLp(address lpAddress, address token)

MultiSwap

This contract has two purposes:

Find the best route for swap two tokens. The result will contain swap pairs.

findLpsForSwaps(address _tokenIn, address _tokenOut)

The function should be called as a view from UI before the swap

Multi-swap will execute swaps for a given route. Used inside ZapContract but also can be used as a dedicated solution.

multiSwap(address[] memory lps, address tokenIn, address tokenOut, uint256 amount, uint256 slippageTolerance)

ZapContract

This contract implements all required steps for deposit/withdraw to the vault.

Resources

Zap Feature article on .

Medium