Function findOptimalLiquiditySwaps

  • This function will find optimial liquidity swaps and return them along with relevant context for the liquidity swap

    Parameters

    Returns {
        expectedVaultTokens: bigint[];
        postBalance: bigint[][];
        vaultTokenSwaps: {
            equivalentInput: bigint[];
            equivalentOutput: bigint[];
            from: number;
            to: number;
            units: bigint;
            vaultTokensReceived: bigint;
            vaultTokensSent: bigint;
        }[];
        vaultsPostDeposit: {
            amplification: bigint;
            balances: bigint[];
            escrowedTokens: bigint[];
            escrowedVaultTokens: bigint;
            totalSupply: bigint;
            unitTracker: bigint;
            vaultFee: bigint;
            weights: bigint[];
        }[];
    }

    • expectedVaultTokens: bigint[]
    • postBalance: bigint[][]
    • vaultTokenSwaps: {
          equivalentInput: bigint[];
          equivalentOutput: bigint[];
          from: number;
          to: number;
          units: bigint;
          vaultTokensReceived: bigint;
          vaultTokensSent: bigint;
      }[]
    • vaultsPostDeposit: {
          amplification: bigint;
          balances: bigint[];
          escrowedTokens: bigint[];
          escrowedVaultTokens: bigint;
          totalSupply: bigint;
          unitTracker: bigint;
          vaultFee: bigint;
          weights: bigint[];
      }[]

    Dev

    This function returns the following information

    1. Liquidity swaps.
    2. Post deposit vault tokens.
    3. Post deposit vault tokens value in tokens.
    4. Post deposit & swap vault state.
    5. Each swaps input and output equiv in vault tokens
    6. Each swaps input and output equiv in tokens