Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One-Click LP [For Testing] #521

Draft
wants to merge 82 commits into
base: main
Choose a base branch
from
Draft

One-Click LP [For Testing] #521

wants to merge 82 commits into from

Conversation

daryakaviani
Copy link
Contributor

@daryakaviani daryakaviani commented Jun 15, 2022

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.

@vercel
Copy link

vercel bot commented Jun 15, 2022

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)

@daryakaviani daryakaviani reopened this Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants