Factor Docs
  • 🏭Introduction to Factor
  • Getting Started
    • 🕹️Quickstart
    • 🔗Supported Protocols
    • 🔐Strategy Cheatsheet
      • Swaps Cheatsheet
        • Conditional Market Order
        • Automated Market Order
        • Multi Swap
        • Automated Swap & Earn
        • Automated Scale Order
        • Scale Order Partial Fill Yield
        • Interest On Pending Trades
        • Leverage Trade
        • Leverage DCA
      • Lending Cheatsheet
        • Lending Pool Zap
        • Multi Lend
        • Market Making To Lending Switch
        • Earn Negative Interest
        • Carry Trade
        • Leveraged Staking Yields
        • Leveraged Fixed Yields
      • Borrowing Cheatsheet
        • Collateralized Borrow
        • Collateralized Borrow Zap
        • Multi Borrow
        • Debt Switching
        • Automated Debt Readjustments
        • Debt Refinancing
        • Asset Switching
      • Liquidity Provision Cheatsheet
        • Liquidity Pool Zap
        • Yield Farm Zap
        • Automated LP Adjustments
        • Yield Farm Adjustments
      • Flash Loan Cheatsheet
    • 🧠Strategy Explainers
      • Leverage
        • Leverage Performance Modelling
        • Leverage Long Simulation
        • Leverage Short Simulation
      • Yield
        • Yield Performance Modelling
      • PT Strategies
        • Leverage Long PT Simulation
      • Delta Neutral Yields
        • Levered USD & ETH Carry
    • 📖Glossary
  • Factor Discover
    • 🔍Factor Discover
      • Public Strategies User Guides
        • Deposit Into User Created Strategies
        • Withdraw From User Created Strategies
      • Leverage User Guides
        • Create A Leveraged Position
        • Adjust Position Leverage
        • Add Collateral To Position
        • Withdraw Collateral From Position
        • Repay Position Debt
      • Yield User Guides
        • Auto-compound Your Yields
      • PT User Guides
        • Redeem Your PT
      • APY Calculations
    • ⚙️Factor Operated Strategies
      • Yield Type Strategies
        • Arbitrum (ChainID: 42161)
          • 4.4x rETH Carry + 1x USDC Lending Yields - Aave & Compound
          • 7x Leveraged rETH:ETH Yields - Compound
          • Additional rETH Yields On USDC Lend
          • Amplified wstETH Yields On USDC Lend - Aave
          • Additional Liquid Staked ETH Yields On USDC Lend
          • Additional Liquid Restaked ETH Yields On USDC Lend
          • Diversified USDC Lending Yields - Aave & Compound
        • Base (ChainID: 8453)
          • 3.5x Leveraged cbETH:ETH Yields - Aave
          • Amplified cbETH Yields On USDC Lend - Aave
          • Additional cbETH Yields On USDC Lend
          • Amplified cbETH Yields On cbBTC Lend - Aave
          • Additional Liquid Staked ETH Yields On USDC Lend
      • Trading Type Strategies
        • WBTC Base Switch On rETH For ETH & USDC Yields
      • Delta Neutral Type Strategies
        • Arbitrum (ChainID: 42161)
          • Delta Neutral ETH With rETH & USDC Yields
        • Base (ChainID: 8453)
          • Delta Neutral ETH With cbETH & USDC Yields
  • Factor Studio
    • 🎨Factor Studio
      • Automated Strategies
      • Conditional Strategies
    • 👥Public Strategies
      • User Guide
        • Public Strategy Creation
        • Create An Exit Strategy
        • Making Your Strategy Public
        • Strategy Execution
      • Security
      • Exit Strategy
    • 🏗️Strategy Builder
      • Building Blocks User Guide
        • Lend
        • Borrow
        • Swap
        • Flash Loan
    • 📜Studio Contracts
      • Leverage
        • FactorLeverageDescriptor.sol
        • FactorLeverageVault.sol
        • WrapperFactorLeverageVault.sol
      • LP Management
        • FactorLPVault.sol
        • FactorLPDescriptor.sol
    • 🏠Private Strategies
      • User Guide
        • Private Strategy Creation
  • Factor SDK
    • 📦Factor SDK
    • ↔️REST APIs
      • Utility APIs
        • Pricing
        • Stats
  • Factor Building Blocks
    • 🧱Factor Building Blocks
    • ➡️Lend
    • ⬅️Borrow
    • 🔄Leverage
      • Concepts
        • Collateralized Lending & Borrowing
        • Looping
      • Leverage Dev Guides
        • Create Leveraged Position
        • Add Leverage To Position
      • Strategy Contracts
        • AAVEV3LeverageStrategy.sol
        • CompoundLeverageStrategy.sol
        • LodeStarLeverageStrategy.sol
        • RadiantLeverageStrategy.sol
        • SiloLeverageStrategy.sol
        • SiloYieldTokenStrategy.sol
        • TenderLeverageStrategy.sol
      • FAQ - Leverage Building Block
    • 💰Yield
      • Concepts
        • Yield Farming
        • Yield Aggregators
      • ⚡Zap
    • 🌊LP Management
      • Concepts
        • Automated Market Maker
        • Concentrated Liquidity
    • 🥩Stake
    • 🔀Swap
      • Concepts
        • Market Orders
        • DEX Aggregators
    • 🪄Flash Loan
      • Concepts
        • Uncollateralized Lending & Borrowing
        • Flash Loan
  • Factor Adapters
    • 🔌Factor Adapters
    • 📜Adapter Contracts
      • Leverage
      • Yield
      • Swap
      • Flash Loan
  • Governance
    • 🏛️FactorDAO
      • Factor Flywheel
      • Factor Participants
      • Governance Incentive Calculations
        • FactorDAO Incentives Model (LTIPP)
      • User Guides
        • Stake FCTR
        • Governance Migration
      • Contracts
        • FactorDAO Contract Addresses
      • FactorDAO Multisig Addresses
      • Platform Fees
    • 🪙FCTR Token
      • Staking and Governance
      • Tokenomics
      • Contract Addresses
      • FAQ - Tokenomics
    • ⚖️Factor Scale
      • Arbitrum Foundation LTIPP
      • Emission Multiplier Calculations
        • Emissions Multiplier Model
      • User Guides
        • Stake FCTR
        • Vote On Emissions Distribution
      • Contracts
        • Factor Scale Contract Addresses
      • ❔FAQ - Factor Scale
    • 🚀Factor Boost
      • Contracts
        • Factor Boost Contract Addresses
    • 💼Factor Bribes
      • Contracts
        • Factor Bribes Contracts
  • Security
    • 🛡️Security
    • 📋Audits
      • PeckShield
        • Leverage Vault Wrapper
        • Silo Yield
        • Silo Leverage
        • Penpie
        • Factor Boost
      • SourceHat
        • FactorDAO Vaults
        • FCTR & Voting Escrow
  • Reference
    • Discover Pro dApp
    • Studio dApp
    • Discover dApp
    • Official Website
    • Press Kit
    • Partnership Form
    • Media Kit
    • Geo Restrictions
  • Community
    • Factor Contributors
    • X
    • Discord
    • Telegram
    • Medium
    • Email Enquiries
Powered by GitBook
On this page
  • Overview
  • Approach
  • Permissionless Vault Contracts
  • Vault Specific Exit Strategy
  • Maintaining Vault Composition
  • Handling Debt Obligations

Was this helpful?

  1. Factor Studio
  2. Public Strategies

Exit Strategy

Supporting Permissionless Vault Withdrawals

Overview

In addition to being non-custodial, true permissionless asset management also means that Depositors should be able to withdraw any amount of their tokens at anytime. This means that Depositors should be able to unwind their vault position without requiring Strategy Manager approval nor having to incur the opportunity costs of waiting.

Instead of having to speculate on when and how much a Depositor will withdraw, Factor Studio enables Managers to specify an exit flow which can be independently executed by the Depositor. This maximizes potential vault returns while simultaneously minimizing any manual overheads and risks.

Vault Composition

To ensure fairness for all Depositors in a vault, it is crucial that the vault's token composition (e.g. % of asset tokens, liabilities, etc.) remains the same before and after the withdrawal.

By maintaining the vault's token ratios, this safeguards vault deposits from the action of any single Depositor. In other words, a Depositor should never trade against the vault as this will come at the expense of other Depositors.

Approach

Permissionless Vault Contracts

The Exit Strategy takes advantage of smart contracts whereby Depositors can also interact directly on-chain with the permissionless vault smart contracts. As long as the vault is able to validate that the caller is the owner of the shares, the Depositor should be able to trigger any action involving his share of the vault.

The delineation between vault Strategy Manager and share owner (i.e. Depositors) allows for permissionless asset management to thrive in a pseudo-anonymous environment where anyone can easily create vaults.

Vault Specific Exit Strategy

Given that Factor Studio enables any strategy to be created, the Strategy Manager will have the best knowledge on how to unwind active capital allocated towards the strategy (e.g. closing outstanding debt, claiming rewards, token swap directions, etc.). While Depositors should DYOR before depositing, not all Depositors will have the requisite DeFi strategy knowledge to unwind the funds themselves.

For every strategy created, Strategy Managers have the option to configure an Exit Strategy which specifies the general flow required to unwind the position. Depositors are able to view if an Exit Strategy has been configured for the strategy prior to depositing. While Factor strongly recommends configuring an Exit Strategy, this decision is ultimately left to the Strategy Manager allowing them to determine the trust levels and risks specific to their strategy.

Maintaining Vault Composition

While Strategy Managers are able to specify the exit flow, the amounts for each step can only be known at the point of withdrawal as it requires the Depositor to specify the amount of shares being withdrawn and the vault state at the point of withdrawal request.

Withdrawals via Factor Discover builds on top of the Exit Strategy configured by the Strategy Manager to generate a withdrawal request which can be easily signed by the Depositor to be executed directly on-chain.

The corresponding amounts for each building block in the Exit Strategy is automatically calculated based on the vault's state at the point of the withdrawal request. This includes:

  • Idle Tokens → Tokens which are sitting in the vault contract and not allocated to an external protocol.

  • Collateral Tokens → Tokens that have been deposited into lending protocols to earn supply interest. Can be used to collateralize borrows of tokens in the same market.

  • LP Tokens → Tokens that represent liquidity locked in an AMM pool to earn market making fees.

  • Staked Tokens → Tokens that have been deposited into various pool/staking contracts to earn yield or rewards.

  • Reward Tokens → Tokens which have accrued as rewards for staking/locking liquidity. Requires claiming from the reward protocol.

  • Debt Tokens → Tokens which represent debt obligations to lending markets where tokens were borrowed from

Critically, the vault’s composition of assets and debts should not change before and after a withdraw tx. Additionally, calculations will also take into account the slippage settings as configured by the Depositor at withdrawal.

Handling Debt Obligations

In cases where the vault's asset:debt ratio decreases between deposit and withdrawal, there is a risk that the Strategy Manager configured Exit Strategy might be insufficient to cover any outstanding debt obligations corresponding to the shares burned.

To facilitate withdrawals in such cases, Factor Studio also provides a "Close Debt" block which a Strategy Manager can append to the end of their configured Exit Strategy. By checking the expected vault end state against the vault state after the configure Exit Strategy, the "Close Debt" block automatically loops through any remaining debt and repays the debt in full using the underlying collateral.

Close Debt High Level Flow

To maintain the vault's composition when triggered by the Depositor, amount calculations must take into account the vault state at 3 separate points in the process:

  1. Before exit strategy → Current state of the vault

  2. After Manager configured exit strategy → Expected vault state after successful execution of the Manager portion of the exit strategy

  3. After exit strategy → Expected end state of vault after withdrawal

The withdrawal still has outstanding debt if the the output from 2 is insufficient to cover the debt owed in 3. To close the remaining debt, the Close Debt block abstracts the following process to facilitate safe settlement of remaining debt:

  1. Loop through all remaining debt tokens

  2. For each debt owed, repay the outstanding with the underlying collateral (equalized in USD terms via price oracle)

    1. Flash loan debt token

    2. Repay debt with flash loaned debt tokens

    3. Withdraw the underlying asset

    4. Swap collateral(s) to flash loaned tokens (i.e. same as debt)

The process above ensures that Depositors are still able to permissionlessly withdraw their tokens even when the Manager configured exit strategy fails is no longer applicable if the vault's asset:debt ratio decreases since deposit.

Note that as tokens have to be swapped via an external aggregator, there is also slippage risks involved which will be configured by the Depositor at the point of initiating the withdrawal tx on Discover.

PreviousSecurityNextStrategy Builder

Last updated 2 months ago

Was this helpful?

👥