squeeth-monorepo icon indicating copy to clipboard operation
squeeth-monorepo copied to clipboard

One-Click LP [For Testing]

Open daryakaviani opened this issue 2 years ago • 1 comments

Task: One-Click LP [Testing Only]

Description

Learn more about the One-Click LP API here.

This PR is not to merge, but it includes frontend tester buttons that can help with testing various API features. The API functions match those in the open PRs.

How to Test

Pull down this PR.

Opening a Position

  1. Open packages/frontend/pages/lp.tsx file
  2. Open an LP position by typing in your desired squeeth amount:
await openLPPosition(new BigNumber(SQUEETH_AMOUNT), LOWER_TICK, UPPER_TICK, 0, () => {})`
  1. yarn dev in the packages/frontend folder in order to run squeeth site on localhost.
  2. Scroll to the bottom of the LP tab to find the tester buttons! Click the open button to open your position.
  3. Check Etherscan on Ropsten to see the vault ID of the vault you just opened via the API. Use this vault ID when testing the other functions.

Update Operator

  1. You need to approve your address to update this new vault.
await updateOperator(VAULT_ID, controllerHelper)
  1. Click the update operator button.

Collecting Fees

  1. Collect fees accumulated by your LP position by typing in the vault ID.
await collectFees(VAULT_ID, () => {})
  1. Click the collect fees button.

Rebalance LP Position

  1. Rebalance your position to a new range by typing in the vault ID and new range.
await rebalanceSwap(VAULT_ID, NEW_LOWER_TICK, NEW_UPPER_TICK, () => {})
  1. Click the rebalance general swap button.

Close LP Position

  1. Close your position.
await closeLPPosition(VAULT_ID, () => {})
  1. Click the rebalance general swap button.

daryakaviani avatar Jun 15 '22 00:06 daryakaviani

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
continuouscall ❌ Failed (Inspect) Nov 18, 2022 at 6:49PM (UTC)

vercel[bot] avatar Jun 15 '22 00:06 vercel[bot]