Full Code of opynfinance/squeeth-monorepo for AI

main 10e70837705a cached
886 files
25.4 MB
6.7M tokens
744 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (26,802K chars total). Download the full file to get everything.
Repository: opynfinance/squeeth-monorepo
Branch: main
Commit: 10e70837705a
Files: 886
Total size: 25.4 MB

Directory structure:
gitextract_ry7xy3jk/

├── .circleci/
│   └── config.yml
├── .editorconfig
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   └── pull_request_template.md
├── .gitignore
├── .gitmodules
├── .gitpod.yml
├── .husky/
│   └── pre-commit
├── .huskyrc
├── .lintstagedrc
├── README.md
├── package.json
└── packages/
    ├── crab-netting/
    │   ├── LICENSE_BUSL
    │   ├── foundry.toml
    │   ├── remappings.txt
    │   ├── script/
    │   │   └── Counter.s.sol
    │   ├── src/
    │   │   ├── CrabNetting.sol
    │   │   └── interfaces/
    │   │       ├── IController.sol
    │   │       ├── ICrabStrategyV2.sol
    │   │       ├── IOracle.sol
    │   │       └── IWETH.sol
    │   └── test/
    │       ├── BaseForkSetup.t.sol
    │       ├── BaseSetup.t.sol
    │       ├── Deposit.t.sol
    │       ├── DepositAuction.t.sol
    │       ├── ForkTestNetAtPrice.sol
    │       ├── Netting.t.sol
    │       ├── PriceChecks.sol
    │       ├── QueuedBalances.t.sol
    │       ├── SkipDeposits.t.sol
    │       ├── WithdrawAuction.t.sol
    │       └── utils/
    │           ├── SigUtils.sol
    │           └── UniswapQuote.sol
    ├── frontend/
    │   ├── .babelrc
    │   ├── .eslintrc
    │   ├── .gitignore
    │   ├── .nvmrc
    │   ├── .prettierrc
    │   ├── CONTRIBUTING.md
    │   ├── LICENSE
    │   ├── README.md
    │   ├── custom.d.ts
    │   ├── cypress/
    │   │   ├── TEST.md
    │   │   ├── fixtures/
    │   │   │   └── example.json
    │   │   ├── integration/
    │   │   │   ├── pages/
    │   │   │   │   ├── header.js
    │   │   │   │   ├── notifications.js
    │   │   │   │   ├── onboard.js
    │   │   │   │   ├── page.js
    │   │   │   │   └── trade.js
    │   │   │   └── specs/
    │   │   │       ├── 01-trade-long.spec.js
    │   │   │       ├── 02-trade-short.spec.js
    │   │   │       └── 06-manual-short.spec.js
    │   │   ├── plugins/
    │   │   │   └── index.js
    │   │   └── support/
    │   │       ├── commands.js
    │   │       └── index.js
    │   ├── cypress.json
    │   ├── env.example
    │   ├── jest.config.js
    │   ├── jest.setup.ts
    │   ├── middleware.ts
    │   ├── next-env.d.ts
    │   ├── next.config.js
    │   ├── package.json
    │   ├── pages/
    │   │   ├── _app.tsx
    │   │   ├── _document.tsx
    │   │   ├── api/
    │   │   │   ├── __tests__/
    │   │   │   │   └── isValidAddress.test.ts
    │   │   │   ├── auction/
    │   │   │   │   └── lastHedgeAuction.ts
    │   │   │   ├── charts/
    │   │   │   │   └── longchart.ts
    │   │   │   ├── currentsqueethvol.ts
    │   │   │   ├── historicalprice.ts
    │   │   │   ├── isValidAddress.ts
    │   │   │   ├── pnl.tsx
    │   │   │   ├── strikes.ts
    │   │   │   ├── tvl.ts
    │   │   │   ├── twelvedata.ts
    │   │   │   └── updateBlockedAddress.ts
    │   │   ├── blocked.tsx
    │   │   ├── index.tsx
    │   │   ├── lp.tsx
    │   │   ├── mint.tsx
    │   │   ├── opt-out.tsx
    │   │   ├── pos-merge.tsx
    │   │   ├── positions.tsx
    │   │   ├── privacy-policy.tsx
    │   │   ├── share-pnl/
    │   │   │   └── [...slug].tsx
    │   │   ├── squeeth.tsx
    │   │   ├── strategies/
    │   │   │   ├── bull.tsx
    │   │   │   ├── crab.tsx
    │   │   │   └── index.tsx
    │   │   ├── terms-of-service-faq.tsx
    │   │   ├── terms-of-service.tsx
    │   │   └── vault/
    │   │       └── [vid].tsx
    │   ├── sentry.client.config.ts
    │   ├── sentry.server.config.ts
    │   ├── src/
    │   │   ├── abis/
    │   │   │   ├── NFTpositionmanager.json
    │   │   │   ├── auctionBull.json
    │   │   │   ├── bullEmergencyWithdraw.json
    │   │   │   ├── bullShutdownEmergencyWithdraw.json
    │   │   │   ├── bullStrategy.json
    │   │   │   ├── controller.json
    │   │   │   ├── controllerHelper.json
    │   │   │   ├── crabHelper.json
    │   │   │   ├── crabMigration.json
    │   │   │   ├── crabNetting.json
    │   │   │   ├── crabStrategy.json
    │   │   │   ├── crabStrategyV2.json
    │   │   │   ├── erc20.json
    │   │   │   ├── erc721.json
    │   │   │   ├── eulerEToken.json
    │   │   │   ├── eulerSimpleLens.json
    │   │   │   ├── flashBullStrategy.json
    │   │   │   ├── oracle.json
    │   │   │   ├── quoter.json
    │   │   │   ├── shortHelper.json
    │   │   │   ├── squeeth.json
    │   │   │   ├── swapRouter.json
    │   │   │   ├── swapRouter2.json
    │   │   │   ├── uniswapPool.json
    │   │   │   ├── vaultManager.json
    │   │   │   └── weth.json
    │   │   ├── components/
    │   │   │   ├── Alert.tsx
    │   │   │   ├── Alerts/
    │   │   │   │   ├── ShutdownAlert.tsx
    │   │   │   │   └── ZenBullAlert.tsx
    │   │   │   ├── Announcement.tsx
    │   │   │   ├── Button/
    │   │   │   │   ├── WalletButton.tsx
    │   │   │   │   └── index.tsx
    │   │   │   ├── Charts/
    │   │   │   │   ├── BullStrategyPerformanceChart.tsx
    │   │   │   │   ├── CrabStrategyChart.tsx
    │   │   │   │   ├── CrabStrategyV2PnLChart.tsx
    │   │   │   │   ├── FundingChart.tsx
    │   │   │   │   ├── LPBuyChart.tsx
    │   │   │   │   ├── LPMintChart.tsx
    │   │   │   │   ├── LongChart.tsx
    │   │   │   │   ├── LongChartPayoff.tsx
    │   │   │   │   ├── LongSqueethPayoff.tsx
    │   │   │   │   ├── ShortChart.tsx
    │   │   │   │   ├── ShortFundingChart.tsx
    │   │   │   │   ├── ShortSqueethPayoff.tsx
    │   │   │   │   └── VaultChart.tsx
    │   │   │   ├── Checkbox.tsx
    │   │   │   ├── CollatRange.tsx
    │   │   │   ├── CollatRatioSlider.tsx
    │   │   │   ├── CustomProgress.tsx
    │   │   │   ├── CustomSlider.tsx
    │   │   │   ├── CustomSwitch.tsx
    │   │   │   ├── DefaultSiteSeo/
    │   │   │   │   └── DefaultSiteSeo.tsx
    │   │   │   ├── Emoji.tsx
    │   │   │   ├── HidePnLText.tsx
    │   │   │   ├── IV.tsx
    │   │   │   ├── Input/
    │   │   │   │   ├── NumberInput.tsx
    │   │   │   │   └── PrimaryInput.tsx
    │   │   │   ├── InputNew/
    │   │   │   │   ├── InputBase.tsx
    │   │   │   │   ├── InputNumber.tsx
    │   │   │   │   ├── InputToken.tsx
    │   │   │   │   └── index.tsx
    │   │   │   ├── LabelWithTooltip.test.tsx
    │   │   │   ├── LabelWithTooltip.tsx
    │   │   │   ├── LandingPage/
    │   │   │   │   ├── DesktopLandingPage.tsx
    │   │   │   │   └── MobileLandingPage.tsx
    │   │   │   ├── LegendBox.tsx
    │   │   │   ├── LinkWrapper.tsx
    │   │   │   ├── Lp/
    │   │   │   │   ├── GetSqueeth.tsx
    │   │   │   │   ├── LPPosition.tsx
    │   │   │   │   ├── LPTable.tsx
    │   │   │   │   ├── ObtainSqueeth.tsx
    │   │   │   │   ├── ProvideLiquidity.tsx
    │   │   │   │   ├── SelectMethod.tsx
    │   │   │   │   ├── SqueethInfo.tsx
    │   │   │   │   └── Stepper.tsx
    │   │   │   ├── MarkdownPage.tsx
    │   │   │   ├── Metric.tsx
    │   │   │   ├── Modal/
    │   │   │   │   ├── MobileModal.tsx
    │   │   │   │   ├── Modal.tsx
    │   │   │   │   └── UniswapIframe.tsx
    │   │   │   ├── Nav.tsx
    │   │   │   ├── PnLTooltip.tsx
    │   │   │   ├── Popup.tsx
    │   │   │   ├── PositionCard.tsx
    │   │   │   ├── RestrictionInfo.tsx
    │   │   │   ├── SettingsMenu.tsx
    │   │   │   ├── SharePnl/
    │   │   │   │   └── PnlChart.tsx
    │   │   │   ├── SqueethCard.tsx
    │   │   │   ├── StepperBox.tsx
    │   │   │   ├── Strategies/
    │   │   │   │   ├── Bull/
    │   │   │   │   │   ├── About/
    │   │   │   │   │   │   ├── AdvancedMetrics.tsx
    │   │   │   │   │   │   ├── NextRebalanceTimer.tsx
    │   │   │   │   │   │   ├── ProfitabilityChart.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── BullTrade/
    │   │   │   │   │   │   ├── Deposit.tsx
    │   │   │   │   │   │   ├── EmergencyWithdraw.tsx
    │   │   │   │   │   │   ├── ShutdownEmergencyWithdraw.tsx
    │   │   │   │   │   │   ├── Withdraw.tsx
    │   │   │   │   │   │   ├── index.tsx
    │   │   │   │   │   │   └── styles.ts
    │   │   │   │   │   ├── MyPosition/
    │   │   │   │   │   │   ├── PnL.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── StrategyPerformance.tsx
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── Crab/
    │   │   │   │   │   ├── About/
    │   │   │   │   │   │   ├── AdvancedMetrics.tsx
    │   │   │   │   │   │   ├── NextRebalanceTimer.tsx
    │   │   │   │   │   │   ├── ProfitabilityChart.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── CapDetails.tsx
    │   │   │   │   │   ├── CapDetailsV2.tsx
    │   │   │   │   │   ├── CrabMetricsV2.tsx
    │   │   │   │   │   ├── CrabMigrate.tsx
    │   │   │   │   │   ├── CrabPosition.tsx
    │   │   │   │   │   ├── CrabPositionV2.tsx
    │   │   │   │   │   ├── CrabTrade.tsx
    │   │   │   │   │   ├── CrabTradeV2/
    │   │   │   │   │   │   ├── Deposit.tsx
    │   │   │   │   │   │   ├── Withdraw.tsx
    │   │   │   │   │   │   ├── index.tsx
    │   │   │   │   │   │   ├── styles.ts
    │   │   │   │   │   │   └── types.ts
    │   │   │   │   │   ├── MigrationNotice.tsx
    │   │   │   │   │   ├── MyPosition/
    │   │   │   │   │   │   ├── CrabPosition.tsx
    │   │   │   │   │   │   ├── PnL.tsx
    │   │   │   │   │   │   ├── QueuedPosition.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── StrategyChartsV2.tsx
    │   │   │   │   │   ├── StrategyHistory.tsx
    │   │   │   │   │   ├── StrategyHistoryV2.tsx
    │   │   │   │   │   ├── StrategyInfoV1.tsx
    │   │   │   │   │   ├── StrategyInfoV2.tsx
    │   │   │   │   │   ├── StrategyPerformance.tsx
    │   │   │   │   │   └── util.ts
    │   │   │   │   ├── SharePnl.tsx
    │   │   │   │   ├── StrategyInfoItem.tsx
    │   │   │   │   └── styles.ts
    │   │   │   ├── StrategyLayout/
    │   │   │   │   └── StrategyLayout.tsx
    │   │   │   ├── StrikeWarning.tsx
    │   │   │   ├── Tabs.tsx
    │   │   │   ├── Trade/
    │   │   │   │   ├── Cancelled.tsx
    │   │   │   │   ├── Confirmed.tsx
    │   │   │   │   ├── Long/
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── Mint.tsx
    │   │   │   │   ├── Short/
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── SqueethMetrics.tsx
    │   │   │   │   ├── WelcomeModal.tsx
    │   │   │   │   └── index.tsx
    │   │   │   ├── TradeOld/
    │   │   │   │   ├── Cancelled.tsx
    │   │   │   │   ├── Confirmed.tsx
    │   │   │   │   ├── Long/
    │   │   │   │   │   ├── BreakEven.tsx
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── TradeDetails.tsx
    │   │   │   │   ├── TradeInfoItem.tsx
    │   │   │   │   └── UniswapData.tsx
    │   │   │   ├── TradeSettings.tsx
    │   │   │   └── WalletFailModal.tsx
    │   │   ├── constants/
    │   │   │   ├── address.ts
    │   │   │   ├── diagram.ts
    │   │   │   ├── enums.ts
    │   │   │   └── index.ts
    │   │   ├── context/
    │   │   │   ├── lp.tsx
    │   │   │   └── restrict-user.tsx
    │   │   ├── hooks/
    │   │   │   ├── __tests__/
    │   │   │   │   ├── useAppCallback.test.ts
    │   │   │   │   ├── useAppEffect.test.ts
    │   │   │   │   └── useAppMemo.test.ts
    │   │   │   ├── contracts/
    │   │   │   │   ├── useAllowance.ts
    │   │   │   │   ├── useERC721.ts
    │   │   │   │   ├── useLiquidations.ts
    │   │   │   │   ├── useLongHelper.ts
    │   │   │   │   ├── useOracle.ts
    │   │   │   │   ├── useShortHelper.ts
    │   │   │   │   ├── useTokenBalance.ts
    │   │   │   │   ├── useVaultManager.ts
    │   │   │   │   └── useWeth.ts
    │   │   │   ├── payOffGraph/
    │   │   │   │   ├── useCrabVaultPayoff.ts
    │   │   │   │   ├── useShortParams.ts
    │   │   │   │   └── useSqueethShortPayOffGraph.ts
    │   │   │   ├── useAmplitude.ts
    │   │   │   ├── useAppCallback.tsx
    │   │   │   ├── useAppEffect.tsx
    │   │   │   ├── useAppMemo.tsx
    │   │   │   ├── useAsyncMemo.tsx
    │   │   │   ├── useBullHedgeHistory.ts
    │   │   │   ├── useBullPosition/
    │   │   │   │   ├── index.ts
    │   │   │   │   ├── mocks.ts
    │   │   │   │   └── useBullPosition.ts
    │   │   │   ├── useCopyClipboard.ts
    │   │   │   ├── useCrabAuctionHistory.ts
    │   │   │   ├── useCrabPosition/
    │   │   │   │   ├── index.ts
    │   │   │   │   ├── mocks.ts
    │   │   │   │   ├── useCrabPosition.test.tsx
    │   │   │   │   └── useCrabPosition.ts
    │   │   │   ├── useCrabV2AuctionHistory.ts
    │   │   │   ├── useENS.ts
    │   │   │   ├── useETHPrice.ts
    │   │   │   ├── useExecuteOnce.ts
    │   │   │   ├── useInterval.ts
    │   │   │   ├── useIntervalAsync.ts
    │   │   │   ├── useNormHistory.ts
    │   │   │   ├── useNormHistoryFromTime.ts
    │   │   │   ├── useOSQTHPrice.ts
    │   │   │   ├── usePopup.tsx
    │   │   │   ├── useRenderCounter.js
    │   │   │   ├── useStateWithReset.ts
    │   │   │   ├── useTVL.ts
    │   │   │   ├── useTrackSiteReload.ts
    │   │   │   ├── useTrackTransactionFlow.ts
    │   │   │   ├── useTransactionHistory.ts
    │   │   │   ├── useUniswapQuoter.tsx
    │   │   │   ├── useUniswapTicks.ts
    │   │   │   ├── useUsdAmount.ts
    │   │   │   ├── useUserBullTxHistory.ts
    │   │   │   ├── useUserCrabTxHistory.ts
    │   │   │   ├── useUserCrabV2TxHistory.ts
    │   │   │   ├── useVault.ts
    │   │   │   ├── useVaultData.ts
    │   │   │   ├── useVaultHistory.ts
    │   │   │   └── useYourVaults.ts
    │   │   ├── lib/
    │   │   │   └── pnl.ts
    │   │   ├── markdown/
    │   │   │   ├── pos-merge.md
    │   │   │   ├── privacy-policy.md
    │   │   │   ├── terms-of-service-faq.md
    │   │   │   └── terms-of-service.md
    │   │   ├── pages/
    │   │   │   └── positions/
    │   │   │       ├── BullPosition.tsx
    │   │   │       ├── ConnectWallet.tsx
    │   │   │       ├── CrabPosition.tsx
    │   │   │       ├── CrabPositionV2.tsx
    │   │   │       ├── History.tsx
    │   │   │       ├── LPedSqueeth.tsx
    │   │   │       ├── LongSqueeth.tsx
    │   │   │       ├── MintedSqueeth.tsx
    │   │   │       ├── Positions.tsx
    │   │   │       ├── ShortSqueeth.tsx
    │   │   │       ├── ShortSqueethLiquidated.tsx
    │   │   │       ├── YourVaults.test.tsx
    │   │   │       ├── YourVaults.tsx
    │   │   │       └── useStyles.ts
    │   │   ├── queries/
    │   │   │   ├── squeeth/
    │   │   │   │   ├── __generated__/
    │   │   │   │   │   ├── Vault.ts
    │   │   │   │   │   ├── VaultHistory.ts
    │   │   │   │   │   ├── Vaults.ts
    │   │   │   │   │   ├── YourVaults.ts
    │   │   │   │   │   ├── bullHedges.ts
    │   │   │   │   │   ├── crabAuctions.ts
    │   │   │   │   │   ├── crabV2Auctions.ts
    │   │   │   │   │   ├── liquidations.ts
    │   │   │   │   │   ├── normalizationFactorUpdates.ts
    │   │   │   │   │   ├── normalizationFactorUpdatesTime.ts
    │   │   │   │   │   ├── strategyQuery.ts
    │   │   │   │   │   ├── subscriptionVaultHistory.ts
    │   │   │   │   │   ├── subscriptionVaults.ts
    │   │   │   │   │   ├── userBullTxes.ts
    │   │   │   │   │   ├── userCrabTxes.ts
    │   │   │   │   │   └── userCrabV2Txes.ts
    │   │   │   │   ├── bullHedgeQuery.ts
    │   │   │   │   ├── crabAuctionQuery.ts
    │   │   │   │   ├── crabV2AuctionQuery.ts
    │   │   │   │   ├── liquidationsQuery.ts
    │   │   │   │   ├── normHistoryQuery.ts
    │   │   │   │   ├── strategyQuery.ts
    │   │   │   │   ├── userBullQuery.ts
    │   │   │   │   ├── userCrabTxQuery.ts
    │   │   │   │   ├── userCrabV2TxQuery.ts
    │   │   │   │   ├── vaultHistoryQuery.ts
    │   │   │   │   └── vaultsQuery.ts
    │   │   │   └── uniswap/
    │   │   │       ├── __generated__/
    │   │   │       │   ├── activePositions.ts
    │   │   │       │   ├── positions.ts
    │   │   │       │   ├── subscriptionSwaps.ts
    │   │   │       │   ├── subscriptionSwapsRopsten.ts
    │   │   │       │   ├── subscriptionpositions.ts
    │   │   │       │   ├── swaps.ts
    │   │   │       │   ├── swapsRopsten.ts
    │   │   │       │   ├── ticks.ts
    │   │   │       │   └── transactions.ts
    │   │   │       ├── positionsQuery.ts
    │   │   │       ├── swapsQuery.ts
    │   │   │       ├── swapsRopstenQuery.ts
    │   │   │       ├── ticksQuery.ts
    │   │   │       └── transactionsQuery.ts
    │   │   ├── server/
    │   │   │   ├── firebase-admin.ts
    │   │   │   └── ipqs.ts
    │   │   ├── state/
    │   │   │   ├── bull/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── utils.ts
    │   │   │   ├── contracts/
    │   │   │   │   └── atoms.ts
    │   │   │   ├── controller/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── utils.ts
    │   │   │   ├── crab/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── utils.ts
    │   │   │   ├── crabMigration/
    │   │   │   │   ├── atom.ts
    │   │   │   │   └── hooks.ts
    │   │   │   ├── ethPriceCharts/
    │   │   │   │   └── atoms.ts
    │   │   │   ├── lp/
    │   │   │   │   └── hooks.ts
    │   │   │   ├── nftmanager/
    │   │   │   │   └── hooks.ts
    │   │   │   ├── pnl/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   └── hooks.ts
    │   │   │   ├── positions/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── providers.tsx
    │   │   │   ├── squeethPool/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── price.ts
    │   │   │   ├── trade/
    │   │   │   │   └── atoms.ts
    │   │   │   └── wallet/
    │   │   │       ├── apis.ts
    │   │   │       ├── atoms.ts
    │   │   │       └── hooks.ts
    │   │   ├── styles/
    │   │   │   ├── index.ts
    │   │   │   └── useTextStyles.ts
    │   │   ├── theme.ts
    │   │   ├── types/
    │   │   │   └── index.ts
    │   │   └── utils/
    │   │       ├── __tests__/
    │   │       │   └── stringifyDeps.test.ts
    │   │       ├── amplitude.ts
    │   │       ├── apollo-client.ts
    │   │       ├── atomTester.tsx
    │   │       ├── calculations.ts
    │   │       ├── cookies.ts
    │   │       ├── crisp-chat.ts
    │   │       ├── csvToJson.ts
    │   │       ├── error.ts
    │   │       ├── ethPriceCharts.ts
    │   │       ├── firestore.ts
    │   │       ├── floatifyBigNums.ts
    │   │       ├── formatter.ts
    │   │       ├── gasProvider.ts
    │   │       ├── getContract.ts
    │   │       ├── index.tsx
    │   │       ├── markdown.ts
    │   │       ├── pricer.ts
    │   │       ├── quoter.ts
    │   │       └── stringifyDeps.ts
    │   ├── styles/
    │   │   ├── Home.module.css
    │   │   └── globals.css
    │   ├── synpress.json
    │   ├── tsconfig.json
    │   └── types/
    │       └── global_apollo.ts
    ├── hardhat/
    │   ├── .eslintrc.js
    │   ├── .gitbook.yaml
    │   ├── .prettierignore
    │   ├── .prettierrc
    │   ├── .solcover.js
    │   ├── CHANGE_DATE
    │   ├── LICENSE_BUSL
    │   ├── README.md
    │   ├── SUMMARY.md
    │   ├── USE_GRANT
    │   ├── arguments/
    │   │   ├── Controller-goerli.js
    │   │   ├── ControllerHelper-goerli.js
    │   │   ├── CrabHelper-goerli.js
    │   │   ├── CrabHelper-mainnet.js
    │   │   ├── CrabMigration-goerli.js
    │   │   ├── CrabMigration-mainnet.js
    │   │   ├── CrabMigration-ropsten.js
    │   │   ├── CrabStrategy-goerli.js
    │   │   ├── CrabStrategyV2-goerli.js
    │   │   ├── CrabStrategyV2-mainnet.js
    │   │   ├── CrabStrategyV2-ropsten.js
    │   │   ├── OpynUsdc-goerli.js
    │   │   ├── OpynWeth-goerli.js
    │   │   ├── Quoter-goerli.js
    │   │   ├── ShortHelper-goerli.js
    │   │   ├── ShortPowerPerp-goerli.js
    │   │   ├── Timelock-goerli.js
    │   │   ├── Timelock-mainnet.js
    │   │   ├── Timelock-ropsten.js
    │   │   └── WPowerPerp-goerli.js
    │   ├── arguments.js
    │   ├── ci/
    │   │   └── e2e.sh
    │   ├── contracts/
    │   │   ├── core/
    │   │   │   ├── Controller.sol
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── Oracle.sol
    │   │   │   ├── ShortPowerPerp.sol
    │   │   │   └── WPowerPerp.sol
    │   │   ├── external/
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   └── WETH9.sol
    │   │   ├── import/
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   └── Uni.sol
    │   │   ├── interfaces/
    │   │   │   ├── IController.sol
    │   │   │   ├── ICrabStrategyV2.sol
    │   │   │   ├── IERC20Detailed.sol
    │   │   │   ├── IEuler.sol
    │   │   │   ├── IOracle.sol
    │   │   │   ├── IShortPowerPerp.sol
    │   │   │   ├── IWETH9.sol
    │   │   │   ├── IWPowerPerp.sol
    │   │   │   └── LICENSE_MIT
    │   │   ├── libs/
    │   │   │   ├── ABDKMath64x64.sol
    │   │   │   ├── LICENSE_BSD_4_Clause
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── LICENSE_MIT
    │   │   │   ├── OracleLibrary.sol
    │   │   │   ├── Power2Base.sol
    │   │   │   ├── SqrtPriceMathPartial.sol
    │   │   │   ├── TickMathExternal.sol
    │   │   │   ├── Uint256Casting.sol
    │   │   │   └── VaultLib.sol
    │   │   ├── mocks/
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── LICENSE_MIT
    │   │   │   ├── MockController.sol
    │   │   │   ├── MockCrab.sol
    │   │   │   ├── MockErc20.sol
    │   │   │   ├── MockEuler.sol
    │   │   │   ├── MockEulerDToken.sol
    │   │   │   ├── MockOracle.sol
    │   │   │   ├── MockShortPowerPerp.sol
    │   │   │   ├── MockTimelock.sol
    │   │   │   ├── MockUniPositionManager.sol
    │   │   │   ├── MockUniswapV3Pool.sol
    │   │   │   ├── MockWSqueeth.sol
    │   │   │   └── OpynWETH9.sol
    │   │   ├── periphery/
    │   │   │   ├── ControllerHelper.sol
    │   │   │   ├── EulerControllerHelper.sol
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── ShortHelper.sol
    │   │   │   ├── UniswapControllerHelper.sol
    │   │   │   └── lib/
    │   │   │       ├── ControllerHelperDataType.sol
    │   │   │       ├── ControllerHelperUtil.sol
    │   │   │       └── LiquidityAmounts.sol
    │   │   ├── strategy/
    │   │   │   ├── AGPL_3
    │   │   │   ├── CrabHelper.sol
    │   │   │   ├── CrabMigration.sol
    │   │   │   ├── CrabStrategy.sol
    │   │   │   ├── CrabStrategyV2.sol
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── base/
    │   │   │   │   ├── StrategyBase.sol
    │   │   │   │   ├── StrategyFlashSwap.sol
    │   │   │   │   └── StrategyMath.sol
    │   │   │   ├── helper/
    │   │   │   │   └── StrategySwap.sol
    │   │   │   └── timelock/
    │   │   │       ├── SafeMath.sol
    │   │   │       └── Timelock.sol
    │   │   └── test/
    │   │       ├── ABDKTester.sol
    │   │       ├── CastingTester.sol
    │   │       ├── ControllerAccessTester.sol
    │   │       ├── ControllerTester.sol
    │   │       ├── LICENSE_BSD_4_Clause
    │   │       ├── LICENSE_BUSL
    │   │       ├── LICENSE_GPL_3
    │   │       ├── LiquidationHelper.sol
    │   │       ├── OracleTester.sol
    │   │       └── VaultTester.sol
    │   ├── crab-migration.js
    │   ├── crabmigration-arguments.js
    │   ├── crabv2-arguments.js
    │   ├── deploy/
    │   │   ├── 00_deploy_basic_coins.ts
    │   │   ├── 01_deploy_uniswapv3.ts
    │   │   ├── 02_deploy_core.ts
    │   │   ├── 03_deploy_pools.ts
    │   │   ├── 04_deploy_controller.ts
    │   │   ├── 05_deploy_periphery.ts
    │   │   ├── 06_deploy_crab_strategy.ts
    │   │   ├── 07_deploy_controller_helper.ts
    │   │   ├── 08_deploy_crab_v2.ts
    │   │   └── 09_deploy_crab_helper.ts
    │   ├── deployments/
    │   │   ├── goerli/
    │   │   │   ├── .chainId
    │   │   │   ├── ABDKMath64x64.json
    │   │   │   ├── Controller.json
    │   │   │   ├── ControllerHelper.json
    │   │   │   ├── ControllerHelperUtil.json
    │   │   │   ├── CrabHelper.json
    │   │   │   ├── CrabStrategyDeployment.json
    │   │   │   ├── CrabStrategyV2.json
    │   │   │   ├── MockErc20.json
    │   │   │   ├── NonfungiblePositionManager.json
    │   │   │   ├── OpynWETH9.json
    │   │   │   ├── Oracle.json
    │   │   │   ├── Quoter.json
    │   │   │   ├── ShortHelper.json
    │   │   │   ├── ShortPowerPerp.json
    │   │   │   ├── SqrtPriceMathPartial.json
    │   │   │   ├── SwapRouter.json
    │   │   │   ├── TickMathExternal.json
    │   │   │   ├── UniswapV3Factory.json
    │   │   │   ├── WPowerPerp.json
    │   │   │   └── solcInputs/
    │   │   │       ├── 0233939f192df1cbf8f7a345e29af693.json
    │   │   │       ├── 05b9c7d057ff8b2bf36168b053759720.json
    │   │   │       ├── 31d85619debc3954507258d16df1741b.json
    │   │   │       ├── 59fefefa6d402a64e50de797130b653c.json
    │   │   │       ├── 5f1800dd06bba4733ee96eb427b535c3.json
    │   │   │       └── c53867cdbf46138ab42de1c7a1689875.json
    │   │   ├── mainnet/
    │   │   │   ├── .chainId
    │   │   │   ├── ABDKMath64x64.json
    │   │   │   ├── Controller.json
    │   │   │   ├── ControllerHelper.json
    │   │   │   ├── ControllerHelperUtil.json
    │   │   │   ├── CrabHelper.json
    │   │   │   ├── CrabMigration.json
    │   │   │   ├── CrabStrategyV2.json
    │   │   │   ├── Oracle.json
    │   │   │   ├── Quoter.json
    │   │   │   ├── ShortHelper.json
    │   │   │   ├── ShortPowerPerp.json
    │   │   │   ├── SqrtPriceMathPartial.json
    │   │   │   ├── TickMathExternal.json
    │   │   │   ├── Timelock.json
    │   │   │   ├── WPowerPerp.json
    │   │   │   └── solcInputs/
    │   │   │       ├── 30afee76cfee2d4cc1c12451e0258499.json
    │   │   │       ├── 56b4ec4ab07157f3d2fb7e1de805d93e.json
    │   │   │       ├── c53867cdbf46138ab42de1c7a1689875.json
    │   │   │       ├── d97d3d4b09e0d70518330d405a7dd9ff.json
    │   │   │       ├── e85d9fda89ae8c3780a8ae01da3f423c.json
    │   │   │       └── fc32ed9e00a9017e491333926bef5473.json
    │   │   ├── rinkebyArbitrum/
    │   │   │   ├── .chainId
    │   │   │   ├── Controller.json
    │   │   │   ├── MockErc20.json
    │   │   │   ├── Oracle.json
    │   │   │   ├── Quoter.json
    │   │   │   ├── ShortHelper.json
    │   │   │   ├── VaultNFTManager.json
    │   │   │   ├── WSqueeth.json
    │   │   │   └── solcInputs/
    │   │   │       ├── 1eb2d8df0d50660ef74af8c7c5cd526b.json
    │   │   │       ├── 49c79f88c6e4ede6ca1f2ffd46fef4fe.json
    │   │   │       ├── 4ad189f955354b6f5c4f3b0e4a7b5326.json
    │   │   │       ├── 63325f69769d83fcd46161b0222ee3cc.json
    │   │   │       ├── 65b5636a064484e3748f101fc0e531a8.json
    │   │   │       └── 7ff94f89a93cd7aa904196251e75bdb3.json
    │   │   └── ropsten/
    │   │       ├── .chainId
    │   │       ├── ABDKMath64x64.json
    │   │       ├── Controller.json
    │   │       ├── ControllerHelper.json
    │   │       ├── ControllerHelperUtil.json
    │   │       ├── CrabMigration.json
    │   │       ├── CrabStrategyDeployment.json
    │   │       ├── CrabStrategyV2.json
    │   │       ├── NonfungiblePositionManager.json
    │   │       ├── Oracle.json
    │   │       ├── Quoter.json
    │   │       ├── ShortHelper.json
    │   │       ├── ShortPowerPerp.json
    │   │       ├── SqrtPriceMathPartial.json
    │   │       ├── SwapRouter.json
    │   │       ├── TickMathExternal.json
    │   │       ├── Timelock.json
    │   │       ├── UniswapV3Factory.json
    │   │       ├── WPowerPerp.json
    │   │       └── solcInputs/
    │   │           ├── 30afee76cfee2d4cc1c12451e0258499.json
    │   │           ├── 5f450d03d2b8109eaf06de68c57d8c2b.json
    │   │           ├── 6176622d73f0107e1e6916638dbba9b9.json
    │   │           ├── ab83bcba860cd7677bf7e9d807e32da5.json
    │   │           ├── cd8e568ab17078249f8bced32d618ecf.json
    │   │           ├── d91027c30078be5bfba0223abd5c6e60.json
    │   │           ├── dfd7860ebd97501ecbdb5935c168e58b.json
    │   │           ├── e2a303b98172c2b7a0e4fda5f2d8e859.json
    │   │           ├── e85d9fda89ae8c3780a8ae01da3f423c.json
    │   │           └── fc32ed9e00a9017e491333926bef5473.json
    │   ├── docs/
    │   │   ├── contract.hbs
    │   │   └── contracts-documentation/
    │   │       ├── core/
    │   │       │   ├── Controller.md
    │   │       │   ├── Oracle.md
    │   │       │   ├── ShortPowerPerp.md
    │   │       │   ├── WPowerPerp.md
    │   │       │   └── WSqueeth.md
    │   │       ├── external/
    │   │       │   └── WETH9.md
    │   │       ├── import/
    │   │       │   └── Uni.md
    │   │       ├── interfaces/
    │   │       │   ├── IController.md
    │   │       │   ├── IERC20Detailed.md
    │   │       │   ├── IOracle.md
    │   │       │   ├── IShortPowerPerp.md
    │   │       │   ├── IVaultManagerNFT.md
    │   │       │   ├── IWETH9.md
    │   │       │   └── IWPowerPerp.md
    │   │       ├── libs/
    │   │       │   ├── OracleLibrary.md
    │   │       │   ├── Power2Base.md
    │   │       │   └── VaultLib.md
    │   │       ├── mocks/
    │   │       │   ├── IUniswapV3FlashCallback.md
    │   │       │   ├── MockController.md
    │   │       │   ├── MockErc20.md
    │   │       │   ├── MockOracle.md
    │   │       │   ├── MockShortPowerPerp.md
    │   │       │   ├── MockUniPositionManager.md
    │   │       │   ├── MockUniswapV3Pool.md
    │   │       │   ├── MockVaultNFTManager.md
    │   │       │   ├── MockWPowerPerp.md
    │   │       │   └── MockWSqueeth.md
    │   │       ├── periphery/
    │   │       │   └── ShortHelper.md
    │   │       ├── strategy/
    │   │       │   ├── CrabStrategy.md
    │   │       │   └── base/
    │   │       │       ├── StrategyBase.md
    │   │       │       ├── StrategyFlashSwap.md
    │   │       │       └── StrategyMath.md
    │   │       └── test/
    │   │           ├── ControllerTester.md
    │   │           ├── OracleTester.md
    │   │           └── VaultLibTester.md
    │   ├── env.example
    │   ├── hardhat.config.ts
    │   ├── package.json
    │   ├── scripts/
    │   │   ├── deploy.js
    │   │   ├── docs/
    │   │   │   └── docify.js
    │   │   ├── etherscan_verify.sh
    │   │   ├── publish.js
    │   │   ├── start_hardhat_fork.sh
    │   │   ├── stop_hardhat_fork.sh
    │   │   └── watch.js
    │   ├── tasks/
    │   │   ├── addSqueethLiquidity.ts
    │   │   ├── addWethLiquidity.ts
    │   │   ├── buySqueeth.ts
    │   │   ├── buyWeth.ts
    │   │   ├── default.ts
    │   │   ├── increaseSlot.ts
    │   │   ├── sellSqueeth.ts
    │   │   ├── sellWeth.ts
    │   │   └── utils.ts
    │   ├── test/
    │   │   ├── calculator.ts
    │   │   ├── e2e/
    │   │   │   ├── crab-Migration.ts
    │   │   │   └── periphery/
    │   │   │       └── controller-helper.ts
    │   │   ├── integration-tests/
    │   │   │   ├── crabv2/
    │   │   │   │   ├── crab-hedging-otc.ts
    │   │   │   │   ├── crab-helper.ts
    │   │   │   │   ├── crab-liquidation-dust.ts
    │   │   │   │   ├── crab-liquidation-flashswap.ts
    │   │   │   │   ├── crab-liquidation-full.ts
    │   │   │   │   ├── crab-shutdown.ts
    │   │   │   │   ├── crab-timelock.ts
    │   │   │   │   └── strategy-flow.ts
    │   │   │   ├── liquidation.ts
    │   │   │   ├── oracle-attack.ts
    │   │   │   ├── oracle_integration.ts
    │   │   │   ├── periphery/
    │   │   │   │   └── controller-helper.ts
    │   │   │   ├── short_helper_integration.ts
    │   │   │   ├── strategy/
    │   │   │   │   ├── crab-flashswap-liquidation.ts
    │   │   │   │   ├── crab-hedge-uniswap-price-based.ts
    │   │   │   │   ├── crab-hedge-uniswap-time-based.ts
    │   │   │   │   ├── crab-hedging-price-based.ts
    │   │   │   │   ├── crab-hedging-time-based.ts
    │   │   │   │   ├── crab-liquidation-dust.ts
    │   │   │   │   ├── crab-liquidation-full.ts
    │   │   │   │   ├── crab-shutdown.ts
    │   │   │   │   └── strategy-flow.ts
    │   │   │   └── uni-position-collateral.ts
    │   │   ├── setup.ts
    │   │   ├── unit-tests/
    │   │   │   ├── abdk-math.ts
    │   │   │   ├── casting.ts
    │   │   │   ├── controller-funding.ts
    │   │   │   ├── controller-lptoken-collateral.ts
    │   │   │   ├── controller-pause-time.ts
    │   │   │   ├── controller-shutdown.ts
    │   │   │   ├── controller-vaults.ts
    │   │   │   ├── controller.ts
    │   │   │   ├── liquidation.ts
    │   │   │   ├── oracle-token-decimals.ts
    │   │   │   ├── oracle.ts
    │   │   │   ├── short-power-perp.ts
    │   │   │   ├── squeeth.ts
    │   │   │   ├── strategy/
    │   │   │   │   ├── crab-migration.ts
    │   │   │   │   ├── crab-strategy-v2.ts
    │   │   │   │   ├── crab-strategy.ts
    │   │   │   │   └── timelock.ts
    │   │   │   └── vault-lib.ts
    │   │   ├── utils.ts
    │   │   └── vault-utils.ts
    │   └── tsconfig.json
    ├── services/
    │   ├── graph-node/
    │   │   ├── Dockerfile
    │   │   ├── README.md
    │   │   ├── bin/
    │   │   │   ├── create
    │   │   │   ├── debug
    │   │   │   ├── deploy
    │   │   │   ├── reassign
    │   │   │   └── remove
    │   │   ├── build.sh
    │   │   ├── cloudbuild.yaml
    │   │   ├── docker-compose.yml
    │   │   ├── hooks/
    │   │   │   └── post_checkout
    │   │   ├── setup.sh
    │   │   ├── start
    │   │   ├── tag.sh
    │   │   └── wait_for
    │   └── package.json
    ├── subgraph/
    │   ├── .gitignore
    │   ├── README.md
    │   ├── config/
    │   │   ├── goerli-config.json
    │   │   ├── localhost-config.json
    │   │   ├── mainnet-config.json
    │   │   ├── rinkebyArbitrum-config.json
    │   │   └── ropsten-config.json
    │   ├── package.json
    │   ├── schema.graphql
    │   ├── src/
    │   │   ├── bullStrategy.ts
    │   │   ├── constants.ts
    │   │   ├── controller.ts
    │   │   ├── crabV2.ts
    │   │   ├── crabstrategy.ts
    │   │   └── util.ts
    │   └── subgraph.template.yaml
    ├── zen-bull-netting/
    │   ├── .gitignore
    │   ├── README.md
    │   ├── docs/
    │   │   ├── .gitignore
    │   │   ├── book.css
    │   │   ├── book.toml
    │   │   └── src/
    │   │       ├── README.md
    │   │       ├── SUMMARY.md
    │   │       └── src/
    │   │           ├── FlashSwap.sol/
    │   │           │   ├── contract.CallbackValidation.md
    │   │           │   ├── contract.FlashSwap.md
    │   │           │   └── contract.PoolAddress.md
    │   │           ├── NettingLib.sol/
    │   │           │   └── contract.NettingLib.md
    │   │           ├── README.md
    │   │           ├── ZenBullNetting.sol/
    │   │           │   └── contract.ZenBullNetting.md
    │   │           └── interface/
    │   │               ├── IController.sol/
    │   │               │   └── contract.IController.md
    │   │               ├── ICrabStrategyV2.sol/
    │   │               │   └── contract.ICrabStrategyV2.md
    │   │               ├── IEulerSimpleLens.sol/
    │   │               │   └── contract.IEulerSimpleLens.md
    │   │               ├── IFlashZen.sol/
    │   │               │   └── contract.IFlashZen.md
    │   │               ├── IOracle.sol/
    │   │               │   └── contract.IOracle.md
    │   │               ├── IWETH.sol/
    │   │               │   └── contract.IWETH.md
    │   │               ├── IZenBullStrategy.sol/
    │   │               │   └── contract.IZenBullStrategy.md
    │   │               └── README.md
    │   ├── foundry.toml
    │   ├── remappings.txt
    │   ├── script/
    │   │   ├── DeployScript.s.sol
    │   │   ├── GoerliDeployScript.s.sol
    │   │   └── MainnetDeployScript.s.sol
    │   ├── src/
    │   │   ├── FlashSwap.sol
    │   │   ├── NettingLib.sol
    │   │   ├── ZenBullNetting.sol
    │   │   └── interface/
    │   │       ├── IController.sol
    │   │       ├── ICrabStrategyV2.sol
    │   │       ├── IEulerSimpleLens.sol
    │   │       ├── IFlashZen.sol
    │   │       ├── IOracle.sol
    │   │       ├── IWETH.sol
    │   │       └── IZenBullStrategy.sol
    │   └── test/
    │       ├── ZenBullNettingBaseSetup.t.sol
    │       ├── fuzzing/
    │       │   └── ZenBullNetting/
    │       │       └── DepositAuctionFuzzing.t.sol
    │       ├── integration-test/
    │       │   └── ZenBullNetting/
    │       │       ├── DepositAuction.t.sol
    │       │       ├── DequeueEth.t.sol
    │       │       ├── DequeueZenBull.t.sol
    │       │       ├── NetAtPrice.t.sol
    │       │       └── WithdrawAuction.t.sol
    │       ├── unit-test/
    │       │   ├── CancelNonce.t.sol
    │       │   ├── QueueEth.t.sol
    │       │   ├── QueueZenBull.t.sol
    │       │   ├── SetAuctionTwapPeriod.t.sol
    │       │   ├── SetDepositsIndex.t.sol
    │       │   ├── SetMinEthAmount.sol
    │       │   ├── SetMinZenBullAmount.t.sol
    │       │   ├── SetOTCPriceTolerance.t.sol
    │       │   ├── SetWithdrawsIndex.t.sol
    │       │   └── ToggleAuctionLive.t.sol
    │       └── util/
    │           └── SigUtil.sol
    └── zen-bull-vault/
        ├── .gitignore
        ├── LICENSE_BUSL
        ├── README.md
        ├── doc/
        │   └── report/
        │       ├── report_auction_bull
        │       ├── report_auction_bull.md
        │       ├── report_bull_strategy
        │       ├── report_bull_strategy.md
        │       ├── report_emergency_shutdown
        │       ├── report_emergency_shutdown.md
        │       ├── report_flash_bull
        │       └── report_flash_bull.md
        ├── foundry.toml
        ├── remappings.txt
        ├── script/
        │   ├── AddLiquidityEuler.s.sol
        │   ├── Deploy.s.sol
        │   ├── GoerliAddUsdcLiquidityEuler.s.sol
        │   ├── GoerliAddWethLiquidityEuler.s.sol
        │   ├── GoerliDeploy.s.sol
        │   ├── GoerliDeployEmergencyWithdraw.s.sol
        │   ├── MainnetDeploy.s.sol
        │   ├── MainnetDeployEmergencyWithdraw.s.sol
        │   └── MainnetDeployShutdownEmergencyWithdraw.s.sol
        ├── src/
        │   ├── EmergencyWithdraw.sol
        │   ├── FlashZen.sol
        │   ├── LeverageZen.sol
        │   ├── ShutdownEmergencyWithdraw.sol
        │   ├── UniFlash.sol
        │   ├── UniOracle.sol
        │   ├── ZenAuction.sol
        │   ├── ZenBullStrategy.sol
        │   ├── ZenEmergencyShutdown.sol
        │   └── interface/
        │       ├── ICrabStrategyV2.sol
        │       ├── IEulerDToken.sol
        │       ├── IEulerEToken.sol
        │       ├── IEulerMarkets.sol
        │       ├── ILeverageZen.sol
        │       ├── IZenBullStrategy.sol
        │       └── IZenEmergencyWithdraw.sol
        └── test/
            ├── e2e/
            │   ├── EmergencyWithdrawScenarios.t.sol
            │   └── ShutdownEmergencyWithdrawTest.t.sol
            ├── fuzz-test/
            │   ├── FlashZenFuzzTest.t.sol
            │   ├── LeverageZenFuzzTest.t.sol
            │   ├── ZenAuctionFuzzTest.t.sol
            │   └── ZenBullStrategyFuzzTest.t.sol
            ├── integration-test/
            │   ├── EmergencyWithdraw/
            │   │   ├── EmergencyRepayEulerDebtTest.t.sol
            │   │   ├── EmergencyWithdrawEthFromCrabTest.t.sol
            │   │   └── WithdrawEthTest.t.sol
            │   ├── FlashZenTestFork.t.sol
            │   ├── ZenAuctionTestFork.t.sol
            │   ├── ZenBullStrategyTestFork.t.sol
            │   └── ZenEmergencyShutdownTestFork.t.sol
            ├── unit-test/
            │   ├── ZenBullStrategyTest.t.sol
            │   ├── mock/
            │   │   ├── EulerDtokenMock.t.sol
            │   │   ├── EulerEtokenMock.t.sol
            │   │   ├── EulerMarketsMock.t.sol
            │   │   ├── EulerMock.t.sol
            │   │   └── Weth9Mock.t.sol
            │   └── util/
            │       └── UnitSetupUtil.t.sol
            └── util/
                ├── SigUtil.sol
                └── TestUtil.t.sol

================================================
FILE CONTENTS
================================================

================================================
FILE: .circleci/config.yml
================================================
version: 2.1
orbs:
  coveralls: coveralls/coveralls@1.0.6
  node: circleci/node@1.1.6

workflows:
  hardhat:
    jobs:
      - checkout-and-install-hardhat
      - compile-hardhat:
          requires:
            - checkout-and-install-hardhat
      - lint-hardhat:
          requires:
            - compile-hardhat
      - unit-test-hardhat:
          requires:
            - compile-hardhat
      - integration-test-hardhat:
          requires:
            - compile-hardhat
      - contract-size-hardhat:
          requires:
            - compile-hardhat
      - e2e-test-hardhat:
          requires:
            - compile-hardhat
  frontend:
    jobs:
      - checkout-and-install-frontend
      - unit-test-frontend:
          requires:
            - checkout-and-install-frontend
  crab-netting:
    jobs:
      - lint-crab-netting
      - compile-crab-netting:
          requires:
            - lint-crab-netting
      - test-crab-netting:
          requires:
            - compile-crab-netting
  zen-bull-vault:
    jobs:
      - compile-zen-bull-vault
      - test-zen-bull-vault:
          requires:
            - compile-zen-bull-vault

jobs:
  ################ hardhat jobs
  checkout-and-install-hardhat:
    working_directory: ~/squeeth/packages/hardhat
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: Install packages
          command: yarn install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - node_modules
      - save_cache:
          key: squeeth-{{ .Environment.CIRCLE_SHA1 }}
          paths:
            - ~/squeeth

  compile-hardhat:
    working_directory: ~/squeeth/packages/hardhat
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: squeeth-{{ .Environment.CIRCLE_SHA1 }}
      - run:
          name: Compile Contracts
          command: npx hardhat compile
      - save_cache:
          key: typechain-cache-{{ .Environment.CIRCLE_SHA1 }}
          paths:
            - typechain
      - save_cache:
          key: artifacts-cache-{{ .Environment.CIRCLE_SHA1 }}
          paths:
            - artifacts

  lint-hardhat:
    working_directory: ~/squeeth/packages/hardhat
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: squeeth-{{ .Environment.CIRCLE_SHA1 }}
      - restore_cache:
          key: typechain-cache-{{ .Environment.CIRCLE_SHA1 }}
      - run:
          name: Lint
          command: yarn lint:check

  unit-test-hardhat:
    working_directory: ~/squeeth/packages/hardhat
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: squeeth-{{ .Environment.CIRCLE_SHA1 }}
      - restore_cache:
          key: typechain-cache-{{ .Environment.CIRCLE_SHA1 }}
      - run:
          name: Unit tests
          command: yarn test:crab-unit

  integration-test-hardhat:
    working_directory: ~/squeeth/packages/hardhat
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: squeeth-{{ .Environment.CIRCLE_SHA1 }}
      - restore_cache:
          key: typechain-cache-{{ .Environment.CIRCLE_SHA1 }}
      - run:
          name: Integration tests
          command: yarn test:crab-integration

  contract-size-hardhat:
    working_directory: ~/squeeth/packages/hardhat
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: squeeth-{{ .Environment.CIRCLE_SHA1 }}
      - restore_cache:
          key: artifacts-cache-{{ .Environment.CIRCLE_SHA1 }}
      - run:
          name: Check Contracts Size
          command: npx hardhat size-contracts

  e2e-test-hardhat:
    working_directory: ~/squeeth/packages/hardhat
    docker:
      - image: cimg/node:18.15.0
    steps:
      - restore_cache:
          key: squeeth-{{ .Environment.CIRCLE_SHA1 }}
      - restore_cache:
          key: typechain-cache-{{ .Environment.CIRCLE_SHA1 }}
      - run:
          name: Set Env Variables
          command: echo "export ALCHEMY_KEY=${ALCHEMY_KEY}" >> $BASH_ENV
      - run:
          name: Mainnet E2E Test
          command: yarn test:e2e

  ################ frontend jobs
  checkout-and-install-frontend:
    working_directory: ~/squeeth/packages/frontend
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: dependency-frontend-cache-{{ checksum "package.json" }}
      - run:
          name: Install packages
          command: yarn install
      - save_cache:
          key: dependency-frontend-cache-{{ checksum "package.json" }}
          paths:
            - node_modules
      - save_cache:
          key: squeeth-frontend-{{ .Environment.CIRCLE_SHA1 }}
          paths:
            - ~/squeeth

  unit-test-frontend:
    working_directory: ~/squeeth/packages/frontend
    docker:
      - image: cimg/node:18.15.0
    steps:
      - checkout:
          path: ~/squeeth
      - restore_cache:
          key: squeeth-frontend-{{ .Environment.CIRCLE_SHA1 }}
      - run:
          name: Unit tests
          command: yarn test:ci

  ################ crab-netting jobs
  lint-crab-netting:
    working_directory: ~/squeeth/packages/crab-netting
    docker:
      - image: ghcr.io/foundry-rs/foundry:latest
    steps:
      - checkout
      - run:
          name: Lint crab-netting
          command: cd packages/crab-netting && FOUNDRY_PROFILE=fmt forge fmt --check

  compile-crab-netting:
    working_directory: ~/squeeth/packages/crab-netting
    docker:
      - image: ghcr.io/foundry-rs/foundry:latest
    steps:
      - checkout
      - run:
          name: Build crab-netting
          command: cd packages/crab-netting && forge build --force

  test-crab-netting:
    working_directory: ~/squeeth/packages/crab-netting
    docker:
      - image: ghcr.io/foundry-rs/foundry:latest
    steps:
      - checkout
      - run: cd packages/crab-netting && forge test -vv --gas-report

  ################ zen-bull-vault jobs
  compile-zen-bull-vault:
    working_directory: ~/squeeth/packages/zen-bull-vault
    docker:
      - image: ghcr.io/foundry-rs/foundry:latest
    steps:
      - checkout
      - run:
          name: Build zen-bull-vault
          command: cd packages/zen-bull-vault && forge build --force

  test-zen-bull-vault:
    working_directory: ~/squeeth/packages/zen-bull-vault
    docker:
      - image: ghcr.io/foundry-rs/foundry:latest
    steps:
      - checkout
      - run: cd packages/zen-bull-vault && forge test -vv --gas-report



================================================
FILE: .editorconfig
================================================
root = true

[packages/**.js{,x}]
indent_style = space
indent_size = 2

[*.{sol,yul}]
indent_style = space
indent_size = 4


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: ""
assignees: ""
---

**Please describe the problem you're having.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context or screenshots about the feature request here.


================================================
FILE: .github/pull_request_template.md
================================================
# Task:

## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes (linear-task)

## Type of change

- [ ] New feature
- [ ] Bug fix
- [ ] Testing code
- [ ] Document update or config files

================================================
FILE: .gitignore
================================================
packages/subgraph/subgraph.yaml
packages/subgraph/generated
packages/subgraph/abis/*
packages/hardhat/*.txt
**/aws.json

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
**/node_modules
packages/hardhat/artifacts*
packages/hardhat/typechain*
# ignore localhost, but keep other deployment record on git
packages/hardhat/deployments/localhost
packages/react-app/src/contracts/*
!packages/react-app/src/contracts/external_contracts.js
packages/hardhat/cache*
packages/hardhat/coverage.json
packages/hardhat/coverage/

packages/**/data

packages/subgraph/config/config.json
tenderly.yaml

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
coverage

# production
build

# misc
.DS_Store
.env

packages/hardhat/.env*

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea

#Local vscode folder
.vscode

# Local Netlify folder
.netlify

# asdf config
**/.tool-versions



packages/bull-vault/out
packages/bull-vault/cache

packages/crab-netting/out
packages/crab-netting/cache


soljson*
lcov.info

================================================
FILE: .gitmodules
================================================
[submodule "packages/services/arbitrum"]
	path = packages/services/arbitrum
	url = https://github.com/OffchainLabs/arbitrum
	branch = master
[submodule "packages/services/optimism"]
	path = packages/services/optimism
	url = https://github.com/ethereum-optimism/optimism
	branch = regenesis/0.4.0
[submodule "packages/zen-bull-vault/lib/squeeth-monorepo"]
	path = packages/zen-bull-vault/lib/squeeth-monorepo
	url = https://github.com/opynfinance/squeeth-monorepo
[submodule "packages/zen-bull-vault/lib/openzeppelin-contracts"]
	path = packages/zen-bull-vault/lib/openzeppelin-contracts
	url = https://github.com/openzeppelin/openzeppelin-contracts
[submodule "packages/zen-bull-vault/lib/v3-core"]
	path = packages/zen-bull-vault/lib/v3-core
	url = https://github.com/Uniswap/v3-core
[submodule "packages/zen-bull-vault/lib/v3-periphery"]
	path = packages/zen-bull-vault/lib/v3-periphery
	url = https://github.com/Uniswap/v3-periphery
[submodule "packages/crab-netting/lib/forge-std"]
	path = packages/crab-netting/lib/forge-std
	url = https://github.com/foundry-rs/forge-std
[submodule "packages/crab-netting/lib/squeeth-monorepo"]
	path = packages/crab-netting/lib/squeeth-monorepo
	url = https://github.com/opynfinance/squeeth-monorepo/
[submodule "packages/crab-netting/lib/openzeppelin-contracts"]
	path = packages/crab-netting/lib/openzeppelin-contracts
	url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "packages/crab-netting/lib/v3-periphery"]
	path = packages/crab-netting/lib/v3-periphery
	url = https://github.com/uniswap/v3-periphery
[submodule "packages/crab-netting/lib/v3-core"]
	path = packages/crab-netting/lib/v3-core
	url = https://github.com/uniswap/v3-core
[submodule "packages/zen-bull-vault/lib/forge-std"]
	path = packages/zen-bull-vault/lib/forge-std
	url = https://github.com/foundry-rs/forge-std
[submodule "packages/zen-bull-netting/lib/forge-std"]
	path = packages/zen-bull-netting/lib/forge-std
	url = https://github.com/foundry-rs/forge-std
[submodule "packages/zen-bull-netting/lib/v3-core"]
	path = packages/zen-bull-netting/lib/v3-core
	url = https://github.com/Uniswap/v3-core
	branch = 0.8
[submodule "packages/zen-bull-netting/lib/v3-periphery"]
	path = packages/zen-bull-netting/lib/v3-periphery
	url = https://github.com/Uniswap/v3-periphery
	branch = 0.8
[submodule "packages/zen-bull-netting/lib/openzeppelin-contracts"]
	path = packages/zen-bull-netting/lib/openzeppelin-contracts
	url = https://github.com/OpenZeppelin/openzeppelin-contracts


================================================
FILE: .gitpod.yml
================================================
tasks:
  - name: App
    init: >
      yarn &&
      gp sync-done install
    command: REACT_APP_PROVIDER=$(gp url 8545) yarn start
  - name: Chain
    init: gp sync-await install
    command: yarn chain
    openMode: split-right
  - name: Deployment
    init: gp sync-await install
    command: yarn deploy
    openMode: split-right
ports:
  - port: 3000
    onOpen: open-preview
  - port: 8545
    onOpen: ignore
github:
  prebuilds:
    pullRequestsFromForks: true
    addComment: true
vscode:
  extensions:
    - dbaeumer.vscode-eslint
    - esbenp.prettier-vscode
    - juanblanco.solidity

================================================
FILE: .husky/pre-commit
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged

================================================
FILE: .huskyrc
================================================
{
  "hooks": {
    "pre-commit": "lint-staged",
    "pre-push": "yarn pre-push"
  }
}

================================================
FILE: .lintstagedrc
================================================
{
  "packages/hardhat/**/*.+(js|ts|json|sol)": [
    "yarn lint-contracts"
  ]
}

================================================
FILE: README.md
================================================
# Squeeth Monorepo

<p align="center">
<img src="https://i.imgur.com/Iyulvqq.png" width=400>
</p>
<p align="center"> The Squeethiest 🐱 </p>
<p align="center">
  <a href="https://discord.gg/ztEuhjyaBF"> <img alt="Discord" src="https://img.shields.io/discord/590664003815211058?style=for-the-badge" height=20></a>
  <a href="https://twitter.com/opyn_"><img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/opyn_?style=for-the-badge" height=20></a>
</p>

## 🤔 What is Squeeth

The squeeth contract is designed for users to long or short a special index: Eth², as an implementation of a Power Perpetual.

<p align="center">
<img height="150" src="https://i.imgur.com/bGue31m.png"> </img>
</p>

This monorepo contains the source code for the frontend app as well as the contracts, you can spin up the environment locally, run tests, or play around with the code. For more details about how to use the contracts and frontend, go to `packages/` and choose `hardhat` for the contracts or `frontend`, we have more detailed explanation in each sub-folder.

## 📚 Learn more

- Read our [GitBook](https://opyn.gitbook.io/squeeth/) Documentation
- Visit our official [Medium page](https://medium.com/opyn) where we have tons of great posts
- Original paper on [Power Perpetual](https://www.paradigm.xyz/2021/08/power-perpetuals/)
- Join our [Discord](https://tiny.cc/opyndiscord) to chat with all the derivative big brains

## 🔒 Security And Bug Bounty Program

Security is our one of our highest priorities. Our team has created a protocol that we believe is safe and dependable, and is audited by Trail of Bits and Akira, and is insured by Sherlock. All smart contract code is publicly verifiable and we have a bug bounty for undiscovered vulnerabilities. We encourage our users to be mindful of risk and only use funds they can afford to lose. Smart contracts are still new and experimental technology. We want to remind our users to be optimistic about innovation while remaining cautious about where they put their money.

Please see here for details on our [security audit](https://opyn.gitbook.io/squeeth/security/audits-and-insurance) and [bug bounty program](https://opyn.gitbook.io/squeeth/security/bug-bounty).

## 🏄‍♂️ Quick Start

### Prerequisites

1. Install [Node](https://nodejs.org/en/download/) LTS
1. Install [Yarn](https://classic.yarnpkg.com/en/docs/install/)

### Steps

> install and start your 👷‍ Hardhat chain:

```bash
cd packages/hardhat
yarn install
yarn chain
```

> in a second terminal window, start your 📱 frontend:

```bash
cd packages/frontend
yarn install
yarn dev
```

> in a third terminal window, 🛰 deploy your contract:

```bash
cd packages/hardhat
yarn deploy
```

Open http://localhost:3000 to see the app


================================================
FILE: package.json
================================================
{
  "name": "@squeeth/monorepo",
  "version": "1.0.0",
  "keywords": [
    "ethereum",
    "react",
    "uniswap",
    "workspaces",
    "yarn"
  ],
  "private": true,
  "scripts": {
    "frontend:build": "NODE_OPTIONS=--max-old-space-size=12288 yarn workspace @squeeth/frontend build",
    "frontend:eject": "yarn workspace @squeeth/frontend eject",
    "frontend:start": "yarn workspace @squeeth/frontend dev",
    "frontend:test": "yarn workspace @squeeth/frontend test",
    "build": "NODE_OPTIONS=--max-old-space-size=12288 yarn workspace @squeeth/frontend build ",
    "chain": "yarn workspace @squeeth/hardhat chain",
    "node": "yarn workspace @squeeth/hardhat chain",
    "test": "yarn workspace @squeeth/hardhat test",
    "start": "yarn workspace @squeeth/frontend start",
    "compile": "yarn workspace @squeeth/hardhat compile",
    "deploy": "yarn workspace @squeeth/hardhat deploy",
    "watch": "yarn workspace @squeeth/hardhat watch",
    "accounts": "yarn workspace @squeeth/hardhat accounts",
    "balance": "yarn workspace @squeeth/hardhat balance",
    "send": "yarn workspace @squeeth/hardhat send",
    "ipfs": "yarn workspace @squeeth/frontend ipfs",
    "surge": "yarn workspace @squeeth/frontend surge",
    "s3": "yarn workspace @squeeth/frontend s3",
    "ship": "yarn workspace @squeeth/frontend ship",
    "generate": "yarn workspace @squeeth/hardhat generate",
    "account": "yarn workspace @squeeth/hardhat account",
    "mineContractAddress": "cd packages/hardhat && npx hardhat mineContractAddress",
    "wallet": "cd packages/hardhat && npx hardhat wallet",
    "fundedwallet": "cd packages/hardhat && npx hardhat fundedwallet",
    "flatten": "cd packages/hardhat && npx hardhat flatten",
    "clean": "cd packages/hardhat && npx hardhat clean",
    "run-graph-node": "yarn workspace @squeeth/services run-graph-node",
    "remove-graph-node": "yarn workspace @squeeth/services remove-graph-node",
    "clean-graph-node": "yarn workspace @squeeth/services clean-graph-node",
    "graph-prepare": "mustache packages/subgraph/config/config.json packages/subgraph/src/subgraph.template.yaml > packages/subgraph/subgraph.yaml",
    "graph-codegen": "yarn workspace @squeeth/subgraph graph codegen",
    "graph-build": "yarn workspace @squeeth/subgraph graph build",
    "graph-create-local": "yarn workspace @squeeth/subgraph graph create --node http://localhost:8020/ scaffold-eth/your-contract",
    "graph-remove-local": "yarn workspace @squeeth/subgraph graph remove --node http://localhost:8020/ scaffold-eth/your-contract",
    "graph-deploy-local": "yarn workspace @squeeth/subgraph graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 scaffold-eth/your-contract",
    "graph-ship-local": "yarn graph-prepare && yarn graph-codegen && yarn graph-deploy-local",
    "deploy-and-graph": "yarn deploy && yarn graph-ship-local",
    "theme": "yarn workspace @squeeth/frontend theme",
    "watch-theme": "yarn workspace @squeeth/frontend watch",
    "lint-contracts": "yarn workspace @squeeth/hardhat lint",
    "pre-push": "cd packages/bull-vault && forge fmt && git commit -a -m 'auto foundry lint commit'"
  },
  "workspaces": {
    "packages": [
      "packages/*"
    ],
    "nohoist": [
      "**/@graphprotocol/graph-ts",
      "**/@graphprotocol/graph-ts/**",
      "**/hardhat",
      "**/hardhat/**",
      "**/ip-range-check",
      "**/ip-range-check/**"
    ]
  },
  "dependencies": {},
  "resolutions": {
    "ipfs-http-client@34.0.0/concat-stream": "2.0.0"
  },
  "devDependencies": {
    "husky": "^7.0.1",
    "lint-staged": "^11.1.2"
  }
}

================================================
FILE: packages/crab-netting/LICENSE_BUSL
================================================
Business Source License 1.1

License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.


"Business Source License" is a trademark of MariaDB Corporation Ab.

-----------------------------------------------------------------------------

Parameters
Licensor:            Opyn 
Licensed Work:       Opyn Crab Netting v1.0
                     The Licensed Work is (c) 2022 Opyn

Additional Use Grant: Any uses listed and defined at
https://github.com/opynfinance/squeeth-monorepo/tree/main/packages/crab-netting/USE_GRANT

Change Date:          The earlier of 2023-12-14 or a date specified at
https://github.com/opynfinance/squeeth-monorepo/tree/main/packages/crab-netting/CHANGE_DATE

Change License:       GNU General Public License v2.0 or later

-----------------------------------------------------------------------------


Terms

The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.

Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.

If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.

You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.

This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.

MariaDB hereby grants you permission to use this License’s text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.

-----------------------------------------------------------------------------

Covenants of Licensor

In consideration of the right to use this License’s text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:

1. To specify as the Change License the GPL Version 2.0 or any later version,
  or a license that is compatible with GPL Version 2.0 or a later version,
  where "compatible" means that software provided under the Change License can
  be included in a program with software provided under GPL Version 2.0 or a
  later version. Licensor may specify additional Change Licenses without
  limitation.

2. To either: (a) specify an additional grant of rights to use that does not
  impose any additional restriction on the right granted in this License, as
  the Additional Use Grant; or (b) insert the text "None".

3. To specify a Change Date.

4. Not to modify this License in any other way.

-----------------------------------------------------------------------------

Notice

The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.



================================================
FILE: packages/crab-netting/foundry.toml
================================================
[profile.default]
src = 'src'
out = 'out'
libs = ['lib']

# See more config options https://github.com/foundry-rs/foundry/tree/master/config

================================================
FILE: packages/crab-netting/remappings.txt
================================================
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
squeeth-monorepo/=lib/squeeth-monorepo/packages/hardhat/contracts/
openzeppelin/=lib/openzeppelin-contracts/contracts/
@uniswap/v3-periphery/=lib/v3-periphery/
@uniswap/v3-core/=lib/v3-core/

================================================
FILE: packages/crab-netting/script/Counter.s.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "forge-std/Script.sol";

contract CounterScript is Script {
    function setUp() public {}

    function run() public {
        vm.broadcast();
    }
}


================================================
FILE: packages/crab-netting/src/CrabNetting.sol
================================================
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.13;

// interface
import {IERC20} from "openzeppelin/token/ERC20/IERC20.sol";
import {IWETH} from "../src/interfaces/IWETH.sol";
import {IOracle} from "../src/interfaces/IOracle.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import {ICrabStrategyV2} from "../src/interfaces/ICrabStrategyV2.sol";
import {IController} from "../src/interfaces/IController.sol";

// contract
import {Ownable} from "openzeppelin/access/Ownable.sol";
import {EIP712} from "openzeppelin/utils/cryptography/draft-EIP712.sol";
import {ECDSA} from "openzeppelin/utils/cryptography/ECDSA.sol";

/// @dev order struct for a signed order from market maker
struct Order {
    uint256 bidId;
    address trader;
    uint256 quantity;
    uint256 price;
    bool isBuying;
    uint256 expiry;
    uint256 nonce;
    uint8 v;
    bytes32 r;
    bytes32 s;
}

/// @dev struct to store proportional amounts of erc20s (received or to send)
struct Portion {
    uint256 crab;
    uint256 eth;
    uint256 sqth;
}

/// @dev params for deposit auction
struct DepositAuctionParams {
    /// @dev USDC to deposit
    uint256 depositsQueued;
    /// @dev minETH equivalent to get from uniswap of the USDC to deposit
    uint256 minEth;
    /// @dev total ETH to deposit after selling the minted SQTH
    uint256 totalDeposit;
    /// @dev orders to buy sqth
    Order[] orders;
    /// @dev price from the auction to sell sqth
    uint256 clearingPrice;
    /// @dev remaining ETH to flashDeposit
    uint256 ethToFlashDeposit;
    /// @dev fee to pay uniswap for ethUSD swap
    uint24 ethUSDFee;
    /// @dev fee to pay uniswap for sqthETH swap
    uint24 flashDepositFee;
}

/// @dev params for withdraw auction
struct WithdrawAuctionParams {
    /// @dev amont of crab to queue for withdrawal
    uint256 crabToWithdraw;
    /// @dev orders that sell sqth to the auction
    Order[] orders;
    /// @dev price that the auction pays for the purchased sqth
    uint256 clearingPrice;
    /// @dev minUSDC to receive from swapping the ETH obtained by withdrawing
    uint256 minUSDC;
    /// @dev uniswap fee for swapping eth to USD;
    uint24 ethUSDFee;
}

/// @dev receipt used to store deposits and withdraws
struct Receipt {
    /// @dev address of the depositor or withdrawer
    address sender;
    /// @dev usdc amount to queue for deposit or crab amount to queue for withdrawal
    uint256 amount;
    /// @dev time of deposit
    uint256 timestamp;
}

/**
 * Crab netting error codes
 * N1: deposit amount smaller than minimum OTC amount
 * N2: auction is live
 * N3: remaining amount smaller than minimum, consider removing full balance
 * N4: force withdraw after 1 week from deposit
 * N5: withdraw amount smaller than minimum OTC amount
 * N6: remaining amount smaller than minimum, consider removing full balance
 * N7: Not enough deposits to net
 * N8: Not enough withdrawals to net
 * N9: signature incorrect
 * N10: order expired
 * N11: Min ETH out too low
 * N12: auction order not buying sqth
 * N13: buy order price less than clearing
 * N14: not enough buy orders for sqth
 * N15: auction order is not selling
 * N16: sell order price greater than clearing
 * N17: min USDC out too low
 * N18: twap period cannot be less than 180
 * N19: Price tolerance has to be less than 20%
 * N20: Nonce already used
 * N21: Price too high relative to Uniswap twap.
 * N22: Price too low relative to Uniswap twap.
 * N23: Crab Price too high
 * N24: Crab Price too low
 * N25: only weth and crab can send me monies
 */

/**
 * @dev CrabNetting contract
 * @notice Contract for Netting Deposits and Withdrawals
 * @author Opyn team
 */
contract CrabNetting is Ownable, EIP712 {
    /// @dev typehash for signed orders
    bytes32 private constant _CRAB_NETTING_TYPEHASH = keccak256(
        "Order(uint256 bidId,address trader,uint256 quantity,uint256 price,bool isBuying,uint256 expiry,uint256 nonce)"
    );
    /// @dev owner sets to true when starting auction
    bool public isAuctionLive;

    /// @dev sqth twap period
    uint32 public immutable sqthTwapPeriod;
    /// @dev twap period to use for auction calculations
    uint32 public auctionTwapPeriod = 420 seconds;

    /// @dev min USDC amounts to withdraw or deposit via netting
    uint256 public minUSDCAmount;

    /// @dev min CRAB amounts to withdraw or deposit via netting
    uint256 public minCrabAmount;

    // @dev OTC price must be within this distance of the uniswap twap price
    uint256 public otcPriceTolerance = 5e16; // 5%
    // @dev OTC price tolerance cannot exceed 20%
    uint256 public constant MAX_OTC_PRICE_TOLERANCE = 2e17; // 20%

    /// @dev address for ERC20 tokens
    address public immutable usdc;
    address public immutable crab;
    address public immutable weth;
    address public immutable sqth;

    /// @dev address for uniswap router
    ISwapRouter public immutable swapRouter;

    /// @dev address for uniswap oracle
    address public immutable oracle;

    /// @dev address for sqth eth pool
    address public immutable ethSqueethPool;

    /// @dev address for usdc eth pool
    address public immutable ethUsdcPool;

    /// @dev address for sqth controller
    address public immutable sqthController;

    /// @dev array index of last processed deposits
    uint256 public depositsIndex;

    /// @dev array index of last processed withdraws
    uint256 public withdrawsIndex;

    /// @dev array of deposit receipts
    Receipt[] public deposits;
    /// @dev array of withdrawal receipts
    Receipt[] public withdraws;

    /// @dev usd amount to deposit for an address
    mapping(address => uint256) public usdBalance;

    /// @dev crab amount to withdraw for an address
    mapping(address => uint256) public crabBalance;

    /// @dev indexes of deposit receipts of an address
    mapping(address => uint256[]) public userDepositsIndex;

    /// @dev indexes of withdraw receipts of an address
    mapping(address => uint256[]) public userWithdrawsIndex;

    /// @dev store the used flag for a nonce for each address
    mapping(address => mapping(uint256 => bool)) public nonces;

    event USDCQueued(
        address indexed depositor, uint256 amount, uint256 depositorsBalance, uint256 indexed receiptIndex
    );

    event USDCDeQueued(address indexed depositor, uint256 amount, uint256 depositorsBalance);

    event CrabQueued(
        address indexed withdrawer, uint256 amount, uint256 withdrawersBalance, uint256 indexed receiptIndex
    );

    event CrabDeQueued(address indexed withdrawer, uint256 amount, uint256 withdrawersBalance);

    event USDCDeposited(
        address indexed depositor,
        uint256 usdcAmount,
        uint256 crabAmount,
        uint256 indexed receiptIndex,
        uint256 refundedETH
    );

    event CrabWithdrawn(
        address indexed withdrawer, uint256 crabAmount, uint256 usdcAmount, uint256 indexed receiptIndex
    );

    event WithdrawRejected(address indexed withdrawer, uint256 crabAmount, uint256 index);

    event BidTraded(uint256 indexed bidId, address indexed trader, uint256 quantity, uint256 price, bool isBuying);

    event SetAuctionTwapPeriod(uint32 previousTwap, uint32 newTwap);
    event SetOTCPriceTolerance(uint256 previousTolerance, uint256 newOtcPriceTolerance);
    event SetMinCrab(uint256 amount);
    event SetMinUSDC(uint256 amount);
    event SetDepositsIndex(uint256 newDepositsIndex);
    event SetWithdrawsIndex(uint256 newWithdrawsIndex);
    event NonceTrue(address sender, uint256 nonce);
    event ToggledAuctionLive(bool isAuctionLive);

    /**
     * @notice netting contract constructor
     * @dev initializes the erc20 address, uniswap router and approves them
     * @param _crab address of crab contract token
     * @param _swapRouter address of uniswap swap router
     */
    constructor(address _crab, address _swapRouter) EIP712("CRABNetting", "1") {
        crab = _crab;
        swapRouter = ISwapRouter(_swapRouter);

        sqthController = ICrabStrategyV2(_crab).powerTokenController();
        usdc = IController(sqthController).quoteCurrency();
        weth = ICrabStrategyV2(_crab).weth();
        sqth = ICrabStrategyV2(_crab).wPowerPerp();
        oracle = ICrabStrategyV2(_crab).oracle();
        ethSqueethPool = ICrabStrategyV2(_crab).ethWSqueethPool();
        ethUsdcPool = IController(sqthController).ethQuoteCurrencyPool();
        sqthTwapPeriod = IController(sqthController).TWAP_PERIOD();

        // approve crab and sqth so withdraw can happen
        IERC20(sqth).approve(crab, type(uint256).max);

        IERC20(weth).approve(address(swapRouter), type(uint256).max);
        IERC20(usdc).approve(address(swapRouter), type(uint256).max);
    }

    /**
     * @dev view function to get the domain seperator used in signing
     */
    function DOMAIN_SEPARATOR() external view returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev toggles the value of isAuctionLive
     */
    function toggleAuctionLive() external onlyOwner {
        isAuctionLive = !isAuctionLive;
        emit ToggledAuctionLive(isAuctionLive);
    }

    /**
     * @notice set nonce to true
     * @param _nonce the number to be set true
     */
    function setNonceTrue(uint256 _nonce) external {
        nonces[msg.sender][_nonce] = true;
        emit NonceTrue(msg.sender, _nonce);
    }

    /**
     * @notice set minUSDCAmount
     * @param _amount the number to be set as minUSDC
     */
    function setMinUSDC(uint256 _amount) external onlyOwner {
        minUSDCAmount = _amount;
        emit SetMinUSDC(_amount);
    }

    /**
     * @notice set minCrabAmount
     * @param _amount the number to be set as minCrab
     */
    function setMinCrab(uint256 _amount) external onlyOwner {
        minCrabAmount = _amount;
        emit SetMinCrab(_amount);
    }

    /**
     * @notice set the depositIndex so that we want to skip processing some deposits
     * @param _newDepositsIndex the new deposits index
     */
    function setDepositsIndex(uint256 _newDepositsIndex) external onlyOwner {
        depositsIndex = _newDepositsIndex;
        emit SetDepositsIndex(_newDepositsIndex);
    }

    /**
     * @notice set the withdraw index so that we want to skip processing some withdraws
     * @param _newWithdrawsIndex the new withdraw index
     */
    function setWithdrawsIndex(uint256 _newWithdrawsIndex) external onlyOwner {
        withdrawsIndex = _newWithdrawsIndex;
        emit SetWithdrawsIndex(_newWithdrawsIndex);
    }

    /**
     * @notice queue USDC for deposit into crab strategy
     * @param _amount USDC amount to deposit
     */
    function depositUSDC(uint256 _amount) external {
        require(_amount >= minUSDCAmount, "N1");

        IERC20(usdc).transferFrom(msg.sender, address(this), _amount);

        // update usd balance of user, add their receipt, and receipt index to user deposits index
        usdBalance[msg.sender] = usdBalance[msg.sender] + _amount;
        deposits.push(Receipt(msg.sender, _amount, block.timestamp));
        userDepositsIndex[msg.sender].push(deposits.length - 1);

        emit USDCQueued(msg.sender, _amount, usdBalance[msg.sender], deposits.length - 1);
    }

    /**
     * @notice withdraw USDC from queue
     * @param _amount USDC amount to dequeue
     * @param _force forceWithdraw if deposited more than a week ago
     */
    function withdrawUSDC(uint256 _amount, bool _force) external {
        require(!isAuctionLive || _force, "N2");

        usdBalance[msg.sender] = usdBalance[msg.sender] - _amount;
        require(usdBalance[msg.sender] >= minUSDCAmount || usdBalance[msg.sender] == 0, "N3");

        // start withdrawing from the users last deposit
        uint256 toRemove = _amount;
        uint256 lastIndexP1 = userDepositsIndex[msg.sender].length;
        for (uint256 i = lastIndexP1; i > 0; i--) {
            Receipt storage r = deposits[userDepositsIndex[msg.sender][i - 1]];
            if (_force) {
                require(block.timestamp > r.timestamp + 1 weeks, "N4");
            }
            if (r.amount > toRemove) {
                r.amount -= toRemove;
                toRemove = 0;
                break;
            } else {
                toRemove -= r.amount;
                delete deposits[userDepositsIndex[msg.sender][i - 1]];
                userDepositsIndex[msg.sender].pop();
            }
        }
        IERC20(usdc).transfer(msg.sender, _amount);

        emit USDCDeQueued(msg.sender, _amount, usdBalance[msg.sender]);
    }

    /**
     * @notice queue Crab for withdraw from crab strategy
     * @param _amount crab amount to withdraw
     */
    function queueCrabForWithdrawal(uint256 _amount) external {
        require(_amount >= minCrabAmount, "N5");
        IERC20(crab).transferFrom(msg.sender, address(this), _amount);
        crabBalance[msg.sender] = crabBalance[msg.sender] + _amount;
        withdraws.push(Receipt(msg.sender, _amount, block.timestamp));
        userWithdrawsIndex[msg.sender].push(withdraws.length - 1);
        emit CrabQueued(msg.sender, _amount, crabBalance[msg.sender], withdraws.length - 1);
    }

    /**
     * @notice withdraw Crab from queue
     * @param _amount Crab amount to dequeue
     * @param _force forceWithdraw if deposited more than a week ago
     */
    function dequeueCrab(uint256 _amount, bool _force) external {
        require(!isAuctionLive || _force, "N2");
        crabBalance[msg.sender] = crabBalance[msg.sender] - _amount;
        require(crabBalance[msg.sender] >= minCrabAmount || crabBalance[msg.sender] == 0, "N6");
        // deQueue crab from the last, last in first out
        uint256 toRemove = _amount;
        uint256 lastIndexP1 = userWithdrawsIndex[msg.sender].length;
        for (uint256 i = lastIndexP1; i > 0; i--) {
            Receipt storage r = withdraws[userWithdrawsIndex[msg.sender][i - 1]];
            if (_force) {
                require(block.timestamp > r.timestamp + 1 weeks, "N4");
            }
            if (r.amount > toRemove) {
                r.amount -= toRemove;
                toRemove = 0;
                break;
            } else {
                toRemove -= r.amount;
                delete withdraws[userWithdrawsIndex[msg.sender][i - 1]];
                userWithdrawsIndex[msg.sender].pop();
            }
        }
        IERC20(crab).transfer(msg.sender, _amount);
        emit CrabDeQueued(msg.sender, _amount, crabBalance[msg.sender]);
    }

    /**
     * @dev swaps _quantity amount of usdc for crab at _price
     * @param _price price of crab in usdc
     * @param _quantity amount of USDC to net
     */
    function netAtPrice(uint256 _price, uint256 _quantity) external onlyOwner {
        _checkCrabPrice(_price);
        uint256 crabQuantity = (_quantity * 1e18) / _price;
        require(_quantity <= IERC20(usdc).balanceOf(address(this)), "N7");
        require(crabQuantity <= IERC20(crab).balanceOf(address(this)), "N8");

        // process deposits and send crab
        uint256 i = depositsIndex;
        uint256 amountToSend;
        while (_quantity > 0) {
            Receipt memory deposit = deposits[i];
            if (deposit.amount == 0) {
                i++;
                continue;
            }
            if (deposit.amount <= _quantity) {
                // deposit amount is lesser than quantity use it fully
                _quantity = _quantity - deposit.amount;
                usdBalance[deposit.sender] -= deposit.amount;
                amountToSend = (deposit.amount * 1e18) / _price;
                IERC20(crab).transfer(deposit.sender, amountToSend);
                emit USDCDeposited(deposit.sender, deposit.amount, amountToSend, i, 0);
                delete deposits[i];
                i++;
            } else {
                // deposit amount is greater than quantity; use it partially
                deposits[i].amount = deposit.amount - _quantity;
                usdBalance[deposit.sender] -= _quantity;
                amountToSend = (_quantity * 1e18) / _price;
                IERC20(crab).transfer(deposit.sender, amountToSend);
                emit USDCDeposited(deposit.sender, _quantity, amountToSend, i, 0);
                _quantity = 0;
            }
        }
        depositsIndex = i;

        // process withdraws and send usdc
        i = withdrawsIndex;
        while (crabQuantity > 0) {
            Receipt memory withdraw = withdraws[i];
            if (withdraw.amount == 0) {
                i++;
                continue;
            }
            if (withdraw.amount <= crabQuantity) {
                crabQuantity = crabQuantity - withdraw.amount;
                crabBalance[withdraw.sender] -= withdraw.amount;
                amountToSend = (withdraw.amount * _price) / 1e18;
                IERC20(usdc).transfer(withdraw.sender, amountToSend);

                emit CrabWithdrawn(withdraw.sender, withdraw.amount, amountToSend, i);

                delete withdraws[i];
                i++;
            } else {
                withdraws[i].amount = withdraw.amount - crabQuantity;
                crabBalance[withdraw.sender] -= crabQuantity;
                amountToSend = (crabQuantity * _price) / 1e18;
                IERC20(usdc).transfer(withdraw.sender, amountToSend);

                emit CrabWithdrawn(withdraw.sender, withdraw.amount, amountToSend, i);

                crabQuantity = 0;
            }
        }
        withdrawsIndex = i;
    }

    /**
     * @return sum usdc amount in queue
     */
    function depositsQueued() external view returns (uint256) {
        uint256 j = depositsIndex;
        uint256 sum;
        while (j < deposits.length) {
            sum = sum + deposits[j].amount;
            j++;
        }
        return sum;
    }

    /**
     * @return sum crab amount in queue
     */
    function withdrawsQueued() external view returns (uint256) {
        uint256 j = withdrawsIndex;
        uint256 sum;
        while (j < withdraws.length) {
            sum = sum + withdraws[j].amount;
            j++;
        }
        return sum;
    }

    function checkOrder(Order memory _order) external view {
        return _checkOrder(_order);
    }

    /**
     * @dev checks the expiry nonce and signer of an order
     * @param _order is the Order struct
     */
    function _checkOrder(Order memory _order) internal view {
        bytes32 structHash = keccak256(
            abi.encode(
                _CRAB_NETTING_TYPEHASH,
                _order.bidId,
                _order.trader,
                _order.quantity,
                _order.price,
                _order.isBuying,
                _order.expiry,
                _order.nonce
            )
        );

        bytes32 hash = _hashTypedDataV4(structHash);
        address offerSigner = ECDSA.recover(hash, _order.v, _order.r, _order.s);
        require(offerSigner == _order.trader, "N9");
        require(_order.expiry >= block.timestamp, "N10");
    }

    /**
     * @dev calculates wSqueeth minted when amount is deposited
     * @param _amount to deposit into crab
     */
    function _debtToMint(uint256 _amount) internal view returns (uint256) {
        uint256 feeAdjustment = _calcFeeAdjustment();
        (,, uint256 collateral, uint256 debt) = ICrabStrategyV2(crab).getVaultDetails();
        uint256 wSqueethToMint = (_amount * debt) / (collateral + (debt * feeAdjustment) / 1e18);
        return wSqueethToMint;
    }

    /**
     * @dev takes in orders from mm's to buy sqth and deposits the usd amount from the depositQueue into crab along with the eth from selling sqth
     * @param _p DepositAuction Params that contain orders, usdToDeposit, uniswap min amount and fee
     */
    function depositAuction(DepositAuctionParams calldata _p) external onlyOwner {
        _checkOTCPrice(_p.clearingPrice, false);
        uint256 ethUSDCPrice = IOracle(oracle).getTwap(ethUsdcPool, weth, usdc, auctionTwapPeriod, true);
        require((_p.depositsQueued * (1e18 - otcPriceTolerance) * 1e12 / ethUSDCPrice) < _p.minEth, "N11");
        /**
         * step 1: get eth from mm
         *     step 2: get eth from deposit usdc
         *     step 3: crab deposit
         *     step 4: flash deposit
         *     step 5: send sqth to mms
         *     step 6: send crab to depositors
         */
        uint256 initCrabBalance = IERC20(crab).balanceOf(address(this));
        uint256 initEthBalance = address(this).balance;

        uint256 sqthToSell = _debtToMint(_p.totalDeposit);
        // step 1 get all the eth in
        uint256 remainingToSell = sqthToSell;
        for (uint256 i = 0; i < _p.orders.length; i++) {
            require(_p.orders[i].isBuying, "N12");
            require(_p.orders[i].price >= _p.clearingPrice, "N13");
            _checkOrder(_p.orders[i]);
            _useNonce(_p.orders[i].trader, _p.orders[i].nonce);
            if (_p.orders[i].quantity >= remainingToSell) {
                IWETH(weth).transferFrom(
                    _p.orders[i].trader, address(this), (remainingToSell * _p.clearingPrice) / 1e18
                );
                remainingToSell = 0;
                break;
            } else {
                IWETH(weth).transferFrom(
                    _p.orders[i].trader, address(this), (_p.orders[i].quantity * _p.clearingPrice) / 1e18
                );
                remainingToSell -= _p.orders[i].quantity;
            }
        }
        require(remainingToSell == 0, "N14");

        // step 2
        ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({
            tokenIn: usdc,
            tokenOut: weth,
            fee: _p.ethUSDFee,
            recipient: address(this),
            deadline: block.timestamp,
            amountIn: _p.depositsQueued,
            amountOutMinimum: _p.minEth,
            sqrtPriceLimitX96: 0
        });
        swapRouter.exactInputSingle(params);

        // step 3
        IWETH(weth).withdraw(IWETH(weth).balanceOf(address(this)));
        ICrabStrategyV2(crab).deposit{value: _p.totalDeposit}();

        // step 4
        Portion memory to_send;
        to_send.eth = address(this).balance - initEthBalance;
        if (to_send.eth > 0 && _p.ethToFlashDeposit > 0) {
            if (to_send.eth <= _p.ethToFlashDeposit) {
                // we cant send more than the flashDeposit
                ICrabStrategyV2(crab).flashDeposit{value: to_send.eth}(_p.ethToFlashDeposit, _p.flashDepositFee);
            }
        }

        // step 5
        to_send.sqth = IERC20(sqth).balanceOf(address(this));
        remainingToSell = to_send.sqth;
        for (uint256 j = 0; j < _p.orders.length; j++) {
            if (_p.orders[j].quantity < remainingToSell) {
                IERC20(sqth).transfer(_p.orders[j].trader, _p.orders[j].quantity);
                remainingToSell -= _p.orders[j].quantity;
                emit BidTraded(_p.orders[j].bidId, _p.orders[j].trader, _p.orders[j].quantity, _p.clearingPrice, true);
            } else {
                IERC20(sqth).transfer(_p.orders[j].trader, remainingToSell);
                emit BidTraded(_p.orders[j].bidId, _p.orders[j].trader, remainingToSell, _p.clearingPrice, true);
                break;
            }
        }

        // step 6 send crab to depositors
        uint256 remainingDeposits = _p.depositsQueued;
        uint256 k = depositsIndex;

        to_send.crab = IERC20(crab).balanceOf(address(this)) - initCrabBalance;
        // get the balance between start and now
        to_send.eth = address(this).balance - initEthBalance;
        IWETH(weth).deposit{value: to_send.eth}();

        while (remainingDeposits > 0) {
            uint256 queuedAmount = deposits[k].amount;
            Portion memory portion;
            if (queuedAmount == 0) {
                k++;
                continue;
            }
            if (queuedAmount <= remainingDeposits) {
                remainingDeposits = remainingDeposits - queuedAmount;
                usdBalance[deposits[k].sender] -= queuedAmount;

                portion.crab = queuedAmount * to_send.crab / _p.depositsQueued;

                IERC20(crab).transfer(deposits[k].sender, portion.crab);

                portion.eth = queuedAmount * to_send.eth / _p.depositsQueued;
                if (portion.eth > 1e12) {
                    IWETH(weth).transfer(deposits[k].sender, portion.eth);
                } else {
                    portion.eth = 0;
                }
                emit USDCDeposited(deposits[k].sender, queuedAmount, portion.crab, k, portion.eth);

                delete deposits[k];
                k++;
            } else {
                usdBalance[deposits[k].sender] -= remainingDeposits;

                portion.crab = remainingDeposits * to_send.crab / _p.depositsQueued;
                IERC20(crab).transfer(deposits[k].sender, portion.crab);

                portion.eth = remainingDeposits * to_send.eth / _p.depositsQueued;
                if (portion.eth > 1e12) {
                    IWETH(weth).transfer(deposits[k].sender, portion.eth);
                } else {
                    portion.eth = 0;
                }
                emit USDCDeposited(deposits[k].sender, remainingDeposits, portion.crab, k, portion.eth);

                deposits[k].amount -= remainingDeposits;
                remainingDeposits = 0;
            }
        }
        depositsIndex = k;
        isAuctionLive = false;
    }

    /**
     * @dev takes in orders from mm's to sell sqth and withdraws the crab amount in q
     * @param _p Withdraw Params that contain orders, crabToWithdraw, uniswap min amount and fee
     */
    function withdrawAuction(WithdrawAuctionParams calldata _p) public onlyOwner {
        _checkOTCPrice(_p.clearingPrice, true);
        uint256 initWethBalance = IERC20(weth).balanceOf(address(this));
        uint256 initEthBalance = address(this).balance;
        /**
         * step 1: get sqth from mms
         *     step 2: withdraw from crab
         *     step 3: send eth to mms
         *     step 4: convert eth to usdc
         *     step 5: send usdc to withdrawers
         */

        // step 1 get sqth from mms
        uint256 sqthRequired = ICrabStrategyV2(crab).getWsqueethFromCrabAmount(_p.crabToWithdraw);
        uint256 toPull = sqthRequired;
        for (uint256 i = 0; i < _p.orders.length && toPull > 0; i++) {
            _checkOrder(_p.orders[i]);
            _useNonce(_p.orders[i].trader, _p.orders[i].nonce);
            require(!_p.orders[i].isBuying, "N15");
            require(_p.orders[i].price <= _p.clearingPrice, "N16");
            if (_p.orders[i].quantity < toPull) {
                toPull -= _p.orders[i].quantity;
                IERC20(sqth).transferFrom(_p.orders[i].trader, address(this), _p.orders[i].quantity);
            } else {
                IERC20(sqth).transferFrom(_p.orders[i].trader, address(this), toPull);
                toPull = 0;
            }
        }

        // step 2 withdraw from crab
        ICrabStrategyV2(crab).withdraw(_p.crabToWithdraw);

        // step 3 pay all mms
        IWETH(weth).deposit{value: address(this).balance - initEthBalance}();
        toPull = sqthRequired;
        uint256 sqthQuantity;
        for (uint256 i = 0; i < _p.orders.length && toPull > 0; i++) {
            if (_p.orders[i].quantity < toPull) {
                sqthQuantity = _p.orders[i].quantity;
            } else {
                sqthQuantity = toPull;
            }
            IERC20(weth).transfer(_p.orders[i].trader, (sqthQuantity * _p.clearingPrice) / 1e18);
            toPull -= sqthQuantity;
            emit BidTraded(_p.orders[i].bidId, _p.orders[i].trader, sqthQuantity, _p.clearingPrice, false);
        }

        // step 4 convert to USDC
        uint256 ethUSDCPrice = IOracle(oracle).getTwap(ethUsdcPool, weth, usdc, auctionTwapPeriod, true);
        uint256 amountIn = (IERC20(weth).balanceOf(address(this)) - initWethBalance);
        require((amountIn * ethUSDCPrice * (1e18 - otcPriceTolerance) / 1e36 / 1e12) < _p.minUSDC, "N17");
        ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({
            tokenIn: address(weth),
            tokenOut: address(usdc),
            fee: _p.ethUSDFee,
            recipient: address(this),
            deadline: block.timestamp,
            amountIn: amountIn,
            amountOutMinimum: _p.minUSDC,
            sqrtPriceLimitX96: 0
        });
        uint256 usdcReceived = swapRouter.exactInputSingle(params);

        // step 5 pay all withdrawers and mark their withdraws as done
        uint256 remainingWithdraws = _p.crabToWithdraw;
        uint256 j = withdrawsIndex;
        uint256 usdcAmount;
        while (remainingWithdraws > 0) {
            Receipt memory withdraw = withdraws[j];
            if (withdraw.amount == 0) {
                j++;
                continue;
            }
            if (withdraw.amount <= remainingWithdraws) {
                // full usage
                remainingWithdraws -= withdraw.amount;
                crabBalance[withdraw.sender] -= withdraw.amount;

                // send proportional usdc
                usdcAmount = withdraw.amount * usdcReceived / _p.crabToWithdraw;
                IERC20(usdc).transfer(withdraw.sender, usdcAmount);
                emit CrabWithdrawn(withdraw.sender, withdraw.amount, usdcAmount, j);
                delete withdraws[j];
                j++;
            } else {
                withdraws[j].amount -= remainingWithdraws;
                crabBalance[withdraw.sender] -= remainingWithdraws;

                // send proportional usdc
                usdcAmount = remainingWithdraws * usdcReceived / _p.crabToWithdraw;
                IERC20(usdc).transfer(withdraw.sender, usdcAmount);
                emit CrabWithdrawn(withdraw.sender, remainingWithdraws, usdcAmount, j);

                remainingWithdraws = 0;
            }
        }
        withdrawsIndex = j;
        isAuctionLive = false;
    }

    /**
     * @dev owner rejects the withdraw at index i thereby sending the withdrawer their crab back
     * @param i index of the Withdraw receipt to reject
     */
    function rejectWithdraw(uint256 i) external onlyOwner {
        Receipt memory withdraw = withdraws[i];
        crabBalance[withdraw.sender] -= withdraw.amount;
        ICrabStrategyV2(crab).transfer(withdraw.sender, withdraw.amount);
        delete withdraws[i];

        emit WithdrawRejected(withdraw.sender, withdraw.amount, i);
    }

    /**
     * @notice owner can set the twap period in seconds that is used for obtaining TWAP prices
     * @param _auctionTwapPeriod the twap period, in seconds
     */
    function setAuctionTwapPeriod(uint32 _auctionTwapPeriod) external onlyOwner {
        require(_auctionTwapPeriod >= 180, "N18");
        uint32 previousTwap = auctionTwapPeriod;

        auctionTwapPeriod = _auctionTwapPeriod;

        emit SetAuctionTwapPeriod(previousTwap, _auctionTwapPeriod);
    }

    /**
     * @notice owner can set a threshold, scaled by 1e18 that determines the maximum discount of a clearing sale price to the current uniswap twap price
     * @param _otcPriceTolerance the OTC price tolerance, in percent, scaled by 1e18
     */
    function setOTCPriceTolerance(uint256 _otcPriceTolerance) external onlyOwner {
        // Tolerance cannot be more than 20%
        require(_otcPriceTolerance <= MAX_OTC_PRICE_TOLERANCE, "N19");
        uint256 previousOtcTolerance = otcPriceTolerance;

        otcPriceTolerance = _otcPriceTolerance;

        emit SetOTCPriceTolerance(previousOtcTolerance, _otcPriceTolerance);
    }

    /**
     * @dev set nonce flag of the trader to true
     * @param _trader address of the signer
     * @param _nonce number that is to be traded only once
     */
    function _useNonce(address _trader, uint256 _nonce) internal {
        require(!nonces[_trader][_nonce], "N20");
        nonces[_trader][_nonce] = true;
    }

    /**
     * @notice check that the proposed sale price is within a tolerance of the current Uniswap twap
     * @param _price clearing price provided by manager
     * @param _isAuctionBuying is crab buying or selling oSQTH
     */
    function _checkOTCPrice(uint256 _price, bool _isAuctionBuying) internal view {
        // Get twap
        uint256 squeethEthPrice = IOracle(oracle).getTwap(ethSqueethPool, sqth, weth, auctionTwapPeriod, true);

        if (_isAuctionBuying) {
            require(_price <= (squeethEthPrice * (1e18 + otcPriceTolerance)) / 1e18, "N21");
        } else {
            require(_price >= (squeethEthPrice * (1e18 - otcPriceTolerance)) / 1e18, "N22");
        }
    }

    function _checkCrabPrice(uint256 _price) internal view {
        // Get twap
        uint256 squeethEthPrice = IOracle(oracle).getTwap(ethSqueethPool, sqth, weth, auctionTwapPeriod, true);
        uint256 usdcEthPrice = IOracle(oracle).getTwap(ethUsdcPool, weth, usdc, auctionTwapPeriod, true);
        (,, uint256 collateral, uint256 debt) = ICrabStrategyV2(crab).getVaultDetails();
        uint256 crabFairPrice =
            ((collateral - ((debt * squeethEthPrice) / 1e18)) * usdcEthPrice) / ICrabStrategyV2(crab).totalSupply();
        crabFairPrice = crabFairPrice / 1e12; //converting from units of 18 to 6
        require(_price <= (crabFairPrice * (1e18 + otcPriceTolerance)) / 1e18, "N23");
        require(_price >= (crabFairPrice * (1e18 - otcPriceTolerance)) / 1e18, "N24");
    }

    function _calcFeeAdjustment() internal view returns (uint256) {
        uint256 feeRate = IController(sqthController).feeRate();
        if (feeRate == 0) return 0;
        uint256 squeethEthPrice = IOracle(oracle).getTwap(ethSqueethPool, sqth, weth, sqthTwapPeriod, true);
        return (squeethEthPrice * feeRate) / 10000;
    }

    receive() external payable {
        require(msg.sender == weth || msg.sender == crab, "N25");
    }
}


================================================
FILE: packages/crab-netting/src/interfaces/IController.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

interface IController {
    function feeRate() external view returns (uint256);

    function TWAP_PERIOD() external view returns (uint32);

    function quoteCurrency() external view returns (address);

    function ethQuoteCurrencyPool() external view returns (address);

    function setFeeRate(uint256 _newFeeRate) external;

    function setFeeRecipient(address _newFeeRecipient) external;
}


================================================
FILE: packages/crab-netting/src/interfaces/ICrabStrategyV2.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {IERC20} from "openzeppelin/interfaces/IERC20.sol";

interface ICrabStrategyV2 is IERC20 {
    function getVaultDetails() external view returns (address, uint256, uint256, uint256);

    function deposit() external payable;

    function withdraw(uint256 _crabAmount) external;

    function flashDeposit(uint256 _ethToDeposit, uint24 _poolFee) external payable;

    function getWsqueethFromCrabAmount(uint256 _crabAmount) external view returns (uint256);

    function powerTokenController() external view returns (address);

    function weth() external view returns (address);

    function wPowerPerp() external view returns (address);

    function oracle() external view returns (address);

    function ethWSqueethPool() external view returns (address);
}


================================================
FILE: packages/crab-netting/src/interfaces/IOracle.sol
================================================
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOracle {
    function getTwap(address _pool, address _base, address _quote, uint32 _period, bool _checkPeriod)
        external
        view
        returns (uint256);
}


================================================
FILE: packages/crab-netting/src/interfaces/IWETH.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {IERC20} from "openzeppelin/interfaces/IERC20.sol";

interface IWETH is IERC20 {
    function deposit() external payable;

    function withdraw(uint256 wad) external;
}


================================================
FILE: packages/crab-netting/test/BaseForkSetup.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "forge-std/Test.sol";

import {ERC20} from "openzeppelin/token/ERC20/ERC20.sol";
import {IWETH} from "../src/interfaces/IWETH.sol";
import {IOracle} from "../src/interfaces/IOracle.sol";
import {ICrabStrategyV2} from "../src/interfaces/ICrabStrategyV2.sol";
import {CrabNetting, Order} from "../src/CrabNetting.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import {IQuoter} from "@uniswap/v3-periphery/contracts/interfaces/IQuoter.sol";
import {IController} from "../src/interfaces/IController.sol";

contract BaseForkSetup is Test {
    ICrabStrategyV2 crab;
    ERC20 usdc;
    IWETH weth;
    ERC20 sqth;
    CrabNetting netting;
    ISwapRouter swapRouter;
    IController sqthController;
    IQuoter quoter;
    IOracle oracle;
    uint256 activeFork;

    uint256 internal ownerPrivateKey;
    address internal owner;
    uint256 internal depositorPk;
    address internal depositor;
    uint256 internal withdrawerPk;
    address internal withdrawer;

    uint256 internal mm1Pk;
    address internal mm1;

    uint256 internal mm2Pk;
    address internal mm2;

    Order[] orders;

    function setUp() public virtual {
        string memory FORK_URL = vm.envString("FORK_URL");
        activeFork = vm.createSelectFork(FORK_URL, 15819213);

        crab = ICrabStrategyV2(0x3B960E47784150F5a63777201ee2B15253D713e8);
        weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
        usdc = ERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
        sqth = ERC20(0xf1B99e3E573A1a9C5E6B2Ce818b617F0E664E86B);
        swapRouter = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564);
        quoter = IQuoter(0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6);
        oracle = IOracle(0x65D66c76447ccB45dAf1e8044e918fA786A483A1);
        sqthController = IController(0x64187ae08781B09368e6253F9E94951243A493D5);

        netting = new CrabNetting(address(crab), address(swapRouter));
        vm.prank(address(netting));
        payable(depositor).transfer(address(netting).balance);

        ownerPrivateKey = 0xA11CE;
        owner = vm.addr(ownerPrivateKey);

        depositorPk = 0xA11CA;
        depositor = vm.addr(depositorPk);
        vm.label(depositor, "depositor");

        withdrawerPk = 0xA11CB;
        withdrawer = vm.addr(withdrawerPk);
        vm.label(withdrawer, "withdrawer");

        mm1Pk = 0xA11CC;
        mm1 = vm.addr(mm1Pk);
        vm.label(mm1, "market maker 1");
        mm2Pk = 0xA11CA;
        mm2 = vm.addr(mm2Pk);
        vm.label(mm2, "market maker 2");
    }
}


================================================
FILE: packages/crab-netting/test/BaseSetup.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "forge-std/Test.sol";
import {ERC20} from "openzeppelin/token/ERC20/ERC20.sol";

import {CrabNetting} from "../src/CrabNetting.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import {IOracle} from "../src/interfaces/IOracle.sol";

contract FixedERC20 is ERC20 {
    constructor(uint256 initialSupply) ERC20("USDC", "USDC") {
        _mint(msg.sender, initialSupply);
    }
}

contract BaseSetup is Test {
    FixedERC20 usdc;
    FixedERC20 crab;
    FixedERC20 weth;
    FixedERC20 sqth;
    CrabNetting netting;
    ISwapRouter public immutable swapRouter = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564);

    IOracle public immutable oracle = IOracle(0x65D66c76447ccB45dAf1e8044e918fA786A483A1);

    uint256 internal ownerPrivateKey;
    address internal owner;
    uint256 internal depositorPk;
    address internal depositor;
    uint256 internal withdrawerPk;
    address internal withdrawer;

    function setUp() public virtual {
        usdc = new FixedERC20(10000 * 1e6);
        crab = new FixedERC20(10000 * 1e18);
        weth = new FixedERC20(10000 * 1e18);
        sqth = new FixedERC20(10000 * 1e18);
        netting = new CrabNetting(address(crab), address(swapRouter));

        ownerPrivateKey = 0xA11CE;
        owner = vm.addr(ownerPrivateKey);

        depositorPk = 0xA11CA;
        depositor = vm.addr(depositorPk);
        vm.label(depositor, "depositor");

        withdrawerPk = 0xA11CB;
        withdrawer = vm.addr(withdrawerPk);
        vm.label(withdrawer, "withdrawer");
    }
}


================================================
FILE: packages/crab-netting/test/Deposit.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {BaseForkSetup} from "./BaseForkSetup.t.sol";

contract DepositTest is BaseForkSetup {
    function setUp() public override {
        BaseForkSetup.setUp(); // gives you netting, depositor, withdrawer, usdc, crab

        vm.startPrank(0x57757E3D981446D585Af0D9Ae4d7DF6D64647806);
        usdc.transfer(depositor, 20e6);
        vm.stopPrank();

        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(withdrawer, 20e18);
    }

    function testDepositMin() public {
        netting.setMinUSDC(1e6);
        vm.startPrank(depositor);
        usdc.approve(address(netting), 2 * 1e6);
        netting.depositUSDC(1e6);
        assertEq(netting.usdBalance(depositor), 1e6);
    }

    function testDepositLessThanMin() public {
        netting.setMinUSDC(1e6);
        vm.startPrank(depositor);
        usdc.approve(address(netting), 5 * 1e5);
        vm.expectRevert();
        netting.depositUSDC(5e5);
    }

    function testDepositAndWithdrawPartialUSDC() public {
        vm.startPrank(depositor);
        usdc.approve(address(netting), 2 * 1e6);

        netting.depositUSDC(2 * 1e6);
        assertEq(netting.usdBalance(depositor), 2e6);

        netting.withdrawUSDC(1 * 1e6, false);

        assertEq(netting.usdBalance(depositor), 1e6);
        assertEq(netting.depositsQueued(), 1e6);
    }

    function testDepositAndWithdrawFullUSDC() public {
        vm.startPrank(depositor);
        usdc.approve(address(netting), 2 * 1e6);

        netting.depositUSDC(2 * 1e6);
        assertEq(netting.usdBalance(depositor), 2e6);

        netting.withdrawUSDC(2 * 1e6, false);
        assertEq(netting.usdBalance(depositor), 0);
        assertEq(netting.depositsQueued(), 0);
    }

    function testLargeWithdraw() public {
        vm.startPrank(depositor);
        usdc.approve(address(netting), 4 * 1e6);

        netting.depositUSDC(2 * 1e6);
        netting.depositUSDC(2 * 1e6);
        assertEq(netting.usdBalance(depositor), 4e6);

        netting.withdrawUSDC(3 * 1e6, false);
        assertEq(netting.usdBalance(depositor), 1e6);
        assertEq(netting.depositsQueued(), 1e6);
    }

    function testDepositAndWithdrawCrabPartial() public {
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 2 * 1e6);

        netting.queueCrabForWithdrawal(2 * 1e6);
        assertEq(netting.crabBalance(withdrawer), 2e6);

        netting.dequeueCrab(1 * 1e6, false);
        assertEq(netting.crabBalance(withdrawer), 1e6);
        assertEq(netting.withdrawsQueued(), 1e6);
    }

    function testDepositAndWithdrawCrabFull() public {
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 2 * 1e6);

        netting.queueCrabForWithdrawal(2 * 1e6);
        assertEq(netting.crabBalance(withdrawer), 2e6);

        netting.dequeueCrab(2 * 1e6, false);
        assertEq(netting.crabBalance(withdrawer), 0);
        assertEq(netting.withdrawsQueued(), 0);
    }

    function testCrabDepositLargeWithdraw() public {
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 4 * 1e6);

        netting.queueCrabForWithdrawal(2 * 1e6);
        netting.queueCrabForWithdrawal(2 * 1e6);
        assertEq(netting.crabBalance(withdrawer), 4e6);

        netting.dequeueCrab(3 * 1e6, false);

        assertEq(netting.crabBalance(withdrawer), 1e6, "withdrawer balance incorrect");
        assertEq(netting.withdrawsQueued(), 1e6, "withdraws queued balance incorrect");
    }

    function testCannotWithdrawCrabWhenAuctionLive() public {
        netting.toggleAuctionLive();

        vm.startPrank(withdrawer);
        crab.approve(address(netting), 2 * 1e18);
        netting.queueCrabForWithdrawal(2 * 1e18);

        vm.expectRevert(bytes("N2"));
        netting.dequeueCrab(2 * 1e18, false);
        vm.stopPrank();
    }

    function testCannotWithdrawUSDCWhenAuctionLive() public {
        netting.toggleAuctionLive();

        vm.startPrank(depositor);
        usdc.approve(address(netting), 2 * 1e6);
        netting.depositUSDC(2 * 1e6);

        vm.expectRevert(bytes("N2"));
        netting.withdrawUSDC(2 * 1e6, false);
        vm.stopPrank();
    }

    function testDepositAndWithdrawFail_POC() public {
        netting.setMinUSDC(10e6);
        vm.startPrank(depositor);
        usdc.approve(address(netting), 10e9);
        netting.depositUSDC(10e6);

        for (uint256 i = 0; i < 100; i++) {
            netting.depositUSDC(10e6);
            netting.withdrawUSDC{gas: 200_000}(10e6, false);
        }
    }

    function testWithdrawAndDeQueueFail_POC() public {
        netting.setMinCrab(1);
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 20e18);
        netting.queueCrabForWithdrawal(10e18);

        for (uint256 i = 0; i < 100; i++) {
            netting.queueCrabForWithdrawal(10);
            netting.dequeueCrab{gas: 200_000}(10e6, false);
        }
    }

    function testForceWithdraw() public {
        uint256 startBalance = usdc.balanceOf(depositor);
        vm.startPrank(depositor);
        usdc.approve(address(netting), 2 * 1e6);
        netting.depositUSDC(2 * 1e6);
        vm.stopPrank();

        netting.toggleAuctionLive();

        vm.startPrank(depositor);
        vm.expectRevert(bytes("N2"));
        netting.withdrawUSDC(2e6, false);
        skip(8 * 24 * 60 * 60);
        netting.withdrawUSDC(2e6, true);
        assertEq(startBalance, usdc.balanceOf(depositor));
    }

    function testForceWithdrawCrab() public {
        uint256 startBalance = crab.balanceOf(withdrawer);
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 2e18);
        netting.queueCrabForWithdrawal(2e18);
        vm.stopPrank();

        netting.toggleAuctionLive();

        vm.startPrank(withdrawer);
        vm.expectRevert(bytes("N2"));
        netting.dequeueCrab(2e18, false);
        skip(8 * 24 * 60 * 60);
        netting.dequeueCrab(2e18, true);
        assertEq(startBalance, crab.balanceOf(withdrawer));
    }
}


================================================
FILE: packages/crab-netting/test/DepositAuction.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "forge-std/Test.sol";
import {BaseForkSetup} from "./BaseForkSetup.t.sol";

import {Order, DepositAuctionParams} from "../src/CrabNetting.sol";
import {ICrabStrategyV2} from "../src/interfaces/ICrabStrategyV2.sol";

import {SigUtils} from "./utils/SigUtils.sol";

struct Sign {
    uint8 v;
    bytes32 r;
    bytes32 s;
}

contract DepositAuctionTest is BaseForkSetup {
    SigUtils sig;

    function setUp() public override {
        BaseForkSetup.setUp();
        sig = new SigUtils(netting.DOMAIN_SEPARATOR());

        vm.deal(depositor, 100000000e18);

        // this is a crab whale, get some crab token from
        //vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        // crab.tranfer(depositor, 100e18);

        // some WETH and USDC rich address
        vm.startPrank(0x57757E3D981446D585Af0D9Ae4d7DF6D64647806);
        weth.transfer(depositor, 10000e18);
        weth.transfer(mm1, 1000e18);
        weth.transfer(mm2, 1000e18);
        usdc.transfer(depositor, 500000e6);
        vm.stopPrank();

        vm.startPrank(depositor);
        usdc.approve(address(netting), 1500000 * 1e6);
        netting.depositUSDC(200000 * 1e6);
        vm.stopPrank();

        // depositor has queued in 200k USDC
    }

    function _findTotalDepositAndToMint(uint256 _eth, uint256 _collateral, uint256 _debt, uint256 _price)
        internal
        pure
        returns (uint256, uint256)
    {
        uint256 totalDeposit = (_eth * 1e18) / (1e18 - ((_debt * _price) / _collateral));
        return (totalDeposit, (totalDeposit * _debt) / _collateral);
    }

    function _findTotalDepositFromAuctioned(uint256 _collateral, uint256 _debt, uint256 _auctionedSqth)
        internal
        pure
        returns (uint256)
    {
        return (_collateral * _auctionedSqth) / _debt;
    }

    function testDepositAuctionPartialFill() public {
        DepositAuctionParams memory p;
        uint256 sqthPriceLimit = (_getSqthPrice(1e18) * 988) / 1000;
        (,, uint256 collateral, uint256 debt) = crab.getVaultDetails();
        // Large first deposit. 10 & 40 as the deposit. 20 is the amount to net
        vm.prank(depositor);
        netting.depositUSDC(300000 * 1e6); //200+300 500k usdc deposited

        p.depositsQueued = 300000 * 1e6;
        p.minEth = (_convertUSDToETH(p.depositsQueued) * 9975) / 10000;

        uint256 toMint;
        (p.totalDeposit, toMint) = _findTotalDepositAndToMint(p.minEth, collateral, debt, sqthPriceLimit);
        bool trade_works = _isEnough(p.minEth, toMint, sqthPriceLimit, p.totalDeposit);
        require(trade_works, "depositing more than we have from sellling");
        Order memory order =
            Order(0, mm1, toMint, (sqthPriceLimit * 1005) / 1000, true, block.timestamp, 0, 1, 0x00, 0x00);

        bytes32 digest = sig.getTypedDataHash(order);
        (uint8 v, bytes32 r, bytes32 s) = vm.sign(mm1Pk, digest);
        order.v = v;
        order.r = r;
        order.s = s;

        orders.push(order);
        p.orders = orders;
        vm.prank(mm1);
        weth.approve(address(netting), 1e30);

        p.clearingPrice = (sqthPriceLimit * 1005) / 1000;
        uint256 excessEth = (toMint * (p.clearingPrice - sqthPriceLimit)) / 1e18;

        p.ethUSDFee = 500;
        p.flashDepositFee = 3000;

        // Find the borrow ration for toFlash
        uint256 mid = _findBorrow(excessEth, debt, collateral);
        p.ethToFlashDeposit = (excessEth * mid) / 10 ** 7;
        // ------------- //
        uint256 depositorBalance = weth.balanceOf(depositor);
        netting.depositAuction(p);

        assertApproxEqAbs(ICrabStrategyV2(crab).balanceOf(depositor), 221e18, 1e18);
        assertEq(netting.usdBalance(depositor), 200000e6);
        assertEq(sqth.balanceOf(mm1), toMint);
        assertEq(weth.balanceOf(address(netting)), 1);
        assertApproxEqAbs(weth.balanceOf(depositor) - depositorBalance, 5e17, 1e17);
    }

    function testDepositAuctionAfterFullWithdrawal() public {
        vm.startPrank(depositor);
        console.log(netting.usdBalance(depositor), "depositor balance");
        netting.withdrawUSDC(netting.usdBalance(depositor), false);
        assertEq(netting.usdBalance(depositor), 0, "depositor balancez ero");
        netting.depositUSDC(200000e6);
        vm.stopPrank();

        DepositAuctionParams memory p;
        uint256 sqthPriceLimit = (_getSqthPrice(1e18) * 988) / 1000;
        (,, uint256 collateral, uint256 debt) = crab.getVaultDetails();
        // Large first deposit. 10 & 40 as the deposit. 20 is the amount to net
        vm.prank(depositor);
        netting.depositUSDC(300000 * 1e6); //200+300 500k usdc deposited

        p.depositsQueued = 300000 * 1e6;
        p.minEth = (_convertUSDToETH(p.depositsQueued) * 9975) / 10000;

        uint256 toMint;
        (p.totalDeposit, toMint) = _findTotalDepositAndToMint(p.minEth, collateral, debt, sqthPriceLimit);
        bool trade_works = _isEnough(p.minEth, toMint, sqthPriceLimit, p.totalDeposit);
        require(trade_works, "depositing more than we have from sellling");
        Order memory order =
            Order(0, mm1, toMint, (sqthPriceLimit * 1005) / 1000, true, block.timestamp, 0, 1, 0x00, 0x00);

        bytes32 digest = sig.getTypedDataHash(order);
        (uint8 v, bytes32 r, bytes32 s) = vm.sign(mm1Pk, digest);
        order.v = v;
        order.r = r;
        order.s = s;

        orders.push(order);
        p.orders = orders;
        vm.prank(mm1);
        weth.approve(address(netting), 1e30);

        p.clearingPrice = (sqthPriceLimit * 1005) / 1000;
        uint256 excessEth = (toMint * (p.clearingPrice - sqthPriceLimit)) / 1e18;

        p.ethUSDFee = 500;
        p.flashDepositFee = 3000;

        // Find the borrow ration for toFlash
        uint256 mid = _findBorrow(excessEth, debt, collateral);
        p.ethToFlashDeposit = (excessEth * mid) / 10 ** 7;
        // ------------- //
        uint256 depositorBalance = weth.balanceOf(depositor);
        console.log(depositorBalance, "balance bfore");
        netting.depositAuction(p);

        console.log(ICrabStrategyV2(crab).balanceOf(depositor), "crab balance");
        assertGt(ICrabStrategyV2(crab).balanceOf(depositor), 221e18);
        assertEq(netting.usdBalance(depositor), 200000e6);
        assertEq(sqth.balanceOf(mm1), toMint);
        assertLe(weth.balanceOf(address(netting)), 1e16);
        assertGt(weth.balanceOf(depositor) - depositorBalance, 5e17, "0.5 eth not remaining");
        assertEq(netting.depositsIndex(), 2);
    }

    function testSqthPriceTooLow() public {
        DepositAuctionParams memory p;
        uint256 sqthPriceLimit = (_getSqthPrice(1e18) * 99) / 100;
        (,, uint256 collateral, uint256 debt) = crab.getVaultDetails();
        // Large first deposit. 10 & 40 as the deposit. 20 is the amount to net
        vm.prank(depositor);
        netting.depositUSDC(300000 * 1e6); //200+300 500k usdc deposited

        p.depositsQueued = 300000 * 1e6;
        p.minEth = (_convertUSDToETH(p.depositsQueued) * 9975) / 10000;

        uint256 toMint;
        (p.totalDeposit, toMint) = _findTotalDepositAndToMint(p.minEth, collateral, debt, sqthPriceLimit);
        Order memory order = Order(0, mm1, toMint, sqthPriceLimit, true, block.timestamp, 0, 1, 0x00, 0x00);
        orders.push(order);
        p.orders = orders;

        vm.prank(mm1);
        weth.approve(address(netting), 1e30);

        p.clearingPrice = (sqthPriceLimit * 94) / 100;
        p.ethUSDFee = 500;
        p.flashDepositFee = 3000;
        p.ethToFlashDeposit = (p.ethToFlashDeposit * 1) / 10 ** 7;

        vm.expectRevert(bytes("N22"));
        netting.depositAuction(p);
    }

    function testFirstDepositAuction() public {
        DepositAuctionParams memory p;
        // get the usd to deposit remaining
        p.depositsQueued = netting.depositsQueued();
        // find the eth value of it
        p.minEth = (_convertUSDToETH(p.depositsQueued) * 9975) / 10000;

        // lets get the uniswap price, you can get this from uniswap function in crabstratgegy itself
        uint256 sqthPrice = (_getSqthPrice(1e18) * 988) / 1000;
        // get the vault details
        (,, uint256 collateral, uint256 debt) = crab.getVaultDetails();
        // get the total deposit
        uint256 toMint;
        (p.totalDeposit, toMint) = _findTotalDepositAndToMint(p.minEth, collateral, debt, sqthPrice);
        // --------
        // then write a test suite with a high eth value where it fails
        bool trade_works = _isEnough(p.minEth, toMint, sqthPrice, p.totalDeposit);
        require(trade_works, "depositing more than we have from sellling");

        // if i sell the sqth and get eth add to user eth, will it be > total deposit

        // then reduce the total value to get more trade value like in crab otc looping
        // find out the root cause of this rounding issue

        // turns out the issue did not occur,
        // so we go ahead as though the auction closed for 0.993 osqth price

        Order memory order =
            Order(0, mm1, toMint - 1e18, (sqthPrice * 1005) / 1000, true, block.timestamp, 0, 1, 0x00, 0x00);

        Sign memory s;
        (s.v, s.r, s.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order));
        order.v = s.v;
        order.r = s.r;
        order.s = s.s;

        Order memory order0 = Order(0, mm1, 1e18, (sqthPrice * 1005) / 1000, true, block.timestamp, 1, 1, 0x00, 0x00);

        Sign memory s0;
        (s0.v, s0.r, s0.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order0));
        order0.v = s0.v;
        order0.r = s0.r;
        order0.s = s0.s;

        orders.push(order0);
        orders.push(order);
        vm.prank(mm1);
        weth.approve(address(netting), 1e30);

        p.orders = orders;
        p.clearingPrice = (sqthPrice * 1005) / 1000;
        uint256 excessEth = (toMint * (p.clearingPrice - sqthPrice)) / 1e18;
        console.log(excessEth, "excess eth is");

        console.log(ICrabStrategyV2(crab).balanceOf(depositor), "balance start crab");

        // Find the borrow ration for toFlash
        uint256 mid = _findBorrow(excessEth, debt, collateral);
        console.log(mid, "borrow percentage is");
        p.ethToFlashDeposit = (excessEth * mid) / 10 ** 7;
        console.log("after multiplying", p.ethToFlashDeposit);
        p.ethUSDFee = 500;
        p.flashDepositFee = 3000;
        // ------------- //
        console.log(p.depositsQueued, p.minEth, p.totalDeposit, toMint);
        console.log(p.clearingPrice);
        uint256 initEthBalance = weth.balanceOf(depositor);
        netting.depositAuction(p);

        assertApproxEqAbs(ICrabStrategyV2(crab).balanceOf(depositor), 147e18, 1e18);
        assertEq(sqth.balanceOf(mm1), toMint);
        assertApproxEqAbs(weth.balanceOf(depositor) - initEthBalance, 3e17, 1e17);
    }

    function testFirstDepositAuctionWithFee() public {
        vm.startPrank(0x609FFF64429e2A275a879e5C50e415cec842c629);
        sqthController.setFeeRecipient(depositor);
        sqthController.setFeeRate(10);
        vm.stopPrank();

        DepositAuctionParams memory p;
        p.depositsQueued = netting.depositsQueued();
        p.minEth = (_convertUSDToETH(p.depositsQueued) * 9975) / 10000;

        uint256 sqthPrice = (_getSqthPrice(1e18) * 988) / 1000;
        (,, uint256 collateral, uint256 debt) = crab.getVaultDetails();
        uint256 toMint;
        (p.totalDeposit, toMint) = _findTotalDepositAndToMint(p.minEth, collateral, debt, sqthPrice);
        bool trade_works = _isEnough(p.minEth, toMint, sqthPrice, p.totalDeposit);
        require(trade_works, "depositing more than we have from sellling");
        Order memory order =
            Order(0, mm1, toMint - 1e18, (sqthPrice * 1005) / 1000, true, block.timestamp, 0, 1, 0x00, 0x00);

        Sign memory s;
        (s.v, s.r, s.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order));
        order.v = s.v;
        order.r = s.r;
        order.s = s.s;

        Order memory order0 = Order(0, mm1, 1e18, (sqthPrice * 1005) / 1000, true, block.timestamp, 1, 1, 0x00, 0x00);

        Sign memory s0;
        (s0.v, s0.r, s0.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order0));
        order0.v = s0.v;
        order0.r = s0.r;
        order0.s = s0.s;

        orders.push(order0);
        orders.push(order);
        vm.prank(mm1);
        weth.approve(address(netting), 1e30);

        p.orders = orders;
        p.clearingPrice = (sqthPrice * 1005) / 1000;
        uint256 excessEth = (toMint * (p.clearingPrice - sqthPrice)) / 1e18;

        // Find the borrow ration for toFlash
        uint256 mid = _findBorrow(excessEth, debt, collateral);
        p.ethToFlashDeposit = (excessEth * mid) / 10 ** 7;
        p.ethUSDFee = 500;
        p.flashDepositFee = 3000;
        // ------------- //
        uint256 initEthBalance = weth.balanceOf(depositor);
        netting.depositAuction(p);

        assertApproxEqAbs(ICrabStrategyV2(crab).balanceOf(depositor), 147e18, 1e18);
        assertApproxEqAbs(sqth.balanceOf(mm1), toMint, 2e18);
        assertApproxEqAbs(weth.balanceOf(depositor) - initEthBalance, 3e17, 1e17);
    }

    // TODO find a way to make this reusable and test easily
    // for multiple ETH movements and external events like partial fills
    // eth going down
    function testDepositAuctionEthUp() public {
        DepositAuctionParams memory p;
        // get the usd to deposit remaining
        p.depositsQueued = netting.depositsQueued();
        // find the eth value of it
        p.minEth = _convertUSDToETH(p.depositsQueued);
        console.log("Starting ETH", p.minEth / 10 ** 18);

        // lets get the uniswap price, you can get this from uniswap function in crabstratgegy itself
        uint256 sqthPrice = (_getSqthPrice(1e18) * 988) / 1000;
        // get the vault details
        (,, uint256 collateral, uint256 debt) = crab.getVaultDetails();
        // get the total deposit
        uint256 toMint;
        (p.totalDeposit, toMint) = _findTotalDepositAndToMint(p.minEth, collateral, debt, sqthPrice);
        console.log("Auctioning for ", toMint / 10 ** 18, "sqth");
        // --------
        // then write a test suite with a high eth value where it fails
        require(_isEnough(p.minEth, toMint, sqthPrice, p.totalDeposit), "depositing more than we have from sellling");

        // if i sell the sqth and get eth add to user eth, will it be > total deposit

        // then reduce the total value to get more trade value like in crab otc looping
        // find out the root cause of this rounding issue

        // turns out the issue did not occur,
        // so we go ahead as though the auction closed for 0.993 osqth price

        Order memory order = Order(
            0,
            mm1,
            toMint,
            63974748984830990, // sqth price in the future
            true,
            block.timestamp + 26000000,
            0,
            1,
            0x00,
            0x00
        );

        (uint8 v, bytes32 r, bytes32 s) = vm.sign(mm1Pk, sig.getTypedDataHash(order));
        order.v = v;
        order.r = r;
        order.s = s;
        orders.push(order);
        vm.prank(mm1);
        weth.approve(address(netting), 1e30);

        p.orders = orders;
        p.clearingPrice = (sqthPrice * 1005) / 1000;
        uint256 excessEth = (toMint * (p.clearingPrice - sqthPrice)) / 1e18;

        console.log(ICrabStrategyV2(crab).balanceOf(depositor), "balance start crab");

        // Find the borrow ration for toFlash
        uint256 mid = _findBorrow(excessEth, debt, collateral);
        p.ethToFlashDeposit = (excessEth * mid) / 10 ** 7;
        p.ethUSDFee = 500;
        p.flashDepositFee = 3000;
        // ------------- //

        // vm.stopPrank();
        assertEq(activeFork, vm.activeFork());
        vm.makePersistent(address(netting));
        vm.makePersistent(address(weth));
        vm.makePersistent(address(usdc));

        vm.rollFork(activeFork, 15829113);
        console.log(address(depositor).balance, "starting");
        p.minEth = _convertUSDToETH(p.depositsQueued);
        p.clearingPrice = _getSqthPrice(1e18);
        console.log("Ending ETH", p.minEth / 10 ** 18);
        (,, collateral, debt) = ICrabStrategyV2(crab).getVaultDetails();
        p.totalDeposit = _findTotalDepositFromAuctioned(collateral, debt, toMint);
        console.log("Using only", toMint, "sqth");
        console.log(p.totalDeposit);

        uint256 mm1Balance = weth.balanceOf(mm1);
        uint256 initDepositorBalance = weth.balanceOf(depositor);
        netting.depositAuction(p);
        assertLe(((toMint * p.clearingPrice) / 10 ** 18) - (mm1Balance - weth.balanceOf(mm1)), 180);

        assertApproxEqAbs(ICrabStrategyV2(crab).balanceOf(depositor), 147e18, 5e18);
        assertApproxEqAbs(
            sqth.balanceOf(mm1), toMint, 0.001e18, "All minted not sold, check if we sold only what we took for"
        );
        assertApproxEqAbs(
            weth.balanceOf(depositor) - initDepositorBalance, 23e17, 1e17, "deposit not refunded enough eth"
        );
    }

    function _findBorrow(uint256 toFlash, uint256 debt, uint256 collateral) internal returns (uint256) {
        // we want a precision of six decimals
        // TODo fix the inifinte loop
        uint8 decimals = 6;

        uint256 start = 5 * 10 ** decimals;
        uint256 end = 30 * 10 ** decimals;
        uint256 mid;
        uint256 ethToBorrow;
        uint256 totDep;
        uint256 debtMinted;
        uint256 ethReceived;
        while (true) {
            mid = (start + end) / 2;
            ethToBorrow = (toFlash * mid) / 10 ** (decimals + 1);
            totDep = toFlash + ethToBorrow;
            debtMinted = (totDep * debt) / collateral;

            // get quote for debt minted and check if eth value is > borrowed but within deviation
            // if eth value is lesser, then we borrow less so end = mid; else start = mid
            ethReceived = _getSqthPrice(debtMinted);
            if (ethReceived >= ethToBorrow && ethReceived <= (ethToBorrow * 10100) / 10000) {
                break;
            }
            // mid is the multiple
            else {
                if (ethReceived > ethToBorrow) {
                    start = mid;
                } else {
                    end = mid;
                }
            }
        }
        // why is all the eth not being take in
        return mid + 1e7;
    }

    function _isEnough(uint256 _userETh, uint256 oSqthQuantity, uint256 oSqthPrice, uint256 _totalDep)
        internal
        pure
        returns (bool)
    {
        uint256 totalAfterSelling = (_userETh + ((oSqthQuantity * oSqthPrice)) / 1e18);
        return totalAfterSelling > _totalDep;
    }

    function _convertUSDToETH(uint256 _usdc) internal returns (uint256) {
        // get the uniswap quoter contract code and address and initiate it
        return quoter.quoteExactInputSingle(
            address(usdc),
            address(weth),
            500, //3000 is 0.3
            _usdc,
            0
        );
    }

    function _getSqthPrice(uint256 _quantity) internal returns (uint256) {
        return quoter.quoteExactInputSingle(address(sqth), address(weth), 3000, _quantity, 0);
    }
}


================================================
FILE: packages/crab-netting/test/ForkTestNetAtPrice.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "forge-std/Test.sol";
import {BaseForkSetup} from "./BaseForkSetup.t.sol";

contract ForkTestNetAtPrice is BaseForkSetup {
    function setUp() public override {
        BaseForkSetup.setUp();
        // this is a crab whale, get some crab token from
        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(withdrawer, 1e18);

        // some WETH and USDC rich address
        vm.prank(0x57757E3D981446D585Af0D9Ae4d7DF6D64647806);
        usdc.transfer(depositor, 20e6);
    }

    function testForkTestNetAtPrice() public {
        vm.startPrank(depositor);
        usdc.approve(address(netting), 17e6);
        netting.depositUSDC(17e6);
        vm.stopPrank();

        vm.startPrank(withdrawer);
        crab.approve(address(netting), 1e18);
        netting.queueCrabForWithdrawal(1e18);
        vm.stopPrank();

        assertEq(usdc.balanceOf(withdrawer), 0);
        assertEq(crab.balanceOf(depositor), 0);
        uint256 priceToNet = 1336290000;
        uint256 quantityToNet = 16840842;
        netting.netAtPrice(priceToNet, quantityToNet); // $1336.29 per crab and nets $16.84
        assertApproxEqAbs(usdc.balanceOf(withdrawer), quantityToNet, 1); // withdrawer gets that amount
        uint256 crabReceived = (quantityToNet * 1e18) / priceToNet;
        assertEq(crab.balanceOf(depositor), crabReceived); // depositor gets 0.01265755 crab
        assertEq(netting.crabBalance(withdrawer), 1e18 - crabReceived); // ensure crab remains
    }
}


================================================
FILE: packages/crab-netting/test/Netting.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "forge-std/Test.sol";
import {BaseForkSetup} from "./BaseForkSetup.t.sol";

import {console} from "forge-std/console.sol";

contract NettingTest is BaseForkSetup {
    function setUp() public override {
        BaseForkSetup.setUp(); // gives you netting, depositor, withdrawer, usdc, crab
        vm.startPrank(0x57757E3D981446D585Af0D9Ae4d7DF6D64647806);
        usdc.transfer(depositor, 400e6);
        vm.stopPrank();

        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(withdrawer, 40e18);

        vm.startPrank(depositor); // makes some USDC deposits
        usdc.approve(address(netting), 280 * 1e6);
        netting.depositUSDC(20 * 1e6);
        netting.depositUSDC(100 * 1e6);
        netting.depositUSDC(80 * 1e6);
        assertEq(netting.usdBalance(depositor), 200e6);
        vm.stopPrank();

        vm.startPrank(withdrawer); // queue some crab
        crab.approve(address(netting), 200 * 1e18);
        netting.queueCrabForWithdrawal(5 * 1e18);
        netting.queueCrabForWithdrawal(4 * 1e18);
        netting.queueCrabForWithdrawal(11 * 1e18);
        assertEq(netting.crabBalance(withdrawer), 20e18);
        vm.stopPrank();

        // withdrawer has 20 queued and depositor 200
    }

    function testNettingAmountEqlsDeposit() public {
        uint256 price = 1330e6;
        uint256 quantity = 20e6;
        netting.netAtPrice(price, quantity);
        assertEq(netting.usdBalance(depositor), 180e6);
        uint256 crabReceived = ((quantity * 1e18) / price);
        assertEq(crab.balanceOf(depositor), crabReceived);
    }

    function testNettingAmountEqlsZero() public {
        uint256 price = 1330e6;
        uint256 quantity = 0;
        netting.netAtPrice(price, quantity);
        assertEq(netting.usdBalance(depositor), 200e6);
    }

    function testNettingAmountGreaterThanBalance() public {
        uint256 price = 1330e6;
        uint256 quantity = 30e10;
        vm.expectRevert();
        netting.netAtPrice(price, quantity);
    }

    function testNetting() public {
        // TODO turn this into a fuzzing test
        assertEq(usdc.balanceOf(withdrawer), 0, "starting balance");
        assertEq(crab.balanceOf(depositor), 0, "depositor got their crab");
        uint256 price = 1330e6;
        uint256 quantity = 100e6;
        netting.netAtPrice(price, quantity); // net for 100 USD where 1 crab is 10 USD, so 10 crab
        assertApproxEqAbs(usdc.balanceOf(withdrawer), quantity, 1, "withdrawer did not get their usdc");
        assertEq(crab.balanceOf(depositor), (quantity * 1e18) / price, "depositor did not get their crab");
    }

    function testNettingWithMultipleDeposits() public {
        assertEq(usdc.balanceOf(withdrawer), 0, "withdrawer starting balance");
        assertEq(crab.balanceOf(depositor), 0, "depositor starting balance");
        uint256 price = 1330e6;
        uint256 quantity = 200e6;
        netting.netAtPrice(price, quantity); // net for 200 USD where 1 crab is 10 USD, so 20 crab
        assertApproxEqAbs(usdc.balanceOf(withdrawer), quantity, 1, "withdrawer did not get their usdc");
        assertEq(crab.balanceOf(depositor), (quantity * 1e18) / price, "depositor did not get their crab");
    }

    function testNettingWithPartialReceipt() public {
        assertEq(usdc.balanceOf(withdrawer), 0, "withdrawer starting balance");
        assertEq(crab.balanceOf(depositor), 0, "depositor starting balance");
        uint256 price = 1330e6;
        uint256 quantity = 30e6;
        netting.netAtPrice(price, quantity); // 20 from first desposit and 10 from second (partial)
        assertEq(netting.depositsQueued(), 170e6, "receipts were not updated correctly");
        netting.netAtPrice(price, 170e6);
        assertEq(crab.balanceOf(depositor), (200e6 * 1e18) / price, "depositor got their crab");
    }

    function testNettingAfterWithdraw() public {
        assertEq(usdc.balanceOf(withdrawer), 0, "withdrawer starting balance");
        assertEq(crab.balanceOf(depositor), 0, "depositor starting balance");
        vm.prank(depositor);
        uint256 withdrawQuantity = 50e6;
        netting.withdrawUSDC(withdrawQuantity, false);
        uint256 price = 1330e6;
        uint256 quantity = 200e6 - withdrawQuantity;
        netting.netAtPrice(price, quantity);
        assertEq(crab.balanceOf(depositor), (quantity * 1e18) / price, "depositor got their crab");
    }

    function testNettingAfterARun() public {
        uint256 price = 1330e6;
        uint256 quantity = 200e6;
        vm.startPrank(depositor);
        netting.withdrawUSDC(80e6, false);
        netting.depositUSDC(80e6);
        vm.stopPrank();

        vm.prank(withdrawer);
        netting.dequeueCrab(20e18 - (quantity * 1e18) / price, false);
        netting.netAtPrice(price, 200e6); // net for 100 USD where 1 crab is 10 USD, so 10 crab
        assertEq(netting.crabBalance(withdrawer), 0, "crab balance not zero after first netting");

        // queue more
        vm.startPrank(depositor);
        usdc.approve(address(netting), 200 * 1e6);
        netting.depositUSDC(20 * 1e6);
        netting.depositUSDC(100 * 1e6);
        netting.depositUSDC(80 * 1e6);
        assertEq(netting.usdBalance(depositor), 200e6, "usd balance not reflecting correctly");
        vm.stopPrank();

        console.log("no issues till here 2");
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 200 * 1e18);
        netting.queueCrabForWithdrawal(5 * 1e18);
        netting.queueCrabForWithdrawal(4 * 1e18);
        netting.queueCrabForWithdrawal(11 * 1e18);
        assertEq(netting.crabBalance(withdrawer), 20e18, "crab balance not reflecting correctly");
        vm.stopPrank();

        console.log("no issues till here 3");
        netting.netAtPrice(price, 200e6); // net for 100 USD where 1 crab is 10 USD, so 10 crab
        console.log("no issues till here 4");
        assertApproxEqAbs(usdc.balanceOf(withdrawer), 400e6, 2, "witadrawer got their usdc");
        assertEq(crab.balanceOf(depositor), (400e6 * 1e18) / price, "depositor got their crab");
    }

    function testCannotWithdrawMoreThanDeposited() public {
        vm.startPrank(depositor);
        vm.expectRevert(stdError.arithmeticError);
        netting.withdrawUSDC(210e6, false);
        vm.stopPrank();
    }

    function testSkipsUSDCBannedAddress() public {
        // remove the withdrawers crab so that we dont net them
        vm.prank(withdrawer);
        netting.dequeueCrab(20e18, false);

        // get bob the blacklisted address some crab
        address bob = address(0xAa05F7C7eb9AF63D6cC03C36c4f4Ef6c37431EE0);
        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(bob, 10e18);

        // bob now deposits
        vm.startPrank(bob);
        crab.approve(address(netting), 10e18);
        netting.queueCrabForWithdrawal(10e18);
        vm.stopPrank();

        vm.expectRevert(bytes("Blacklistable: account is blacklisted"));
        netting.netAtPrice(1330e6, 200e6);

        netting.rejectWithdraw(3);
        vm.prank(withdrawer);
        netting.queueCrabForWithdrawal(20e18);
        netting.netAtPrice(1330e6, 200e6);

        assertEq(crab.balanceOf(bob), 10e18);
        assertEq(netting.crabBalance(bob), 0);
    }
}


================================================
FILE: packages/crab-netting/test/PriceChecks.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "forge-std/Test.sol";
import {BaseForkSetup} from "./BaseForkSetup.t.sol";

contract PriceChecks is BaseForkSetup {
    uint256 crabsToWithdraw = 40e18;
    uint256 price = 1269e6; // 1335 bounds are 1267 and 1401
    uint256 totalUSDCRequired = (crabsToWithdraw * price) / 1e18;

    function setUp() public override {
        BaseForkSetup.setUp(); // gives you netting, depositor, withdrawer, usdc, crab
        vm.prank(0x57757E3D981446D585Af0D9Ae4d7DF6D64647806);
        usdc.transfer(depositor, totalUSDCRequired);

        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(withdrawer, crabsToWithdraw);

        // make multiple deposits from depositor
        vm.startPrank(depositor);
        usdc.approve(address(netting), totalUSDCRequired);
        netting.depositUSDC(totalUSDCRequired);
        vm.stopPrank();

        // queue multiple crabs from withdrawer
        vm.startPrank(withdrawer);
        crab.approve(address(netting), crabsToWithdraw);
        netting.queueCrabForWithdrawal(crabsToWithdraw);
        vm.stopPrank();
    }

    function testCrabPriceHigh() public {
        console.log("expecting a high crdab price");
        vm.expectRevert(bytes("N23"));
        netting.netAtPrice(1500e6, totalUSDCRequired / 2);
    }

    function testCrabPriceLow() public {
        vm.expectRevert(bytes("N24"));
        netting.netAtPrice(1100e6, totalUSDCRequired / 2);
    }
}


================================================
FILE: packages/crab-netting/test/QueuedBalances.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {BaseForkSetup} from "./BaseForkSetup.t.sol";

contract QueuedBalancesTest is BaseForkSetup {
    uint256 crabsToWithdraw = 40e18;
    uint256 price = 1279e6; // 1338 bounds are 1271 and 1404
    uint256 totalUSDCRequired = (crabsToWithdraw * price) / 1e18;

    function setUp() public override {
        BaseForkSetup.setUp(); // gives you netting, depositor, withdrawer, usdc, crab
        vm.startPrank(0x57757E3D981446D585Af0D9Ae4d7DF6D64647806);
        usdc.transfer(depositor, totalUSDCRequired);
        vm.stopPrank();

        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(withdrawer, crabsToWithdraw);

        // make multiple deposits from depositor
        vm.startPrank(depositor);
        usdc.approve(address(netting), totalUSDCRequired);
        netting.depositUSDC((totalUSDCRequired * 10) / 100);
        netting.depositUSDC((totalUSDCRequired * 50) / 100);
        netting.depositUSDC((totalUSDCRequired * 40) / 100);
        assertEq(netting.usdBalance(depositor), totalUSDCRequired);
        vm.stopPrank();

        // queue multiple crabs from withdrawer
        vm.startPrank(withdrawer);
        crab.approve(address(netting), crabsToWithdraw);
        netting.queueCrabForWithdrawal((crabsToWithdraw * 25) / 100);
        netting.queueCrabForWithdrawal((crabsToWithdraw * 20) / 100);
        netting.queueCrabForWithdrawal((crabsToWithdraw * 55) / 100);
        assertEq(netting.crabBalance(withdrawer), crabsToWithdraw);
        vm.stopPrank();

        netting.netAtPrice(price, totalUSDCRequired / 2); // net for 100 USD where 1 crab is 10 USD, so 10 crab
    }

    function testcrabBalanceQueued() public {
        assertEq(netting.depositsQueued(), totalUSDCRequired / 2);
    }

    function testWithdrawsQueued() public {
        assertEq(netting.withdrawsQueued(), crabsToWithdraw / 2);
    }
}


================================================
FILE: packages/crab-netting/test/SkipDeposits.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {BaseForkSetup} from "./BaseForkSetup.t.sol";

contract SkipDeposits is BaseForkSetup {
    function setUp() public override {
        BaseForkSetup.setUp(); // gives you netting, depositor, withdrawer, usdc, crab

        vm.startPrank(0x57757E3D981446D585Af0D9Ae4d7DF6D64647806);
        usdc.transfer(depositor, 20e6);
        vm.stopPrank();

        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(withdrawer, 20e18);
    }

    function testSkipDeposits() public {
        netting.setMinUSDC(1e6);
        vm.startPrank(depositor);
        usdc.approve(address(netting), 2 * 1e6);
        netting.depositUSDC(1e6);
        netting.depositUSDC(1e6);
        vm.stopPrank();
        assertEq(netting.depositsQueued(), 2e6);
        netting.setDepositsIndex(1);
        assertEq(netting.depositsQueued(), 1e6);
    }

    function testSkipWithdraws() public {
        netting.setMinCrab(1e18);
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 2 * 1e18);
        netting.queueCrabForWithdrawal(1e18);
        netting.queueCrabForWithdrawal(1e18);
        vm.stopPrank();
        assertEq(netting.withdrawsQueued(), 2e18);
        netting.setWithdrawsIndex(1);
        assertEq(netting.withdrawsQueued(), 1e18);
    }
}


================================================
FILE: packages/crab-netting/test/WithdrawAuction.t.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "forge-std/Test.sol";

import {Order, WithdrawAuctionParams} from "../src/CrabNetting.sol";
import {ICrabStrategyV2} from "../src/interfaces/ICrabStrategyV2.sol";

import {UniswapQuote} from "./utils/UniswapQuote.sol";
import {BaseForkSetup} from "./BaseForkSetup.t.sol";

import {ERC20} from "openzeppelin/token/ERC20/ERC20.sol";
import {IWETH} from "../src/interfaces/IWETH.sol";

import {SigUtils} from "./utils/SigUtils.sol";

struct TimeBalances {
    uint256 start;
    uint256 end;
}

struct Portion {
    uint256 collateral;
    uint256 debt;
}

struct Sign {
    uint8 v;
    bytes32 r;
    bytes32 s;
}

contract TestWithdrawAuction is BaseForkSetup {
    SigUtils sig;

    function setUp() public override {
        BaseForkSetup.setUp();
        sig = new SigUtils(netting.DOMAIN_SEPARATOR());

        // this is a crab whale, get some crab token from
        vm.prank(0x06CECFbac34101aE41C88EbC2450f8602b3d164b);
        crab.transfer(withdrawer, 20e18);

        // send sqth to market makers todo
        vm.startPrank(0x56178a0d5F301bAf6CF3e1Cd53d9863437345Bf9);
        sqth.transfer(mm1, 1000e18);
        sqth.transfer(mm2, 1000e18);
        vm.stopPrank();

        // deposit crab for withdrawing
        vm.startPrank(withdrawer);
        crab.approve(address(netting), 19 * 1e18);
        netting.queueCrabForWithdrawal(2 * 1e18);
        netting.queueCrabForWithdrawal(3 * 1e18);
        netting.queueCrabForWithdrawal(6 * 1e18);
        vm.stopPrank();
        // 11 crabs queued for withdrawal
    }

    function testWithdrawAuction() public {
        WithdrawAuctionParams memory params;
        // find the sqth to buy to make the trade
        params.crabToWithdraw = 10e18;
        uint256 sqthToBuy = crab.getWsqueethFromCrabAmount(params.crabToWithdraw);
        UniswapQuote quote = new UniswapQuote();
        uint256 sqthPrice = quote.getSqthPrice(1e18);
        params.clearingPrice = (sqthPrice * 1001) / 1000;

        // get the orders for that sqth
        vm.prank(mm1);
        sqth.approve(address(netting), 1000000e18);

        Order memory order0 = Order(0, mm1, 1e18, params.clearingPrice, false, block.timestamp, 2, 1, 0x00, 0x00);
        Sign memory s0;
        (s0.v, s0.r, s0.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order0));
        order0.v = s0.v;
        order0.r = s0.r;
        order0.s = s0.s;
        orders.push(order0);

        Order memory order =
            Order(0, mm1, sqthToBuy - 1e18, params.clearingPrice, false, block.timestamp, 0, 1, 0x00, 0x00);
        Sign memory s1;
        (s1.v, s1.r, s1.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order));
        order.v = s1.v;
        order.r = s1.r;
        order.s = s1.s;
        orders.push(order);
        params.orders = orders;

        // find the minUSDC to receive
        // get col and wsqth from crab amount, find the equity value in eth
        (,, uint256 collateral,) = crab.getVaultDetails();
        Portion memory p;
        p.collateral = (params.crabToWithdraw * collateral) / crab.totalSupply();
        p.debt = crab.getWsqueethFromCrabAmount(params.crabToWithdraw);
        uint256 equityInEth = p.collateral - (p.debt * params.clearingPrice) / 1e18;

        params.minUSDC = (quote.convertWETHToUSDC(equityInEth) * 999) / 1000;
        params.ethUSDFee = 500;
        // get equivalent usdc quote with slippage and send

        // call withdrawAuction on netting contract
        TimeBalances memory timeUSDC;
        TimeBalances memory timeWETH;
        timeUSDC.start = ERC20(usdc).balanceOf(withdrawer);
        timeWETH.start = IWETH(weth).balanceOf(mm1);

        netting.withdrawAuction(params);

        timeUSDC.end = ERC20(usdc).balanceOf(withdrawer);
        timeWETH.end = IWETH(weth).balanceOf(mm1);
        assertGe(timeUSDC.end - timeUSDC.start, params.minUSDC);
        assertGe(timeWETH.end - timeWETH.start, (sqthToBuy * sqthPrice) / 1e18);

        // and eth recevied for mm
        assertEq(address(netting).balance, 0);
        assertEq(ERC20(sqth).balanceOf(address(netting)), 0, "sqth balance");
        assertLe(ERC20(usdc).balanceOf(address(netting)), 1, "usdc balance");
        assertEq(ICrabStrategyV2(crab).balanceOf(address(netting)), 1e18, "crab balance");
        assertEq(netting.crabBalance(address(withdrawer)), 11e18 - params.crabToWithdraw);
        assertEq(IWETH(weth).balanceOf(address(netting)), 0, "weth balance");
    }

    function testWithdrawAuctionAfterFullWithdraw() public {
        vm.startPrank(withdrawer);
        netting.dequeueCrab(6e18, false);
        netting.queueCrabForWithdrawal(6e18);
        vm.stopPrank();

        WithdrawAuctionParams memory params;
        // find the sqth to buy to make the trade
        params.crabToWithdraw = 10e18;
        uint256 sqthToBuy = crab.getWsqueethFromCrabAmount(params.crabToWithdraw);
        UniswapQuote quote = new UniswapQuote();
        uint256 sqthPrice = quote.getSqthPrice(1e18);
        params.clearingPrice = (sqthPrice * 1001) / 1000;

        // get the orders for that sqth
        vm.prank(mm1);
        sqth.approve(address(netting), 1000000e18);

        Order memory order0 = Order(0, mm1, 1e18, params.clearingPrice, false, block.timestamp, 2, 1, 0x00, 0x00);
        Sign memory s0;
        (s0.v, s0.r, s0.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order0));
        order0.v = s0.v;
        order0.r = s0.r;
        order0.s = s0.s;
        orders.push(order0);

        Order memory order =
            Order(0, mm1, sqthToBuy - 1e18, params.clearingPrice, false, block.timestamp, 0, 1, 0x00, 0x00);
        Sign memory s1;
        (s1.v, s1.r, s1.s) = vm.sign(mm1Pk, sig.getTypedDataHash(order));
        order.v = s1.v;
        order.r = s1.r;
        order.s = s1.s;
        orders.push(order);
        params.orders = orders;

        // find the minUSDC to receive
        // get col and wsqth from crab amount, find the equity value in eth
        (,, uint256 collateral,) = crab.getVaultDetails();
        Portion memory p;
        p.collateral = (params.crabToWithdraw * collateral) / crab.totalSupply();
        p.debt = crab.getWsqueethFromCrabAmount(params.crabToWithdraw);
        uint256 equityInEth = p.collateral - (p.debt * params.clearingPrice) / 1e18;

        params.minUSDC = (quote.convertWETHToUSDC(equityInEth) * 999) / 1000;
        params.ethUSDFee = 500;
        // get equivalent usdc quote with slippage and send

        // call withdrawAuction on netting contract
        TimeBalances memory timeUSDC;
        TimeBalances memory timeWETH;
        timeUSDC.start = ERC20(usdc).balanceOf(withdrawer);
        timeWETH.start = IWETH(weth).balanceOf(mm1);

        netting.withdrawAuction(params);

        timeUSDC.end = ERC20(usdc).balanceOf(withdrawer);
        timeWETH.end = IWETH(weth).balanceOf(mm1);
        assertGe(timeUSDC.end - timeUSDC.start, params.minUSDC);
        assertGe(timeWETH.end - timeWETH.start, (sqthToBuy * sqthPrice) / 1e18);

        // and eth recevied for mm
        assertEq(address(netting).balance, 0);
        assertEq(ERC20(sqth).balanceOf(address(netting)), 0, "sqth balance");
        assertLe(ERC20(usdc).balanceOf(address(netting)), 1, "usdc balance");
        assertEq(ICrabStrategyV2(crab).balanceOf(address(netting)), 1e18, "crab balance");
        assertEq(netting.crabBalance(address(withdrawer)), 11e18 - params.crabToWithdraw);
        assertEq(IWETH(weth).balanceOf(address(netting)), 0, "weth balance");
    }

    function testSqthPriceAboveThreshold() public {
        WithdrawAuctionParams memory params;
        // find the sqth to buy to make the trade
        params.crabToWithdraw = 10e18;
        uint256 sqthToBuy = 1e6;
        UniswapQuote quote = new UniswapQuote();
        uint256 sqthPrice = quote.getSqthPrice(1e18);
        params.clearingPrice = (sqthPrice * 106) / 100;

        // get the orders for that sqth

        Order memory order = Order(0, mm1, sqthToBuy, params.clearingPrice, false, block.timestamp, 0, 1, 0x00, 0x00);
        (uint8 v, bytes32 r, bytes32 s) = vm.sign(mm1Pk, sig.getTypedDataHash(order));
        order.v = v;
        order.r = r;
        order.s = s;
        orders.push(order);
        params.orders = orders;

        params.minUSDC = 1e6;
        params.ethUSDFee = 500;
        // get equivalent usdc quote with slippage and send

        vm.expectRevert(bytes("N21"));
        netting.withdrawAuction(params);
    }
}


================================================
FILE: packages/crab-netting/test/utils/SigUtils.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import {console} from "forge-std/console.sol";

import {Order} from "../../src/CrabNetting.sol";

contract SigUtils {
    bytes32 internal DOMAIN_SEPARATOR;

    constructor(bytes32 _DOMAIN_SEPARATOR) {
        DOMAIN_SEPARATOR = _DOMAIN_SEPARATOR;
    }

    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant _CRAB_NETTING_TYPEHASH = keccak256(
        "Order(uint256 bidId,address trader,uint256 quantity,uint256 price,bool isBuying,uint256 expiry,uint256 nonce)"
    );

    // computes the hash of a permit
    function getStructHash(Order memory _order) internal pure returns (bytes32) {
        return keccak256(
            abi.encode(
                _CRAB_NETTING_TYPEHASH,
                _order.bidId,
                _order.trader,
                _order.quantity,
                _order.price,
                _order.isBuying,
                _order.expiry,
                _order.nonce
            )
        );
    }

    // computes the hash of the fully encoded EIP-712 message for the domain, which can be used to recover the signer
    function getTypedDataHash(Order memory _order) public view returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, getStructHash(_order)));
    }
}


================================================
FILE: packages/crab-netting/test/utils/UniswapQuote.sol
================================================
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import {IQuoter} from "@uniswap/v3-periphery/contracts/interfaces/IQuoter.sol";

contract UniswapQuote {
    address usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
    address sqth = 0xf1B99e3E573A1a9C5E6B2Ce818b617F0E664E86B;
    address weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    IQuoter public immutable quoter = IQuoter(0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6);

    function convertUSDToETH(uint256 _usdc) external returns (uint256) {
        // get the uniswap quoter contract code and address and initiate it
        return quoter.quoteExactInputSingle(
            (usdc),
            (weth),
            500, //3000 is 0.3
            _usdc,
            0
        );
    }

    function convertWETHToUSDC(uint256 _weth) external returns (uint256) {
        // get the uniswap quoter contract code and address and initiate it
        return quoter.quoteExactInputSingle(
            (weth),
            (usdc),
            500, //3000 is 0.3
            _weth,
            0
        );
    }

    function getSqthPrice(uint256 _quantity) external returns (uint256) {
        return quoter.quoteExactInputSingle((sqth), (weth), 3000, _quantity, 0);
    }
}


================================================
FILE: packages/frontend/.babelrc
================================================
{
  "presets": ["next/babel"]
}


================================================
FILE: packages/frontend/.eslintrc
================================================
{
  "parser": "@typescript-eslint/parser",
  "plugins": ["prettier", "@typescript-eslint", "react", "react-hooks", "simple-import-sort"],
  "extends": [
    "plugin:react/recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:prettier/recommended",
    "prettier",
    "next",
    "next/core-web-vitals"
  ],
  "env": {
    "browser": true,
    "jest": true
  },
  "parserOptions": {
    "ecmaVersion": 2020,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  },
  "rules": {
    "@typescript-eslint/no-unused-vars": [
      "warn",
      {
        "argsIgnorePattern": "^_",
        "ignoreRestSiblings": true
      }
    ],
    "@typescript-eslint/explicit-function-return-type": "off",
    "@typescript-eslint/explicit-module-boundary-types": "off",
    "@typescript-eslint/no-explicit-any": "off",
    "@typescript-eslint/member-delimiter-style": "off",
    "@typescript-eslint/no-non-null-assertion": "off",
    "@typescript-eslint/no-use-before-define": "off",
    "@typescript-eslint/no-empty-interface": "off",
    "@typescript-eslint/ban-ts-ignore": "off",
    "@typescript-eslint/ban-ts-comment": "off",
    "@typescript-eslint/camelcase": "off",
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": [
      "warn",
      {
        "additionalHooks": "(useAppEffect|useAppMemo|useAppCallback)"
      }
    ],
    "react/prop-types": "off",
    "import/order": "off",
    "sort-imports": "off",
    "simple-import-sort/exports": "error",
    "@typescript-eslint/ban-types": "off",
    "@typescript-eslint/no-empty-function": "off",
    // This rule will help with preventing to commit code that is not yet finished
    // I removed TODO as a term so that we can still use that for future work
    // and use FIXME during the development process
    "no-warning-comments": [
      "warn",
      {
        "terms": ["fixme"],
        "location": "start"
      }
    ]
  }
}


================================================
FILE: packages/frontend/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# tests
cypress/screenshots
cypress/videos
cypress/downloads


================================================
FILE: packages/frontend/.nvmrc
================================================
v18.15.0


================================================
FILE: packages/frontend/.prettierrc
================================================
{
  "semi": false,
  "trailingComma": "all",
  "singleQuote": true,
  "useTabs": false,
  "bracketSpacing": true,
  "printWidth": 120,
  "tabWidth": 2
}

================================================
FILE: packages/frontend/CONTRIBUTING.md
================================================
# Squeeth Frontend Contribution Guidelines

## Issues

- Check to see if your issue has been previously brought up, and if so add a comment to the existing issue
- Follow the issue templates for bugs or feature requests
- As much as possible, tie the issue back to the problem users are facing

## Branches

- Please create a feature / fix / documentation branch for what you’re working on
- Make a PR from your branch into the either the _master_ branch or a _staging_ branch.
  - Make PRs into _master_ for fixes and single features
  - Make PRs into the _staging_ branch for a bigger feature or set of fixes that need to be tested and then released all at once. Different features might have different staging branches. eg. "staging/strategies" and "staging/lp-nft-collateral"

## Commits

- Follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format

```
build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)

ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)

docs: Documentation only changes

feat: A new feature

fix: A bug fix

perf: A code change that improves performance

refactor: A code change that neither fixes a bug nor adds a feature

style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)

test: Adding missing tests or correcting existing tests
```

## PRs

- Each PR requires at least one review before it can be merged to master
- Follow the PR template when making PRs
- Link to the issue you are working on


================================================
FILE: packages/frontend/LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

================================================
FILE: packages/frontend/README.md
================================================
# Squeeth frontend

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

## Getting started

As the first step, install the node dependencies

```
yarn install
```

### Set up the environment

Copy the contents of `.env.example` to a new file `.env`.

`NEXT_PUBLIC_INFURA_API_KEY` - Sign up in [Infura](https://infura.io/dashboard/ethereum) and create an Ethereum project to get infura key.
`NEXT_PUBLIC_ALCHEMY_API_KEY` - Sign up at [Alchemy] (https://www.alchemy.com/) and create an Etheruem project to get an alchemy key
`NEXT_PUBLIC_BLOCKNATIVE_DAPP_ID` - Sign up in [Blocknative](https://www.blocknative.com/) and get the api key.

The backtests use Tardis and Firebase and we use Fathom for analytics. All of those fields are optional (note that the backtests will not show up without them though).

### Run the app

Once everything is set run the following command.

```
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

## Deployment

The easiest way to deploy this Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

## Contributions

We welcome contributions to the Squeeth Frontend! You can contribute by resolving existing issues, taking on feature requests, and refactoring code. Please feel free to open new issues / feature requests as well. You can find our [contribution guidelines here.](CONTRIBUTING.md) If you have questions about contributing, ping us on #dev in the [Opyn discord](http://tiny.cc/opyndiscord) :)

## Branding

Don't use the Opyn or Squeeth logo or name in anything dishonest or fraudulent. If you deploy another version of the interface, please make it clear that it is an interface to the Squeeth Protocol, but not affiliated with Opyn Inc.


================================================
FILE: packages/frontend/custom.d.ts
================================================
declare module 'fzero'


================================================
FILE: packages/frontend/cypress/TEST.md
================================================
- Setup / Preparation

  1. Test Environment
     1. Test locally
     2. Network: Ropsten
     3. Wallet: Metamask
     4. Browser: Default is Chrome
        1. Can test with firefox or chromium-based browsers as well, but will need to change the command in `package.json` ,
     5. Test websites
        1. squeeth, at `localhost:3000`
        2. uniswap lp page to lp oSQTH
  2. Test setup

     1. Make sure `synpress` and `dotenv-cli` packages are installed successfully with `package.json`
        1. if there is no `dotenv-cli` installed, run `yarn global add dotenv-cli`
     2. Put SECRET_WORDS or PRIVATE_KEY and NETWORK in `.env` file, i.e.

        ```jsx
        SECRET_WORDS = 'word1, word2, word3...'
        NETWORK_NAME = ropsten
        OR
        PRIVATE_KEY = 'your PRIVATE_KEY'
        NETWORK_NAME = ropsten
        ```

     3. If you want to test with squeeth website, set `baseUrl` in `cypress.json` as `"baseUrl": "http://localhost:3000",`
     4. if you want to test lp, set `baseUrl` in `cypress.json` as `"baseUrl": "https://squeeth-uniswap.netlify.app/#/add/ETH/0xa4222f78d23593e82Aa74742d25D06720DCa4ab7/3000",`
     5. Recommended to clear your existing position before you run the tests, otherwise it may be hard to tell if the test fails because of the existing position or the new position
     6. Run `yarn run build` and `yarn start` , dont use `yarn dev` , cuz it will have warning pop-ups hiding some DOM elements
     7. **Recommended**: if you only want to test one page or related functionalities or the functionalities you changed, plz specify the tests file you would like to include, it will run only provided spec files, i.e.

        ```jsx
        yarn run cypress -s cypress/integration/specs/01-trade-long.spec.js
        yarn run cypress -s cypress/integration/specs/02-trade-short.spec.js
        ```

        1. Tests you should run
           1. Test long: `01-trade-long.spec`
           2. Test short: `02-trade-short.spec`
           3. Test vault with short or mint position: `03-vault.spec`
           4. Test lp:
              1. buy to lp: `04-buy-lp` + `05-lp-uniswap` + `05-lp-position`
              2. mint to lp: `04-mint-lp` + `05-lp-uniswap` + `05-lp-position` + `05-lp-vault`
           5. Test manual short : `06-manual-short`
           6. Test strategy: `07-strategy`
           7. Test on position page : `08-position`
           8. Test on lp nft as collateral : `09-lp-token`

     8. **Not recommended**: Run `yarn run cypress` to start all testing, it will start with `01-trade-long.spec` by default, it will take forever to run through all the tests


================================================
FILE: packages/frontend/cypress/fixtures/example.json
================================================
{
    "name": "Using fixtures to represent data",
    "email": "hello@cypress.io",
    "body": "Fixtures are a great way to mock data for responses to routes"
}

================================================
FILE: packages/frontend/cypress/integration/pages/header.js
================================================
import Page from './page'
export default class Header extends Page {
  getConnectWalletBtn() {
    return cy.get('#connect-wallet')
  }
  getWalletAddress() {
    return cy.get('#wallet-address')
  }
}


================================================
FILE: packages/frontend/cypress/integration/pages/notifications.js
================================================
import Page from './page'
export default class Notifications extends Page {
  getTransactionSuccessNotification() {
    return cy.contains('has succeeded', { timeout: 600000 }).should(`exist`)
  }
  getTransactionSuccessNotificationLink() {
    return cy.get('.bn-notify-notification-success a', { timeout: 60000 })
  }
}


================================================
FILE: packages/frontend/cypress/integration/pages/onboard.js
================================================
import Page from './page'
export default class Onboard extends Page {
  getBrowserWalletBtn() {
    return cy.get('[alt="MetaMask"]')
  }
}


================================================
FILE: packages/frontend/cypress/integration/pages/page.js
================================================
export default class Page {
  getTitle() {
    return cy.title()
  }

  getMetamaskWalletAddress() {
    return cy.fetchMetamaskWalletAddress()
  }

  acceptMetamaskAccessRequest() {
    cy.acceptMetamaskAccess()
  }

  confirmMetamaskTransaction() {
    // Currently without supplying a gas configuration results in failing transactions
    // Possibly caused by wrong default behaviour within Synpress
    cy.confirmMetamaskTransaction({ gasFee: 30, gasLimit: 5000000 })
  }

  confirmMetamaskPermissionToSpend() {
    cy.confirmMetamaskPermissionToSpend().then((approved) => {
      expect(approved).to.be.true
    })
  }
}


================================================
FILE: packages/frontend/cypress/integration/pages/trade.js
================================================
import Page from './page'
import Header from './header'
import Onboard from './onboard'
import Notifications from './notifications.js'

export default class TradePage extends Page {
  constructor() {
    super()
    this.header = new Header()
    this.onboard = new Onboard()
    this.notifications = new Notifications()
  }

  connectBrowserWallet() {
    const connectWalletButton = this.header.getConnectWalletBtn()
    connectWalletButton.click()
    const onboardBrowserWalletButton = this.onboard.getBrowserWalletBtn()
    onboardBrowserWalletButton.click()
  }

  getLoggedInWalletAddress() {
    const addr = this.header.getWalletAddress()
    return addr.invoke('text')
  }

  waitForTransactionSuccess() {
    cy.waitUntil(
      () => {
        const txSuccessNotification = this.notifications.getTransactionSuccessNotification()
        return txSuccessNotification.should('exist')
      },
      {
        // tx takes a bit longer so extend the timeout duration, wait for 200000 ms
        timeout: 200000,
      },
    )
  }

  getTransactionUrl() {
    const txUrl = this.notifications.getTransactionSuccessNotificationLink()
    return txUrl.invoke('attr', 'href')
  }
}


================================================
FILE: packages/frontend/cypress/integration/specs/01-trade-long.spec.js
================================================
/// <reference types="cypress" />

import TradePage from '../pages/trade'
import BigNumber from 'bignumber.js'

const trade = new TradePage()

describe('Trade on trade page', () => {
  context('Before tests', () => {
    it(`Before tests`, () => {
      cy.disconnectMetamaskWalletFromAllDapps()
      cy.visit('/')
    })
  })

  context('Connect metamask wallet', () => {
    it(`should login with success`, () => {
      trade.connectBrowserWallet()
      trade.acceptMetamaskAccessRequest()
      cy.get('#wallet-address').should(`contain.text`, '0x' || '.eth')
    })
  })

  context('Trade switch checks', () => {
    it('check if there is open long card opened by default', () => {
      cy.get('#open-long-header-box').should('contain.text', 'Pay ETH to buy squeeth ERC20')
    })

    it('switch between long & short, open & close trade cards with default 0 value', () => {
      cy.get('#long-card-btn').click({ force: true })
      cy.get('#open-btn').click({ force: true })
      cy.get('#open-long-header-box').should('contain.text', 'Pay ETH to buy squeeth ERC20')
      cy.get('#open-long-eth-input').should('have.value', '0')
      cy.get('#open-long-osqth-input').should('have.value', '0')
      // to make sure the cards are function independently after switching
      cy.get('#open-long-eth-input').type('2', { delay: 200 }).should('have.value', '2')

      cy.get('#long-card-btn').click({ force: true })
      cy.get('#close-btn').click({ force: true })
      cy.get('#close-long-header-box').should('contain.text', 'Sell squeeth ERC20 to get ETH')
      cy.get('#close-long-eth-input').should('have.value', '0')
      cy.get('#close-long-osqth-input').should('have.value', '0')
      cy.get('#close-long-eth-input').type('2', { delay: 200 }).should('have.value', '2')

      cy.get('#short-card-btn').click({ force: true })
      cy.get('#open-btn').click({ force: true })
      cy.get('#open-short-header-box').should('contain.text', 'Mint & sell squeeth for premium')
      cy.get('#open-short-eth-input').should('have.value', '0')
      cy.get('#open-short-trade-details .trade-details-amount').should('contain.text', '0')
      cy.get('#open-short-eth-input').type('2', { delay: 200 }).should('have.value', '2')

      cy.get('#short-card-btn').click({ force: true })
      cy.get('#close-btn').click({ force: true })
      cy.get('#close-short-header-box').should('contain.text', 'Buy back oSQTH & close position')
      cy.get('#close-short-osqth-input').should('have.value', '0')
      cy.get('#close-short-trade-details .trade-details-amount').should('contain.text', '0')
    })
  })

  let openLongoSQTHInput
  let openLongETHInput
  let closeLongoSQTHInput
  let closeLongETHInput
  let openLongOsqthBeforeTradeBal
  let posCardBeforeLongTradeBal
  let closeLongBeforeTradeBal

  context(`open long position`, () => {
    before('jump to open long trade card', () => {
      cy.get('#long-card-btn').click({ force: true })
      cy.get('#open-btn').click({ force: true })
    })

    before(() => {
      it('eth balance should be greater than 0', () => {
        cy.get('#user-eth-wallet-balance').invoke('text').then(parseFloat).should('be.greaterThan', 0)
      })
    })

    context('open long trade condition checks', () => {
      it('eth balance from wallet should be the same as eth input box', () => {
        cy.get('#user-eth-wallet-balance').then((bal) => {
          cy.get('#open-long-eth-before-trade-balance').should('contain.text', Number(bal.text()).toFixed(4))
        })
      })

      it('it is on open long card', () => {
        cy.get('#open-long-header-box').should('contain.text', 'Pay ETH to buy squeeth ERC20')
      })
    })

    context('input checks', () => {
      // issue 277
      it.skip('inputs should be zero by default and tx button is disabled', () => {
        cy.get('#open-long-header-box').should('contain.text', 'Pay ETH to buy squeeth ERC20')
        cy.get('#open-long-eth-input').should('have.value', '0')
        cy.get('#open-long-osqth-input').should('have.value', '0')
        cy.get('#open-long-submit-tx-btn').should('be.disabled')
      })

      it('zero input amount', () => {
        cy.get('#open-long-eth-input').clear().type('0', { delay: 200 }).should('have.value', '0')
        cy.get('#open-long-osqth-input').clear().type('0', { delay: 200 }).should('have.value', '0')
      })

      it('invalid input amount', () => {
        cy.get('#open-long-eth-input').clear().type('\\', { delay: 200 }).should('have.value', '0')
        cy.get('#open-long-osqth-input').clear().type('\\', { delay: 200 }).should('have.value', '0')
      })
    })

    context('can enter an amount into eth input, check position card & input box balances', () => {
      it('can enter an amount into eth input', () => {
        cy.get('#open-long-eth-input').should('be.visible')
        cy.get('#open-long-eth-input').clear().type('1.', { force: true, delay: 200 }).should('have.value', '1.0')

        cy.get('#open-long-osqth-input').should('not.equal', '0')
        cy.get('#open-long-osqth-input').then((v) => {
          openLongoSQTHInput = new BigNumber(v.val().toString())
        })
      })

      // a-post = a + input
      it('input box oSQTH post trade balance should be the same as before-trade + input when input changes', () => {
        cy.get('#open-long-osqth-before-trade-balance').then((bal) => {
          cy.get('#open-long-osqth-post-trade-balance')
            .then((v) => Number(parseFloat(v.text()).toFixed(4)))
            .should('be.approximately', Number(openLongoSQTHInput.plus(Number(bal.text()))), 0.0002)
        })
      })

      // b-post = b + input
      it('position card oSQTH post trade balance should be the same as before-trade + input when input changes', () => {
        cy.get('#position-card-before-trade-balance').then((bal) => {
          cy.get('#position-card-post-trade-balance')
            .then((v) => Number(parseFloat(v.text()).toFixed(4)))
            .should('be.approximately', Number(openLongoSQTHInput.plus(Number(bal.text()))), 0.0002)
        })
      })

      // a = b
      it('position card oSQTH before trade balance should be the same as input box before oSQTH trade balance', () => {
        cy.get('#open-long-osqth-before-trade-balance').then((bal) => {
          cy.get('#position-card-before-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', new BigNumber(bal.text().toString()).toFixed(4))
        })
      })

      // a + input = b + input != 0
      it('position card oSQTH post trade balance should be the same as input box post oSQTH trade balance and not equal 0', () => {
        cy.get('#open-long-osqth-post-trade-balance').then((bal) => {
          cy.get('#position-card-post-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', new BigNumber(bal.text().toString()).toFixed(4))
        })
        cy.get('#open-long-osqth-post-trade-balance').invoke('text').then(parseFloat).should('not.equal', 0)
        cy.get('#position-card-post-trade-balance').invoke('text').then(parseFloat).should('not.equal', 0)
      })

      // eth-post = eth-before - openLongETHInput
      it('input box eth post trade balance should be the same as before-trade - input when input changes', () => {
        cy.get('#open-long-eth-before-trade-balance').then((bal) => {
          cy.get('#open-long-eth-post-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', (Number(bal.text()) - 1).toFixed(4))
        })
      })
    })

    context('can enter an amount into osqth input, check position card & input box balances', () => {
      it('can enter an amount into osqth input', () => {
        cy.get('#open-long-osqth-input').should('be.visible')
        cy.get('#open-long-osqth-input').clear().type('1.', { force: true, delay: 200 }).should('have.value', '1.0')
        openLongoSQTHInput = new BigNumber(1)
      })

      // a-post = a + input
      it('input box oSQTH post trade balance should be the same as before-trade + input when input changes', () => {
        cy.get('#open-long-osqth-before-trade-balance').then((bal) => {
          cy.get('#open-long-osqth-post-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', openLongoSQTHInput.plus(Number(bal.text())).toFixed(4))
        })
      })

      // b-post = b + input
      it('position card oSQTH post trade balance should be the same as before-trade + input when input changes', () => {
        cy.get('#position-card-before-trade-balance').then((bal) => {
          cy.get('#position-card-post-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', openLongoSQTHInput.plus(Number(bal.text())).toFixed(4))
        })
      })

      // a = b
      it('position card oSQTH before trade balance should be the same as input box before oSQTH trade balance', () => {
        cy.get('#open-long-osqth-before-trade-balance').then((bal) => {
          cy.get('#position-card-before-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', new BigNumber(bal.text().toString()).toFixed(4))
        })
      })

      // a + input = b + input != 0
      it('position card oSQTH post trade balance should be the same as input box post oSQTH trade balance and not equal 0', () => {
        cy.get('#open-long-eth-input').then((bal) => {
          openLongETHInput = new BigNumber(bal.text().toString())
        })
        cy.get('#open-long-osqth-post-trade-balance').then((bal) => {
          cy.get('#position-card-post-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', new BigNumber(bal.text().toString()).toFixed(4))
        })
        cy.get('#open-long-osqth-post-trade-balance').invoke('text').then(parseFloat).should('not.equal', 0)
        cy.get('#position-card-post-trade-balance').invoke('text').then(parseFloat).should('not.equal', 0)
      })

      // eth-post = eth-before - openLongETHInput
      // issue #280
      it.skip('input box eth post trade balance should be the same as before-trade - input when input changes', () => {
        cy.get('#open-long-eth-before-trade-balance').then((bal) => {
          cy.get('#open-long-eth-post-trade-balance')
            .wait(15000)
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', new BigNumber(bal.text()).minus(openLongETHInput).toFixed(4))
        })
      })
    })

    context('can open long position', () => {
      it('can open long position for osqth, and tx succeeds', () => {
        cy.get('#open-long-eth-input').clear().type('1.', { force: true, delay: 200 }).should('have.value', '1.0')
        cy.get('#open-long-osqth-input').should('not.equal', '0')
        cy.get('#open-long-osqth-input').then((v) => {
          openLongoSQTHInput = new BigNumber(v.val().toString())
        })

        cy.get('#open-long-submit-tx-btn').should('contain.text', 'Buy')
        cy.get('#open-long-submit-tx-btn').should('not.be.disabled')

        cy.get('#open-long-osqth-before-trade-balance').then((val) => {
          openLongOsqthBeforeTradeBal = new BigNumber(val.text())
        })

        cy.get('#position-card-before-trade-balance').then((val) => {
          posCardBeforeLongTradeBal = new BigNumber(val.text())
        })

        cy.get('#open-long-submit-tx-btn').click({ force: true })
        trade.confirmMetamaskTransaction()
        trade.waitForTransactionSuccess()
      })

      it('there is open loong tx finished card after tx succeeds with correct closing value', () => {
        cy.get('#open-long-card').should('contain.text', 'Close').should('contain.text', 'Bought')
        cy.get('#conf-msg').should('contain.text', openLongoSQTHInput.toFixed(6))
        cy.get('#open-long-close-btn').click({ force: true })
      })

      it('return to open long card successfully with all values update to 0', () => {
        cy.get('#open-long-header-box').should('contain.text', 'Pay ETH to buy squeeth ERC20')
        cy.get('#open-long-eth-input').should('have.value', '0')
        cy.get('#open-long-osqth-input').should('have.value', '0')
        cy.get('#open-long-submit-tx-btn').should('be.disabled')
      })

      it('position card should update to new osqth balance', () => {
        // wait for 20 sec to update positon
        cy.get('#position-card-before-trade-balance')
          .wait(30000)
          .then((v) => Number(parseFloat(v.text()).toFixed(4)))
          .should('be.approximately', Number(posCardBeforeLongTradeBal.plus(openLongoSQTHInput)), 0.0002)
      })

      it('input box before trade update to new osqth balance', () => {
        cy.get('#open-long-osqth-before-trade-balance')
          .then((v) => Number(parseFloat(v.text()).toFixed(4)))
          .should('be.approximately', Number(openLongOsqthBeforeTradeBal.plus(openLongoSQTHInput)), 0.0002)
      })

      it('position card update to the same value as input box before trade balance and not equal 0', () => {
        cy.get('#open-long-osqth-before-trade-balance').then((bal) => {
          cy.get('#position-card-before-trade-balance')
            .then((v) => Number(v.text()).toFixed(4))
            .should('eq', new BigNumber(bal.text().toString()).toFixed(4))
        })
        cy.get('#open-long-osqth-before-trade-balance').invoke('text').then(parseFloat).should('not.equal', 0)
        cy.get('#position-card-before-trade-balance').invoke('text').then(parseFloat).should('not.equal', 0)
      })

      // issue #282
      it.skip('unrealized PnL display', () => {
        cy.get('#unrealized-pnl-value').should('not.contain.text', 'Loading').should('not.contain.text', '--')
      })

      it('should have "close your long position to open a long" error in short oSQTH input when user have short oSQTH', () => {
        cy.get('#short-card-btn').click({ force: true })
        cy.get('#open-btn').click({ force: true })
        cy.get('#open-short-eth-input-box').should('contain.text', 'Close your long position to open a short')
      })
    })
  })

  context(`close long position`, () => {
    before(() => {
      cy.get('#long-card-btn').click({ force: true })
      cy.get('#close-btn').click({ force: true })
    })

    context('close long trade condition checks', () => {
      it('it is on close long card', () => {
        cy.get('#close-long-header-box').should('contain.text', 'Sell squeeth ERC20 to get ETH')
      })

      it('inputs should be zero by default and tx button is disabled', () => {
        cy.get('#close-long-eth-input').should('have.value', '0')
        cy.get('#close-long-osqth-input').should('have.value', '0')
        cy.get('#close-long-submit-tx-btn').should('be.disabled')
      })

      it('should have oSQTH long balance in position card', () => {
        cy.get('#position-card-before-trade-balance').invoke('text').then(parseFloat).should('not.equal', 0)
      })
    })

    context('input checks', () => {
      it('zero input amount', () => {
        cy.get('#close-long-eth-input').clear().type('0', { delay: 200 }).should('have.value', '0')
        cy.get('#close-long-osqth-input').clear().type('0', { delay: 200 }).should('have.value', '0')
      })

      it('invalid input amount', () => {
        cy.get('#close-long-eth-input').clear().type('\\', { delay: 200 }).should('have.value', '0')
        cy.get('#close-long-osqth-input').clear().type('\\', { delay: 200 }).should('have.value', '0')
      })

      it('submit tx button should be disabled when input is zero', () => {
        cy.get('#close-long-osqth-input').clear().type('0', { delay: 200 }).should('have.value', '0')
        cy.get('#close-long-submit-tx-btn').should('be.disabled')
      })
    })

    //1 input status check -> trade status check -> send tx -> post trade status check
    context('can close long with manual osqth inputs and tx succeeds', () => {
      it('can enter an amount into osqth input', () => {
        cy.get('#close-long-osqth-input').clear().type('0.1', { force: true, delay: 800 }).should('have.value', '0.1')
        cy.get('#close-long-eth-input').should('not.equal', '0')
        cy.get('#close-long-submit-tx-btn').should('not.be.disabled')
      })

      it('position card before trade balance should be the same as input box before trade balance', () => {
        cy.get('#position-card-before-trade-balance').then((val) => {
          cy.get('#close-long-osqth-before-trade-balance')
            .then((v) => Number(v.text()).toFixed(6))
            .should('eq', Number(val.text()).toFixed(6))
        })
      })

      it('position card post trade balance should become before-trade - input when input changes', () => {
        cy.get('#position-card-before-trade-balance').then((val) => {
          cy.get('#position-card-post-trade-balance')
            .then((v) => Number(parseFloat(v.text()).toFixed(6)))
            .should('be.approximately', Number(val.text()) - 0.1, 0.000002)
        })
      })

      it('input box before trade balance should become before-trade - input when input changes', () => {
        cy.get('#close-long-osqth-before-trade-balance').then((val) => {
          cy.get('#close-long-osqth-post-trade-balance')
            .then((v) => Number(parseFloat(v.text()).toFixed(6)))
            .should('be.approximately', Number(val.text()) - 0.1, 0.000002)
        })
      })

      it('send tx', () => {
        cy.get('#close-long-osqth-before-trade-balance').then((bal) => {
          closeLongBeforeTradeBal = bal.text()
        })

        cy.get('#position-card-before-trade-balance').then((bal) => {
          posCardBeforeLongTradeBal = bal.text()
        })

        cy.get('#close-long-submit-tx-btn').then((btn) => {
          if (btn.text().includes('Approve oSQTH')) {
            cy.get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskPermissionToSpend()
            trade.waitForTransactionSuccess()
            cy.wait(15000).get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskTransaction()
            trade.waitForTransactionSuccess()
          } else if (btn.text().includes('Sell')) {
            cy.get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskTransaction()
            trade.waitForTransactionSuccess()
          }
        })
      })

      it('there is close long tx finished card after tx succeeds with correct closing value', () => {
        cy.get('#close-long-card').should('contain.text', 'Close').should('contain.text', 'Sold')
        cy.get('#conf-msg').should('contain.text', (0.1).toFixed(6))
        cy.get('#close-long-close-btn').click({ force: true })
      })

      it('new position card value should be the same as prev position card value', () => {
        // wait for 30 sec to update positon
        cy.get('#position-card-before-trade-balance')
          .wait(30000)
          .then((v) => Number(parseFloat(v.text()).toFixed(6)))
          .should('be.approximately', Number(posCardBeforeLongTradeBal) - 0.1, 0.000002)
      })

      // issue #280
      it.skip('new input box before trade value should be the same as the one before trade', () => {
        cy.get('#close-long-osqth-before-trade-balance')
          .then((v) => Number(parseFloat(v.text()).toFixed(6)))
          .should('be.approximately', Number(closeLongBeforeTradeBal) - 0.1, 0.000002)
      })

      it('return to close long card successfully', () => {
        cy.get('#close-long-header-box').should('contain.text', 'Sell squeeth ERC20 to get ETH')
        cy.get('#close-long-eth-input').should('have.value', '0')
        cy.get('#close-long-osqth-input').should('have.value', '0')
        cy.get('#close-long-submit-tx-btn').should('be.disabled')
      })

      it('should have "close your long position" first error in short oSQTH input when user have long oSQTH', () => {
        cy.get('#short-card-btn').click({ force: true })
        cy.get('#open-btn').click({ force: true })
        cy.get('#open-short-eth-input-box').should('contain.text', 'Close your long position to open a short')
      })

      // issue #282
      it.skip('there should be unrealized PnL value', () => {
        cy.get('#unrealized-pnl-value').should('not.contain.text', 'Loading').should('not.contain.text', '--')
      })

      it('there should be realized PnL value', () => {
        cy.get('#realized-pnl-value').should('not.contain.text', 'Loading').should('not.contain.text', '--')
      })
    })

    context('close long with manual eth inputs and tx succeeds', () => {
      before(() => {
        cy.get('#long-card-btn').click({ force: true })
        cy.get('#close-btn').click({ force: true })
      })
      it('can enter an amount into eth input and tx succeeds', () => {
        cy.get('#close-long-eth-input').clear().type('0.1', { force: true, delay: 800 }).should('have.value', '0.1')
        cy.get('#close-long-osqth-input').should('not.equal', '0')
        cy.get('#close-long-submit-tx-btn').should('not.be.disabled')

        // wait for 15 secs for trade amount to load
        cy.get('#close-long-osqth-input')
          .wait(15000)
          .then((v) => {
            closeLongoSQTHInput = new BigNumber(v.val().toString())
          })
      })

      it('position card before trade balance should be the same as input box before trade balance', () => {
        cy.get('#position-card-before-trade-balance').then((val) => {
          cy.get('#close-long-osqth-before-trade-balance')
            .then((v) => Number(v.text()).toFixed(6))
            .should('eq', Number(val.text()).toFixed(6))
        })
      })

      it('position card post trade balance should become before-trade - input when input changes', () => {
        cy.get('#position-card-before-trade-balance').then((val) => {
          cy.get('#position-card-post-trade-balance')
            .then((v) => Number(parseFloat(v.text()).toFixed(6)))
            .should('be.approximately', Number(new BigNumber(val.text()).minus(closeLongoSQTHInput)), 0.0002)
        })
      })

      it('input box before trade balance should become before-trade - input when input changes', () => {
        cy.get('#close-long-osqth-before-trade-balance').then((val) => {
          cy.get('#close-long-osqth-post-trade-balance')
            .then((v) => Number(parseFloat(v.text()).toFixed(6)))
            .should('be.approximately', Number(new BigNumber(val.text()).minus(closeLongoSQTHInput)), 0.0002)
        })
      })

      it('send tx', () => {
        cy.get('#close-long-osqth-before-trade-balance').then((bal) => {
          closeLongBeforeTradeBal = new BigNumber(bal.text().toString())
        })

        cy.get('#position-card-before-trade-balance').then((bal) => {
          posCardBeforeLongTradeBal = new BigNumber(bal.text().toString())
        })
        cy.get('#close-long-submit-tx-btn').then((btn) => {
          if (btn.text().includes('Approve oSQTH')) {
            cy.get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskPermissionToSpend()
            trade.waitForTransactionSuccess()
            cy.wait(15000).get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskTransaction()
            trade.waitForTransactionSuccess()
          } else if (btn.text().includes('Sell')) {
            cy.get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskTransaction()
            trade.waitForTransactionSuccess()
          }
        })
      })

      it('there is close long tx finished card after tx succeeds with correct closing value', () => {
        cy.get('#close-long-card').should('contain.text', 'Close').should('contain.text', 'Sold')
        cy.get('#conf-msg').should('contain.text', closeLongoSQTHInput.toFixed(6))
        cy.get('#close-long-close-btn').click({ force: true })
      })

      it('new position card value should be the same as prev position card value', () => {
        // wait for 30 sec to update positon
        cy.get('#position-card-before-trade-balance')
          .wait(30000)
          .then((v) => Number(parseFloat(v.text()).toFixed(6)))
          .should('be.approximately', Number(posCardBeforeLongTradeBal.minus(closeLongoSQTHInput)), 0.000002)
      })

      it.skip('new input box before trade value should be the same as the one before trade', () => {
        // issue #280
        cy.get('#close-long-osqth-before-trade-balance')
          .then((v) => Number(parseFloat(v.text()).toFixed(6)))
          .should('be.approximately', Number(closeLongBeforeTradeBal.minus(closeLongoSQTHInput)), 0.000002)
      })

      it('return to close long card successfully', () => {
        cy.get('#close-long-header-box').should('contain.text', 'Sell squeeth ERC20 to get ETH')
        cy.get('#close-long-eth-input').should('have.value', '0')
        cy.get('#close-long-osqth-input').should('have.value', '0')
        cy.get('#close-long-submit-tx-btn').should('be.disabled')
      })

      it('should have "close your long position" first error in short oSQTH input when user have long oSQTH', () => {
        cy.get('#short-card-btn').click({ force: true })
        cy.get('#open-btn').click({ force: true })
        cy.get('#open-short-eth-input-box').should('contain.text', 'Close your long position to open a short')
      })

      // issue #282
      it.skip('there should be unrealized PnL value', () => {
        cy.get('#unrealized-pnl-value').should('not.contain.text', 'Loading').should('not.contain.text', '--')
      })

      it('there should be realized PnL value', () => {
        cy.get('#realized-pnl-value').should('not.contain.text', 'Loading').should('not.contain.text', '--')
      })
    })

    context('close long position with max button and tx succeeds', () => {
      before(() => {
        cy.get('#long-card-btn').click({ force: true })
        cy.get('#close-btn').click({ force: true })
      })
      // issue #280, sometimes get incorrect amount to close due to loading issue
      it('can use max button for close long osqth input and tx succeeds', () => {
        cy.get('#close-long-osqth-input-action').click()
        cy.get('#close-long-osqth-input').should('not.equal', '0')
        cy.get('#close-long-eth-input').should('not.equal', '0')
        cy.get('#close-long-submit-tx-btn').should('not.be.disabled')

        cy.get('#close-long-osqth-input')
          .wait(15000)
          .then((v) => {
            closeLongoSQTHInput = new BigNumber(v.val().toString())
          })
      })

      it('send tx', () => {
        cy.get('#close-long-submit-tx-btn').then((btn) => {
          if (btn.text().includes('Approve oSQTH')) {
            cy.get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskPermissionToSpend()
            trade.waitForTransactionSuccess()
            cy.wait(15000).get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskTransaction()
            trade.waitForTransactionSuccess()
          } else if (btn.text().includes('Sell')) {
            cy.get('#close-long-submit-tx-btn').click({ force: true })
            trade.confirmMetamaskTransaction()
            trade.waitForTransactionSuccess()
          }
        })
      })

      // issue #286
      it.skip('there is close long tx finished card after tx succeeds with correct closing value', () => {
        cy.get('#close-long-card').should('contain.text', 'Close').should('contain.text', 'Sold')
        cy.get('#conf-msg').should('contain.text', closeLongoSQTHInput.toFixed(6))
        cy.get('#close-long-close-btn').click({ force: true })
      })

      it('return to close long card successfully with all values update to 0', () => {
        cy.get('#close-long-close-btn').click({ force: true })
        cy.get('#close-long-header-box').should('contain.text', 'Sell squeeth ERC20 to get ETH')
        cy.get('#close-long-eth-input').should('have.value', '0')
        cy.get('#close-long-osqth-input').should('have.value', '0')
        cy.get('#close-long-submit-tx-btn').should('be.disabled')
      })

      it('position card should update to 0', () => {
        cy.get('#position-card-before-trade-balance').should('contain.text', '0')
      })

      // issue 280
      it.skip('input box before trade balance should update to 0', () => {
        cy.get('#close-long-osqth-before-trade-balance').should('contain.text', '0')
      })

      it('unrealized PnL should be --', () => {
        cy.get('#unrealized-pnl-value').should('contain.text', '--')
      })

      it('realized PnL should be --', () => {
        cy.get('#realized-pnl-value').should('contain.text', '--')
      })
    })
  })
})


================================================
FILE: packages/frontend/cypress/integration/specs/02-trade-short.spec.js
================================================
/// <reference types="cypress" />
import TradePage from '../pages/trade'
import BigNumber from 'bignumber.js'
import { MIN_COLLATERAL_AMOUNT } from '../../../src/constants/index'

const trade = new TradePage()

describe('Trade on trade page', () => {
  context('Before tests', () => {
    it(`Before tests`, () => {
      cy.disconnectMetamaskWalletFromAllDapps()
      cy.visit('/')
    })
  })

  context('Connect metamask wallet', () => {
    it(`should login with success`, () => {
      trade.connectBrowserWallet()
      trade.acceptMetamaskAccessRequest()

      cy.get('#wallet-address').should(`contain.text`, '0x' || '.eth')
    })
  })

  let openShortOsqthInput
  let openShortOsqthBeforeTradeBal
  let posCardBeforeShortTradeBal

  context(`open short position`, () => {
    before('jump to open short trade card', () => {
      cy.get('#short-card-btn').click({ force: true })
      cy.get('#open-btn').click({ force: true })
    })

    before(() => {
      it('eth balance should be greater than minimum collateral amount', () => {
        cy.get('#user-eth-wallet-balance').invoke('text').then(parseFloat).should('be.at.least', MIN_COLLATERAL_AMOUNT)
      })
    })

    context('open short trade condition checks', () => {
      it('eth balance from wallet should be the same as balance of eth input box', () => {
        cy.get('#user-eth-wallet-balance').then((bal) => {
          cy.get('#open-short-eth-before-trade-balance').should('contain.text', Number(bal.text()))
        })
      })

      it('it is on open short card', () => {
        cy.get('#open-short-header-box').should('contain.text', 'Mint & sell squeeth for premium')
      })
    })

    context('input checks', () => {
      it('inputs should be zero by default and tx button is disabled', () => {
        cy.get('#open-short-eth-input').should('have.value', '0')
        cy.get('#open-short-trade-details .trade-details-amount').should('contain.text', '0')
        cy.get('#open-short-submit-tx-btn').should('be.disabled')
      })

      it('open short input should be more than minimum collateral amount', () => {
        cy.get('#open-short-eth-input').clear().type('6.9', { delay: 200, force: true }).should('have.value', '6.90')
        cy.get('#open-short-eth-input').invoke('val').then(parseFloat).should('be.at.least', MIN_COLLATERAL_AMOUNT)
      })

      it('zero input amount', () => {
        cy.get('#trade-card').parent().scrollTo('top')
        cy.get('#open-short-eth-input').should('be.visibl
Download .txt
gitextract_ry7xy3jk/

├── .circleci/
│   └── config.yml
├── .editorconfig
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   └── pull_request_template.md
├── .gitignore
├── .gitmodules
├── .gitpod.yml
├── .husky/
│   └── pre-commit
├── .huskyrc
├── .lintstagedrc
├── README.md
├── package.json
└── packages/
    ├── crab-netting/
    │   ├── LICENSE_BUSL
    │   ├── foundry.toml
    │   ├── remappings.txt
    │   ├── script/
    │   │   └── Counter.s.sol
    │   ├── src/
    │   │   ├── CrabNetting.sol
    │   │   └── interfaces/
    │   │       ├── IController.sol
    │   │       ├── ICrabStrategyV2.sol
    │   │       ├── IOracle.sol
    │   │       └── IWETH.sol
    │   └── test/
    │       ├── BaseForkSetup.t.sol
    │       ├── BaseSetup.t.sol
    │       ├── Deposit.t.sol
    │       ├── DepositAuction.t.sol
    │       ├── ForkTestNetAtPrice.sol
    │       ├── Netting.t.sol
    │       ├── PriceChecks.sol
    │       ├── QueuedBalances.t.sol
    │       ├── SkipDeposits.t.sol
    │       ├── WithdrawAuction.t.sol
    │       └── utils/
    │           ├── SigUtils.sol
    │           └── UniswapQuote.sol
    ├── frontend/
    │   ├── .babelrc
    │   ├── .eslintrc
    │   ├── .gitignore
    │   ├── .nvmrc
    │   ├── .prettierrc
    │   ├── CONTRIBUTING.md
    │   ├── LICENSE
    │   ├── README.md
    │   ├── custom.d.ts
    │   ├── cypress/
    │   │   ├── TEST.md
    │   │   ├── fixtures/
    │   │   │   └── example.json
    │   │   ├── integration/
    │   │   │   ├── pages/
    │   │   │   │   ├── header.js
    │   │   │   │   ├── notifications.js
    │   │   │   │   ├── onboard.js
    │   │   │   │   ├── page.js
    │   │   │   │   └── trade.js
    │   │   │   └── specs/
    │   │   │       ├── 01-trade-long.spec.js
    │   │   │       ├── 02-trade-short.spec.js
    │   │   │       └── 06-manual-short.spec.js
    │   │   ├── plugins/
    │   │   │   └── index.js
    │   │   └── support/
    │   │       ├── commands.js
    │   │       └── index.js
    │   ├── cypress.json
    │   ├── env.example
    │   ├── jest.config.js
    │   ├── jest.setup.ts
    │   ├── middleware.ts
    │   ├── next-env.d.ts
    │   ├── next.config.js
    │   ├── package.json
    │   ├── pages/
    │   │   ├── _app.tsx
    │   │   ├── _document.tsx
    │   │   ├── api/
    │   │   │   ├── __tests__/
    │   │   │   │   └── isValidAddress.test.ts
    │   │   │   ├── auction/
    │   │   │   │   └── lastHedgeAuction.ts
    │   │   │   ├── charts/
    │   │   │   │   └── longchart.ts
    │   │   │   ├── currentsqueethvol.ts
    │   │   │   ├── historicalprice.ts
    │   │   │   ├── isValidAddress.ts
    │   │   │   ├── pnl.tsx
    │   │   │   ├── strikes.ts
    │   │   │   ├── tvl.ts
    │   │   │   ├── twelvedata.ts
    │   │   │   └── updateBlockedAddress.ts
    │   │   ├── blocked.tsx
    │   │   ├── index.tsx
    │   │   ├── lp.tsx
    │   │   ├── mint.tsx
    │   │   ├── opt-out.tsx
    │   │   ├── pos-merge.tsx
    │   │   ├── positions.tsx
    │   │   ├── privacy-policy.tsx
    │   │   ├── share-pnl/
    │   │   │   └── [...slug].tsx
    │   │   ├── squeeth.tsx
    │   │   ├── strategies/
    │   │   │   ├── bull.tsx
    │   │   │   ├── crab.tsx
    │   │   │   └── index.tsx
    │   │   ├── terms-of-service-faq.tsx
    │   │   ├── terms-of-service.tsx
    │   │   └── vault/
    │   │       └── [vid].tsx
    │   ├── sentry.client.config.ts
    │   ├── sentry.server.config.ts
    │   ├── src/
    │   │   ├── abis/
    │   │   │   ├── NFTpositionmanager.json
    │   │   │   ├── auctionBull.json
    │   │   │   ├── bullEmergencyWithdraw.json
    │   │   │   ├── bullShutdownEmergencyWithdraw.json
    │   │   │   ├── bullStrategy.json
    │   │   │   ├── controller.json
    │   │   │   ├── controllerHelper.json
    │   │   │   ├── crabHelper.json
    │   │   │   ├── crabMigration.json
    │   │   │   ├── crabNetting.json
    │   │   │   ├── crabStrategy.json
    │   │   │   ├── crabStrategyV2.json
    │   │   │   ├── erc20.json
    │   │   │   ├── erc721.json
    │   │   │   ├── eulerEToken.json
    │   │   │   ├── eulerSimpleLens.json
    │   │   │   ├── flashBullStrategy.json
    │   │   │   ├── oracle.json
    │   │   │   ├── quoter.json
    │   │   │   ├── shortHelper.json
    │   │   │   ├── squeeth.json
    │   │   │   ├── swapRouter.json
    │   │   │   ├── swapRouter2.json
    │   │   │   ├── uniswapPool.json
    │   │   │   ├── vaultManager.json
    │   │   │   └── weth.json
    │   │   ├── components/
    │   │   │   ├── Alert.tsx
    │   │   │   ├── Alerts/
    │   │   │   │   ├── ShutdownAlert.tsx
    │   │   │   │   └── ZenBullAlert.tsx
    │   │   │   ├── Announcement.tsx
    │   │   │   ├── Button/
    │   │   │   │   ├── WalletButton.tsx
    │   │   │   │   └── index.tsx
    │   │   │   ├── Charts/
    │   │   │   │   ├── BullStrategyPerformanceChart.tsx
    │   │   │   │   ├── CrabStrategyChart.tsx
    │   │   │   │   ├── CrabStrategyV2PnLChart.tsx
    │   │   │   │   ├── FundingChart.tsx
    │   │   │   │   ├── LPBuyChart.tsx
    │   │   │   │   ├── LPMintChart.tsx
    │   │   │   │   ├── LongChart.tsx
    │   │   │   │   ├── LongChartPayoff.tsx
    │   │   │   │   ├── LongSqueethPayoff.tsx
    │   │   │   │   ├── ShortChart.tsx
    │   │   │   │   ├── ShortFundingChart.tsx
    │   │   │   │   ├── ShortSqueethPayoff.tsx
    │   │   │   │   └── VaultChart.tsx
    │   │   │   ├── Checkbox.tsx
    │   │   │   ├── CollatRange.tsx
    │   │   │   ├── CollatRatioSlider.tsx
    │   │   │   ├── CustomProgress.tsx
    │   │   │   ├── CustomSlider.tsx
    │   │   │   ├── CustomSwitch.tsx
    │   │   │   ├── DefaultSiteSeo/
    │   │   │   │   └── DefaultSiteSeo.tsx
    │   │   │   ├── Emoji.tsx
    │   │   │   ├── HidePnLText.tsx
    │   │   │   ├── IV.tsx
    │   │   │   ├── Input/
    │   │   │   │   ├── NumberInput.tsx
    │   │   │   │   └── PrimaryInput.tsx
    │   │   │   ├── InputNew/
    │   │   │   │   ├── InputBase.tsx
    │   │   │   │   ├── InputNumber.tsx
    │   │   │   │   ├── InputToken.tsx
    │   │   │   │   └── index.tsx
    │   │   │   ├── LabelWithTooltip.test.tsx
    │   │   │   ├── LabelWithTooltip.tsx
    │   │   │   ├── LandingPage/
    │   │   │   │   ├── DesktopLandingPage.tsx
    │   │   │   │   └── MobileLandingPage.tsx
    │   │   │   ├── LegendBox.tsx
    │   │   │   ├── LinkWrapper.tsx
    │   │   │   ├── Lp/
    │   │   │   │   ├── GetSqueeth.tsx
    │   │   │   │   ├── LPPosition.tsx
    │   │   │   │   ├── LPTable.tsx
    │   │   │   │   ├── ObtainSqueeth.tsx
    │   │   │   │   ├── ProvideLiquidity.tsx
    │   │   │   │   ├── SelectMethod.tsx
    │   │   │   │   ├── SqueethInfo.tsx
    │   │   │   │   └── Stepper.tsx
    │   │   │   ├── MarkdownPage.tsx
    │   │   │   ├── Metric.tsx
    │   │   │   ├── Modal/
    │   │   │   │   ├── MobileModal.tsx
    │   │   │   │   ├── Modal.tsx
    │   │   │   │   └── UniswapIframe.tsx
    │   │   │   ├── Nav.tsx
    │   │   │   ├── PnLTooltip.tsx
    │   │   │   ├── Popup.tsx
    │   │   │   ├── PositionCard.tsx
    │   │   │   ├── RestrictionInfo.tsx
    │   │   │   ├── SettingsMenu.tsx
    │   │   │   ├── SharePnl/
    │   │   │   │   └── PnlChart.tsx
    │   │   │   ├── SqueethCard.tsx
    │   │   │   ├── StepperBox.tsx
    │   │   │   ├── Strategies/
    │   │   │   │   ├── Bull/
    │   │   │   │   │   ├── About/
    │   │   │   │   │   │   ├── AdvancedMetrics.tsx
    │   │   │   │   │   │   ├── NextRebalanceTimer.tsx
    │   │   │   │   │   │   ├── ProfitabilityChart.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── BullTrade/
    │   │   │   │   │   │   ├── Deposit.tsx
    │   │   │   │   │   │   ├── EmergencyWithdraw.tsx
    │   │   │   │   │   │   ├── ShutdownEmergencyWithdraw.tsx
    │   │   │   │   │   │   ├── Withdraw.tsx
    │   │   │   │   │   │   ├── index.tsx
    │   │   │   │   │   │   └── styles.ts
    │   │   │   │   │   ├── MyPosition/
    │   │   │   │   │   │   ├── PnL.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── StrategyPerformance.tsx
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── Crab/
    │   │   │   │   │   ├── About/
    │   │   │   │   │   │   ├── AdvancedMetrics.tsx
    │   │   │   │   │   │   ├── NextRebalanceTimer.tsx
    │   │   │   │   │   │   ├── ProfitabilityChart.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── CapDetails.tsx
    │   │   │   │   │   ├── CapDetailsV2.tsx
    │   │   │   │   │   ├── CrabMetricsV2.tsx
    │   │   │   │   │   ├── CrabMigrate.tsx
    │   │   │   │   │   ├── CrabPosition.tsx
    │   │   │   │   │   ├── CrabPositionV2.tsx
    │   │   │   │   │   ├── CrabTrade.tsx
    │   │   │   │   │   ├── CrabTradeV2/
    │   │   │   │   │   │   ├── Deposit.tsx
    │   │   │   │   │   │   ├── Withdraw.tsx
    │   │   │   │   │   │   ├── index.tsx
    │   │   │   │   │   │   ├── styles.ts
    │   │   │   │   │   │   └── types.ts
    │   │   │   │   │   ├── MigrationNotice.tsx
    │   │   │   │   │   ├── MyPosition/
    │   │   │   │   │   │   ├── CrabPosition.tsx
    │   │   │   │   │   │   ├── PnL.tsx
    │   │   │   │   │   │   ├── QueuedPosition.tsx
    │   │   │   │   │   │   └── index.tsx
    │   │   │   │   │   ├── StrategyChartsV2.tsx
    │   │   │   │   │   ├── StrategyHistory.tsx
    │   │   │   │   │   ├── StrategyHistoryV2.tsx
    │   │   │   │   │   ├── StrategyInfoV1.tsx
    │   │   │   │   │   ├── StrategyInfoV2.tsx
    │   │   │   │   │   ├── StrategyPerformance.tsx
    │   │   │   │   │   └── util.ts
    │   │   │   │   ├── SharePnl.tsx
    │   │   │   │   ├── StrategyInfoItem.tsx
    │   │   │   │   └── styles.ts
    │   │   │   ├── StrategyLayout/
    │   │   │   │   └── StrategyLayout.tsx
    │   │   │   ├── StrikeWarning.tsx
    │   │   │   ├── Tabs.tsx
    │   │   │   ├── Trade/
    │   │   │   │   ├── Cancelled.tsx
    │   │   │   │   ├── Confirmed.tsx
    │   │   │   │   ├── Long/
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── Mint.tsx
    │   │   │   │   ├── Short/
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── SqueethMetrics.tsx
    │   │   │   │   ├── WelcomeModal.tsx
    │   │   │   │   └── index.tsx
    │   │   │   ├── TradeOld/
    │   │   │   │   ├── Cancelled.tsx
    │   │   │   │   ├── Confirmed.tsx
    │   │   │   │   ├── Long/
    │   │   │   │   │   ├── BreakEven.tsx
    │   │   │   │   │   └── index.tsx
    │   │   │   │   ├── TradeDetails.tsx
    │   │   │   │   ├── TradeInfoItem.tsx
    │   │   │   │   └── UniswapData.tsx
    │   │   │   ├── TradeSettings.tsx
    │   │   │   └── WalletFailModal.tsx
    │   │   ├── constants/
    │   │   │   ├── address.ts
    │   │   │   ├── diagram.ts
    │   │   │   ├── enums.ts
    │   │   │   └── index.ts
    │   │   ├── context/
    │   │   │   ├── lp.tsx
    │   │   │   └── restrict-user.tsx
    │   │   ├── hooks/
    │   │   │   ├── __tests__/
    │   │   │   │   ├── useAppCallback.test.ts
    │   │   │   │   ├── useAppEffect.test.ts
    │   │   │   │   └── useAppMemo.test.ts
    │   │   │   ├── contracts/
    │   │   │   │   ├── useAllowance.ts
    │   │   │   │   ├── useERC721.ts
    │   │   │   │   ├── useLiquidations.ts
    │   │   │   │   ├── useLongHelper.ts
    │   │   │   │   ├── useOracle.ts
    │   │   │   │   ├── useShortHelper.ts
    │   │   │   │   ├── useTokenBalance.ts
    │   │   │   │   ├── useVaultManager.ts
    │   │   │   │   └── useWeth.ts
    │   │   │   ├── payOffGraph/
    │   │   │   │   ├── useCrabVaultPayoff.ts
    │   │   │   │   ├── useShortParams.ts
    │   │   │   │   └── useSqueethShortPayOffGraph.ts
    │   │   │   ├── useAmplitude.ts
    │   │   │   ├── useAppCallback.tsx
    │   │   │   ├── useAppEffect.tsx
    │   │   │   ├── useAppMemo.tsx
    │   │   │   ├── useAsyncMemo.tsx
    │   │   │   ├── useBullHedgeHistory.ts
    │   │   │   ├── useBullPosition/
    │   │   │   │   ├── index.ts
    │   │   │   │   ├── mocks.ts
    │   │   │   │   └── useBullPosition.ts
    │   │   │   ├── useCopyClipboard.ts
    │   │   │   ├── useCrabAuctionHistory.ts
    │   │   │   ├── useCrabPosition/
    │   │   │   │   ├── index.ts
    │   │   │   │   ├── mocks.ts
    │   │   │   │   ├── useCrabPosition.test.tsx
    │   │   │   │   └── useCrabPosition.ts
    │   │   │   ├── useCrabV2AuctionHistory.ts
    │   │   │   ├── useENS.ts
    │   │   │   ├── useETHPrice.ts
    │   │   │   ├── useExecuteOnce.ts
    │   │   │   ├── useInterval.ts
    │   │   │   ├── useIntervalAsync.ts
    │   │   │   ├── useNormHistory.ts
    │   │   │   ├── useNormHistoryFromTime.ts
    │   │   │   ├── useOSQTHPrice.ts
    │   │   │   ├── usePopup.tsx
    │   │   │   ├── useRenderCounter.js
    │   │   │   ├── useStateWithReset.ts
    │   │   │   ├── useTVL.ts
    │   │   │   ├── useTrackSiteReload.ts
    │   │   │   ├── useTrackTransactionFlow.ts
    │   │   │   ├── useTransactionHistory.ts
    │   │   │   ├── useUniswapQuoter.tsx
    │   │   │   ├── useUniswapTicks.ts
    │   │   │   ├── useUsdAmount.ts
    │   │   │   ├── useUserBullTxHistory.ts
    │   │   │   ├── useUserCrabTxHistory.ts
    │   │   │   ├── useUserCrabV2TxHistory.ts
    │   │   │   ├── useVault.ts
    │   │   │   ├── useVaultData.ts
    │   │   │   ├── useVaultHistory.ts
    │   │   │   └── useYourVaults.ts
    │   │   ├── lib/
    │   │   │   └── pnl.ts
    │   │   ├── markdown/
    │   │   │   ├── pos-merge.md
    │   │   │   ├── privacy-policy.md
    │   │   │   ├── terms-of-service-faq.md
    │   │   │   └── terms-of-service.md
    │   │   ├── pages/
    │   │   │   └── positions/
    │   │   │       ├── BullPosition.tsx
    │   │   │       ├── ConnectWallet.tsx
    │   │   │       ├── CrabPosition.tsx
    │   │   │       ├── CrabPositionV2.tsx
    │   │   │       ├── History.tsx
    │   │   │       ├── LPedSqueeth.tsx
    │   │   │       ├── LongSqueeth.tsx
    │   │   │       ├── MintedSqueeth.tsx
    │   │   │       ├── Positions.tsx
    │   │   │       ├── ShortSqueeth.tsx
    │   │   │       ├── ShortSqueethLiquidated.tsx
    │   │   │       ├── YourVaults.test.tsx
    │   │   │       ├── YourVaults.tsx
    │   │   │       └── useStyles.ts
    │   │   ├── queries/
    │   │   │   ├── squeeth/
    │   │   │   │   ├── __generated__/
    │   │   │   │   │   ├── Vault.ts
    │   │   │   │   │   ├── VaultHistory.ts
    │   │   │   │   │   ├── Vaults.ts
    │   │   │   │   │   ├── YourVaults.ts
    │   │   │   │   │   ├── bullHedges.ts
    │   │   │   │   │   ├── crabAuctions.ts
    │   │   │   │   │   ├── crabV2Auctions.ts
    │   │   │   │   │   ├── liquidations.ts
    │   │   │   │   │   ├── normalizationFactorUpdates.ts
    │   │   │   │   │   ├── normalizationFactorUpdatesTime.ts
    │   │   │   │   │   ├── strategyQuery.ts
    │   │   │   │   │   ├── subscriptionVaultHistory.ts
    │   │   │   │   │   ├── subscriptionVaults.ts
    │   │   │   │   │   ├── userBullTxes.ts
    │   │   │   │   │   ├── userCrabTxes.ts
    │   │   │   │   │   └── userCrabV2Txes.ts
    │   │   │   │   ├── bullHedgeQuery.ts
    │   │   │   │   ├── crabAuctionQuery.ts
    │   │   │   │   ├── crabV2AuctionQuery.ts
    │   │   │   │   ├── liquidationsQuery.ts
    │   │   │   │   ├── normHistoryQuery.ts
    │   │   │   │   ├── strategyQuery.ts
    │   │   │   │   ├── userBullQuery.ts
    │   │   │   │   ├── userCrabTxQuery.ts
    │   │   │   │   ├── userCrabV2TxQuery.ts
    │   │   │   │   ├── vaultHistoryQuery.ts
    │   │   │   │   └── vaultsQuery.ts
    │   │   │   └── uniswap/
    │   │   │       ├── __generated__/
    │   │   │       │   ├── activePositions.ts
    │   │   │       │   ├── positions.ts
    │   │   │       │   ├── subscriptionSwaps.ts
    │   │   │       │   ├── subscriptionSwapsRopsten.ts
    │   │   │       │   ├── subscriptionpositions.ts
    │   │   │       │   ├── swaps.ts
    │   │   │       │   ├── swapsRopsten.ts
    │   │   │       │   ├── ticks.ts
    │   │   │       │   └── transactions.ts
    │   │   │       ├── positionsQuery.ts
    │   │   │       ├── swapsQuery.ts
    │   │   │       ├── swapsRopstenQuery.ts
    │   │   │       ├── ticksQuery.ts
    │   │   │       └── transactionsQuery.ts
    │   │   ├── server/
    │   │   │   ├── firebase-admin.ts
    │   │   │   └── ipqs.ts
    │   │   ├── state/
    │   │   │   ├── bull/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── utils.ts
    │   │   │   ├── contracts/
    │   │   │   │   └── atoms.ts
    │   │   │   ├── controller/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── utils.ts
    │   │   │   ├── crab/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── utils.ts
    │   │   │   ├── crabMigration/
    │   │   │   │   ├── atom.ts
    │   │   │   │   └── hooks.ts
    │   │   │   ├── ethPriceCharts/
    │   │   │   │   └── atoms.ts
    │   │   │   ├── lp/
    │   │   │   │   └── hooks.ts
    │   │   │   ├── nftmanager/
    │   │   │   │   └── hooks.ts
    │   │   │   ├── pnl/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   └── hooks.ts
    │   │   │   ├── positions/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── providers.tsx
    │   │   │   ├── squeethPool/
    │   │   │   │   ├── atoms.ts
    │   │   │   │   ├── hooks.ts
    │   │   │   │   └── price.ts
    │   │   │   ├── trade/
    │   │   │   │   └── atoms.ts
    │   │   │   └── wallet/
    │   │   │       ├── apis.ts
    │   │   │       ├── atoms.ts
    │   │   │       └── hooks.ts
    │   │   ├── styles/
    │   │   │   ├── index.ts
    │   │   │   └── useTextStyles.ts
    │   │   ├── theme.ts
    │   │   ├── types/
    │   │   │   └── index.ts
    │   │   └── utils/
    │   │       ├── __tests__/
    │   │       │   └── stringifyDeps.test.ts
    │   │       ├── amplitude.ts
    │   │       ├── apollo-client.ts
    │   │       ├── atomTester.tsx
    │   │       ├── calculations.ts
    │   │       ├── cookies.ts
    │   │       ├── crisp-chat.ts
    │   │       ├── csvToJson.ts
    │   │       ├── error.ts
    │   │       ├── ethPriceCharts.ts
    │   │       ├── firestore.ts
    │   │       ├── floatifyBigNums.ts
    │   │       ├── formatter.ts
    │   │       ├── gasProvider.ts
    │   │       ├── getContract.ts
    │   │       ├── index.tsx
    │   │       ├── markdown.ts
    │   │       ├── pricer.ts
    │   │       ├── quoter.ts
    │   │       └── stringifyDeps.ts
    │   ├── styles/
    │   │   ├── Home.module.css
    │   │   └── globals.css
    │   ├── synpress.json
    │   ├── tsconfig.json
    │   └── types/
    │       └── global_apollo.ts
    ├── hardhat/
    │   ├── .eslintrc.js
    │   ├── .gitbook.yaml
    │   ├── .prettierignore
    │   ├── .prettierrc
    │   ├── .solcover.js
    │   ├── CHANGE_DATE
    │   ├── LICENSE_BUSL
    │   ├── README.md
    │   ├── SUMMARY.md
    │   ├── USE_GRANT
    │   ├── arguments/
    │   │   ├── Controller-goerli.js
    │   │   ├── ControllerHelper-goerli.js
    │   │   ├── CrabHelper-goerli.js
    │   │   ├── CrabHelper-mainnet.js
    │   │   ├── CrabMigration-goerli.js
    │   │   ├── CrabMigration-mainnet.js
    │   │   ├── CrabMigration-ropsten.js
    │   │   ├── CrabStrategy-goerli.js
    │   │   ├── CrabStrategyV2-goerli.js
    │   │   ├── CrabStrategyV2-mainnet.js
    │   │   ├── CrabStrategyV2-ropsten.js
    │   │   ├── OpynUsdc-goerli.js
    │   │   ├── OpynWeth-goerli.js
    │   │   ├── Quoter-goerli.js
    │   │   ├── ShortHelper-goerli.js
    │   │   ├── ShortPowerPerp-goerli.js
    │   │   ├── Timelock-goerli.js
    │   │   ├── Timelock-mainnet.js
    │   │   ├── Timelock-ropsten.js
    │   │   └── WPowerPerp-goerli.js
    │   ├── arguments.js
    │   ├── ci/
    │   │   └── e2e.sh
    │   ├── contracts/
    │   │   ├── core/
    │   │   │   ├── Controller.sol
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── Oracle.sol
    │   │   │   ├── ShortPowerPerp.sol
    │   │   │   └── WPowerPerp.sol
    │   │   ├── external/
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   └── WETH9.sol
    │   │   ├── import/
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   └── Uni.sol
    │   │   ├── interfaces/
    │   │   │   ├── IController.sol
    │   │   │   ├── ICrabStrategyV2.sol
    │   │   │   ├── IERC20Detailed.sol
    │   │   │   ├── IEuler.sol
    │   │   │   ├── IOracle.sol
    │   │   │   ├── IShortPowerPerp.sol
    │   │   │   ├── IWETH9.sol
    │   │   │   ├── IWPowerPerp.sol
    │   │   │   └── LICENSE_MIT
    │   │   ├── libs/
    │   │   │   ├── ABDKMath64x64.sol
    │   │   │   ├── LICENSE_BSD_4_Clause
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── LICENSE_MIT
    │   │   │   ├── OracleLibrary.sol
    │   │   │   ├── Power2Base.sol
    │   │   │   ├── SqrtPriceMathPartial.sol
    │   │   │   ├── TickMathExternal.sol
    │   │   │   ├── Uint256Casting.sol
    │   │   │   └── VaultLib.sol
    │   │   ├── mocks/
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── LICENSE_MIT
    │   │   │   ├── MockController.sol
    │   │   │   ├── MockCrab.sol
    │   │   │   ├── MockErc20.sol
    │   │   │   ├── MockEuler.sol
    │   │   │   ├── MockEulerDToken.sol
    │   │   │   ├── MockOracle.sol
    │   │   │   ├── MockShortPowerPerp.sol
    │   │   │   ├── MockTimelock.sol
    │   │   │   ├── MockUniPositionManager.sol
    │   │   │   ├── MockUniswapV3Pool.sol
    │   │   │   ├── MockWSqueeth.sol
    │   │   │   └── OpynWETH9.sol
    │   │   ├── periphery/
    │   │   │   ├── ControllerHelper.sol
    │   │   │   ├── EulerControllerHelper.sol
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── ShortHelper.sol
    │   │   │   ├── UniswapControllerHelper.sol
    │   │   │   └── lib/
    │   │   │       ├── ControllerHelperDataType.sol
    │   │   │       ├── ControllerHelperUtil.sol
    │   │   │       └── LiquidityAmounts.sol
    │   │   ├── strategy/
    │   │   │   ├── AGPL_3
    │   │   │   ├── CrabHelper.sol
    │   │   │   ├── CrabMigration.sol
    │   │   │   ├── CrabStrategy.sol
    │   │   │   ├── CrabStrategyV2.sol
    │   │   │   ├── LICENSE_GPL_3
    │   │   │   ├── base/
    │   │   │   │   ├── StrategyBase.sol
    │   │   │   │   ├── StrategyFlashSwap.sol
    │   │   │   │   └── StrategyMath.sol
    │   │   │   ├── helper/
    │   │   │   │   └── StrategySwap.sol
    │   │   │   └── timelock/
    │   │   │       ├── SafeMath.sol
    │   │   │       └── Timelock.sol
    │   │   └── test/
    │   │       ├── ABDKTester.sol
    │   │       ├── CastingTester.sol
    │   │       ├── ControllerAccessTester.sol
    │   │       ├── ControllerTester.sol
    │   │       ├── LICENSE_BSD_4_Clause
    │   │       ├── LICENSE_BUSL
    │   │       ├── LICENSE_GPL_3
    │   │       ├── LiquidationHelper.sol
    │   │       ├── OracleTester.sol
    │   │       └── VaultTester.sol
    │   ├── crab-migration.js
    │   ├── crabmigration-arguments.js
    │   ├── crabv2-arguments.js
    │   ├── deploy/
    │   │   ├── 00_deploy_basic_coins.ts
    │   │   ├── 01_deploy_uniswapv3.ts
    │   │   ├── 02_deploy_core.ts
    │   │   ├── 03_deploy_pools.ts
    │   │   ├── 04_deploy_controller.ts
    │   │   ├── 05_deploy_periphery.ts
    │   │   ├── 06_deploy_crab_strategy.ts
    │   │   ├── 07_deploy_controller_helper.ts
    │   │   ├── 08_deploy_crab_v2.ts
    │   │   └── 09_deploy_crab_helper.ts
    │   ├── deployments/
    │   │   ├── goerli/
    │   │   │   ├── .chainId
    │   │   │   ├── ABDKMath64x64.json
    │   │   │   ├── Controller.json
    │   │   │   ├── ControllerHelper.json
    │   │   │   ├── ControllerHelperUtil.json
    │   │   │   ├── CrabHelper.json
    │   │   │   ├── CrabStrategyDeployment.json
    │   │   │   ├── CrabStrategyV2.json
    │   │   │   ├── MockErc20.json
    │   │   │   ├── NonfungiblePositionManager.json
    │   │   │   ├── OpynWETH9.json
    │   │   │   ├── Oracle.json
    │   │   │   ├── Quoter.json
    │   │   │   ├── ShortHelper.json
    │   │   │   ├── ShortPowerPerp.json
    │   │   │   ├── SqrtPriceMathPartial.json
    │   │   │   ├── SwapRouter.json
    │   │   │   ├── TickMathExternal.json
    │   │   │   ├── UniswapV3Factory.json
    │   │   │   ├── WPowerPerp.json
    │   │   │   └── solcInputs/
    │   │   │       ├── 0233939f192df1cbf8f7a345e29af693.json
    │   │   │       ├── 05b9c7d057ff8b2bf36168b053759720.json
    │   │   │       ├── 31d85619debc3954507258d16df1741b.json
    │   │   │       ├── 59fefefa6d402a64e50de797130b653c.json
    │   │   │       ├── 5f1800dd06bba4733ee96eb427b535c3.json
    │   │   │       └── c53867cdbf46138ab42de1c7a1689875.json
    │   │   ├── mainnet/
    │   │   │   ├── .chainId
    │   │   │   ├── ABDKMath64x64.json
    │   │   │   ├── Controller.json
    │   │   │   ├── ControllerHelper.json
    │   │   │   ├── ControllerHelperUtil.json
    │   │   │   ├── CrabHelper.json
    │   │   │   ├── CrabMigration.json
    │   │   │   ├── CrabStrategyV2.json
    │   │   │   ├── Oracle.json
    │   │   │   ├── Quoter.json
    │   │   │   ├── ShortHelper.json
    │   │   │   ├── ShortPowerPerp.json
    │   │   │   ├── SqrtPriceMathPartial.json
    │   │   │   ├── TickMathExternal.json
    │   │   │   ├── Timelock.json
    │   │   │   ├── WPowerPerp.json
    │   │   │   └── solcInputs/
    │   │   │       ├── 30afee76cfee2d4cc1c12451e0258499.json
    │   │   │       ├── 56b4ec4ab07157f3d2fb7e1de805d93e.json
    │   │   │       ├── c53867cdbf46138ab42de1c7a1689875.json
    │   │   │       ├── d97d3d4b09e0d70518330d405a7dd9ff.json
    │   │   │       ├── e85d9fda89ae8c3780a8ae01da3f423c.json
    │   │   │       └── fc32ed9e00a9017e491333926bef5473.json
    │   │   ├── rinkebyArbitrum/
    │   │   │   ├── .chainId
    │   │   │   ├── Controller.json
    │   │   │   ├── MockErc20.json
    │   │   │   ├── Oracle.json
    │   │   │   ├── Quoter.json
    │   │   │   ├── ShortHelper.json
    │   │   │   ├── VaultNFTManager.json
    │   │   │   ├── WSqueeth.json
    │   │   │   └── solcInputs/
    │   │   │       ├── 1eb2d8df0d50660ef74af8c7c5cd526b.json
    │   │   │       ├── 49c79f88c6e4ede6ca1f2ffd46fef4fe.json
    │   │   │       ├── 4ad189f955354b6f5c4f3b0e4a7b5326.json
    │   │   │       ├── 63325f69769d83fcd46161b0222ee3cc.json
    │   │   │       ├── 65b5636a064484e3748f101fc0e531a8.json
    │   │   │       └── 7ff94f89a93cd7aa904196251e75bdb3.json
    │   │   └── ropsten/
    │   │       ├── .chainId
    │   │       ├── ABDKMath64x64.json
    │   │       ├── Controller.json
    │   │       ├── ControllerHelper.json
    │   │       ├── ControllerHelperUtil.json
    │   │       ├── CrabMigration.json
    │   │       ├── CrabStrategyDeployment.json
    │   │       ├── CrabStrategyV2.json
    │   │       ├── NonfungiblePositionManager.json
    │   │       ├── Oracle.json
    │   │       ├── Quoter.json
    │   │       ├── ShortHelper.json
    │   │       ├── ShortPowerPerp.json
    │   │       ├── SqrtPriceMathPartial.json
    │   │       ├── SwapRouter.json
    │   │       ├── TickMathExternal.json
    │   │       ├── Timelock.json
    │   │       ├── UniswapV3Factory.json
    │   │       ├── WPowerPerp.json
    │   │       └── solcInputs/
    │   │           ├── 30afee76cfee2d4cc1c12451e0258499.json
    │   │           ├── 5f450d03d2b8109eaf06de68c57d8c2b.json
    │   │           ├── 6176622d73f0107e1e6916638dbba9b9.json
    │   │           ├── ab83bcba860cd7677bf7e9d807e32da5.json
    │   │           ├── cd8e568ab17078249f8bced32d618ecf.json
    │   │           ├── d91027c30078be5bfba0223abd5c6e60.json
    │   │           ├── dfd7860ebd97501ecbdb5935c168e58b.json
    │   │           ├── e2a303b98172c2b7a0e4fda5f2d8e859.json
    │   │           ├── e85d9fda89ae8c3780a8ae01da3f423c.json
    │   │           └── fc32ed9e00a9017e491333926bef5473.json
    │   ├── docs/
    │   │   ├── contract.hbs
    │   │   └── contracts-documentation/
    │   │       ├── core/
    │   │       │   ├── Controller.md
    │   │       │   ├── Oracle.md
    │   │       │   ├── ShortPowerPerp.md
    │   │       │   ├── WPowerPerp.md
    │   │       │   └── WSqueeth.md
    │   │       ├── external/
    │   │       │   └── WETH9.md
    │   │       ├── import/
    │   │       │   └── Uni.md
    │   │       ├── interfaces/
    │   │       │   ├── IController.md
    │   │       │   ├── IERC20Detailed.md
    │   │       │   ├── IOracle.md
    │   │       │   ├── IShortPowerPerp.md
    │   │       │   ├── IVaultManagerNFT.md
    │   │       │   ├── IWETH9.md
    │   │       │   └── IWPowerPerp.md
    │   │       ├── libs/
    │   │       │   ├── OracleLibrary.md
    │   │       │   ├── Power2Base.md
    │   │       │   └── VaultLib.md
    │   │       ├── mocks/
    │   │       │   ├── IUniswapV3FlashCallback.md
    │   │       │   ├── MockController.md
    │   │       │   ├── MockErc20.md
    │   │       │   ├── MockOracle.md
    │   │       │   ├── MockShortPowerPerp.md
    │   │       │   ├── MockUniPositionManager.md
    │   │       │   ├── MockUniswapV3Pool.md
    │   │       │   ├── MockVaultNFTManager.md
    │   │       │   ├── MockWPowerPerp.md
    │   │       │   └── MockWSqueeth.md
    │   │       ├── periphery/
    │   │       │   └── ShortHelper.md
    │   │       ├── strategy/
    │   │       │   ├── CrabStrategy.md
    │   │       │   └── base/
    │   │       │       ├── StrategyBase.md
    │   │       │       ├── StrategyFlashSwap.md
    │   │       │       └── StrategyMath.md
    │   │       └── test/
    │   │           ├── ControllerTester.md
    │   │           ├── OracleTester.md
    │   │           └── VaultLibTester.md
    │   ├── env.example
    │   ├── hardhat.config.ts
    │   ├── package.json
    │   ├── scripts/
    │   │   ├── deploy.js
    │   │   ├── docs/
    │   │   │   └── docify.js
    │   │   ├── etherscan_verify.sh
    │   │   ├── publish.js
    │   │   ├── start_hardhat_fork.sh
    │   │   ├── stop_hardhat_fork.sh
    │   │   └── watch.js
    │   ├── tasks/
    │   │   ├── addSqueethLiquidity.ts
    │   │   ├── addWethLiquidity.ts
    │   │   ├── buySqueeth.ts
    │   │   ├── buyWeth.ts
    │   │   ├── default.ts
    │   │   ├── increaseSlot.ts
    │   │   ├── sellSqueeth.ts
    │   │   ├── sellWeth.ts
    │   │   └── utils.ts
    │   ├── test/
    │   │   ├── calculator.ts
    │   │   ├── e2e/
    │   │   │   ├── crab-Migration.ts
    │   │   │   └── periphery/
    │   │   │       └── controller-helper.ts
    │   │   ├── integration-tests/
    │   │   │   ├── crabv2/
    │   │   │   │   ├── crab-hedging-otc.ts
    │   │   │   │   ├── crab-helper.ts
    │   │   │   │   ├── crab-liquidation-dust.ts
    │   │   │   │   ├── crab-liquidation-flashswap.ts
    │   │   │   │   ├── crab-liquidation-full.ts
    │   │   │   │   ├── crab-shutdown.ts
    │   │   │   │   ├── crab-timelock.ts
    │   │   │   │   └── strategy-flow.ts
    │   │   │   ├── liquidation.ts
    │   │   │   ├── oracle-attack.ts
    │   │   │   ├── oracle_integration.ts
    │   │   │   ├── periphery/
    │   │   │   │   └── controller-helper.ts
    │   │   │   ├── short_helper_integration.ts
    │   │   │   ├── strategy/
    │   │   │   │   ├── crab-flashswap-liquidation.ts
    │   │   │   │   ├── crab-hedge-uniswap-price-based.ts
    │   │   │   │   ├── crab-hedge-uniswap-time-based.ts
    │   │   │   │   ├── crab-hedging-price-based.ts
    │   │   │   │   ├── crab-hedging-time-based.ts
    │   │   │   │   ├── crab-liquidation-dust.ts
    │   │   │   │   ├── crab-liquidation-full.ts
    │   │   │   │   ├── crab-shutdown.ts
    │   │   │   │   └── strategy-flow.ts
    │   │   │   └── uni-position-collateral.ts
    │   │   ├── setup.ts
    │   │   ├── unit-tests/
    │   │   │   ├── abdk-math.ts
    │   │   │   ├── casting.ts
    │   │   │   ├── controller-funding.ts
    │   │   │   ├── controller-lptoken-collateral.ts
    │   │   │   ├── controller-pause-time.ts
    │   │   │   ├── controller-shutdown.ts
    │   │   │   ├── controller-vaults.ts
    │   │   │   ├── controller.ts
    │   │   │   ├── liquidation.ts
    │   │   │   ├── oracle-token-decimals.ts
    │   │   │   ├── oracle.ts
    │   │   │   ├── short-power-perp.ts
    │   │   │   ├── squeeth.ts
    │   │   │   ├── strategy/
    │   │   │   │   ├── crab-migration.ts
    │   │   │   │   ├── crab-strategy-v2.ts
    │   │   │   │   ├── crab-strategy.ts
    │   │   │   │   └── timelock.ts
    │   │   │   └── vault-lib.ts
    │   │   ├── utils.ts
    │   │   └── vault-utils.ts
    │   └── tsconfig.json
    ├── services/
    │   ├── graph-node/
    │   │   ├── Dockerfile
    │   │   ├── README.md
    │   │   ├── bin/
    │   │   │   ├── create
    │   │   │   ├── debug
    │   │   │   ├── deploy
    │   │   │   ├── reassign
    │   │   │   └── remove
    │   │   ├── build.sh
    │   │   ├── cloudbuild.yaml
    │   │   ├── docker-compose.yml
    │   │   ├── hooks/
    │   │   │   └── post_checkout
    │   │   ├── setup.sh
    │   │   ├── start
    │   │   ├── tag.sh
    │   │   └── wait_for
    │   └── package.json
    ├── subgraph/
    │   ├── .gitignore
    │   ├── README.md
    │   ├── config/
    │   │   ├── goerli-config.json
    │   │   ├── localhost-config.json
    │   │   ├── mainnet-config.json
    │   │   ├── rinkebyArbitrum-config.json
    │   │   └── ropsten-config.json
    │   ├── package.json
    │   ├── schema.graphql
    │   ├── src/
    │   │   ├── bullStrategy.ts
    │   │   ├── constants.ts
    │   │   ├── controller.ts
    │   │   ├── crabV2.ts
    │   │   ├── crabstrategy.ts
    │   │   └── util.ts
    │   └── subgraph.template.yaml
    ├── zen-bull-netting/
    │   ├── .gitignore
    │   ├── README.md
    │   ├── docs/
    │   │   ├── .gitignore
    │   │   ├── book.css
    │   │   ├── book.toml
    │   │   └── src/
    │   │       ├── README.md
    │   │       ├── SUMMARY.md
    │   │       └── src/
    │   │           ├── FlashSwap.sol/
    │   │           │   ├── contract.CallbackValidation.md
    │   │           │   ├── contract.FlashSwap.md
    │   │           │   └── contract.PoolAddress.md
    │   │           ├── NettingLib.sol/
    │   │           │   └── contract.NettingLib.md
    │   │           ├── README.md
    │   │           ├── ZenBullNetting.sol/
    │   │           │   └── contract.ZenBullNetting.md
    │   │           └── interface/
    │   │               ├── IController.sol/
    │   │               │   └── contract.IController.md
    │   │               ├── ICrabStrategyV2.sol/
    │   │               │   └── contract.ICrabStrategyV2.md
    │   │               ├── IEulerSimpleLens.sol/
    │   │               │   └── contract.IEulerSimpleLens.md
    │   │               ├── IFlashZen.sol/
    │   │               │   └── contract.IFlashZen.md
    │   │               ├── IOracle.sol/
    │   │               │   └── contract.IOracle.md
    │   │               ├── IWETH.sol/
    │   │               │   └── contract.IWETH.md
    │   │               ├── IZenBullStrategy.sol/
    │   │               │   └── contract.IZenBullStrategy.md
    │   │               └── README.md
    │   ├── foundry.toml
    │   ├── remappings.txt
    │   ├── script/
    │   │   ├── DeployScript.s.sol
    │   │   ├── GoerliDeployScript.s.sol
    │   │   └── MainnetDeployScript.s.sol
    │   ├── src/
    │   │   ├── FlashSwap.sol
    │   │   ├── NettingLib.sol
    │   │   ├── ZenBullNetting.sol
    │   │   └── interface/
    │   │       ├── IController.sol
    │   │       ├── ICrabStrategyV2.sol
    │   │       ├── IEulerSimpleLens.sol
    │   │       ├── IFlashZen.sol
    │   │       ├── IOracle.sol
    │   │       ├── IWETH.sol
    │   │       └── IZenBullStrategy.sol
    │   └── test/
    │       ├── ZenBullNettingBaseSetup.t.sol
    │       ├── fuzzing/
    │       │   └── ZenBullNetting/
    │       │       └── DepositAuctionFuzzing.t.sol
    │       ├── integration-test/
    │       │   └── ZenBullNetting/
    │       │       ├── DepositAuction.t.sol
    │       │       ├── DequeueEth.t.sol
    │       │       ├── DequeueZenBull.t.sol
    │       │       ├── NetAtPrice.t.sol
    │       │       └── WithdrawAuction.t.sol
    │       ├── unit-test/
    │       │   ├── CancelNonce.t.sol
    │       │   ├── QueueEth.t.sol
    │       │   ├── QueueZenBull.t.sol
    │       │   ├── SetAuctionTwapPeriod.t.sol
    │       │   ├── SetDepositsIndex.t.sol
    │       │   ├── SetMinEthAmount.sol
    │       │   ├── SetMinZenBullAmount.t.sol
    │       │   ├── SetOTCPriceTolerance.t.sol
    │       │   ├── SetWithdrawsIndex.t.sol
    │       │   └── ToggleAuctionLive.t.sol
    │       └── util/
    │           └── SigUtil.sol
    └── zen-bull-vault/
        ├── .gitignore
        ├── LICENSE_BUSL
        ├── README.md
        ├── doc/
        │   └── report/
        │       ├── report_auction_bull
        │       ├── report_auction_bull.md
        │       ├── report_bull_strategy
        │       ├── report_bull_strategy.md
        │       ├── report_emergency_shutdown
        │       ├── report_emergency_shutdown.md
        │       ├── report_flash_bull
        │       └── report_flash_bull.md
        ├── foundry.toml
        ├── remappings.txt
        ├── script/
        │   ├── AddLiquidityEuler.s.sol
        │   ├── Deploy.s.sol
        │   ├── GoerliAddUsdcLiquidityEuler.s.sol
        │   ├── GoerliAddWethLiquidityEuler.s.sol
        │   ├── GoerliDeploy.s.sol
        │   ├── GoerliDeployEmergencyWithdraw.s.sol
        │   ├── MainnetDeploy.s.sol
        │   ├── MainnetDeployEmergencyWithdraw.s.sol
        │   └── MainnetDeployShutdownEmergencyWithdraw.s.sol
        ├── src/
        │   ├── EmergencyWithdraw.sol
        │   ├── FlashZen.sol
        │   ├── LeverageZen.sol
        │   ├── ShutdownEmergencyWithdraw.sol
        │   ├── UniFlash.sol
        │   ├── UniOracle.sol
        │   ├── ZenAuction.sol
        │   ├── ZenBullStrategy.sol
        │   ├── ZenEmergencyShutdown.sol
        │   └── interface/
        │       ├── ICrabStrategyV2.sol
        │       ├── IEulerDToken.sol
        │       ├── IEulerEToken.sol
        │       ├── IEulerMarkets.sol
        │       ├── ILeverageZen.sol
        │       ├── IZenBullStrategy.sol
        │       └── IZenEmergencyWithdraw.sol
        └── test/
            ├── e2e/
            │   ├── EmergencyWithdrawScenarios.t.sol
            │   └── ShutdownEmergencyWithdrawTest.t.sol
            ├── fuzz-test/
            │   ├── FlashZenFuzzTest.t.sol
            │   ├── LeverageZenFuzzTest.t.sol
            │   ├── ZenAuctionFuzzTest.t.sol
            │   └── ZenBullStrategyFuzzTest.t.sol
            ├── integration-test/
            │   ├── EmergencyWithdraw/
            │   │   ├── EmergencyRepayEulerDebtTest.t.sol
            │   │   ├── EmergencyWithdrawEthFromCrabTest.t.sol
            │   │   └── WithdrawEthTest.t.sol
            │   ├── FlashZenTestFork.t.sol
            │   ├── ZenAuctionTestFork.t.sol
            │   ├── ZenBullStrategyTestFork.t.sol
            │   └── ZenEmergencyShutdownTestFork.t.sol
            ├── unit-test/
            │   ├── ZenBullStrategyTest.t.sol
            │   ├── mock/
            │   │   ├── EulerDtokenMock.t.sol
            │   │   ├── EulerEtokenMock.t.sol
            │   │   ├── EulerMarketsMock.t.sol
            │   │   ├── EulerMock.t.sol
            │   │   └── Weth9Mock.t.sol
            │   └── util/
            │       └── UnitSetupUtil.t.sol
            └── util/
                ├── SigUtil.sol
                └── TestUtil.t.sol
Download .txt
SYMBOL INDEX (744 symbols across 216 files)

FILE: packages/frontend/cypress/integration/pages/header.js
  class Header (line 2) | class Header extends Page {
    method getConnectWalletBtn (line 3) | getConnectWalletBtn() {
    method getWalletAddress (line 6) | getWalletAddress() {

FILE: packages/frontend/cypress/integration/pages/notifications.js
  class Notifications (line 2) | class Notifications extends Page {
    method getTransactionSuccessNotification (line 3) | getTransactionSuccessNotification() {
    method getTransactionSuccessNotificationLink (line 6) | getTransactionSuccessNotificationLink() {

FILE: packages/frontend/cypress/integration/pages/onboard.js
  class Onboard (line 2) | class Onboard extends Page {
    method getBrowserWalletBtn (line 3) | getBrowserWalletBtn() {

FILE: packages/frontend/cypress/integration/pages/page.js
  class Page (line 1) | class Page {
    method getTitle (line 2) | getTitle() {
    method getMetamaskWalletAddress (line 6) | getMetamaskWalletAddress() {
    method acceptMetamaskAccessRequest (line 10) | acceptMetamaskAccessRequest() {
    method confirmMetamaskTransaction (line 14) | confirmMetamaskTransaction() {
    method confirmMetamaskPermissionToSpend (line 20) | confirmMetamaskPermissionToSpend() {

FILE: packages/frontend/cypress/integration/pages/trade.js
  class TradePage (line 6) | class TradePage extends Page {
    method constructor (line 7) | constructor() {
    method connectBrowserWallet (line 14) | connectBrowserWallet() {
    method getLoggedInWalletAddress (line 21) | getLoggedInWalletAddress() {
    method waitForTransactionSuccess (line 26) | waitForTransactionSuccess() {
    method getTransactionUrl (line 39) | getTransactionUrl() {

FILE: packages/frontend/middleware.ts
  constant THIRTY_DAYS_IN_MS (line 12) | const THIRTY_DAYS_IN_MS = 30 * 24 * 60 * 60 * 1000
  type RedisResponse (line 14) | interface RedisResponse {
  function isIPBlockedInRedis (line 19) | async function isIPBlockedInRedis(ip: string, currentTime: number) {
  function middleware (line 43) | async function middleware(request: NextRequest) {

FILE: packages/frontend/next.config.js
  method rewrites (line 16) | async rewrites() {
  method headers (line 24) | async headers() {

FILE: packages/frontend/pages/_app.tsx
  function MyApp (line 45) | function MyApp({ Component, pageProps }: any) {

FILE: packages/frontend/pages/_document.tsx
  class MyDocument (line 5) | class MyDocument extends Document {
    method render (line 6) | render() {

FILE: packages/frontend/pages/api/__tests__/isValidAddress.test.ts
  type APIRequest (line 12) | type APIRequest = NextApiResponse & ReturnType<typeof createRequest>;
  type APIResponse (line 13) | type APIResponse = NextApiResponse & ReturnType<typeof createResponse>;
  type isValidAddressResponse (line 15) | interface isValidAddressResponse {
  function mockRequestResponse (line 26) | function mockRequestResponse(method: RequestMethod = 'GET', address: str...

FILE: packages/frontend/pages/api/auction/lastHedgeAuction.ts
  constant SQUEETH_PORTAL_API (line 4) | const SQUEETH_PORTAL_API = process.env.NEXT_PUBLIC_SQUEETH_PORTAL_BASE_URL

FILE: packages/frontend/pages/api/charts/longchart.ts
  function handler (line 5) | async function handler(req: NextApiRequest, res: NextApiResponse) {
  function getETHSqueethPNLCompounding (line 42) | async function getETHSqueethPNLCompounding(

FILE: packages/frontend/pages/api/currentsqueethvol.ts
  constant SQUEETH_VOL_API (line 4) | const SQUEETH_VOL_API = process.env.SQUEETH_VOL_API_BASE_URL

FILE: packages/frontend/pages/api/historicalprice.ts
  constant TWELVE_DATA_API (line 4) | const TWELVE_DATA_API = 'https://api.twelvedata.com'

FILE: packages/frontend/pages/api/pnl.tsx
  constant OMDB_BASE_URL (line 9) | const OMDB_BASE_URL = process.env.NEXT_PUBLIC_OMDB_BASE_URL as string
  constant CHART_WIDTH (line 35) | const CHART_WIDTH = 1000
  constant CHART_HEIGHT (line 36) | const CHART_HEIGHT = 280
  constant X_AXIS_WIDTH (line 38) | const X_AXIS_WIDTH = 5
  constant Y_AXIS_WIDTH (line 39) | const Y_AXIS_WIDTH = 5
  constant PADDING_X (line 41) | const PADDING_X = 3
  constant PADDING_Y (line 42) | const PADDING_Y = 36
  type StrategyType (line 44) | type StrategyType = 'crab' | 'zenbull'
  type PnLDataPoint (line 45) | type PnLDataPoint = [number, number]
  type UserPnlProps (line 46) | interface UserPnlProps {
  function handler (line 208) | async function handler(req: NextRequest) {

FILE: packages/frontend/pages/api/twelvedata.ts
  constant TWELVE_DATA_API (line 4) | const TWELVE_DATA_API = 'https://api.twelvedata.com'

FILE: packages/frontend/pages/index.tsx
  function LandingPage (line 9) | function LandingPage() {

FILE: packages/frontend/pages/lp.tsx
  function LPCalculator (line 183) | function LPCalculator() {
  function LPage (line 245) | function LPage() {

FILE: packages/frontend/pages/pos-merge.tsx
  function getStaticProps (line 14) | async function getStaticProps() {

FILE: packages/frontend/pages/privacy-policy.tsx
  function MarkdownListItem (line 25) | function MarkdownListItem(props: any) {
  function getStaticProps (line 91) | async function getStaticProps() {

FILE: packages/frontend/pages/share-pnl/[...slug].tsx
  type StrategyType (line 18) | type StrategyType = 'crab' | 'zenbull'
  type SharePnlProps (line 20) | interface SharePnlProps {

FILE: packages/frontend/pages/squeeth.tsx
  function TradePage (line 212) | function TradePage() {

FILE: packages/frontend/pages/strategies/index.tsx
  function getServerSideProps (line 18) | async function getServerSideProps() {

FILE: packages/frontend/pages/terms-of-service-faq.tsx
  function getStaticProps (line 14) | async function getStaticProps() {

FILE: packages/frontend/pages/terms-of-service.tsx
  function getStaticProps (line 14) | async function getStaticProps() {

FILE: packages/frontend/pages/vault/[vid].tsx
  type VaultAction (line 337) | enum VaultAction {
  type VaultError (line 349) | enum VaultError {
  type VaultRedeemSectionProps (line 796) | interface VaultRedeemSectionProps {

FILE: packages/frontend/src/components/Alert.tsx
  type AlertSeverity (line 6) | type AlertSeverity = 'warning' | 'error' | 'info' | 'success'
  type StylesProps (line 8) | interface StylesProps {
  type AlertCustomProps (line 31) | interface AlertCustomProps {
  type AlertProps (line 35) | type AlertProps = BoxProps & AlertCustomProps

FILE: packages/frontend/src/components/Announcement.tsx
  constant ANNOUNCEMENT_KEY (line 5) | const ANNOUNCEMENT_KEY = 'DISABLE_MERGE_ANNOUNCEMENT'

FILE: packages/frontend/src/components/Charts/BullStrategyPerformanceChart.tsx
  type ChartDataInfo (line 16) | type ChartDataInfo = {
  function BullStrategyPerformanceChart (line 56) | function BullStrategyPerformanceChart() {

FILE: packages/frontend/src/components/Charts/CrabStrategyChart.tsx
  function CrabStrategyChart (line 87) | function CrabStrategyChart({ vault, longAmount }: { vault?: Vaults; long...

FILE: packages/frontend/src/components/Charts/CrabStrategyV2PnLChart.tsx
  type ChartDataInfo (line 19) | type ChartDataInfo = {
  function CrabStrategyV2PnLChart (line 59) | function CrabStrategyV2PnLChart() {

FILE: packages/frontend/src/components/Charts/LongChart.tsx
  type ChartType (line 28) | enum ChartType {
  function LongChart (line 123) | function LongChart() {

FILE: packages/frontend/src/components/Charts/LongChartPayoff.tsx
  function LongChartPayoff (line 119) | function LongChartPayoff() {

FILE: packages/frontend/src/components/Charts/ShortChart.tsx
  function ShortChart (line 64) | function ShortChart({

FILE: packages/frontend/src/components/Charts/VaultChart.tsx
  function VaultChart (line 66) | function VaultChart({

FILE: packages/frontend/src/components/Checkbox.tsx
  type CheckboxCustomProps (line 26) | interface CheckboxCustomProps {
  type CheckboxProps (line 33) | type CheckboxProps = MaterialCheckboxProps & CheckboxCustomProps

FILE: packages/frontend/src/components/CollatRange.tsx
  type CollatRangeType (line 27) | type CollatRangeType = {

FILE: packages/frontend/src/components/CollatRatioSlider.tsx
  constant HEALTH_CATEGORIES (line 6) | const HEALTH_CATEGORIES = {
  constant MARKS (line 33) | const MARKS = [
  type ValueLabelStylePropsType (line 90) | interface ValueLabelStylePropsType {
  function ValueLabelComponent (line 119) | function ValueLabelComponent(props: any) {
  type CollatRatioSliderPropsType (line 145) | interface CollatRatioSliderPropsType {

FILE: packages/frontend/src/components/CustomSwitch.tsx
  type SwitchItem (line 29) | type SwitchItem = {
  type CustomSwitchType (line 36) | type CustomSwitchType = {

FILE: packages/frontend/src/components/Input/NumberInput.tsx
  type NumberInputType (line 80) | type NumberInputType = {

FILE: packages/frontend/src/components/Input/PrimaryInput.tsx
  type PrimaryInputType (line 79) | type PrimaryInputType = {

FILE: packages/frontend/src/components/InputNew/InputBase.tsx
  type InputBaseCustomProps (line 37) | interface InputBaseCustomProps {
  type InputBaseProps (line 41) | type InputBaseProps = StandardTextFieldProps & InputBaseCustomProps

FILE: packages/frontend/src/components/InputNew/InputNumber.tsx
  constant DECIMAL_REGEX (line 4) | const DECIMAL_REGEX = RegExp('^[0-9]*[.]{1}[0-9]*$')
  type InputNumberCustomProps (line 6) | interface InputNumberCustomProps extends InputBaseProps {
  type InputNumberProps (line 9) | type InputNumberProps = InputNumberCustomProps

FILE: packages/frontend/src/components/InputNew/InputToken.tsx
  type InputTokenProps (line 65) | interface InputTokenProps extends InputNumberProps {

FILE: packages/frontend/src/components/LabelWithTooltip.tsx
  type Props (line 5) | interface Props extends BoxProps {

FILE: packages/frontend/src/components/LandingPage/DesktopLandingPage.tsx
  function DesktopLandingPage (line 317) | function DesktopLandingPage() {

FILE: packages/frontend/src/components/LandingPage/MobileLandingPage.tsx
  function MobileLandingPage (line 318) | function MobileLandingPage() {

FILE: packages/frontend/src/components/LegendBox.tsx
  type LegendBoxType (line 14) | type LegendBoxType = {

FILE: packages/frontend/src/components/LinkWrapper.tsx
  type LinkWrapperProps (line 19) | interface LinkWrapperProps {

FILE: packages/frontend/src/components/Lp/LPTable.tsx
  type LPTableProps (line 75) | interface LPTableProps {

FILE: packages/frontend/src/components/MarkdownPage.tsx
  function MarkdownListItem (line 23) | function MarkdownListItem(props: any) {
  type Props (line 74) | interface Props {
  function MarkdownPage (line 78) | function MarkdownPage({ markdown }: Props) {

FILE: packages/frontend/src/components/Metric.tsx
  type StyleProps (line 7) | interface StyleProps {
  type MetricProps (line 40) | interface MetricProps {
  type MetricLabelProps (line 83) | interface MetricLabelProps {

FILE: packages/frontend/src/components/Modal/MobileModal.tsx
  type MobileModalType (line 37) | type MobileModalType = {

FILE: packages/frontend/src/components/Modal/Modal.tsx
  type ModalProps (line 32) | interface ModalProps {

FILE: packages/frontend/src/components/Modal/UniswapIframe.tsx
  type UniswapIframeProps (line 75) | interface UniswapIframeProps {

FILE: packages/frontend/src/components/PnLTooltip.tsx
  type PnLTooltipProps (line 17) | interface PnLTooltipProps {

FILE: packages/frontend/src/components/Popup.tsx
  type PopupType (line 41) | type PopupType = {

FILE: packages/frontend/src/components/RestrictionInfo.tsx
  type RestrictionInfoProps (line 32) | type RestrictionInfoProps = BoxProps & { withdrawAllowed?: boolean }

FILE: packages/frontend/src/components/SharePnl/PnlChart.tsx
  type StrategyType (line 11) | type StrategyType = 'crab' | 'zenbull'

FILE: packages/frontend/src/components/StepperBox.tsx
  type StepperBoxProps (line 16) | type StepperBoxProps = {

FILE: packages/frontend/src/components/Strategies/Bull/About/ProfitabilityChart.tsx
  type CustomTooltipCustomProps (line 43) | interface CustomTooltipCustomProps {
  type CustomTooltipProps (line 46) | type CustomTooltipProps = TooltipProps<any, any> & CustomTooltipCustomProps
  function getStrategyReturn (line 99) | function getStrategyReturn(funding: number, ethReturn: number) {
  function ChartWrapper (line 308) | function ChartWrapper() {

FILE: packages/frontend/src/components/Strategies/Bull/BullTrade/EmergencyWithdraw.tsx
  type Step (line 79) | enum Step {

FILE: packages/frontend/src/components/Strategies/Bull/BullTrade/ShutdownEmergencyWithdraw.tsx
  type Callback (line 25) | type Callback = () => void
  type ShutdownEmergencyWithdrawProps (line 27) | interface ShutdownEmergencyWithdrawProps {

FILE: packages/frontend/src/components/Strategies/Bull/BullTrade/index.tsx
  type BullTradeType (line 12) | enum BullTradeType {
  type BullTransactionConfirmation (line 18) | interface BullTransactionConfirmation {

FILE: packages/frontend/src/components/Strategies/Bull/MyPosition/PnL.tsx
  type PnLProps (line 11) | interface PnLProps {

FILE: packages/frontend/src/components/Strategies/Bull/StrategyPerformance.tsx
  type ChartDataInfo (line 54) | type ChartDataInfo = {
  type StrategyPerformanceProps (line 114) | interface StrategyPerformanceProps {

FILE: packages/frontend/src/components/Strategies/Crab/About/ProfitabilityChart.tsx
  function getStrategyReturn (line 92) | function getStrategyReturn(funding: number, ethReturn: number) {
  function ChartWrapper (line 301) | function ChartWrapper() {

FILE: packages/frontend/src/components/Strategies/Crab/CapDetails.tsx
  type CapType (line 25) | type CapType = {

FILE: packages/frontend/src/components/Strategies/Crab/CapDetailsV2.tsx
  type CapType (line 27) | type CapType = {

FILE: packages/frontend/src/components/Strategies/Crab/CrabMigrate.tsx
  type MIGRATION_STEP (line 48) | enum MIGRATION_STEP {

FILE: packages/frontend/src/components/Strategies/Crab/CrabTrade.tsx
  type CrabTradeType (line 72) | type CrabTradeType = {

FILE: packages/frontend/src/components/Strategies/Crab/CrabTradeV2/Deposit.tsx
  type CrabDepositProps (line 63) | type CrabDepositProps = {
  type DepositSteps (line 67) | enum DepositSteps {
  constant OTC_PRICE_IMPACT_THRESHOLD (line 72) | const OTC_PRICE_IMPACT_THRESHOLD = Number(process.env.NEXT_PUBLIC_OTC_PR...

FILE: packages/frontend/src/components/Strategies/Crab/CrabTradeV2/Withdraw.tsx
  type RedeemStepsV1 (line 33) | enum RedeemStepsV1 {
  type RedeemStepsV2 (line 38) | enum RedeemStepsV2 {

FILE: packages/frontend/src/components/Strategies/Crab/CrabTradeV2/types.ts
  type CrabTradeType (line 3) | enum CrabTradeType {
  type CrabTradeTransactionType (line 9) | enum CrabTradeTransactionType {
  type CrabTransactionConfirmation (line 14) | interface CrabTransactionConfirmation {
  type OngoingTransaction (line 23) | interface OngoingTransaction {

FILE: packages/frontend/src/components/Strategies/Crab/MyPosition/CrabPosition.tsx
  type CrabPositionProps (line 11) | interface CrabPositionProps {

FILE: packages/frontend/src/components/Strategies/Crab/MyPosition/PnL.tsx
  type PnLProps (line 11) | interface PnLProps {

FILE: packages/frontend/src/components/Strategies/Crab/StrategyChartsV2.tsx
  type ChartType (line 9) | enum ChartType {
  function StrategyChartsV2 (line 43) | function StrategyChartsV2() {

FILE: packages/frontend/src/components/Strategies/Crab/StrategyHistory.tsx
  type TxType (line 52) | enum TxType {

FILE: packages/frontend/src/components/Strategies/Crab/StrategyPerformance.tsx
  type ChartDataInfo (line 51) | type ChartDataInfo = {
  type StrategyPerformanceProps (line 111) | interface StrategyPerformanceProps {

FILE: packages/frontend/src/components/Strategies/SharePnl.tsx
  type SharePnlProps (line 36) | interface SharePnlProps {

FILE: packages/frontend/src/components/Strategies/StrategyInfoItem.tsx
  type StrategyProps (line 39) | type StrategyProps = {

FILE: packages/frontend/src/components/StrategyLayout/StrategyLayout.tsx
  constant STRATEGIES_PATH (line 86) | const STRATEGIES_PATH = '/strategies'
  constant CRAB_PATH (line 88) | const CRAB_PATH = `${STRATEGIES_PATH}/crab`
  constant BULL_PATH (line 89) | const BULL_PATH = `${STRATEGIES_PATH}/bull`
  constant BEAR_PATH (line 90) | const BEAR_PATH = `${STRATEGIES_PATH}/bear`
  type StrategyImageProps (line 110) | interface StrategyImageProps {

FILE: packages/frontend/src/components/StrikeWarning.tsx
  type StrikeWarningModalProps (line 11) | interface StrikeWarningModalProps {
  type StrikeCountModalProps (line 41) | interface StrikeCountModalProps {
  function StrikeModalManager (line 89) | function StrikeModalManager() {

FILE: packages/frontend/src/components/Trade/Cancelled.tsx
  type ConfirmedProps (line 52) | type ConfirmedProps = {

FILE: packages/frontend/src/components/Trade/Confirmed.tsx
  type ConfirmType (line 107) | enum ConfirmType {
  type ConfirmedProps (line 113) | type ConfirmedProps = {

FILE: packages/frontend/src/components/Trade/Long/index.tsx
  type BuyProps (line 522) | type BuyProps = {

FILE: packages/frontend/src/components/Trade/Mint.tsx
  type MintProps (line 54) | interface MintProps {

FILE: packages/frontend/src/components/Trade/Short/index.tsx
  type SellType (line 567) | type SellType = {

FILE: packages/frontend/src/components/TradeOld/Cancelled.tsx
  type ConfirmedProps (line 49) | type ConfirmedProps = {

FILE: packages/frontend/src/components/TradeOld/Confirmed.tsx
  type ConfirmType (line 50) | enum ConfirmType {
  type ConfirmedProps (line 55) | type ConfirmedProps = {

FILE: packages/frontend/src/components/TradeOld/Long/index.tsx
  constant FUNDING_MOVE_THRESHOLD (line 249) | const FUNDING_MOVE_THRESHOLD = 1.3
  type BuyProps (line 983) | type BuyProps = {

FILE: packages/frontend/src/components/TradeOld/TradeDetails.tsx
  type TradeDetailsType (line 5) | type TradeDetailsType = {

FILE: packages/frontend/src/components/TradeOld/TradeInfoItem.tsx
  type tradeType (line 53) | type tradeType = {

FILE: packages/frontend/src/components/TradeOld/UniswapData.tsx
  type UniswapDataType (line 15) | type UniswapDataType = {

FILE: packages/frontend/src/components/TradeSettings.tsx
  type TradeSettingsProps (line 47) | type TradeSettingsProps = {

FILE: packages/frontend/src/components/WalletFailModal.tsx
  function WalletFailModal (line 6) | function WalletFailModal() {

FILE: packages/frontend/src/constants/address.ts
  type Address (line 3) | type Address = { [key in Networks]: string }
  constant CONTROLLER (line 5) | const CONTROLLER: Address = {
  constant VAULT_MANAGER (line 15) | const VAULT_MANAGER: Address = {
  constant OSQUEETH (line 25) | const OSQUEETH: Address = {
  constant WETH (line 34) | const WETH: Address = {
  constant USDC (line 43) | const USDC: Address = {
  constant UNI_V3_FACTORY (line 52) | const UNI_V3_FACTORY: Address = {
  constant SWAP_ROUTER (line 61) | const SWAP_ROUTER: Address = {
  constant SWAP_ROUTER_02 (line 71) | const SWAP_ROUTER_02: Address = {
  constant SQUEETH_UNI_POOL (line 80) | const SQUEETH_UNI_POOL: Address = {
  constant QUOTER (line 89) | const QUOTER: Address = {
  constant SHORT_HELPER (line 98) | const SHORT_HELPER: Address = {
  constant ORACLE (line 107) | const ORACLE: Address = {
  constant ETH_USDC_POOL (line 116) | const ETH_USDC_POOL: Address = {
  constant NFT_MANAGER (line 125) | const NFT_MANAGER: Address = {
  constant CRAB_STRATEGY (line 134) | const CRAB_STRATEGY: Address = {
  constant CRAB_MIGRATION (line 143) | const CRAB_MIGRATION: Address = {
  constant CRAB_STRATEGY2 (line 152) | const CRAB_STRATEGY2: Address = {
  constant ZERO_ADDR (line 161) | const ZERO_ADDR = '0x0000000000000000000000000000000000000000'
  constant CONTROLLER_HELPER (line 163) | const CONTROLLER_HELPER: Address = {
  constant CRAB_HELPER (line 172) | const CRAB_HELPER: Address = {
  constant CRAB_NETTING (line 181) | const CRAB_NETTING: Address = {
  constant FLASH_BULL_STRATEGY (line 190) | const FLASH_BULL_STRATEGY: Address = {
  constant BULL_STRATEGY (line 199) | const BULL_STRATEGY: Address = {
  constant WETH_E_TOKEN (line 208) | const WETH_E_TOKEN: Address = {
  constant USDC_D_TOKEN (line 217) | const USDC_D_TOKEN: Address = {
  constant AUCTION_BULL (line 226) | const AUCTION_BULL: Address = {
  constant EULER_SIMPLE_LENS (line 235) | const EULER_SIMPLE_LENS: Address = {
  constant BULL_EMERGENCY_WITHDRAW (line 244) | const BULL_EMERGENCY_WITHDRAW: Address = {
  constant BULL_SHUTDOWN_EMERGENCY_WITHDRAW (line 253) | const BULL_SHUTDOWN_EMERGENCY_WITHDRAW: Address = {

FILE: packages/frontend/src/constants/enums.ts
  type TradeMode (line 3) | enum TradeMode {
  type Vaults (line 8) | enum Vaults {
  type VaultSubtitle (line 16) | enum VaultSubtitle {
  type TransactionType (line 22) | enum TransactionType {
  type CloseType (line 41) | enum CloseType {
  type InputType (line 46) | enum InputType {
  type Tooltips (line 51) | enum Tooltips {
  type Links (line 103) | enum Links {
  type Action (line 129) | enum Action {

FILE: packages/frontend/src/constants/index.ts
  constant UNI_POOL_FEES (line 6) | const UNI_POOL_FEES = 3000
  constant ETH_USDC_POOL_FEES (line 7) | const ETH_USDC_POOL_FEES = 500
  constant REVERTED_TRANSACTION_CODE (line 9) | const REVERTED_TRANSACTION_CODE = 4001
  constant FUNDING_PERIOD (line 12) | const FUNDING_PERIOD = 17.5
  constant DEFAULT_SLIPPAGE (line 14) | const DEFAULT_SLIPPAGE = 0.25
  constant MIN_COLLATERAL_AMOUNT (line 16) | const MIN_COLLATERAL_AMOUNT = 6.9
  constant MIN_COLLATERAL_RATIO (line 18) | const MIN_COLLATERAL_RATIO = 150
  constant DEFAULT_COLLATERAL_RATIO (line 20) | const DEFAULT_COLLATERAL_RATIO = 225
  constant YEAR (line 22) | const YEAR = 365
  constant VOL_PERCENT_FIXED (line 24) | const VOL_PERCENT_FIXED = 0.1
  constant VOL_PERCENT_SCALAR (line 26) | const VOL_PERCENT_SCALAR = 0.1
  constant AVERAGE_AUCTION_PRICE_IMPACT (line 28) | const AVERAGE_AUCTION_PRICE_IMPACT = 0.79
  constant NETTING_PRICE_IMPACT (line 30) | const NETTING_PRICE_IMPACT = 0.2
  constant TWAP_PERIOD (line 33) | const TWAP_PERIOD = 420
  constant SHUTDOWN_DATE (line 35) | const SHUTDOWN_DATE = '2024-11-04T16:00:00Z'
  constant INDEX_SCALE (line 45) | const INDEX_SCALE = 10000
  constant OSQUEETH_DECIMALS (line 46) | const OSQUEETH_DECIMALS = 18
  constant WETH_DECIMALS (line 47) | const WETH_DECIMALS = 18
  constant USDC_DECIMALS (line 48) | const USDC_DECIMALS = 6
  constant CRAB_TOKEN_DECIMALS (line 49) | const CRAB_TOKEN_DECIMALS = 18
  constant BULL_TOKEN_DECIMALS (line 50) | const BULL_TOKEN_DECIMALS = 18
  constant SWAP_EVENT_TOPIC (line 52) | const SWAP_EVENT_TOPIC = '0xc42079f94a6350d7e6235f29174924f928cc2ac818eb...
  constant BIG_ZERO (line 54) | const BIG_ZERO = new BigNumber(0)
  constant BIG_ONE (line 55) | const BIG_ONE = new BigNumber(10).pow(18)
  constant TWELVEDATA_NO_PRICEDATA_DURATION (line 56) | const TWELVEDATA_NO_PRICEDATA_DURATION = 62
  constant BLOCKED_COUNTRIES (line 57) | const BLOCKED_COUNTRIES = [
  constant ALLOW_WITHDRAWALS (line 74) | const ALLOW_WITHDRAWALS = ['CA']
  constant BLOCKED_IP_VALUE (line 76) | const BLOCKED_IP_VALUE = 'BLOCKED'
  constant V2_MIGRATION_ETH_PRICE (line 79) | const V2_MIGRATION_ETH_PRICE = 1611.71
  constant V2_MIGRATION_OSQTH_PRICE (line 80) | const V2_MIGRATION_OSQTH_PRICE = 0.0897
  constant V2_MIGRATION_ETH_AMOUNT (line 81) | const V2_MIGRATION_ETH_AMOUNT = 790.186510787310292814
  constant V2_MIGRATION_OSQTH_AMOUNT (line 82) | const V2_MIGRATION_OSQTH_AMOUNT = 4604.57349514942255453
  constant V2_MIGRATION_SUPPLY (line 83) | const V2_MIGRATION_SUPPLY = 519.994374902152348633
  constant CRABV2_START_DATE (line 86) | const CRABV2_START_DATE = '2022-07-28'
  constant BULL_START_DATE (line 87) | const BULL_START_DATE = '2022-12-19'
  constant ZERO_ADDRESS (line 89) | const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
  constant STRATEGY_DEPOSIT_LIMIT (line 91) | const STRATEGY_DEPOSIT_LIMIT = 1000_000
  constant SQUEETH_BASE_URL (line 92) | const SQUEETH_BASE_URL = 'https://squeeth.opyn.co'
  constant TOS_UPDATE_DATE (line 98) | const TOS_UPDATE_DATE = '2023-04-21'
  constant LEGAL_PAGES (line 100) | const LEGAL_PAGES = ['/terms-of-service', '/privacy-policy']

FILE: packages/frontend/src/context/lp.tsx
  type Steps (line 9) | enum Steps {
  type OBTAIN_METHOD (line 15) | enum OBTAIN_METHOD {
  type LPType (line 20) | type LPType = {
  type LPContextType (line 28) | type LPContextType = {
  type LPActions (line 41) | enum LPActions {
  type ActionType (line 48) | type ActionType = {

FILE: packages/frontend/src/context/restrict-user.tsx
  type restrictUserContextType (line 9) | type restrictUserContextType = {

FILE: packages/frontend/src/hooks/contracts/useAllowance.ts
  constant MAX_UINT (line 12) | const MAX_UINT = '0xffffffffffffffffffffffffffffffffffffffffffffffffffff...
  function useUserAllowance (line 14) | function useUserAllowance(token: string, spenderAddess: string | null, d...

FILE: packages/frontend/src/hooks/contracts/useTokenBalance.ts
  type Callback (line 12) | type Callback = (newBalance: BigNumber) => void
  type TokenQueryKeyParams (line 14) | interface TokenQueryKeyParams {
  function updateBalance (line 80) | async function updateBalance(

FILE: packages/frontend/src/hooks/contracts/useVaultManager.ts
  method updateQuery (line 71) | updateQuery(prev, { subscriptionData }) {

FILE: packages/frontend/src/hooks/payOffGraph/useCrabVaultPayoff.ts
  function useCrabVaultPayoff (line 3) | function useCrabVaultPayoff(ethPrice: number, collatRatio: number) {

FILE: packages/frontend/src/hooks/payOffGraph/useShortParams.ts
  function useShortParams (line 4) | function useShortParams(ethPrice: number, collatRatio: number) {

FILE: packages/frontend/src/hooks/payOffGraph/useSqueethShortPayOffGraph.ts
  function useSqueethShortPayOffGraph (line 3) | function useSqueethShortPayOffGraph(ethPrice: number, collatRatio: numbe...

FILE: packages/frontend/src/hooks/useAppCallback.tsx
  function useAppCallback (line 5) | function useAppCallback<T extends (...args: any[]) => any>(

FILE: packages/frontend/src/hooks/useAppEffect.tsx
  function useAppEffect (line 6) | function useAppEffect(effect: EffectCallback, deps?: DependencyList, len...

FILE: packages/frontend/src/hooks/useAppMemo.tsx
  function useAppMemo (line 5) | function useAppMemo<T>(factory: () => T, deps?: DependencyList, lengthAs...

FILE: packages/frontend/src/hooks/useAsyncMemo.tsx
  function useAsyncMemo (line 3) | function useAsyncMemo<T>(

FILE: packages/frontend/src/hooks/useCopyClipboard.ts
  function useCopyClipboard (line 4) | function useCopyClipboard(timeout = 500): [boolean, (toCopy: string) => ...

FILE: packages/frontend/src/hooks/useENS.ts
  function useENS (line 6) | function useENS(address: string | null | undefined) {

FILE: packages/frontend/src/hooks/useETHPrice.ts
  method onError (line 24) | onError() {

FILE: packages/frontend/src/hooks/useInterval.ts
  type Callback (line 3) | type Callback = () => void
  function useInterval (line 5) | function useInterval(callback: Callback, delay: number) {

FILE: packages/frontend/src/hooks/useIntervalAsync.ts
  type Callback (line 4) | type Callback = () => void
  function useIntervalAsync (line 12) | function useIntervalAsync(callback: Callback, interval: number) {

FILE: packages/frontend/src/hooks/usePopup.tsx
  type PopupAction (line 59) | interface PopupAction {
  type PopupConfig (line 67) | interface PopupConfig {
  type PopupProps (line 73) | interface PopupProps extends PopupConfig {

FILE: packages/frontend/src/hooks/useRenderCounter.js
  function getDisplayName (line 5) | function getDisplayName(type) {
  function useRenderCounter (line 40) | function useRenderCounter(logRenderCountKey, resetRenderCountKey) {

FILE: packages/frontend/src/hooks/useTVL.ts
  function useTVL (line 3) | function useTVL() {

FILE: packages/frontend/src/hooks/useVaultData.ts
  type IVault (line 9) | interface IVault {

FILE: packages/frontend/src/hooks/useVaultHistory.ts
  method updateQuery (line 63) | updateQuery(prev, { subscriptionData }) {

FILE: packages/frontend/src/hooks/useYourVaults.ts
  function useYourVaults (line 8) | function useYourVaults(options?: QueryHookOptions<YourVaults, YourVaults...

FILE: packages/frontend/src/lib/pnl.ts
  type ShortPnLParams (line 13) | type ShortPnLParams = {
  function calcUnrealizedPnl (line 19) | function calcUnrealizedPnl({ wethAmount, buyQuote, ethPrice }: ShortPnLP...
  type ShortGainParams (line 34) | type ShortGainParams = {
  function calcShortGain (line 41) | function calcShortGain({ shortUnrealizedPNL, usdAmount, wethAmount, unis...
  function calcETHCollateralPnl (line 61) | async function calcETHCollateralPnl(
  function pnl (line 117) | function pnl(currentValue: BigNumber, cost: BigNumber): BigNumber {
  function pnlInPerct (line 121) | function pnlInPerct(currentValue: BigNumber, cost: BigNumber): BigNumber {
  function pnlv2 (line 126) | function pnlv2(currentValue: BigNumber, remainingDeposit: BigNumber): Bi...
  function pnlInPerctv2 (line 130) | function pnlInPerctv2(currentValue: BigNumber, remainingDeposit: BigNumb...
  function calcDollarShortUnrealizedpnl (line 167) | async function calcDollarShortUnrealizedpnl(
  function calcDollarLongUnrealizedpnl (line 204) | async function calcDollarLongUnrealizedpnl(
  function getEthPriceAtTransactionTime (line 246) | async function getEthPriceAtTransactionTime(timestamp: string) {

FILE: packages/frontend/src/pages/positions/CrabPosition.tsx
  type CrabPositionType (line 11) | type CrabPositionType = {

FILE: packages/frontend/src/pages/positions/CrabPositionV2.tsx
  type CrabPositionV2Type (line 14) | type CrabPositionV2Type = {

FILE: packages/frontend/src/pages/positions/LPedSqueeth.tsx
  type Props (line 9) | interface Props {
  function LPedSqueeth (line 13) | function LPedSqueeth({ vaultExists }: Props) {

FILE: packages/frontend/src/pages/positions/LongSqueeth.tsx
  function LongSqueeth (line 14) | function LongSqueeth() {

FILE: packages/frontend/src/pages/positions/MintedSqueeth.tsx
  type Props (line 10) | interface Props {
  function MintedSqueeth (line 14) | function MintedSqueeth({ vaultExists }: Props) {

FILE: packages/frontend/src/pages/positions/Positions.tsx
  function Positions (line 51) | function Positions() {

FILE: packages/frontend/src/pages/positions/ShortSqueeth.tsx
  function ShortSqueeth (line 21) | function ShortSqueeth() {

FILE: packages/frontend/src/pages/positions/ShortSqueethLiquidated.tsx
  function ShortSqueethLiquidated (line 7) | function ShortSqueethLiquidated() {

FILE: packages/frontend/src/queries/squeeth/__generated__/Vault.ts
  type Vault_vault_owner (line 10) | interface Vault_vault_owner {
  type Vault_vault (line 15) | interface Vault_vault {
  type Vault (line 25) | interface Vault {
  type VaultVariables (line 29) | interface VaultVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/VaultHistory.ts
  type VaultHistory_vaultHistories (line 12) | interface VaultHistory_vaultHistories {
  type VaultHistory (line 23) | interface VaultHistory {
  type VaultHistoryVariables (line 27) | interface VaultHistoryVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/Vaults.ts
  type Vaults_vaults_owner (line 10) | interface Vaults_vaults_owner {
  type Vaults_vaults (line 15) | interface Vaults_vaults {
  type Vaults (line 25) | interface Vaults {
  type VaultsVariables (line 29) | interface VaultsVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/YourVaults.ts
  type YourVaults_vaults (line 10) | interface YourVaults_vaults {
  type YourVaults (line 17) | interface YourVaults {
  type YourVaultsVariables (line 21) | interface YourVaultsVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/bullHedges.ts
  type bullHedges_fullRebalances (line 10) | interface bullHedges_fullRebalances {
  type bullHedges_leverageRebalances (line 19) | interface bullHedges_leverageRebalances {
  type bullHedges (line 27) | interface bullHedges {

FILE: packages/frontend/src/queries/squeeth/__generated__/crabAuctions.ts
  type crabAuctions_crabAuctions (line 10) | interface crabAuctions_crabAuctions {
  type crabAuctions (line 21) | interface crabAuctions {

FILE: packages/frontend/src/queries/squeeth/__generated__/crabV2Auctions.ts
  type crabV2Auctions_hedgeOTCs (line 10) | interface crabV2Auctions_hedgeOTCs {
  type crabV2Auctions (line 20) | interface crabV2Auctions {

FILE: packages/frontend/src/queries/squeeth/__generated__/liquidations.ts
  type liquidations_liquidations (line 10) | interface liquidations_liquidations {
  type liquidations (line 19) | interface liquidations {
  type liquidationsVariables (line 23) | interface liquidationsVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/normalizationFactorUpdates.ts
  type normalizationFactorUpdates_normalizationFactorUpdates (line 10) | interface normalizationFactorUpdates_normalizationFactorUpdates {
  type normalizationFactorUpdates (line 19) | interface normalizationFactorUpdates {
  type normalizationFactorUpdatesVariables (line 23) | interface normalizationFactorUpdatesVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/normalizationFactorUpdatesTime.ts
  type normalizationFactorUpdatesTime_normalizationFactorUpdates (line 10) | interface normalizationFactorUpdatesTime_normalizationFactorUpdates {
  type normalizationFactorUpdatesTime (line 19) | interface normalizationFactorUpdatesTime {
  type normalizationFactorUpdatesTimeVariables (line 23) | interface normalizationFactorUpdatesTimeVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/strategyQuery.ts
  type strategyQuery_strategy (line 10) | interface strategyQuery_strategy {
  type strategyQuery (line 18) | interface strategyQuery {
  type strategyQueryVariables (line 22) | interface strategyQueryVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/subscriptionVaultHistory.ts
  type subscriptionVaultHistory_vaultHistories (line 12) | interface subscriptionVaultHistory_vaultHistories {
  type subscriptionVaultHistory (line 23) | interface subscriptionVaultHistory {
  type subscriptionVaultHistoryVariables (line 27) | interface subscriptionVaultHistoryVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/subscriptionVaults.ts
  type subscriptionVaults_vaults_owner (line 10) | interface subscriptionVaults_vaults_owner {
  type subscriptionVaults_vaults (line 15) | interface subscriptionVaults_vaults {
  type subscriptionVaults (line 25) | interface subscriptionVaults {
  type subscriptionVaultsVariables (line 29) | interface subscriptionVaultsVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/userBullTxes.ts
  type userBullTxes_bullUserTxes (line 10) | interface userBullTxes_bullUserTxes {
  type userBullTxes (line 20) | interface userBullTxes {
  type userBullTxesVariables (line 24) | interface userBullTxesVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/userCrabTxes.ts
  type userCrabTxes_crabStrategyTxes (line 10) | interface userCrabTxes_crabStrategyTxes {
  type userCrabTxes (line 20) | interface userCrabTxes {
  type userCrabTxesVariables (line 24) | interface userCrabTxesVariables {

FILE: packages/frontend/src/queries/squeeth/__generated__/userCrabV2Txes.ts
  type userCrabV2Txes_crabUserTxes (line 10) | interface userCrabV2Txes_crabUserTxes {
  type userCrabV2Txes (line 24) | interface userCrabV2Txes {
  type userCrabV2TxesVariables (line 28) | interface userCrabV2TxesVariables {

FILE: packages/frontend/src/queries/squeeth/bullHedgeQuery.ts
  constant BULL_REBALANCE_QUERY (line 3) | const BULL_REBALANCE_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/crabAuctionQuery.ts
  constant CRAB_TX_QUERY (line 3) | const CRAB_TX_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/crabV2AuctionQuery.ts
  constant CRAB_V2_AUCTION_QUERY (line 3) | const CRAB_V2_AUCTION_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/liquidationsQuery.ts
  constant LIQUIDATIONS_QUERY (line 3) | const LIQUIDATIONS_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/normHistoryQuery.ts
  constant NORMHISTORY_QUERY (line 5) | const NORMHISTORY_QUERY = gql`
  constant NORMHISTORY_TIME_QUERY (line 17) | const NORMHISTORY_TIME_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/strategyQuery.ts
  constant STRATEGY_QUERY (line 3) | const STRATEGY_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/userBullQuery.ts
  constant USER_BULL_TX_QUERY (line 3) | const USER_BULL_TX_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/userCrabTxQuery.ts
  constant USER_CRAB_TX_QUERY (line 3) | const USER_CRAB_TX_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/userCrabV2TxQuery.ts
  constant USER_CRAB_V2_TX_QUERY (line 3) | const USER_CRAB_V2_TX_QUERY = gql`

FILE: packages/frontend/src/queries/squeeth/vaultHistoryQuery.ts
  constant VAULT_HISTORY_QUERY (line 3) | const VAULT_HISTORY_QUERY = gql`
  constant VAULT_HISTORY_SUBSCRIPTION (line 17) | const VAULT_HISTORY_SUBSCRIPTION = gql`

FILE: packages/frontend/src/queries/squeeth/vaultsQuery.ts
  constant VAULTS_QUERY (line 3) | const VAULTS_QUERY = gql`
  constant YOUR_VAULTS_QUERY (line 18) | const YOUR_VAULTS_QUERY = gql`
  constant VAULTS_SUBSCRIPTION (line 28) | const VAULTS_SUBSCRIPTION = gql`
  constant VAULT_QUERY (line 43) | const VAULT_QUERY = gql`

FILE: packages/frontend/src/queries/uniswap/__generated__/activePositions.ts
  type activePositions_positions_token0 (line 10) | interface activePositions_positions_token0 {
  type activePositions_positions_token1 (line 16) | interface activePositions_positions_token1 {
  type activePositions_positions_pool (line 22) | interface activePositions_positions_pool {
  type activePositions_positions_tickLower (line 27) | interface activePositions_positions_tickLower {
  type activePositions_positions_tickUpper (line 35) | interface activePositions_positions_tickUpper {
  type activePositions_positions (line 43) | interface activePositions_positions {
  type activePositions (line 61) | interface activePositions {
  type activePositionsVariables (line 65) | interface activePositionsVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/positions.ts
  type positions_positions_token0 (line 10) | interface positions_positions_token0 {
  type positions_positions_token1 (line 16) | interface positions_positions_token1 {
  type positions_positions_pool (line 22) | interface positions_positions_pool {
  type positions_positions_tickLower (line 27) | interface positions_positions_tickLower {
  type positions_positions_tickUpper (line 35) | interface positions_positions_tickUpper {
  type positions_positions (line 43) | interface positions_positions {
  type positions (line 61) | interface positions {
  type positionsVariables (line 65) | interface positionsVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/subscriptionSwaps.ts
  type subscriptionSwaps_swaps_pool_token0 (line 10) | interface subscriptionSwaps_swaps_pool_token0 {
  type subscriptionSwaps_swaps_pool_token1 (line 16) | interface subscriptionSwaps_swaps_pool_token1 {
  type subscriptionSwaps_swaps_pool (line 22) | interface subscriptionSwaps_swaps_pool {
  type subscriptionSwaps_swaps_transaction (line 28) | interface subscriptionSwaps_swaps_transaction {
  type subscriptionSwaps_swaps (line 34) | interface subscriptionSwaps_swaps {
  type subscriptionSwaps (line 47) | interface subscriptionSwaps {
  type subscriptionSwapsVariables (line 51) | interface subscriptionSwapsVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/subscriptionSwapsRopsten.ts
  type subscriptionSwapsRopsten_swaps_pool_token0 (line 10) | interface subscriptionSwapsRopsten_swaps_pool_token0 {
  type subscriptionSwapsRopsten_swaps_pool_token1 (line 16) | interface subscriptionSwapsRopsten_swaps_pool_token1 {
  type subscriptionSwapsRopsten_swaps_pool (line 22) | interface subscriptionSwapsRopsten_swaps_pool {
  type subscriptionSwapsRopsten_swaps_transaction (line 28) | interface subscriptionSwapsRopsten_swaps_transaction {
  type subscriptionSwapsRopsten_swaps (line 34) | interface subscriptionSwapsRopsten_swaps {
  type subscriptionSwapsRopsten (line 47) | interface subscriptionSwapsRopsten {
  type subscriptionSwapsRopstenVariables (line 51) | interface subscriptionSwapsRopstenVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/subscriptionpositions.ts
  type subscriptionpositions_positions_token0 (line 10) | interface subscriptionpositions_positions_token0 {
  type subscriptionpositions_positions_token1 (line 16) | interface subscriptionpositions_positions_token1 {
  type subscriptionpositions_positions_pool (line 22) | interface subscriptionpositions_positions_pool {
  type subscriptionpositions_positions_tickLower (line 27) | interface subscriptionpositions_positions_tickLower {
  type subscriptionpositions_positions_tickUpper (line 35) | interface subscriptionpositions_positions_tickUpper {
  type subscriptionpositions_positions (line 43) | interface subscriptionpositions_positions {
  type subscriptionpositions (line 61) | interface subscriptionpositions {
  type subscriptionpositionsVariables (line 65) | interface subscriptionpositionsVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/swaps.ts
  type swaps_swaps_pool_token0 (line 10) | interface swaps_swaps_pool_token0 {
  type swaps_swaps_pool_token1 (line 16) | interface swaps_swaps_pool_token1 {
  type swaps_swaps_pool (line 22) | interface swaps_swaps_pool {
  type swaps_swaps_transaction (line 28) | interface swaps_swaps_transaction {
  type swaps_swaps (line 34) | interface swaps_swaps {
  type swaps (line 47) | interface swaps {
  type swapsVariables (line 51) | interface swapsVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/swapsRopsten.ts
  type swapsRopsten_swaps_pool_token0 (line 10) | interface swapsRopsten_swaps_pool_token0 {
  type swapsRopsten_swaps_pool_token1 (line 16) | interface swapsRopsten_swaps_pool_token1 {
  type swapsRopsten_swaps_pool (line 22) | interface swapsRopsten_swaps_pool {
  type swapsRopsten_swaps_transaction (line 28) | interface swapsRopsten_swaps_transaction {
  type swapsRopsten_swaps (line 34) | interface swapsRopsten_swaps {
  type swapsRopsten (line 47) | interface swapsRopsten {
  type swapsRopstenVariables (line 51) | interface swapsRopstenVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/ticks.ts
  type ticks_ticks (line 10) | interface ticks_ticks {
  type ticks (line 18) | interface ticks {
  type ticksVariables (line 22) | interface ticksVariables {

FILE: packages/frontend/src/queries/uniswap/__generated__/transactions.ts
  type transactions_positionSnapshots_transaction (line 10) | interface transactions_positionSnapshots_transaction {
  type transactions_positionSnapshots (line 16) | interface transactions_positionSnapshots {
  type transactions (line 28) | interface transactions {
  type transactionsVariables (line 32) | interface transactionsVariables {

FILE: packages/frontend/src/queries/uniswap/positionsQuery.ts
  constant POSITIONS_SUBSCRIPTION (line 3) | const POSITIONS_SUBSCRIPTION = gql`
  constant POSITIONS_QUERY (line 42) | const POSITIONS_QUERY = gql`
  constant ACTIVE_POSITIONS_QUERY (line 81) | const ACTIVE_POSITIONS_QUERY = gql`

FILE: packages/frontend/src/queries/uniswap/swapsQuery.ts
  constant SWAPS_SUBSCRIPTION (line 3) | const SWAPS_SUBSCRIPTION = gql`
  constant SWAPS_QUERY (line 42) | const SWAPS_QUERY = gql`

FILE: packages/frontend/src/queries/uniswap/swapsRopstenQuery.ts
  constant SWAPS_ROPSTEN_SUBSCRIPTION (line 3) | const SWAPS_ROPSTEN_SUBSCRIPTION = gql`
  constant SWAPS_ROPSTEN_QUERY (line 43) | const SWAPS_ROPSTEN_QUERY = gql`

FILE: packages/frontend/src/queries/uniswap/ticksQuery.ts
  constant TICKS_QUERY (line 3) | const TICKS_QUERY = gql`

FILE: packages/frontend/src/queries/uniswap/transactionsQuery.ts
  constant TRANSACTIONS_QUERY (line 3) | const TRANSACTIONS_QUERY = gql`

FILE: packages/frontend/src/server/ipqs.ts
  type ApiResponse (line 1) | type ApiResponse = {
  function checkUserIP (line 34) | async function checkUserIP(ipAddress: string): Promise<ApiResponse | nul...
  function getIPQUrl (line 55) | async function getIPQUrl(url: string): Promise<ApiResponse | null> {
  function isVPN (line 65) | async function isVPN(ipAddress: string): Promise<boolean> {

FILE: packages/frontend/src/state/controller/utils.ts
  type UnivariateFunction (line 70) | type UnivariateFunction = (x: number) => number
  function getVault (line 153) | async function getVault(vaultId: number, contract: Contract | null): Pro...
  function getIndex (line 167) | async function getIndex(period: number, contract: Contract | null) {
  function getMark (line 174) | async function getMark(period: number, contract: Contract | null) {
  function getNormFactor (line 180) | async function getNormFactor(contract: Contract | null) {
  function getDailyHistoricalFunding (line 188) | async function getDailyHistoricalFunding(contract: Contract | null) {
  function getCurrentImpliedFunding (line 224) | async function getCurrentImpliedFunding(contract: Contract | null) {
  function getCurrentImpliedFundingShutdown (line 238) | async function getCurrentImpliedFundingShutdown(contract: Contract | nul...
  function getImpliedVolatilityShutdown (line 265) | async function getImpliedVolatilityShutdown(contract: Contract | null) {
  function getDailyHistoricalFundingShutdown (line 285) | async function getDailyHistoricalFundingShutdown(contract: Contract | nu...
  function getOsqthRefVol (line 333) | async function getOsqthRefVol() {

FILE: packages/frontend/src/state/ethPriceCharts/atoms.ts
  constant FIVE_MINUTES_IN_MILLISECONDS (line 21) | const FIVE_MINUTES_IN_MILLISECONDS = 300_000
  constant STRATEGIES_LAUNCH_TIME_STAMP (line 22) | const STRATEGIES_LAUNCH_TIME_STAMP = 1642636810000

FILE: packages/frontend/src/state/lp/hooks.ts
  constant COLLAT_RATIO_FLASHLOAN (line 24) | const COLLAT_RATIO_FLASHLOAN = 2
  constant POOL_FEE (line 25) | const POOL_FEE = 3000
  constant MAX_INT_128 (line 26) | const MAX_INT_128 = new BigNumber(2).pow(128).minus(1).toFixed(0)
  constant FLASHLOAN_BUFFER (line 28) | const FLASHLOAN_BUFFER = 0.02
  function getPoolState (line 329) | async function getPoolState(poolContract: Contract) {

FILE: packages/frontend/src/state/pnl/hooks.ts
  function useEthCollateralPnl (line 34) | function useEthCollateralPnl() {
  function useBuyAndSellQuote (line 77) | function useBuyAndSellQuote() {
  function useCurrentLongPositionValue (line 98) | function useCurrentLongPositionValue() {
  function useCurrentShortPositionValue (line 117) | function useCurrentShortPositionValue() {
  function useLongGain (line 137) | function useLongGain() {
  function useShortGain (line 160) | function useShortGain() {
  function useLongUnrealizedPNL (line 181) | function useLongUnrealizedPNL() {
  function useShortUnrealizedPNL (line 220) | function useShortUnrealizedPNL() {

FILE: packages/frontend/src/state/positions/hooks.ts
  method updateQuery (line 89) | updateQuery(prev, { subscriptionData }) {
  method updateQuery (line 225) | updateQuery(prev, { subscriptionData }) {
  constant MAX_UNIT (line 238) | const MAX_UNIT = '0xffffffffffffffffffffffffffffffff'

FILE: packages/frontend/src/state/positions/providers.tsx
  type ComputeSwapsContextValue (line 14) | interface ComputeSwapsContextValue {

FILE: packages/frontend/src/state/squeethPool/hooks.ts
  function getPoolInfo (line 798) | function getPoolInfo(route: SwapRoute, overallInputAmount: BigNumber) {

FILE: packages/frontend/src/state/squeethPool/price.ts
  constant BIPS_BASE (line 7) | const BIPS_BASE = JSBI.BigInt(10000)
  constant ALLOWED_PRICE_IMPACT_HIGH (line 8) | const ALLOWED_PRICE_IMPACT_HIGH = new Percent(JSBI.BigInt(500), BIPS_BAS...
  constant ALLOWED_PRICE_IMPACT_LOW (line 9) | const ALLOWED_PRICE_IMPACT_LOW = new Percent(JSBI.BigInt(100), BIPS_BASE...
  constant ALLOWED_PRICE_IMPACT_MEDIUM (line 10) | const ALLOWED_PRICE_IMPACT_MEDIUM = new Percent(JSBI.BigInt(500), BIPS_B...
  constant BLOCKED_PRICE_IMPACT_NON_EXPERT (line 11) | const BLOCKED_PRICE_IMPACT_NON_EXPERT = new Percent(JSBI.BigInt(1500), B...
  constant ONE_HUNDRED_PERCENT (line 12) | const ONE_HUNDRED_PERCENT = new Percent('1')
  constant ZERO_PERCENT (line 13) | const ZERO_PERCENT = new Percent('0')
  constant THIRTY_BIPS_FEE (line 15) | const THIRTY_BIPS_FEE = new Percent(JSBI.BigInt(30), JSBI.BigInt(10000))
  constant INPUT_FRACTION_AFTER_FEE (line 16) | const INPUT_FRACTION_AFTER_FEE = ONE_HUNDRED_PERCENT.subtract(THIRTY_BIP...
  function computeRealizedPriceImpact (line 18) | function computeRealizedPriceImpact(trade: Trade<Currency, Currency, Tra...
  function getPriceImpactWarning (line 23) | function getPriceImpactWarning(priceImpact?: Percent): 'warning' | 'erro...
  function computeRealizedLPFeePercent (line 30) | function computeRealizedLPFeePercent(trade: Trade<Currency, Currency, Tr...
  function computeRealizedLPFeeAmount (line 70) | function computeRealizedLPFeeAmount(
  constant IMPACT_TIERS (line 83) | const IMPACT_TIERS = [
  type WarningSeverity (line 90) | type WarningSeverity = 0 | 1 | 2 | 3 | 4
  function warningSeverity (line 91) | function warningSeverity(priceImpact: Percent | undefined): WarningSever...

FILE: packages/frontend/src/state/wallet/hooks.ts
  function initOnboard (line 308) | function initOnboard(subscriptions: any, networkId: Networks) {
  function initNotify (line 374) | function initNotify(networkId: Networks) {
  function getBalance (line 382) | async function getBalance(web3: Web3, address: string | null) {

FILE: packages/frontend/src/theme.ts
  type Mode (line 3) | enum Mode {

FILE: packages/frontend/src/types/index.ts
  type TypeBackground (line 6) | interface TypeBackground {
  type TypographyVariants (line 14) | interface TypographyVariants {
  type TypographyPropsVariantOverrides (line 21) | interface TypographyPropsVariantOverrides {
  type Networks (line 26) | enum Networks {
  type Vault (line 35) | type Vault = {
  type NormHistory (line 43) | type NormHistory = {
  type PositionType (line 51) | enum PositionType {
  type TradeType (line 57) | enum TradeType {
  type PnLType (line 62) | enum PnLType {
  type NFTManagers (line 66) | interface NFTManagers extends positions_positions {
  type CollateralStatus (line 74) | enum CollateralStatus {
  type CrabStrategyTxType (line 80) | enum CrabStrategyTxType {
  type CrabStrategyV2TxType (line 89) | enum CrabStrategyV2TxType {
  type BullStrategyTxType (line 102) | enum BullStrategyTxType {
  type BullRebalanceType (line 107) | enum BullRebalanceType {
  class ChartDataInfo (line 112) | class ChartDataInfo {
  type AuctionType (line 117) | enum AuctionType {

FILE: packages/frontend/src/utils/amplitude.ts
  type BULL_EVENTS (line 38) | enum BULL_EVENTS {
  type WALLET_EVENTS (line 71) | enum WALLET_EVENTS {
  type SITE_EVENTS (line 75) | enum SITE_EVENTS {
  type LANDING_EVENTS (line 95) | enum LANDING_EVENTS {
  type LONG_SQUEETH_EVENTS (line 113) | enum LONG_SQUEETH_EVENTS {
  type SHORT_SQUEETH_EVENTS (line 122) | enum SHORT_SQUEETH_EVENTS {
  type CRAB_EVENTS (line 128) | enum CRAB_EVENTS {

FILE: packages/frontend/src/utils/apollo-client.ts
  constant THE_GRAPH_API_KEYS (line 7) | const THE_GRAPH_API_KEYS = {
  constant SUBGRAPH_IDS (line 12) | const SUBGRAPH_IDS = {

FILE: packages/frontend/src/utils/calculations.ts
  function toTokenAmount (line 15) | function toTokenAmount(amount: BigNumber | number | string, decimals: nu...
  function fromTokenAmount (line 26) | function fromTokenAmount(amount: BigNumber | number | string, decimals: ...
  function inRange (line 30) | function inRange(lower: number, upper: number, pool: Pool | undefined): ...
  function parseSlippageInput (line 37) | function parseSlippageInput(value: string) {
  function getCollatPercentStatus (line 48) | function getCollatPercentStatus(collatPercent: number) {
  function getBreakEvenForLongSqueeth (line 59) | function getBreakEvenForLongSqueeth(
  function getUSDCPoolFee (line 74) | function getUSDCPoolFee(network: Networks) {

FILE: packages/frontend/src/utils/cookies.ts
  constant ACCEPT_COOKIE_FATHOM_EVENT_CODE (line 5) | const ACCEPT_COOKIE_FATHOM_EVENT_CODE = 'A4YYBAUT'
  constant REJECT_COOKIE_FATHOM_EVENT_CODE (line 6) | const REJECT_COOKIE_FATHOM_EVENT_CODE = '6WRWR0XB'
  type CookieNames (line 8) | enum CookieNames {

FILE: packages/frontend/src/utils/crisp-chat.ts
  function sendCrispChatMessage (line 3) | function sendCrispChatMessage(text: string) {
  function openCrispChat (line 7) | function openCrispChat() {
  function hideCrispChat (line 11) | function hideCrispChat() {
  function showCrispChat (line 15) | function showCrispChat() {

FILE: packages/frontend/src/utils/csvToJson.ts
  function csvJSON (line 1) | function csvJSON(csv: any) {

FILE: packages/frontend/src/utils/error.ts
  type ErrorWithMessage (line 1) | type ErrorWithMessage = {
  function isErrorWithMessage (line 5) | function isErrorWithMessage(error: unknown): error is ErrorWithMessage {
  function toErrorWithMessage (line 14) | function toErrorWithMessage(maybeError: unknown): ErrorWithMessage {
  function getErrorMessage (line 26) | function getErrorMessage(error: unknown) {

FILE: packages/frontend/src/utils/ethPriceCharts.ts
  function getCoingeckoETHPrices (line 8) | async function getCoingeckoETHPrices(day = 1): Promise<{ time: number; v...
  function getCoingeckoETHPricesBetweenTimestamps (line 24) | async function getCoingeckoETHPricesBetweenTimestamps(
  function getCUSDCPrices (line 45) | async function getCUSDCPrices(day = 1): Promise<{ time: number; value: n...
  function getETH90DaysPrices (line 62) | async function getETH90DaysPrices(): Promise<{ time: number; value: numb...
  function getETHWithinOneDayPrices (line 78) | async function getETHWithinOneDayPrices(): Promise<{ time: number; value...

FILE: packages/frontend/src/utils/floatifyBigNums.ts
  function floatifyBigNums (line 4) | function floatifyBigNums(value: any): any {

FILE: packages/frontend/src/utils/index.tsx
  function getCost (line 3) | function getCost(amount: number, price: number) {

FILE: packages/frontend/src/utils/markdown.ts
  function getMarkdown (line 7) | function getMarkdown(file: string) {

FILE: packages/frontend/src/utils/pricer.ts
  function getFairSqueethMarkBefore (line 13) | function getFairSqueethMarkBefore(price: number, timeElapsedInDay: numbe...
  function getFairSqueethMarkAfter (line 19) | function getFairSqueethMarkAfter(price: number, timeElapsedInDay: number...
  function getFairSqueethAsk (line 24) | function getFairSqueethAsk(price: number, timeElapsedInDay: number, vol:...
  function getFairSqueethBid (line 29) | function getFairSqueethBid(price: number, timeElapsedInDay: number, vol:...
  function getETHPNLCompounding (line 33) | async function getETHPNLCompounding(ethPrices: { time: number; value: nu...
  function getSqueethPNLCompounding (line 61) | async function getSqueethPNLCompounding(
  function useETHSqueethPNLCompounding (line 111) | function useETHSqueethPNLCompounding(
  function getSqueethChartWithFunding (line 208) | async function getSqueethChartWithFunding(
  function getFunding (line 276) | function getFunding(price: number, mark: number, power = 2) {
  function getVolForTimestamp (line 286) | async function getVolForTimestamp(
  function getVolForTimestampOrDefault (line 294) | async function getVolForTimestampOrDefault(
  function getVolMap (line 317) | async function getVolMap(): Promise<{ [key: string]: number }> {
  function getLiveVolMap (line 324) | async function getLiveVolMap(): Promise<{ [key: string]: number }> {
  function updateTimestampVolDB (line 337) | async function updateTimestampVolDB(timestamp: number, vol: number): Pro...
  function updateTimestampLiveVolDB (line 356) | async function updateTimestampLiveVolDB(timestamp: number, vol: number):...
  function getVolForTimestampFromTardis (line 371) | async function getVolForTimestampFromTardis(timestamp: number, ethPrice:...
  function instrumentNameToStrike (line 412) | function instrumentNameToStrike(optionName: string) {
  function calculateMinCollatReq (line 422) | function calculateMinCollatReq(shortAmount: number, _vol: number, _ethPr...
  function calculateLiquidationPrice (line 433) | function calculateLiquidationPrice(
  function getEthPrices (line 443) | function getEthPrices(startPrice: number, step: number, length: number) {
  function getSqueethLongPayOffGraph (line 455) | function getSqueethLongPayOffGraph(ethPrice: number) {
  function getBuyAndLPPayOffGraph (line 516) | function getBuyAndLPPayOffGraph(ethPrice: number) {
  function getMintAndLpPayoffGraph (line 557) | function getMintAndLpPayoffGraph(ethPrice: number) {

FILE: packages/frontend/src/utils/stringifyDeps.ts
  function stringifyDeps (line 4) | function stringifyDeps(deps?: DependencyList, lengthAsArrDep?: boolean) {

FILE: packages/frontend/types/global_apollo.ts
  type Action (line 10) | enum Action {

FILE: packages/hardhat/hardhat.config.ts
  function mnemonic (line 44) | function mnemonic() {
  constant UNISWAP_SETTING (line 57) | const UNISWAP_SETTING = {

FILE: packages/hardhat/scripts/deploy.js
  function sleep (line 163) | function sleep(ms) {

FILE: packages/hardhat/scripts/docs/docify.js
  constant NODE_DIR (line 1) | const NODE_DIR     = "node_modules";
  constant INPUT_DIR (line 2) | const INPUT_DIR    = "contracts";
  constant CONFIG_DIR (line 3) | const CONFIG_DIR   = "docs";
  constant OUTPUT_DIR (line 4) | const OUTPUT_DIR   = "docs/contracts-documentation";
  constant README_FILE (line 5) | const README_FILE  = "README.md";
  constant SUMMARY_FILE (line 6) | const SUMMARY_FILE = "SUMMARY.md";
  constant EXCLUDE_LIST (line 7) | const EXCLUDE_LIST = ["packages", "interfaces", "mocks", "test", "extern...
  function exclude (line 15) | function exclude(pathName) {
  function scan (line 24) | function scan(pathName, indentation) {
  function fix (line 39) | function fix(pathName) {

FILE: packages/hardhat/scripts/publish.js
  function publishContract (line 9) | function publishContract(contractName, networkName) {
  function main (line 64) | async function main() {

FILE: packages/hardhat/tasks/default.ts
  constant DEBUG (line 13) | const DEBUG = false;
  function debug (line 15) | function debug(text: any) {
  function addr (line 183) | async function addr(ethers: any, addr: string) {
  function send (line 211) | function send(signer: any, txparams: any) {

FILE: packages/hardhat/test/calculator.ts
  function convertPriceToSqrtX96 (line 4) | function convertPriceToSqrtX96 (sqrtPriceX96: string) {
  function convertRawPriceToSqrtX96 (line 28) | function convertRawPriceToSqrtX96 (rawPrice: BigNumber) {
  function convertToken1PriceToSqrtX96Price (line 33) | function convertToken1PriceToSqrtX96Price(token1PriceInToken0: string) {
  function convertToken0PriceToSqrtX96Price (line 38) | function convertToken0PriceToSqrtX96Price(token1PriceInToken0: string) {
  function getTickFromToken0Price (line 43) | function getTickFromToken0Price(price: string) {
  function getTickFromNormalPrice (line 47) | function getTickFromNormalPrice(price: string) {
  function log1_0001 (line 51) | function log1_0001(num: number) { // eslint-disable-line
  function getSqrtPriceAndTickBySqueethPrice (line 55) | function getSqrtPriceAndTickBySqueethPrice(price1e18: string|BigNumberis...
  function getYAmountAboveRange (line 65) | function getYAmountAboveRange (pa:number, pb: number, liquidity: string) {
  function getXAmountBelowRange (line 71) | function getXAmountBelowRange (pa:number, pb: number, liquidity: string) {
  function tickToPrice1e18 (line 77) | function tickToPrice1e18(tick: number) {

FILE: packages/hardhat/test/integration-tests/liquidation.ts
  constant TICK_SPACE (line 11) | const TICK_SPACE = 60

FILE: packages/hardhat/test/integration-tests/uni-position-collateral.ts
  constant TICK_SPACE (line 11) | const TICK_SPACE = 60

FILE: packages/hardhat/test/setup.ts
  function delay (line 330) | function delay(ms: number) {

FILE: packages/hardhat/test/unit-tests/controller-funding.ts
  function getNormFactorMultiplier (line 482) | function getNormFactorMultiplier(mark: BigNumber, index:BigNumber, secon...

FILE: packages/hardhat/test/utils.ts
  type Vault (line 9) | type Vault = [BigNumber, BigNumber, BigNumber] & {
  constant UNDERFLOW_ERROR (line 31) | const UNDERFLOW_ERROR =

FILE: packages/hardhat/test/vault-utils.ts
  type Vault (line 3) | type Vault = [string, number, BigNumber, BigNumber] & {
  constant UNDERFLOW_ERROR (line 15) | const UNDERFLOW_ERROR = "reverted with panic code 0x11 (Arithmetic opera...

FILE: packages/subgraph/src/bullStrategy.ts
  function loadOrCreateTx (line 44) | function loadOrCreateTx(id: string): BullUserTxSchema {
  function handleWithdraw (line 62) | function handleWithdraw(event: Withdraw): void {
  function handleSetCap (line 77) | function handleSetCap(event: SetCap): void {
  function handleDeposit (line 85) | function handleDeposit(event: Deposit): void {
  function handleSetStrategyCap (line 98) | function handleSetStrategyCap(event: SetCap): void {
  function handleSetAuction (line 105) | function handleSetAuction(event: SetAuction): void {
  function handleRedeemCrabAndWithdrawEth (line 113) | function handleRedeemCrabAndWithdrawEth(event: RedeemCrabAndWithdrawEth)...
  function handleSetShutdownContract (line 125) | function handleSetShutdownContract(event: SetShutdownContract): void {
  function handleShutdownRepayAndWithdraw (line 133) | function handleShutdownRepayAndWithdraw(event: ShutdownRepayAndWithdraw)...
  function handleFarm (line 145) | function handleFarm(event: Farm): void {
  function handleDepositEthIntoCrab (line 152) | function handleDepositEthIntoCrab(event: DepositEthIntoCrab): void {
  function handleWithdrawShutdown (line 162) | function handleWithdrawShutdown(event: WithdrawShutdown): void {
  function handleAuctionRepayAndWithdrawFromLeverage (line 173) | function handleAuctionRepayAndWithdrawFromLeverage(event: AuctionRepayAn...
  function handleSetCrUpperAndLower (line 185) | function handleSetCrUpperAndLower(event: SetCrUpperAndLower): void {
  function handleSetDeltaUpperAndLower (line 194) | function handleSetDeltaUpperAndLower(event: SetDeltaUpperAndLower): void {
  function handleLeverageRebalance (line 203) | function handleLeverageRebalance(event: LeverageRebalance): void {
  function handleSetFullRebalanceClearingPriceTolerance (line 217) | function handleSetFullRebalanceClearingPriceTolerance(event: SetFullReba...
  function handleSetRebalanceWethLimitPriceTolerance (line 224) | function handleSetRebalanceWethLimitPriceTolerance(event: SetRebalanceWe...
  function handleSetAuctionManager (line 231) | function handleSetAuctionManager(event: SetAuctionManager): void {
  function handleFullRebalance (line 239) | function handleFullRebalance(event: FullRebalance): void {
  function handleFlashDeposit (line 255) | function handleFlashDeposit(event: FlashDeposit): void {
  function handleFlashWithdraw (line 268) | function handleFlashWithdraw(event: FlashWithdraw): void {
  function handleTransfer (line 279) | function handleTransfer(event: Transfer): void {
  function findFlashBullEthDeposited (line 285) | function findFlashBullEthDeposited(event: FlashDeposit): BigInt {

FILE: packages/subgraph/src/constants.ts
  constant BIGINT_ONE (line 4) | const BIGINT_ONE = BigInt.fromI32(1);
  constant BIGINT_ZERO (line 5) | const BIGINT_ZERO = BigInt.fromI32(0);
  constant EMPTY_ADDR (line 6) | const EMPTY_ADDR = Address.empty();
  constant MAINNET_SHORT_HELPER_ADDR (line 8) | const MAINNET_SHORT_HELPER_ADDR = Address.fromString(
  constant MAINNET_CRAB_V2_ADDR (line 11) | const MAINNET_CRAB_V2_ADDR = Address.fromString(
  constant MAINNET_CRAB_MIGRATION_ADDR (line 14) | const MAINNET_CRAB_MIGRATION_ADDR = Address.fromString(
  constant MAINNET_CRAB_V1_ADDR (line 17) | const MAINNET_CRAB_V1_ADDR = Address.fromString(
  constant MAINNET_FLASH_BULL_ADDR (line 20) | const MAINNET_FLASH_BULL_ADDR = Address.fromString(
  constant MAINNET_BULL_STRATEGY_ADDR (line 23) | const MAINNET_BULL_STRATEGY_ADDR = Address.fromString(
  constant MAINNET_AUCTION_BULL_ADDR (line 26) | const MAINNET_AUCTION_BULL_ADDR = Address.fromString(
  constant MAINNET_WETH_ADDR (line 30) | const MAINNET_WETH_ADDR = Address.fromString(
  constant ROPSTEN_SHORT_HELPER_ADDR (line 34) | const ROPSTEN_SHORT_HELPER_ADDR = Address.fromString(
  constant ROPSTEN_CRAB_V2_ADDR (line 37) | const ROPSTEN_CRAB_V2_ADDR = Address.fromString(
  constant ROPSTEN_CRAB_MIGRATION_ADDR (line 40) | const ROPSTEN_CRAB_MIGRATION_ADDR = Address.fromString(
  constant ROPSTEN_CRAB_V1_ADDR (line 43) | const ROPSTEN_CRAB_V1_ADDR = Address.fromString(
  constant LOCALHOST_SHORT_HELPER_ADDR (line 47) | const LOCALHOST_SHORT_HELPER_ADDR = Address.fromString(
  constant RA_SHORT_HELPER_ADDR (line 51) | const RA_SHORT_HELPER_ADDR = Address.fromString(
  constant GOERLI_SHORT_HELPER_ADDR (line 55) | const GOERLI_SHORT_HELPER_ADDR = Address.fromString(
  constant GOERLI_CRAB_V2_ADDR (line 58) | const GOERLI_CRAB_V2_ADDR = Address.fromString(
  constant GOERLI_CRAB_MIGRATION_ADDR (line 61) | const GOERLI_CRAB_MIGRATION_ADDR = Address.fromString(
  constant GOERLI_CRAB_V1_ADDR (line 64) | const GOERLI_CRAB_V1_ADDR = Address.fromString(
  constant GOERLI_BULL_STRATEGY_ADDR (line 67) | const GOERLI_BULL_STRATEGY_ADDR = Address.fromString(
  constant GOERLI_AUCTION_BULL_ADDR (line 70) | const GOERLI_AUCTION_BULL_ADDR = Address.fromString(
  constant GOERLI_FLASH_BULL_ADDR (line 73) | const GOERLI_FLASH_BULL_ADDR = Address.fromString(
  constant GOERLI_WETH_ADDR (line 77) | const GOERLI_WETH_ADDR = Address.fromString(
  constant SHORT_HELPER_ADDR (line 81) | const SHORT_HELPER_ADDR = getShortHelperAddr(dataSource.network());
  constant CRAB_V2_ADDR (line 82) | const CRAB_V2_ADDR = getCrabV2Addr(dataSource.network());
  constant CRAB_MIGRATION_ADDR (line 83) | const CRAB_MIGRATION_ADDR = getCrabMigrationAddr(dataSource.network());
  constant CRAB_V1_ADDR (line 84) | const CRAB_V1_ADDR = getCrabV1Addr(dataSource.network());
  constant FLASH_BULL_ADDR (line 85) | const FLASH_BULL_ADDR = getFlashBullAddr(dataSource.network());
  constant BULL_ADDR (line 86) | const BULL_ADDR = getBullAddr(dataSource.network());
  constant AUCTION_BULL (line 87) | const AUCTION_BULL = getAuctionBullAddr(dataSource.network());
  constant WETH (line 88) | const WETH = getWethAddr(dataSource.network());

FILE: packages/subgraph/src/controller.ts
  function handleBurnShort (line 95) | function handleBurnShort(event: BurnShort): void {
  function handleDepositCollateral (line 129) | function handleDepositCollateral(event: DepositCollateral): void {
  function handleDepositUniPositionToken (line 165) | function handleDepositUniPositionToken(
  function handleFeeRateUpdated (line 175) | function handleFeeRateUpdated(event: FeeRateUpdated): void {}
  function handleFeeRecipientUpdated (line 177) | function handleFeeRecipientUpdated(event: FeeRecipientUpdated): void {}
  function handleLiquidate (line 179) | function handleLiquidate(event: Liquidate): void {
  function handleMintShort (line 227) | function handleMintShort(event: MintShort): void {
  function handleNormalizationFactorUpdated (line 260) | function handleNormalizationFactorUpdated(
  function handleOpenVault (line 273) | function handleOpenVault(event: OpenVault): void {
  function handleOwnershipTransferred (line 285) | function handleOwnershipTransferred(event: OwnershipTransferred): void {}
  function handlePaused (line 287) | function handlePaused(event: Paused): void {}
  function handleRedeemLong (line 289) | function handleRedeemLong(event: RedeemLong): void {}
  function handleRedeemShort (line 291) | function handleRedeemShort(event: RedeemShort): void {}
  function handleReduceDebt (line 293) | function handleReduceDebt(event: ReduceDebt): void {}
  function handleShutdown (line 295) | function handleShutdown(event: Shutdown): void {}
  function handleUnPaused (line 297) | function handleUnPaused(event: UnPaused): void {}
  function handleUpdateOperator (line 299) | function handleUpdateOperator(event: UpdateOperator): void {
  function handleWithdrawCollateral (line 307) | function handleWithdrawCollateral(event: WithdrawCollateral): void {
  function handleWithdrawUniPositionToken (line 343) | function handleWithdrawUniPositionToken(
  function getHourStatSnapshot (line 353) | function getHourStatSnapshot(timestamp: BigInt): HourStatSnapshot {
  function getDayStatSnapshot (line 382) | function getDayStatSnapshot(timestamp: BigInt): DayStatSnapshot {
  function getTransactionDetail (line 411) | function getTransactionDetail(

FILE: packages/subgraph/src/crabV2.ts
  function loadOrCreateTx (line 46) | function loadOrCreateTx(id: string): CrabUserTxSchema {
  function handleDeposit (line 61) | function handleDeposit(event: Deposit): void {
  function handleWithdraw (line 74) | function handleWithdraw(event: Withdraw): void {
  function handleWithdrawShutdown (line 87) | function handleWithdrawShutdown(event: WithdrawShutdown): void {
  function handleFlashDeposit (line 98) | function handleFlashDeposit(event: FlashDeposit): void {
  function handleFlashWithdraw (line 121) | function handleFlashWithdraw(event: FlashWithdraw): void {
  function handleFlashDepositCallback (line 136) | function handleFlashDepositCallback(event: FlashDepositCallback): void {
  function handleFlashDepositERC20 (line 144) | function handleFlashDepositERC20(event: FlashDepositERC20): void {
  function handleFlashWithdrawERC20 (line 152) | function handleFlashWithdrawERC20(event: FlashWithdrawERC20): void {
  function handleNettingDeposit (line 159) | function handleNettingDeposit(event: USDCDeposited): void {
  function handleNettingWithdraw (line 175) | function handleNettingWithdraw(event: CrabWithdrawn): void {
  function handleFlashWithdrawCallback (line 191) | function handleFlashWithdrawCallback(event: FlashWithdrawCallback): void {
  function handleTransfer (line 199) | function handleTransfer(event: Transfer): void {
  function handleDepositV1Shares (line 222) | function handleDepositV1Shares(event: DepositV1Shares): void {
  function handleSetHedgeTimeThreshold (line 238) | function handleSetHedgeTimeThreshold(event: SetHedgeTimeThreshold): void {
  function handleQueueTransaction (line 245) | function handleQueueTransaction(event: QueueTransaction): void {
  function handleExecuteTransaction (line 257) | function handleExecuteTransaction(event: QueueTransaction): void {
  function handleHedgeOTC (line 270) | function handleHedgeOTC(event: HedgeOTC): void {
  function handleHedgeOTCSingle (line 285) | function handleHedgeOTCSingle(event: HedgeOTCSingle): void {
  function handleSetStrategyCap (line 298) | function handleSetStrategyCap(event: SetStrategyCap): void {
  function handleSetHedgingTwapPeriod (line 305) | function handleSetHedgingTwapPeriod(event: SetHedgingTwapPeriod): void {
  function handleSetHedgePriceThreshold (line 312) | function handleSetHedgePriceThreshold(event: SetHedgePriceThreshold): vo...
  function handleSetOTCPriceTolerance (line 319) | function handleSetOTCPriceTolerance(event: SetOTCPriceTolerance): void {
  function handleVaultTransferred (line 326) | function handleVaultTransferred(event: VaultTransferred): void {

FILE: packages/subgraph/src/crabstrategy.ts
  function loadOrCreateTx (line 21) | function loadOrCreateTx(id: string): CrabStrategyTx {
  function handleDeposit (line 33) | function handleDeposit(event: Deposit): void {
  function handleWithdraw (line 44) | function handleWithdraw(event: Withdraw): void {
  function handleFlashDeposit (line 55) | function handleFlashDeposit(event: FlashDeposit): void {
  function handleFlashWithdraw (line 65) | function handleFlashWithdraw(event: FlashWithdraw): void {
  function handleHedgeOnUniswap (line 75) | function handleHedgeOnUniswap(event: HedgeOnUniswap): void {
  function handleHedge (line 87) | function handleHedge(event: Hedge): void {
  function handleFlashDepositCallback (line 100) | function handleFlashDepositCallback(event: FlashDepositCallback): void {
  function handleFlashWithdrawCallback (line 106) | function handleFlashWithdrawCallback(event: FlashWithdrawCallback): void {
  function handleTransfer (line 112) | function handleTransfer(event: Transfer): void {
  function handleExecuteSellAuction (line 135) | function handleExecuteSellAuction(event: ExecuteSellAuction): void {
  function handleExecuteBuyAuction (line 146) | function handleExecuteBuyAuction(event: ExecuteBuyAuction): void {

FILE: packages/subgraph/src/util.ts
  function getShortHelperAddr (line 29) | function getShortHelperAddr(networkName: string): Address {
  function getCrabV2Addr (line 43) | function getCrabV2Addr(networkName: string): Address {
  function getCrabMigrationAddr (line 54) | function getCrabMigrationAddr(networkName: string): Address {
  function getCrabV1Addr (line 65) | function getCrabV1Addr(networkName: string): Address {
  function getFlashBullAddr (line 76) | function getFlashBullAddr(networkName: string): Address {
  function getBullAddr (line 87) | function getBullAddr(networkName: string): Address {
  function getAuctionBullAddr (line 98) | function getAuctionBullAddr(networkName: string): Address {
  function getWethAddr (line 109) | function getWethAddr(networkName: string): Address {
  function loadOrCreateAccount (line 118) | function loadOrCreateAccount(accountId: string): Account {
  function loadOrCreateStrategy (line 128) | function loadOrCreateStrategy(id: string): Strategy {
Copy disabled (too large) Download .json
Condensed preview — 886 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (27,805K chars).
[
  {
    "path": ".circleci/config.yml",
    "chars": 6926,
    "preview": "version: 2.1\norbs:\n  coveralls: coveralls/coveralls@1.0.6\n  node: circleci/node@1.1.6\n\nworkflows:\n  hardhat:\n    jobs:\n "
  },
  {
    "path": ".editorconfig",
    "chars": 123,
    "preview": "root = true\n\n[packages/**.js{,x}]\nindent_style = space\nindent_size = 2\n\n[*.{sol,yul}]\nindent_style = space\nindent_size ="
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 535,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: \"\"\nlabels: \"\"\nassignees: \"\"\n---\n\n**Describe the bu"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 417,
    "preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: \"\"\nlabels: \"\"\nassignees: \"\"\n---\n\n**Please descr"
  },
  {
    "path": ".github/pull_request_template.md",
    "chars": 329,
    "preview": "# Task:\n\n## Description\n\nPlease include a summary of the change and which issue is fixed. Please also include relevant m"
  },
  {
    "path": ".gitignore",
    "chars": 1039,
    "preview": "packages/subgraph/subgraph.yaml\npackages/subgraph/generated\npackages/subgraph/abis/*\npackages/hardhat/*.txt\n**/aws.json\n"
  },
  {
    "path": ".gitmodules",
    "chars": 2509,
    "preview": "[submodule \"packages/services/arbitrum\"]\n\tpath = packages/services/arbitrum\n\turl = https://github.com/OffchainLabs/arbit"
  },
  {
    "path": ".gitpod.yml",
    "chars": 594,
    "preview": "tasks:\n  - name: App\n    init: >\n      yarn &&\n      gp sync-done install\n    command: REACT_APP_PROVIDER=$(gp url 8545)"
  },
  {
    "path": ".husky/pre-commit",
    "chars": 57,
    "preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpx lint-staged"
  },
  {
    "path": ".huskyrc",
    "chars": 85,
    "preview": "{\n  \"hooks\": {\n    \"pre-commit\": \"lint-staged\",\n    \"pre-push\": \"yarn pre-push\"\n  }\n}"
  },
  {
    "path": ".lintstagedrc",
    "chars": 80,
    "preview": "{\n  \"packages/hardhat/**/*.+(js|ts|json|sol)\": [\n    \"yarn lint-contracts\"\n  ]\n}"
  },
  {
    "path": "README.md",
    "chars": 2750,
    "preview": "# Squeeth Monorepo\n\n<p align=\"center\">\n<img src=\"https://i.imgur.com/Iyulvqq.png\" width=400>\n</p>\n<p align=\"center\"> The"
  },
  {
    "path": "package.json",
    "chars": 3611,
    "preview": "{\n  \"name\": \"@squeeth/monorepo\",\n  \"version\": \"1.0.0\",\n  \"keywords\": [\n    \"ethereum\",\n    \"react\",\n    \"uniswap\",\n    \""
  },
  {
    "path": "packages/crab-netting/LICENSE_BUSL",
    "chars": 4445,
    "preview": "Business Source License 1.1\n\nLicense text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.\n\n\n\"Business So"
  },
  {
    "path": "packages/crab-netting/foundry.toml",
    "chars": 140,
    "preview": "[profile.default]\nsrc = 'src'\nout = 'out'\nlibs = ['lib']\n\n# See more config options https://github.com/foundry-rs/foundr"
  },
  {
    "path": "packages/crab-netting/remappings.txt",
    "chars": 260,
    "preview": "ds-test/=lib/forge-std/lib/ds-test/src/\nforge-std/=lib/forge-std/src/\nsqueeth-monorepo/=lib/squeeth-monorepo/packages/ha"
  },
  {
    "path": "packages/crab-netting/script/Counter.s.sol",
    "chars": 224,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport \"forge-std/Script.sol\";\n\ncontract CounterScript "
  },
  {
    "path": "packages/crab-netting/src/CrabNetting.sol",
    "chars": 34023,
    "preview": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.13;\n\n// interface\nimport {IERC20} from \"openzeppelin/token/ERC"
  },
  {
    "path": "packages/crab-netting/src/interfaces/IController.sol",
    "chars": 462,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.17;\n\ninterface IController {\n    function feeRate() external"
  },
  {
    "path": "packages/crab-netting/src/interfaces/ICrabStrategyV2.sol",
    "chars": 836,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport {IERC20} from \"openzeppelin/interfaces/IERC20.so"
  },
  {
    "path": "packages/crab-netting/src/interfaces/IOracle.sol",
    "chars": 239,
    "preview": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\ninterface IOracle {\n    function getTwap(address _pool, addres"
  },
  {
    "path": "packages/crab-netting/src/interfaces/IWETH.sol",
    "chars": 242,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport {IERC20} from \"openzeppelin/interfaces/IERC20.so"
  },
  {
    "path": "packages/crab-netting/test/BaseForkSetup.t.sol",
    "chars": 2612,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.17;\n\nimport \"forge-std/Test.sol\";\n\nimport {ERC20} from \"open"
  },
  {
    "path": "packages/crab-netting/test/BaseSetup.t.sol",
    "chars": 1621,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.17;\n\nimport \"forge-std/Test.sol\";\nimport {ERC20} from \"openz"
  },
  {
    "path": "packages/crab-netting/test/Deposit.t.sol",
    "chars": 6055,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport {BaseForkSetup} from \"./BaseForkSetup.t.sol\";\n\nc"
  },
  {
    "path": "packages/crab-netting/test/DepositAuction.t.sol",
    "chars": 19311,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\nimport {BaseForkSetup} fro"
  },
  {
    "path": "packages/crab-netting/test/ForkTestNetAtPrice.sol",
    "chars": 1558,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.17;\n\nimport \"forge-std/Test.sol\";\nimport {BaseForkSetup} fro"
  },
  {
    "path": "packages/crab-netting/test/Netting.t.sol",
    "chars": 7345,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\nimport {BaseForkSetup} fro"
  },
  {
    "path": "packages/crab-netting/test/PriceChecks.sol",
    "chars": 1500,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\nimport {BaseForkSetup} fro"
  },
  {
    "path": "packages/crab-netting/test/QueuedBalances.t.sol",
    "chars": 1935,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport {BaseForkSetup} from \"./BaseForkSetup.t.sol\";\n\nc"
  },
  {
    "path": "packages/crab-netting/test/SkipDeposits.t.sol",
    "chars": 1346,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.13;\n\nimport {BaseForkSetup} from \"./BaseForkSetup.t.sol\";\n\nc"
  },
  {
    "path": "packages/crab-netting/test/WithdrawAuction.t.sol",
    "chars": 8493,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.17;\n\nimport \"forge-std/Test.sol\";\n\nimport {Order, WithdrawAu"
  },
  {
    "path": "packages/crab-netting/test/utils/SigUtils.sol",
    "chars": 1381,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.17;\n\nimport {console} from \"forge-std/console.sol\";\n\nimport "
  },
  {
    "path": "packages/crab-netting/test/utils/UniswapQuote.sol",
    "chars": 1248,
    "preview": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.17;\n\nimport {IQuoter} from \"@uniswap/v3-periphery/contracts/"
  },
  {
    "path": "packages/frontend/.babelrc",
    "chars": 32,
    "preview": "{\n  \"presets\": [\"next/babel\"]\n}\n"
  },
  {
    "path": "packages/frontend/.eslintrc",
    "chars": 2015,
    "preview": "{\n  \"parser\": \"@typescript-eslint/parser\",\n  \"plugins\": [\"prettier\", \"@typescript-eslint\", \"react\", \"react-hooks\", \"simp"
  },
  {
    "path": "packages/frontend/.gitignore",
    "chars": 448,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
  },
  {
    "path": "packages/frontend/.nvmrc",
    "chars": 9,
    "preview": "v18.15.0\n"
  },
  {
    "path": "packages/frontend/.prettierrc",
    "chars": 152,
    "preview": "{\n  \"semi\": false,\n  \"trailingComma\": \"all\",\n  \"singleQuote\": true,\n  \"useTabs\": false,\n  \"bracketSpacing\": true,\n  \"pri"
  },
  {
    "path": "packages/frontend/CONTRIBUTING.md",
    "chars": 1630,
    "preview": "# Squeeth Frontend Contribution Guidelines\n\n## Issues\n\n- Check to see if your issue has been previously brought up, and "
  },
  {
    "path": "packages/frontend/LICENSE",
    "chars": 35148,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "packages/frontend/README.md",
    "chars": 2082,
    "preview": "# Squeeth frontend\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-squa"
  },
  {
    "path": "packages/frontend/custom.d.ts",
    "chars": 23,
    "preview": "declare module 'fzero'\n"
  },
  {
    "path": "packages/frontend/cypress/TEST.md",
    "chars": 2628,
    "preview": "- Setup / Preparation\n\n  1. Test Environment\n     1. Test locally\n     2. Network: Ropsten\n     3. Wallet: Metamask\n    "
  },
  {
    "path": "packages/frontend/cypress/fixtures/example.json",
    "chars": 160,
    "preview": "{\n    \"name\": \"Using fixtures to represent data\",\n    \"email\": \"hello@cypress.io\",\n    \"body\": \"Fixtures are a great way"
  },
  {
    "path": "packages/frontend/cypress/integration/pages/header.js",
    "chars": 202,
    "preview": "import Page from './page'\nexport default class Header extends Page {\n  getConnectWalletBtn() {\n    return cy.get('#conne"
  },
  {
    "path": "packages/frontend/cypress/integration/pages/notifications.js",
    "chars": 322,
    "preview": "import Page from './page'\nexport default class Notifications extends Page {\n  getTransactionSuccessNotification() {\n    "
  },
  {
    "path": "packages/frontend/cypress/integration/pages/onboard.js",
    "chars": 140,
    "preview": "import Page from './page'\nexport default class Onboard extends Page {\n  getBrowserWalletBtn() {\n    return cy.get('[alt="
  },
  {
    "path": "packages/frontend/cypress/integration/pages/page.js",
    "chars": 627,
    "preview": "export default class Page {\n  getTitle() {\n    return cy.title()\n  }\n\n  getMetamaskWalletAddress() {\n    return cy.fetch"
  },
  {
    "path": "packages/frontend/cypress/integration/pages/trade.js",
    "chars": 1187,
    "preview": "import Page from './page'\nimport Header from './header'\nimport Onboard from './onboard'\nimport Notifications from './not"
  },
  {
    "path": "packages/frontend/cypress/integration/specs/01-trade-long.spec.js",
    "chars": 28909,
    "preview": "/// <reference types=\"cypress\" />\n\nimport TradePage from '../pages/trade'\nimport BigNumber from 'bignumber.js'\n\nconst tr"
  },
  {
    "path": "packages/frontend/cypress/integration/specs/02-trade-short.spec.js",
    "chars": 25644,
    "preview": "/// <reference types=\"cypress\" />\nimport TradePage from '../pages/trade'\nimport BigNumber from 'bignumber.js'\nimport { M"
  },
  {
    "path": "packages/frontend/cypress/integration/specs/06-manual-short.spec.js",
    "chars": 2896,
    "preview": "/// <reference types=\"cypress\" />\nimport BigNumber from 'bignumber.js'\nimport TradePage from '../pages/trade'\n\nconst tra"
  },
  {
    "path": "packages/frontend/cypress/plugins/index.js",
    "chars": 313,
    "preview": "import synpressPlugins from '@synthetixio/synpress/plugins'\n\n/** @type {Cypress.PluginConfig} */\n// eslint-disable-next-"
  },
  {
    "path": "packages/frontend/cypress/support/commands.js",
    "chars": 1141,
    "preview": "// ***********************************************\n// This example commands.js shows you how to\n// create various custom"
  },
  {
    "path": "packages/frontend/cypress/support/index.js",
    "chars": 708,
    "preview": "// ***********************************************************\n// This example support/index.js is processed and\n// load"
  },
  {
    "path": "packages/frontend/cypress.json",
    "chars": 735,
    "preview": "{\n    \"baseUrl\": \"http://localhost:3000\",\n    \"userAgent\": \"synpress\",\n    \"retries\": {\n        \"runMode\": 0,\n        \"o"
  },
  {
    "path": "packages/frontend/env.example",
    "chars": 378,
    "preview": "NEXT_PUBLIC_INFURA_API_KEY=\" \"\nNEXT_PUBLIC_BLOCKNATIVE_DAPP_ID=\" \"\nNEXT_PUBLIC_UPDATE_DB=\"false\"\nNEXT_PUBLIC_TARDIS_API_"
  },
  {
    "path": "packages/frontend/jest.config.js",
    "chars": 405,
    "preview": "module.exports = {\n  testEnvironment: 'jsdom',\n  setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],\n  testPathIgnorePatter"
  },
  {
    "path": "packages/frontend/jest.setup.ts",
    "chars": 109,
    "preview": "import '@testing-library/jest-dom'\nimport 'cross-fetch/polyfill'\nimport dotenv from \"dotenv\"\ndotenv.config()\n"
  },
  {
    "path": "packages/frontend/middleware.ts",
    "chars": 2663,
    "preview": "import { NextRequest, NextResponse } from 'next/server'\nimport { Redis } from '@upstash/redis'\n\nimport { isVPN } from 's"
  },
  {
    "path": "packages/frontend/next-env.d.ts",
    "chars": 201,
    "preview": "/// <reference types=\"next\" />\n/// <reference types=\"next/image-types/global\" />\n\n// NOTE: This file should not be edite"
  },
  {
    "path": "packages/frontend/next.config.js",
    "chars": 922,
    "preview": "// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { withSentryConfig } = require('@sentry/nextjs')\n\nc"
  },
  {
    "path": "packages/frontend/package.json",
    "chars": 6004,
    "preview": "{\n    \"name\": \"@squeeth/frontend\",\n    \"version\": \"0.1.0\",\n    \"private\": true,\n    \"engines\": {\n        \"node\": \"^18\"\n "
  },
  {
    "path": "packages/frontend/pages/_app.tsx",
    "chars": 8073,
    "preview": "import useRenderCounter from '../src/hooks/useRenderCounter'\nimport '../styles/globals.css'\nimport { ApolloProvider } fr"
  },
  {
    "path": "packages/frontend/pages/_document.tsx",
    "chars": 1761,
    "preview": "import { ServerStyleSheets } from '@material-ui/core/styles'\nimport Document, { Head, Html, Main, NextScript } from 'nex"
  },
  {
    "path": "packages/frontend/pages/api/__tests__/isValidAddress.test.ts",
    "chars": 3799,
    "preview": "/**\n * @jest-environment node\n */\n import { createMocks, RequestMethod, createRequest, createResponse } from 'node-mocks"
  },
  {
    "path": "packages/frontend/pages/api/auction/lastHedgeAuction.ts",
    "chars": 556,
    "preview": "import axios from 'axios'\nimport type { NextApiRequest, NextApiResponse } from 'next'\n\nconst SQUEETH_PORTAL_API = proces"
  },
  {
    "path": "packages/frontend/pages/api/charts/longchart.ts",
    "chars": 4283,
    "preview": "import type { NextApiRequest, NextApiResponse } from 'next'\nimport { getCoingeckoETHPricesBetweenTimestamps as getETHPri"
  },
  {
    "path": "packages/frontend/pages/api/currentsqueethvol.ts",
    "chars": 517,
    "preview": "import axios from 'axios'\nimport type { NextApiRequest, NextApiResponse } from 'next'\n\nconst SQUEETH_VOL_API = process.e"
  },
  {
    "path": "packages/frontend/pages/api/historicalprice.ts",
    "chars": 2544,
    "preview": "import { format } from 'date-fns'\nimport type { NextApiRequest, NextApiResponse } from 'next'\n\nconst TWELVE_DATA_API = '"
  },
  {
    "path": "packages/frontend/pages/api/isValidAddress.ts",
    "chars": 1253,
    "preview": "import type { NextApiRequest, NextApiResponse } from 'next'\nimport axios from 'axios'\nimport * as Sentry from '@sentry/n"
  },
  {
    "path": "packages/frontend/pages/api/pnl.tsx",
    "chars": 8694,
    "preview": "/* eslint-disable @next/next/no-img-element */\nimport { ImageResponse } from '@vercel/og'\nimport { NextRequest } from 'n"
  },
  {
    "path": "packages/frontend/pages/api/strikes.ts",
    "chars": 589,
    "preview": "import type { NextApiRequest, NextApiResponse } from 'next'\nimport { getAddressStrikeCount } from 'src/server/firebase-a"
  },
  {
    "path": "packages/frontend/pages/api/tvl.ts",
    "chars": 614,
    "preview": "import axios from 'axios'\nimport type { NextApiRequest, NextApiResponse } from 'next'\n\nconst handleRequest = async (req:"
  },
  {
    "path": "packages/frontend/pages/api/twelvedata.ts",
    "chars": 734,
    "preview": "import axios from 'axios'\nimport type { NextApiRequest, NextApiResponse } from 'next'\n\nconst TWELVE_DATA_API = 'https://"
  },
  {
    "path": "packages/frontend/pages/api/updateBlockedAddress.ts",
    "chars": 598,
    "preview": "import type { NextApiRequest, NextApiResponse } from 'next'\nimport { updateBlockedAddress } from 'src/server/firebase-ad"
  },
  {
    "path": "packages/frontend/pages/blocked.tsx",
    "chars": 941,
    "preview": "import React from 'react'\nimport { Box, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles } from '"
  },
  {
    "path": "packages/frontend/pages/index.tsx",
    "chars": 768,
    "preview": "import React, { useEffect } from 'react'\nimport Hidden from '@material-ui/core/Hidden'\nimport DesktopLandingPage from '@"
  },
  {
    "path": "packages/frontend/pages/lp.tsx",
    "chars": 8386,
    "preview": "import { createStyles, makeStyles } from '@material-ui/core'\nimport { Box, Typography } from '@material-ui/core'\nimport "
  },
  {
    "path": "packages/frontend/pages/mint.tsx",
    "chars": 1117,
    "preview": "import React from 'react'\nimport { Box, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles } from '"
  },
  {
    "path": "packages/frontend/pages/opt-out.tsx",
    "chars": 1465,
    "preview": "import React, { useEffect, useState } from 'react'\nimport { Box, Typography } from '@material-ui/core'\nimport { createSt"
  },
  {
    "path": "packages/frontend/pages/pos-merge.tsx",
    "chars": 446,
    "preview": "import { getMarkdown } from '@utils/markdown'\nimport MarkdownPage from '@components/MarkdownPage'\nimport DefaultSiteSeo "
  },
  {
    "path": "packages/frontend/pages/positions.tsx",
    "chars": 694,
    "preview": "import { useAtomValue } from 'jotai'\n\nimport ConnectWallet from '@pages/positions/ConnectWallet'\nimport Positions from '"
  },
  {
    "path": "packages/frontend/pages/privacy-policy.tsx",
    "chars": 2137,
    "preview": "import ReactMarkdown from 'markdown-to-jsx'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport B"
  },
  {
    "path": "packages/frontend/pages/share-pnl/[...slug].tsx",
    "chars": 6992,
    "preview": "import { GetServerSideProps } from 'next'\nimport { NextSeo } from 'next-seo'\nimport { makeStyles, createStyles } from '@"
  },
  {
    "path": "packages/frontend/pages/squeeth.tsx",
    "chars": 8620,
    "preview": "import { useState } from 'react'\nimport { Typography, Box, Tooltip } from '@material-ui/core'\nimport { makeStyles, creat"
  },
  {
    "path": "packages/frontend/pages/strategies/bull.tsx",
    "chars": 839,
    "preview": "import React from 'react'\nimport { NextSeo } from 'next-seo'\n\nimport BullStrategy from '@components/Strategies/Bull'\nimp"
  },
  {
    "path": "packages/frontend/pages/strategies/crab.tsx",
    "chars": 3115,
    "preview": "import React, { useEffect } from 'react'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport { Ne"
  },
  {
    "path": "packages/frontend/pages/strategies/index.tsx",
    "chars": 474,
    "preview": "import React, { useEffect } from 'react'\nimport { useRouter } from 'next/router'\n\nconst Redirection = () => {\n  const ro"
  },
  {
    "path": "packages/frontend/pages/terms-of-service-faq.tsx",
    "chars": 475,
    "preview": "import { getMarkdown } from '@utils/markdown'\nimport MarkdownPage from '@components/MarkdownPage'\nimport DefaultSiteSeo "
  },
  {
    "path": "packages/frontend/pages/terms-of-service.tsx",
    "chars": 465,
    "preview": "import { getMarkdown } from '@utils/markdown'\nimport MarkdownPage from '@components/MarkdownPage'\nimport DefaultSiteSeo "
  },
  {
    "path": "packages/frontend/pages/vault/[vid].tsx",
    "chars": 30468,
    "preview": "import { useQuery } from '@apollo/client'\nimport {\n  CircularProgress,\n  Link,\n  Typography,\n  Tooltip,\n  Select,\n  Menu"
  },
  {
    "path": "packages/frontend/sentry.client.config.ts",
    "chars": 447,
    "preview": "import * as Sentry from '@sentry/nextjs'\n\nSentry.init({\n  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,\n  // We recommend adj"
  },
  {
    "path": "packages/frontend/sentry.server.config.ts",
    "chars": 447,
    "preview": "import * as Sentry from '@sentry/nextjs'\n\nSentry.init({\n  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,\n  // We recommend adj"
  },
  {
    "path": "packages/frontend/src/abis/NFTpositionmanager.json",
    "chars": 24314,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_factory\",\n        \"type\": \"address\"\n "
  },
  {
    "path": "packages/frontend/src/abis/auctionBull.json",
    "chars": 14491,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_auctionManager\",\n        \"type\": \"add"
  },
  {
    "path": "packages/frontend/src/abis/bullEmergencyWithdraw.json",
    "chars": 8696,
    "preview": "[\n  {\n    \"inputs\": [\n      { \"internalType\": \"address\", \"name\": \"_crab\", \"type\": \"address\" },\n      { \"internalType\": \""
  },
  {
    "path": "packages/frontend/src/abis/bullShutdownEmergencyWithdraw.json",
    "chars": 5031,
    "preview": "[\n  {\n    \"type\": \"constructor\",\n    \"inputs\": [\n      {\n        \"name\": \"_crab\",\n        \"type\": \"address\",\n        \"in"
  },
  {
    "path": "packages/frontend/src/abis/bullStrategy.json",
    "chars": 20255,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_crab\",\n        \"type\": \"address\"\n    "
  },
  {
    "path": "packages/frontend/src/abis/controller.json",
    "chars": 24694,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_oracle\",\n        \"type\": \"address\"\n  "
  },
  {
    "path": "packages/frontend/src/abis/controllerHelper.json",
    "chars": 18169,
    "preview": "[\n    {\n      \"inputs\": [\n        {\n          \"internalType\": \"address\",\n          \"name\": \"_controller\",\n          \"typ"
  },
  {
    "path": "packages/frontend/src/abis/crabHelper.json",
    "chars": 4369,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_crab\",\n        \"type\": \"address\"\n    "
  },
  {
    "path": "packages/frontend/src/abis/crabMigration.json",
    "chars": 8940,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address payable\",\n        \"name\": \"_crabV1\",\n        \"type\": \"add"
  },
  {
    "path": "packages/frontend/src/abis/crabNetting.json",
    "chars": 26854,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_crab\",\n        \"type\": \"address\"\n    "
  },
  {
    "path": "packages/frontend/src/abis/crabStrategy.json",
    "chars": 31579,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_wSqueethController\",\n        \"type\": "
  },
  {
    "path": "packages/frontend/src/abis/crabStrategyV2.json",
    "chars": 29655,
    "preview": "[\n    {\n      \"inputs\": [\n        {\n          \"internalType\": \"address\",\n          \"name\": \"_wSqueethController\",\n      "
  },
  {
    "path": "packages/frontend/src/abis/erc20.json",
    "chars": 3685,
    "preview": "[\n  {\n    \"constant\": true,\n    \"inputs\": [],\n    \"name\": \"name\",\n    \"outputs\": [\n      {\n        \"name\": \"\",\n        \""
  },
  {
    "path": "packages/frontend/src/abis/erc721.json",
    "chars": 6308,
    "preview": "[\n  {\n    \"constant\": false,\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"to\",\n        \"t"
  },
  {
    "path": "packages/frontend/src/abis/eulerEToken.json",
    "chars": 1379,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"account\",\n        \"type\": \"address\"\n  "
  },
  {
    "path": "packages/frontend/src/abis/eulerSimpleLens.json",
    "chars": 11834,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"bytes32\",\n        \"name\": \"moduleGitCommit_\",\n        \"type\": \"by"
  },
  {
    "path": "packages/frontend/src/abis/flashBullStrategy.json",
    "chars": 4380,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_bull\",\n        \"type\": \"address\"\n    "
  },
  {
    "path": "packages/frontend/src/abis/oracle.json",
    "chars": 2348,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_pool\",\n        \"type\": \"address\"\n    "
  },
  {
    "path": "packages/frontend/src/abis/quoter.json",
    "chars": 5650,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_factory\",\n        \"type\": \"address\"\n "
  },
  {
    "path": "packages/frontend/src/abis/shortHelper.json",
    "chars": 5632,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_controllerAddr\",\n        \"type\": \"add"
  },
  {
    "path": "packages/frontend/src/abis/squeeth.json",
    "chars": 8388,
    "preview": "[\n    {\n        \"inputs\": [\n            {\n                \"internalType\": \"string\",\n                \"name\": \"_name\",\n   "
  },
  {
    "path": "packages/frontend/src/abis/swapRouter.json",
    "chars": 11749,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"address\",\n        \"name\": \"_factory\",\n        \"type\": \"address\"\n "
  },
  {
    "path": "packages/frontend/src/abis/swapRouter2.json",
    "chars": 28762,
    "preview": "[\n    {\n        \"inputs\": [\n            {\n                \"internalType\": \"address\",\n                \"name\": \"_factoryV2"
  },
  {
    "path": "packages/frontend/src/abis/uniswapPool.json",
    "chars": 19545,
    "preview": "[\n  {\n    \"anonymous\": false,\n    \"inputs\": [\n      {\n        \"indexed\": true,\n        \"internalType\": \"address\",\n      "
  },
  {
    "path": "packages/frontend/src/abis/vaultManager.json",
    "chars": 8728,
    "preview": "[\n  {\n    \"inputs\": [\n      {\n        \"internalType\": \"string\",\n        \"name\": \"_name\",\n        \"type\": \"string\"\n      "
  },
  {
    "path": "packages/frontend/src/abis/weth.json",
    "chars": 5074,
    "preview": "[\n  {\n    \"anonymous\": false,\n    \"inputs\": [\n      {\n        \"indexed\": true,\n        \"internalType\": \"address\",\n      "
  },
  {
    "path": "packages/frontend/src/components/Alert.tsx",
    "chars": 1371,
    "preview": "import React from 'react'\nimport { Box, Typography, BoxProps } from '@material-ui/core'\nimport { makeStyles, createStyle"
  },
  {
    "path": "packages/frontend/src/components/Alerts/ShutdownAlert.tsx",
    "chars": 3027,
    "preview": "import React from 'react'\nimport Link from 'next/link'\nimport { Typography, useMediaQuery, useTheme } from '@material-ui"
  },
  {
    "path": "packages/frontend/src/components/Alerts/ZenBullAlert.tsx",
    "chars": 1477,
    "preview": "import React from 'react'\nimport Link from 'next/link'\nimport { Typography, useMediaQuery, useTheme } from '@material-ui"
  },
  {
    "path": "packages/frontend/src/components/Announcement.tsx",
    "chars": 1432,
    "preview": "import { Box, createStyles, IconButton, Link, makeStyles, Typography } from '@material-ui/core'\nimport React, { useEffec"
  },
  {
    "path": "packages/frontend/src/components/Button/WalletButton.tsx",
    "chars": 5294,
    "preview": "import { Hidden, Box, Button, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-"
  },
  {
    "path": "packages/frontend/src/components/Button/index.tsx",
    "chars": 3017,
    "preview": "import Button from '@material-ui/core/Button'\nimport { withStyles } from '@material-ui/core/styles'\n\nexport const Primar"
  },
  {
    "path": "packages/frontend/src/components/Charts/BullStrategyPerformanceChart.tsx",
    "chars": 4172,
    "preview": "import { Box, CircularProgress } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/st"
  },
  {
    "path": "packages/frontend/src/components/Charts/CrabStrategyChart.tsx",
    "chars": 9210,
    "preview": "import { createStyles, Hidden, InputAdornment, makeStyles, TextField, Tooltip } from '@material-ui/core'\nimport Alert fr"
  },
  {
    "path": "packages/frontend/src/components/Charts/CrabStrategyV2PnLChart.tsx",
    "chars": 4231,
    "preview": "import { Box, CircularProgress } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/st"
  },
  {
    "path": "packages/frontend/src/components/Charts/FundingChart.tsx",
    "chars": 5264,
    "preview": "import { memo } from 'react'\nimport { Box, CircularProgress, createStyles, makeStyles, Tooltip } from '@material-ui/core"
  },
  {
    "path": "packages/frontend/src/components/Charts/LPBuyChart.tsx",
    "chars": 3970,
    "preview": "import useAppCallback from '@hooks/useAppCallback'\nimport React, { memo, useEffect, useState } from 'react'\nimport { Lin"
  },
  {
    "path": "packages/frontend/src/components/Charts/LPMintChart.tsx",
    "chars": 4008,
    "preview": "import useAppCallback from '@hooks/useAppCallback'\nimport useAppEffect from '@hooks/useAppEffect'\nimport React, { memo, "
  },
  {
    "path": "packages/frontend/src/components/Charts/LongChart.tsx",
    "chars": 13781,
    "preview": "import {\n  Box,\n  createStyles,\n  Hidden,\n  InputAdornment,\n  makeStyles,\n  TextField,\n  Tooltip,\n  Typography,\n  Circul"
  },
  {
    "path": "packages/frontend/src/components/Charts/LongChartPayoff.tsx",
    "chars": 6960,
    "preview": "import {\n  Box,\n  createStyles,\n  makeStyles,\n  CircularProgress,\n  InputLabel,\n  TextFieldProps,\n  TextField,\n  Divider"
  },
  {
    "path": "packages/frontend/src/components/Charts/LongSqueethPayoff.tsx",
    "chars": 4590,
    "preview": "import useAppCallback from '@hooks/useAppCallback'\nimport useAppEffect from '@hooks/useAppEffect'\nimport React, { memo, "
  },
  {
    "path": "packages/frontend/src/components/Charts/ShortChart.tsx",
    "chars": 5610,
    "preview": "import { useETHPrice } from '@hooks/useETHPrice'\nimport { createStyles, makeStyles, TextField, Typography } from '@mater"
  },
  {
    "path": "packages/frontend/src/components/Charts/ShortFundingChart.tsx",
    "chars": 5250,
    "preview": "import { memo } from 'react'\nimport { Box, CircularProgress, createStyles, makeStyles, Tooltip } from '@material-ui/core"
  },
  {
    "path": "packages/frontend/src/components/Charts/ShortSqueethPayoff.tsx",
    "chars": 4748,
    "preview": "import useSqueethShortPayOffGraph from '@hooks/payOffGraph/useSqueethShortPayOffGraph'\nimport React, { memo, useCallback"
  },
  {
    "path": "packages/frontend/src/components/Charts/VaultChart.tsx",
    "chars": 12016,
    "preview": "import { useETHPrice } from '@hooks/useETHPrice'\nimport { createStyles, makeStyles, TextField, Typography } from '@mater"
  },
  {
    "path": "packages/frontend/src/components/Checkbox.tsx",
    "chars": 1253,
    "preview": "import {\n  FormControlLabel,\n  Checkbox as MaterialCheckbox,\n  CheckboxProps as MaterialCheckboxProps,\n} from '@material"
  },
  {
    "path": "packages/frontend/src/components/CollatRange.tsx",
    "chars": 2854,
    "preview": "import { createStyles, makeStyles, Tooltip, Snackbar, Collapse, styled } from '@material-ui/core'\nimport { yellow } from"
  },
  {
    "path": "packages/frontend/src/components/CollatRatioSlider.tsx",
    "chars": 4411,
    "preview": "import { createStyles, makeStyles, Tooltip } from '@material-ui/core'\nimport React, { useCallback } from 'react'\n\nimport"
  },
  {
    "path": "packages/frontend/src/components/CustomProgress.tsx",
    "chars": 847,
    "preview": "import LinearProgress from '@material-ui/core/LinearProgress'\nimport { withStyles, createStyles } from '@material-ui/cor"
  },
  {
    "path": "packages/frontend/src/components/CustomSlider.tsx",
    "chars": 1001,
    "preview": "import Slider from '@material-ui/core/Slider'\nimport { yellow } from '@material-ui/core/colors'\nimport { withStyles } fr"
  },
  {
    "path": "packages/frontend/src/components/CustomSwitch.tsx",
    "chars": 1390,
    "preview": "import { createStyles, makeStyles, Typography } from '@material-ui/core'\nimport React from 'react'\nimport clsx from 'cls"
  },
  {
    "path": "packages/frontend/src/components/DefaultSiteSeo/DefaultSiteSeo.tsx",
    "chars": 683,
    "preview": "import React from 'react'\nimport { NextSeo } from 'next-seo'\nimport { SiteMetaDescription, SiteMetaImage, SiteMetaTitle,"
  },
  {
    "path": "packages/frontend/src/components/Emoji.tsx",
    "chars": 232,
    "preview": "import React from 'react'\nimport { Typography, TypographyProps } from '@material-ui/core'\n\nconst Emoji: React.FC<Typogra"
  },
  {
    "path": "packages/frontend/src/components/HidePnLText.tsx",
    "chars": 871,
    "preview": "import { Typography } from '@material-ui/core'\nimport { makeStyles } from '@material-ui/core/styles'\nimport { useAtomVal"
  },
  {
    "path": "packages/frontend/src/components/IV.tsx",
    "chars": 964,
    "preview": "import { InputAdornment, TextField, Tooltip } from '@material-ui/core'\nimport InfoOutlinedIcon from '@material-ui/icons/"
  },
  {
    "path": "packages/frontend/src/components/Input/NumberInput.tsx",
    "chars": 4791,
    "preview": "import { Typography } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimpor"
  },
  {
    "path": "packages/frontend/src/components/Input/PrimaryInput.tsx",
    "chars": 6122,
    "preview": "import { CircularProgress, Tooltip, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@mat"
  },
  {
    "path": "packages/frontend/src/components/InputNew/InputBase.tsx",
    "chars": 1967,
    "preview": "import { TextField, StandardTextFieldProps } from '@material-ui/core'\nimport { makeStyles, createStyles } from '@materia"
  },
  {
    "path": "packages/frontend/src/components/InputNew/InputNumber.tsx",
    "chars": 1433,
    "preview": "import React from 'react'\nimport InputBase, { InputBaseProps } from './InputBase'\n\nconst DECIMAL_REGEX = RegExp('^[0-9]*"
  },
  {
    "path": "packages/frontend/src/components/InputNew/InputToken.tsx",
    "chars": 5430,
    "preview": "import { Typography, InputAdornment, Box, ButtonBase, CircularProgress, Tooltip } from '@material-ui/core'\nimport { make"
  },
  {
    "path": "packages/frontend/src/components/InputNew/index.tsx",
    "chars": 165,
    "preview": "import InputBase from './InputBase'\nimport InputNumber from './InputNumber'\nimport { InputToken } from './InputToken'\n\ne"
  },
  {
    "path": "packages/frontend/src/components/LabelWithTooltip.test.tsx",
    "chars": 776,
    "preview": "import { render, screen } from '@testing-library/react'\nimport LabelWithTooltip from './LabelWithTooltip'\n\ndescribe('Lab"
  },
  {
    "path": "packages/frontend/src/components/LabelWithTooltip.tsx",
    "chars": 801,
    "preview": "import { Box, BoxProps, Tooltip, Typography, TypographyVariant } from '@material-ui/core'\nimport { FC } from 'react'\nimp"
  },
  {
    "path": "packages/frontend/src/components/LandingPage/DesktopLandingPage.tsx",
    "chars": 18794,
    "preview": "import React, { useEffect } from 'react'\nimport { makeStyles, createStyles } from '@material-ui/core/styles'\nimport logo"
  },
  {
    "path": "packages/frontend/src/components/LandingPage/MobileLandingPage.tsx",
    "chars": 18982,
    "preview": "import React, { useEffect, useState } from 'react'\nimport { makeStyles, createStyles } from '@material-ui/core/styles'\ni"
  },
  {
    "path": "packages/frontend/src/components/LegendBox.tsx",
    "chars": 776,
    "preview": "import { createStyles, makeStyles, Box, Tooltip } from '@material-ui/core'\nimport InfoIcon from '@material-ui/icons/Info"
  },
  {
    "path": "packages/frontend/src/components/LinkWrapper.tsx",
    "chars": 813,
    "preview": "import { createStyles, makeStyles } from '@material-ui/core/styles'\nimport OpenInNewIcon from '@material-ui/icons/OpenIn"
  },
  {
    "path": "packages/frontend/src/components/Lp/GetSqueeth.tsx",
    "chars": 1248,
    "preview": "import { Typography } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimpor"
  },
  {
    "path": "packages/frontend/src/components/Lp/LPPosition.tsx",
    "chars": 1832,
    "preview": "import React from 'react'\nimport { Typography, Box } from '@material-ui/core'\nimport { createStyles, makeStyles } from '"
  },
  {
    "path": "packages/frontend/src/components/Lp/LPTable.tsx",
    "chars": 13950,
    "preview": "import { Chip, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip } from '@material-ui/core'\nimpo"
  },
  {
    "path": "packages/frontend/src/components/Lp/ObtainSqueeth.tsx",
    "chars": 916,
    "preview": "import { createStyles, makeStyles } from '@material-ui/core/styles'\nimport React from 'react'\n\nimport { Steps, useLPStat"
  },
  {
    "path": "packages/frontend/src/components/Lp/ProvideLiquidity.tsx",
    "chars": 2730,
    "preview": "import { Typography } from '@material-ui/core'\nimport { orange } from '@material-ui/core/colors'\nimport { createStyles, "
  },
  {
    "path": "packages/frontend/src/components/Lp/SelectMethod.tsx",
    "chars": 3055,
    "preview": "import { Typography, Box } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\n"
  },
  {
    "path": "packages/frontend/src/components/Lp/SqueethInfo.tsx",
    "chars": 2903,
    "preview": "import { Box, BoxProps } from '@material-ui/core'\nimport React from 'react'\nimport { useAtomValue } from 'jotai'\n\nimport"
  },
  {
    "path": "packages/frontend/src/components/Lp/Stepper.tsx",
    "chars": 2083,
    "preview": "import { IconButton, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles, withStyles } from '@materi"
  },
  {
    "path": "packages/frontend/src/components/MarkdownPage.tsx",
    "chars": 1904,
    "preview": "import ReactMarkdown from 'markdown-to-jsx'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport B"
  },
  {
    "path": "packages/frontend/src/components/Metric.tsx",
    "chars": 2856,
    "preview": "import React from 'react'\nimport { Typography, Box, BoxProps, Tooltip } from '@material-ui/core'\nimport { makeStyles, cr"
  },
  {
    "path": "packages/frontend/src/components/Modal/MobileModal.tsx",
    "chars": 1599,
    "preview": "import { Drawer, IconButton, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-u"
  },
  {
    "path": "packages/frontend/src/components/Modal/Modal.tsx",
    "chars": 1898,
    "preview": "import { createStyles, IconButton, makeStyles } from '@material-ui/core'\nimport Dialog from '@material-ui/core/Dialog'\ni"
  },
  {
    "path": "packages/frontend/src/components/Modal/UniswapIframe.tsx",
    "chars": 4737,
    "preview": "import { createStyles, IconButton, makeStyles, Tooltip } from '@material-ui/core'\nimport Button from '@material-ui/core/"
  },
  {
    "path": "packages/frontend/src/components/Nav.tsx",
    "chars": 13033,
    "preview": "import { Button, Drawer, IconButton, Menu, MenuItem, ButtonBase } from '@material-ui/core'\nimport Hidden from '@material"
  },
  {
    "path": "packages/frontend/src/components/PnLTooltip.tsx",
    "chars": 1137,
    "preview": "import { Tooltips } from '@constants/enums'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport T"
  },
  {
    "path": "packages/frontend/src/components/Popup.tsx",
    "chars": 1856,
    "preview": "import Button from '@material-ui/core/Button'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@"
  },
  {
    "path": "packages/frontend/src/components/PositionCard.tsx",
    "chars": 19340,
    "preview": "import { Typography, Box } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\n"
  },
  {
    "path": "packages/frontend/src/components/RestrictionInfo.tsx",
    "chars": 1822,
    "preview": "import { createStyles, makeStyles } from '@material-ui/core/styles'\nimport { Typography, BoxProps } from '@material-ui/c"
  },
  {
    "path": "packages/frontend/src/components/SettingsMenu.tsx",
    "chars": 11549,
    "preview": "import { Backdrop, Button, Link as MatLink, Switch } from '@material-ui/core'\nimport { createStyles, makeStyles } from '"
  },
  {
    "path": "packages/frontend/src/components/SharePnl/PnlChart.tsx",
    "chars": 4999,
    "preview": "import { Typography, CircularProgress } from '@material-ui/core'\nimport { makeStyles, createStyles } from '@material-ui/"
  },
  {
    "path": "packages/frontend/src/components/SqueethCard.tsx",
    "chars": 409,
    "preview": "import { Box, BoxProps, useTheme } from '@material-ui/core'\nimport { FC } from 'react'\n\nconst SqueethCard: FC<BoxProps> "
  },
  {
    "path": "packages/frontend/src/components/StepperBox.tsx",
    "chars": 857,
    "preview": "import Step from '@material-ui/core/Step'\nimport StepLabel from '@material-ui/core/StepLabel'\nimport Stepper from '@mate"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/About/AdvancedMetrics.tsx",
    "chars": 3151,
    "preview": "import React, { useState } from 'react'\nimport { Box, Fade, Typography } from '@material-ui/core'\nimport { makeStyles, c"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/About/NextRebalanceTimer.tsx",
    "chars": 3461,
    "preview": "import React, { useEffect, useState } from 'react'\nimport { Typography } from '@material-ui/core'\nimport { makeStyles, c"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/About/ProfitabilityChart.tsx",
    "chars": 10669,
    "preview": "import React, { useMemo } from 'react'\nimport { useAtomValue } from 'jotai'\nimport {\n  LineChart,\n  Line,\n  XAxis,\n  YAx"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/About/index.tsx",
    "chars": 2185,
    "preview": "import React from 'react'\nimport { Box, Typography } from '@material-ui/core'\nimport clsx from 'clsx'\nimport { makeStyle"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/BullTrade/Deposit.tsx",
    "chars": 14125,
    "preview": "import { Box, Typography, Tooltip, CircularProgress } from '@material-ui/core'\nimport BigNumber from 'bignumber.js'\nimpo"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/BullTrade/EmergencyWithdraw.tsx",
    "chars": 17548,
    "preview": "import React, { useCallback, useState, useRef, useMemo } from 'react'\nimport { Box, Typography, Link, CircularProgress, "
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/BullTrade/ShutdownEmergencyWithdraw.tsx",
    "chars": 8298,
    "preview": "import React, { useState, useEffect } from 'react'\nimport { Box, Typography, CircularProgress, Collapse, Link } from '@m"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/BullTrade/Withdraw.tsx",
    "chars": 14344,
    "preview": "import { Box, Typography, Tooltip, CircularProgress } from '@material-ui/core'\nimport BigNumber from 'bignumber.js'\nimpo"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/BullTrade/index.tsx",
    "chars": 2825,
    "preview": "import BigNumber from 'bignumber.js'\nimport React, { useCallback, useState } from 'react'\nimport { useAtomValue } from '"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/BullTrade/styles.ts",
    "chars": 1054,
    "preview": "import { makeStyles, createStyles } from '@material-ui/core'\n\nexport const useZenBullStyles = makeStyles((theme) =>\n  cr"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/MyPosition/PnL.tsx",
    "chars": 1940,
    "preview": "import { Typography, Box, CircularProgress } from '@material-ui/core'\nimport React from 'react'\nimport clsx from 'clsx'\n"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/MyPosition/index.tsx",
    "chars": 2660,
    "preview": "import { Typography, Box } from '@material-ui/core'\nimport React, { memo } from 'react'\nimport clsx from 'clsx'\nimport {"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/StrategyPerformance.tsx",
    "chars": 9589,
    "preview": "import React, { useMemo } from 'react'\nimport { Box, Typography, Tooltip, TextField, InputLabel, TextFieldProps, Divider"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Bull/index.tsx",
    "chars": 2354,
    "preview": "import React, { useEffect } from 'react'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\n\nimport { u"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Crab/About/AdvancedMetrics.tsx",
    "chars": 3072,
    "preview": "import React, { useState } from 'react'\nimport { Box, Fade, Typography } from '@material-ui/core'\nimport { makeStyles, c"
  },
  {
    "path": "packages/frontend/src/components/Strategies/Crab/About/NextRebalanceTimer.tsx",
    "chars": 3461,
    "preview": "import React, { useEffect, useState } from 'react'\nimport { Typography } from '@material-ui/core'\nimport { makeStyles, c"
  }
]

// ... and 686 more files (download for full content)

About this extraction

This page contains the full source code of the opynfinance/squeeth-monorepo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 886 files (25.4 MB), approximately 6.7M tokens, and a symbol index with 744 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!