Function depositWithLiquiditySwaps

  • Parameters

    • userDeposits: bigint[][]

      The deposits of the user.

    • chains: {
          chainId: number;
          channelId: string;
      }[]

      The chains that the user is depositing to. Is a list of objects with channelId. Is specific to AMBs. ChainId is the id in gasMap.

    • vaults: VaultInformation[]

      The vaults that the user is depositing to. Between volatile and amplified there is a lot of unused variables. So while all arguments aren't used by both, they are used by either.

    • vaultAddresses: string[]

      The addresses of the vaults that the user is depositing to.

    • assetsAddresses: string[][]

      The addresses of the assets within the vaults. Needs to be complete.

    • userAddresses: string[]

      The addresses of the users on the other chains.

    • messageVerifyGasCosts: bigint[]

      The cost to verify a message by the underlying messaging protocol on the various chains. Can be found by calling the CCI on estimateAdditionalCost.

    • priceOfDeliveryGas: bigint[][]

      What is the incentive for gas on the destination chain? Is indexed by from, to (in source chain wei).

    • priceOfAckGas: bigint[]

      What is the ack incentive for gas on the source chain? Is indexed by from chain. (in source chain wei).

    • refundGasTo: string

      Where should unspent gas go? (which is released on acks).

    • slippage: bigint = ...

      What is the slippage for the deposit? (in WAD percentage). Default 1%.

    Returns {
        executionInstructions: {
            commands: string;
            gas: {
                estimatedGasUsedOnLocal: bigint;
                estimatedGasUsedOnLocalAck: bigint;
                estimatedGasUsedOnRemote: bigint;
                estimatedRefundOnAck: bigint;
                estimatedRoutingPayment: bigint;
            };
            inputs: string[];
        };
    }[]

    Notice

    Returns router arguments for a deposit along with liquidity swaps to balance the deposit over the whole pool.

    Dev

    All lists should be equal length.