Technical details

Here is a sequence diagram showing components involved while user goes through the flow

The only transaction required from user is "invest". Let's see Smart Contract API

    struct InvestmentParams {
        // Contract address of the first token
        address token0;
        // Contract address of the second token
        address token1;
        // Pool fee basis points. Required to find specific pool
        uint24 fee;
        // Amount of token0 in target position
        uint amount0;
        // Amount of token1 in target position
        uint amount1;
        /* Position boundaries. 
        Depends on current pool price and needs to be calculated on caller side. */
        int24 tickLower;
        int24 tickUpper;
    }

    /**
     * Single button, one transaction function to deposit, swap and mint best position in a pool.
     */
    function invest(InvestmentParams memory params) external payable;

When the user has chosen the pool and target amounts all these params are already known.

Cool, eh? 👍

But for convenience and flexibility API provides many more useful methods. Please check the full smart contract interface here

Last updated