Function findOptimalSwapsAmplified

  • Parameters

    Returns {
        from: number;
        to: number;
        units: bigint;
    }[]

    Dev

    This function uses a simplification which requires that the amplification for all vaults are equal. This is because when the amplification is equal, we can extend the desire of (PTi + pti)/PTi = (PTj + ptj)/PTj to ((PTi + pti)/PTi)^(1-ampi) = ((PTj + ptj)/PTj)^(1-ampj) since ampi == ampj // By using the liquidity swap equation U = Ni · walpha_i0^(1-ampi) * ((PTi + pti)/PTi)^(1-ampi) we observe that we can U/(sum Ni · walpha_i0^(1-ampi)). to get an estimation of now many units to contribute per the first part.