🦄UniSupply

Description

Action ID: 0x834ebcf7

Network mainnet: (Deployed address | Code)

Supplies liquidity to Uniswap V2

SDK Action

    const uniSupplyAction = new dfs.actions.uniswap.UniswapSupplyAction(...uniObj);

Contract

This is a DFS STANDARD_ACTION.

Uni markets can move, so extra tokens are expected to be left and are send to _to

The address from which we're pulling tokens A and B must approve proxy

if amountADesired or AmountBDesired is uint.max whole _from token balance is pulled

Input:

    /// @param tokenA The address of the A token in pool
    /// @param tokenB The address of the B token in pool
    /// @param from The address from which we're pulling A and B tokens
    /// @param to The address that will receive LP tokens
    /// @param amountADesired The amount of tokenA to add as liquidity if the B/A price is <= amountBDesired/amountADesired (A depreciates).
    /// @param amountBDesired The amount of tokenB to add as liquidity if the A/B price is <= amountADesired/amountBDesired (B depreciates).
    /// @param amountAMin Bounds the extent to which the B/A price can go up before the transaction reverts. Must be <= amountADesired.
    /// @param amountBMin Bounds the extent to which the A/B price can go up before the transaction reverts. Must be <= amountBDesired
    /// @param deadline Unix timestamp after which the transaction will revert.
    struct UniSupplyData {
        address tokenA;
        address tokenB;
        address from;
        address to;
        uint256 amountADesired;
        uint256 amountBDesired;
        uint256 amountAMin;
        uint256 amountBMin;
        uint256 deadline;
    }

Return value:

return bytes32(liqAmount);

Events:

emit ActionEvent("UniSupply", logData);

logger.logActionDirectEvent("UniSupply", logData);

bytes memory logData = abi.encode(_uniData, amountA, amountB, liqAmount)

Last updated