LogoLogo
Tokemak.xyzTokemak AppGithubXDiscord
  • Autopilot
    • Introduction
    • A New Way to Provide Liquidity
    • Protocol Mechanics
      • Components & Logic
      • Asset Flow Example
    • Autopools & LATs
    • Staking TOKE
    • Custom Autopools
    • Glossary
  • USING THE APP
    • App Guide
      • Autopools
        • Deposit and Withdraw
        • Stake and Unstake
        • Claim Incentives
        • View Positions
      • Staking TOKE
        • Stake and Allocate
        • Unstake and Withdraw
        • View Positions
        • Claim Rewards
      • Toke/ETH LP
      • Guarded Launch Rewards
    • With Wallet Services
      • Fireblocks
    • Troubleshooting
  • Developer Docs
    • Contracts Overview
      • Autopool ETH Contracts Overview
        • Autopilot System High Level Overview
        • Autopilot Contracts and Systems
          • Autopilot Contract Security
          • Stats
          • Autopilot Strategy
          • Pricing
          • Swap Router
          • Curve Resolver
          • Message Proxy
          • accTOKE
          • Autopilot Router
          • Liquidation
          • Destination Vaults
          • Autopools
        • Autopilot Contracts Glossary
      • Contract Addresses
    • Security and Audits
      • Hexens: autoUSD March 25th 2025
      • Hexens: Autopilot Follow Up/Updates Audit July 2024
      • Hexens: Tokemak Autopilot May 2024
      • Certora: LMPStrategy Security Assessment & Formal Verification Report - Jan/March 2024
      • Hats.Finance, Crowd Competition Smart Contract Audit, February - March 2024
      • Halborn - Autopilot (Autopools) Contracts - Preliminary Smart Contract Audit - Sept 2023
      • Halborn - Autopilot Pricing Contracts - Formal Verification Report - Sept 2023
      • Sherlock - Autopilot Contracts - Crowd Competition - Sept 2023
      • Halborn - accTOKE Contract - Nov 2022
    • Integrating
      • 4626 Compliance
      • Large Withdrawals
      • Checking for Stale Data
  • Additional Links
    • Community Resources
Powered by GitBook
On this page
  • Step 1: Users deposit assets
  • Step 2: Rebalance
  • Step 3: Auto-Compounding
  • Step 4: Debt Reporting
  • Step 5: Rinse and Repeat

Was this helpful?

Export as PDF
  1. Developer Docs
  2. Contracts Overview
  3. Autopool ETH Contracts Overview

Autopilot System High Level Overview

The purpose of Autopilot is to continuously rebalance Autopool assets into the Destinations with the best return/risk profile. Earnings are auto-compounded for the users, reinvested into the Autopool, and then rebalanced out to begin earning. We’ll give an overview of how things work by looking at how the assets flow through the system.

Step 1: Users deposit assets

Users must deposit assets into an Autopool for there to be assets to deploy. If this is a contract-to-contract interaction, this can happen directly in an Autopool. If this is a user interaction, through our UI, this will happen through our Router. The end-result is that the Autopool has idle assets sitting in it and the external party has Autopool shares in their wallet.

Step 2: Rebalance

Once a sufficient number of assets are deposited, the Autopool, or more importantly the Strategy backing the Autopool, will begin to accept rebalance proposals from our Solver. When a proposal satisfies the constraints of the Strategy:

  • The Autopools underlying asset, WETH in this case, will be sent to the Solver specified in the proposal

  • The Solver will take those underlying assets and turn them into the LP tokens for the Destination specified in the proposal. This can involve swaps, liquidity provisioning, or w/e other means the Solver has to procure the LP tokens.

  • The Solver will send those LP tokens back to the Autopool

  • Once validating everything looks good with the Strategy, the Autopool deposit those LP tokens into the corresponding DestinationVault for that Destination.

  • The DestinationVault will do what it needs to with the LP tokens depending on the type of Destination it is. If its just a pool Destination then the LP tokens can stay there. If its a Curve+Convex Destination, then the DestinationVault will stake the tokens into Convex.

  • The DestinationVault mints the Autopool 1:1 shares of itself to represent the deposit

  • Each DestinationVault has its own Rewarder where its shares are virtually staked on the Autopools behalf.

At the end of the rebalance, the Autopool has less of its base asset, and some number of DestinationVault shares representing a claim on some LP tokens.

Step 3: Auto-Compounding

On a periodic basis, rewards from the Destinations will claimed and collected via a permissioned keeper process. This is most-likely, though not restricted to, incentive tokens through say Convex or Aura, for example.

These tokens all go to a central LiquidationRow contract where they can be liquidated to the base asset in bulk at a later time.

When that liquidation occurs, assets are sent back proportionately to the DestinationVaults that contributed to their balance. These assets are held in the DestinationVaults Rewarder where the Autopools earn them over a short period of time.

Step 4: Debt Reporting

At least every 24 hours, each Autopool goes through a debt reporting where we re-value the LP tokens held by that Autopool. During that process, any available auto-compounded rewards are claimed and come into the Autopool as idle funds.

Step 5: Rinse and Repeat

With sufficient idle assets in the Autopool, another rebalance can occur. There is no requirement that funds earned from a Destination must go back to that Destination.

The above outline focused on idle → LP rebalances but the rebalance step can occur for LP → LP rebalances as well. So long as the proposal results in a higher potential return (and satisfies other constraints) it can be executed.

PreviousAutopool ETH Contracts OverviewNextAutopilot Contracts and Systems

Was this helpful?