-
Notifications
You must be signed in to change notification settings - Fork 70
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: Collect Fees #598
base: one-click-lp-close
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes, big one that will impact all PRs is that we need to be more conservative with the amount of ETH that we borrow to target a higher CR.
approving to not block, but needs to be fixed
@@ -17,6 +17,7 @@ import { useGetDebtAmount, useGetTwapSqueethPrice, useGetVault } from '../contro | |||
const TICK_SPACE = 60 | |||
const COLLAT_RATIO = 1.5 | |||
const POOL_FEE = 3000 | |||
const MAX_INT = new BigNumber(2).pow(128).minus(1).toFixed(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call this MAX_INT_128 or something, might need MAX_INT_256 later, etc
|
||
const shortAmount = fromTokenAmount(vaultBefore.shortAmount, OSQUEETH_DECIMALS) | ||
const debtInEth = await getDebtAmount(shortAmount) | ||
const collateralToFlashloan = debtInEth.multipliedBy(COLLAT_RATIO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for all of these we need to have some buffer room.
If the transaction takes some time to be mined and spot prices change, its possible we won't be borrowing enough ETH.
Maybe 200% is fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
1dce1e0
to
151b0fb
Compare
d73e710
to
b9e7ad0
Compare
047d506
to
77b8d9c
Compare
|
||
export const CONTROLLER_HELPER: Address = { | ||
1: '0xfa86d43b41Fa7a759c606130cc81970A955ff816', | ||
3: '0x7e9C5490e91F93529c6480B46a59D738F6bcEa43', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ropsten ded :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should add goerli deployment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I think before merge we might want to remove all the other f/e code that doesnt deal with collect fees (ie useClosePosition, etc)
Task: One-Click LP Collect Fees
Description
Collect fees accumulated by an LP position via the ControllerHelper's
rebalanceLpInVault
function.Learn more about the One-Click LP API here.