-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: vaults v2 #557
feat: vaults v2 #557
Conversation
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.
Reviewed this up to sorted vaults contract, will do a second round, perhaps some comments will be invalid once I see all the code
) | ||
|
||
;; Get collateral amount info to use in liquidation | ||
(define-public (get-collateral-for-liquidation (oracle <oracle-trait>) (token principal) (collateral uint) (debt uint)) |
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.
Q: I guess we cannot define this as read-only
?
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.
Q: do we need to check the oracle
input param?
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.
A: Overall there are still a lot of hardcoded contracts in the code. The goal is to replace them all by traits. I think once we replace .arkadiko-vaults-tokens-v1-1
by a trait, the function can not be read-only anymore?
;; Need hints to know where to insert vault in sorted list | ||
(define-public (open-vault | ||
(oracle <oracle-trait>) | ||
(token <ft-trait>) |
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.
Q: how is the token
verified?
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.
A: See: (collateral-info (unwrap! (contract-call? .arkadiko-vaults-tokens-v1-1 get-token (contract-of token)) (err ERR_UNKNOWN_TOKEN)))
clarity/contracts/vaults-v2/arkadiko-vaults-operations-v1-1.clar
Outdated
Show resolved
Hide resolved
clarity/contracts/vaults-v2/arkadiko-vaults-operations-v1-1.clar
Outdated
Show resolved
Hide resolved
clarity/contracts/vaults-v2/arkadiko-vaults-operations-v1-1.clar
Outdated
Show resolved
Hide resolved
;; --------------------------------------------------------- | ||
|
||
;; Deposit tokens to pool | ||
(define-public (deposit (token <ft-trait>) (sender principal) (amount uint)) |
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.
Q: Should we allow deposits & withdrawals on any token?
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.
A: these methods are used by contracts only, which should check the token. (ex: open-vault on vaults-operations)
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.
Did a second round, I need to dive deeper into the sorted logic, but costs may be a concern
* feat: implement vault v2 UI * wip * wip * deploy contracts v2 script * deps * deploy migration contract * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * finish step 1 * wip * wip * fix PC * fix vault overview * overview * vault positions * feat: merge "Your positions" and "Start borrowing" sections (#561) * feat: merge positions and start borrowing sections * chore: cleanup * misc: make vaults index page dynamic * wip * wip * wip * wip * wip * fix vault creation * feat: vaults-v2 manage vault UI (#562) * feat: vaults-v2 manage vault UI * wip --------- Co-authored-by: --global <--global> * wip * cleanup * fix design * fix: sort collateral types * fix: numbers * wip * wip: stSTX colors * wip * fix: status indicators * fix labels * fix labels * fix * fix: price * fix: collateral type xbtc * do not launch with atALEXv2 * some colors * misc: show convert to stSTX vault * target _blank * remove redemption fee * fix css class * fix css * fix: dynamic token * fix: todos * fix: add stSTX prices * add stSTX balance to UI * wip * fixes * dynamic logo * wip: vault mint * cleanup * wip: vault actions * wip: vault actions * wip: vault actions * wip * fix margin * fix data * wip: liquidation pool * wip * add liquidate vault script * fix: wizard * wip * wip * fix claims * chore: update new testnet addy * wip * fix: make sure price is not 0 * chore: add mint fee * chore: add script to set collateral token * fix: loading screen for collateral * fix: error handling with min 500 USDA * fix: do not allow borrows when liquidity is not available * fix: remove atALEX from unstake/stake fn * fix: stSTX vault creation * fix: tokenNameToTicker * fix: take max debt into account when minting USDA * fix: rounding * fix: decimals for stSTX in UI * wip: migrate stx vault * chore: cleanup * chore: cleanup * fix: do not show authorized sections * fix: vault mint usda 98% * fix: use oracle v2-3 * fix: mint for protocol on xBTC * guardian v3-1 * fix: set new testnet addy * chore: set oracle prices * fix: governance v4-2 * wip: mint from faucet * fixes * feat: add testnet prices * fix: merge conflict * fixes * fix * add testnet query param * add testnet query param * fixes * fix: fetch real-time oracle prices for testnet * fix: make minting max USDA more conservative * cleanup * fix: debt burn * fix: more conservative collateral withdraw * fix: warning shield * feat: calculate min stability fee * cleanup * fixes * fix: int for minting fee * CSS fixes * fix: use 6 blocks as minimum stability fee * fixes * feat: add stacker-payer-v3-9 * feat: add gov vote for upgrade * use gov 4-2 * fix: set correct FE addresses * fix: mainnet addresses on vaults-migration contract * fix: remove unused migrate method * add migration notice * add migration notice (usda stake pool) * fix: spacing * Revert "fix: spacing" This reverts commit 4feafe7. * fix: spacing --------- Co-authored-by: --global <--global> Co-authored-by: Maxime Laforet <me@macx.im> Co-authored-by: Niel Deckx <hello@nieldeckx.be>
No description provided.