/sigma-strategy-contracts

🐙 Strategy for Uniswap v3 🦄

Primary LanguageTypeScript

Sigma Strategy 🐙

build codecov

Strategy built on top of Uni v3 and Yearn
https://hackmd.io/@134dd3v/SkVUgYQZt

npx hardhat compile
npx hardhat test
npx hardhat coverage
npx hardhat deploy

REPORT_GAS=true npx hardhat test
npx prettier '**/*.{json,sol,md}' --check
npx prettier '**/*.{json,sol,md}' --write
npx solhint 'contracts/**/*.sol'
npx solhint 'contracts/**/*.sol' --fix

Sigma Vault Functions

External

  • Anyone
    • deposit
    • withdraw
  • Strategy
    • rebalance
    • collectFees
  • onlyGovernance
    • setProtocolFee
    • transferGovernance
  • onlyGovernanceOrTeamMultisig
    • transferTeamMultisig
    • sweep
    • setStrategy
    • setMaxTotalSupply
    • emergencyBurn
    • emergencyWithdrawL0
    • emergencyWithdrawL1
    • pause
    • unpause
  • pool
    • uniswapV3MintCallback
    • uniswapV3SwapCallback

Public

  • getBalance0
  • getBalance1
  • getTotalAmounts
  • getPositionAmounts

Internal

  • _poke
  • _calcSharesAndAmounts
  • _adjustTick
  • _swapExcess
  • _swap0to1
  • _swap1to0
  • _getTwap
  • _checkRange
  • _executeWithdraw
  • _uniBurnAndCollect
  • _lvWithdraw
  • _accureFees
  • _mintLiquidity
  • _position
  • _amountsForLiquidity

Sigma Strategy Functions

External

  • onlyKeeper
    • rebalance
  • onlyFeeCollector
    • redeemFees
  • onlyGovernance
    • setKeeper
    • setUniSwapShare
    • setMaxTwapDeviation
    • setTwapDuration
    • setRebalanceGap
    • setFeeCollector

Internal

  • getTick
  • getTwap