---
# System prepended metadata

title: Untitled

---

## Initialise
- Get pool with check
- TimeswapV2Pool.intialise()
    - Check if liquidity exists
    - If it doesnt exit set the sqrt as is given

## AddLiquidityGivenPrincipal
- Check deadline
- Get pool with check
- data = encode(true,(msg.sender,token0,token1,uniswapV3Fee))
- token0Amount, token1Amount = pool.swap(address(this),isToken0, exactInputIsTrue,strike,data)
    - get sqrtPrice
- data = (msg.sender, isToken0)
- liquidityAmount, excessLong0, excessLong1, excessShort = TsIntPeri.addLiquidityGivenPrincipal(token0,token1,strike,maturity,iquidityTo,excessLong0To,excessLong1To,excessShortTo,ifToken0 => tokenAmount-tokenAmountOut else tokenAmountOut,ifToken0 =>tokenAmountOut  else tokenAmount-tokenAmountOut )
    - Get pool address
    - data = Encode(token0,token1,liquidityTo,excessLong0To,excessLong1To,excessShortTo,preferLong0Excess,token0Amount,token1Amount)
    - (liquidityAmount, , , ,data) = ITimeswapV2Pool.mint(strike,matuiryt,address(this),GivenLarger,strike.combine(token0Amount,token1Amount,strike,false),data)
    - (excessLong0,excessLong1,excessShort) = abi.decode(data)
        - 

- MinLiquidityCheck
- MinExcessShortCheck
- MinLong0Check
- MinLong1Check