Closed mergify[bot] closed 5 days ago
Cherry-pick of edcc82b79e7298e2bd79da8bdde52cfca488743d has failed:
On branch mergify/bp/release/protocol/v5.1.x/pr-1681
Your branch is up to date with 'origin/release/protocol/v5.1.x'.
You are currently cherry-picking commit edcc82b7.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: protocol/mocks/PerpetualsKeeper.go
modified: protocol/x/clob/keeper/deleveraging.go
modified: protocol/x/clob/keeper/liquidations.go
modified: protocol/x/clob/types/expected_keepers.go
modified: protocol/x/perpetuals/keeper/perpetual.go
modified: protocol/x/perpetuals/lib/lib.go
modified: protocol/x/perpetuals/lib/lib_test.go
modified: protocol/x/perpetuals/types/types.go
modified: protocol/x/subaccounts/keeper/subaccount.go
modified: protocol/x/subaccounts/types/expected_keepers.go
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: protocol/x/perpetuals/keeper/perpetual_test.go
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
[!IMPORTANT]
Review skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Changelist
Speed up collateralization checks by not getting the perpetual and price from state twice (once for net collateral, once for margin requirements). Instead, just get it a single time.
Breaking change as this reduces the number of state reads which modifies the gas used.
Test Plan
Updated and added unit tests
Blocked on
https://github.com/dydxprotocol/v4-chain/pull/1678
Summary by CodeRabbit
New Features
GetPerpetualAndMarketPriceAndLiquidityTier
to retrieve perpetual details, market price, and liquidity tier.Refactor
perplib
functions.Tests
Removals
GetMarginRequirements
function from several modules to centralize calculations using the newperplib
library.This is an automatic backport of pull request #1681 done by Mergify.