Function findOptimalLiquiditySwaps
- findOptimalLiquiditySwaps(vaults, userDeposit): {
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[];
}[];
} 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[];
}[]
This function will find optimial liquidity swaps and return them along with relevant context for the liquidity swap