Update core-v1 contract docs for v0.11.0#151
Open
duelinggalois wants to merge 4 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Updates the generated Core v1 contract documentation to match the v0.11.0 contract surface (new/changed storage variables, function signatures, events/errors) and refreshes Git Source links to the new core-v1 commit.
Changes:
- Refresh Git Source links across contract docs to the v0.11.0 commit hash.
- Update docs for multiple contracts/libraries to reflect API/signature/state changes (e.g., liquidation flow, saturation/TWAP state, validation, token controllers).
- Add new documentation for the
PriceExtremeslibrary.
Reviewed changes
Copilot reviewed 53 out of 53 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/developer-guide/contracts/utils/deployHelper.sol/function.deployFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/tokens/TokenController.sol/contract.TokenController.md | Reflect storage visibility + new/changed helper signatures and liquidity docs |
| docs/developer-guide/contracts/tokens/HookRegistry.sol/contract.HookRegistry.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/tokens/ERC4626DepositToken.sol/contract.ERC4626DepositToken.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/tokens/ERC4626DebtToken.sol/contract.ERC4626DebtToken.md | Update Git Source link + approve signature docs |
| docs/developer-guide/contracts/tokens/ERC20LiquidityToken.sol/contract.ERC20LiquidityToken.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/tokens/ERC20DebtLiquidityToken.sol/contract.ERC20DebtLiquidityToken.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/tokens/ERC20DebtBase.sol/abstract.ERC20DebtBase.md | Update Git Source link + approve signature docs |
| docs/developer-guide/contracts/tokens/ERC20Base.sol/struct.ERC20BaseConfig.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/SaturationAndGeometricTWAPState.sol/contract.SaturationAndGeometricTWAPState.md | Document new saturation/TWAP state fields + new/changed methods |
| docs/developer-guide/contracts/proxy/PairLockedLoans.sol/contract.PairLockedLoans.md | Document _initialize lock behavior + new INIT error |
| docs/developer-guide/contracts/proxy/PairFrozen.sol/contract.PairFrozen.md | Document _initialize revert behavior for restricted implementation |
| docs/developer-guide/contracts/proxy/PairBlockLendingFundRemoval.sol/contract.PairBlockLendingFundRemoval.md | Rename doc to match contract + add _initialize lock + INIT error |
| docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/interface.IPairInitializable.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.PairBeaconProxy.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.InitializablePair.md | Document new onlyProxySelfCall + gated reInitialize + AccessDenied error |
| docs/developer-guide/contracts/proxy/BeaconController.sol/interface.IBeaconController.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/proxy/BeaconController.sol/contract.BeaconController.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/libraries/Validation.sol/library.Validation.md | Update constants visibility + remove scaler param references + new validation docs |
| docs/developer-guide/contracts/libraries/Uint16Set.sol/library.Uint16Set.md | Update remove return name/behavior docs |
| docs/developer-guide/contracts/libraries/TokenSymbol.sol/library.TokenSymbol.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/libraries/TickMath.sol/library.TickMath.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/libraries/Saturation.sol/library.Saturation.md | Add new constants + penalty helpers + refactor signature docs + expanded math docs |
| docs/developer-guide/contracts/libraries/QuadraticSwapFees.sol/library.QuadraticSwapFees.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/libraries/PriceExtremes.sol/library.PriceExtremes.md | Add new library documentation |
| docs/developer-guide/contracts/libraries/PartialLiquidations.sol/library.PartialLiquidations.md | Expand and update partial liquidation theory + function docs/signatures |
| docs/developer-guide/contracts/libraries/Liquidation.sol/library.Liquidation.md | Update leverage/hard liquidation docs + new helpers/errors + signature changes |
| docs/developer-guide/contracts/libraries/Interest.sol/library.Interest.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/libraries/GeometricTWAP.sol/library.GeometricTWAP.md | Update observed mid-term tick API docs + remove outdated lending-state docs |
| docs/developer-guide/contracts/libraries/Convert.sol/library.Convert.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/libraries/constants.sol/constants.constants.md | Update constants docs (remove lending-tick sentinel) |
| docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/interface.ITokenController.md | Update InterestAccrued event docs + add new error docs |
| docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/constants.ITokenController.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/tokens/IHookRegistry.sol/interface.IHookRegistry.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/tokens/IERC20DebtToken.sol/interface.IERC20DebtToken.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/tokens/IAmmalgamERC20.sol/interface.IAmmalgamERC20.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/ISaturationAndGeometricTWAPState.sol/interface.ISaturationAndGeometricTWAPState.md | Add new saturation/TWAP interface methods + update signatures |
| docs/developer-guide/contracts/interfaces/IAmmalgamPair.sol/interface.IAmmalgamPair.md | Update interface docs (add validateOnUpdate and restructure header) |
| docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/factories/IFactoryCallback.sol/interface.IFactoryCallback.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IBeaconCallback.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IAmmalgamFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/callbacks/ITransferValidator.sol/interface.ITransferValidator.md | Add tokens() docs |
| docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ISwapCallback.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ICallback.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.IBorrowCallback.md | Improve parameter descriptions |
| docs/developer-guide/contracts/factories/ERC4626DepositTokenFactory.sol/contract.ERC4626DepositTokenFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/factories/ERC4626DebtTokenFactory.sol/contract.ERC4626DebtTokenFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/factories/ERC20LiquidityTokenFactory.sol/contract.ERC20LiquidityTokenFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/factories/ERC20DebtLiquidityTokenFactory.sol/contract.ERC20DebtLiquidityTokenFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/factories/AmmalgamFactory.sol/contract.AmmalgamFactory.md | Update Git Source link to new core-v1 commit |
| docs/developer-guide/contracts/AmmalgamPair.sol/contract.AmmalgamPair.md | Document new borrow lock state + expanded hard liquidation documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
41
to
+43
| remove a key. | ||
|
|
||
| *key to remove must exist.* | ||
| *If the key does not exist, this function is a no-op and returns true.* |
Comment on lines
58
to
+60
| |Name|Type|Description| | ||
| |----|----|-----------| | ||
| |`keyDidNotExist`|`bool`|whether the key already did not yet exist in the set| | ||
| |`isSetEmpty`|`bool`|whether the key did not exist or the set still has items after removal| |
Comment on lines
+40
to
+42
| |Name|Type|Description| | ||
| |----|----|-----------| | ||
| |`tokenType`|`uint256`|The type of token for which the scaler is being computed. Can be one of BORROW_X, DEPOSIT_X, BORROW_Y, DEPOSIT_Y, BORROW_L, or DEPOSIT_L.| |
Comment on lines
88
to
+91
| ### allAssets | ||
| The first position in this array is never stored because it is instead computed as | ||
| $$\sqrt{reserveX * reserveY} + borrowedLAssets$$. We keep this storage spot because | ||
| we heavily use DEPOSIT_L, DEPOSIT_X, DEPOSIT_Y, BORROW_L, BORROW_X, BORROW_Y to look |
| actual amount transferred prior to calling `liquidate()` by the amount passed in for the | ||
| repayXAssets and repayYAssets parameters. | ||
| ## Calculating a Hard Liquidation | ||
| Hard liquidations can be partial subset of the borrower's entire position based on |
| @@ -1211,7 +1230,46 @@ function findHighestSetLeafDownwards( | |||
|
|
|||
| ### calcLiqSqrtPriceQ72 | |||
|
|
|||
| Calc sqrt price at which positions' LTV would reach LTV_MAX | |||
| Calc sqrt price at which positions' LTV would reach LTV_MAX. Given the net $$L$$, | |||
| $$X$$, and Y, we define the the sqrt price $$s_p$$ at which the position would be at the | |||
| |`pairAddress`|`address`|The address of the pair| | ||
| |`account`|`address`|The account for which we are calculating the saturation change ratio.| | ||
|
|
||
| **Returns** | ||
|
|
||
| |Name|Type|Description| | ||
| |----|----|-----------| | ||
| |`ratioNetXBips`|`uint256`|The ratio representing the change in netX saturation for account.| | ||
| |`ratioNetYBips`|`uint256`|The ratio representing the change in netY saturation for account.| | ||
| |`ratioBips`|`uint256`|The ratio representing the change saturation for account.| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.