From c865640a6290158362855e04268dcca80c30a0af Mon Sep 17 00:00:00 2001 From: duelinggalois Date: Mon, 26 Jan 2026 06:56:01 +0000 Subject: [PATCH] Updated contract docs for synchronize pull request feature/ci-cache-optimization --- .../AmmalgamPair.sol/contract.AmmalgamPair.md | 14 +-- ...ontract.SaturationAndGeometricTWAPState.md | 7 +- .../contract.AmmalgamFactory.md | 2 +- ...contract.ERC20DebtLiquidityTokenFactory.md | 2 +- .../contract.ERC20LiquidityTokenFactory.md | 2 +- .../contract.ERC4626DebtTokenFactory.md | 2 +- .../contract.ERC4626DepositTokenFactory.md | 2 +- .../interface.IAmmalgamPair.md | 2 +- ...erface.ISaturationAndGeometricTWAPState.md | 7 +- .../interface.IBorrowCallback.md | 2 +- .../interface.ICallback.md | 2 +- .../interface.ISwapCallback.md | 2 +- .../interface.ITransferValidator.md | 2 +- .../interface.IAmmalgamFactory.md | 2 +- .../interface.IBeaconCallback.md | 2 +- .../interface.IFactoryCallback.md | 2 +- .../interface.ITokenFactory.md | 2 +- .../interface.IAmmalgamERC20.md | 2 +- .../interface.IERC20DebtToken.md | 2 +- .../interface.IHookRegistry.md | 2 +- .../constants.ITokenController.md | 2 +- .../interface.ITokenController.md | 2 +- .../libraries/Convert.sol/library.Convert.md | 2 +- .../library.GeometricTWAP.md | 2 +- .../Interest.sol/library.Interest.md | 2 +- .../Liquidation.sol/library.Liquidation.md | 48 +++------ .../library.PartialLiquidations.md | 2 +- .../library.QuadraticSwapFees.md | 2 +- .../Saturation.sol/library.Saturation.md | 101 +++++++++++++++--- .../TickMath.sol/library.TickMath.md | 2 +- .../TokenSymbol.sol/library.TokenSymbol.md | 2 +- .../Uint16Set.sol/library.Uint16Set.md | 2 +- .../Validation.sol/library.Validation.md | 2 +- .../constants.sol/constants.constants.md | 2 +- .../contract.BeaconController.md | 2 +- .../interface.IBeaconController.md | 2 +- .../contract.InitializablePair.md | 2 +- .../contract.PairBeaconProxy.md | 2 +- .../interface.IPairInitializable.md | 2 +- .../contract.PairBlockAllTransfers.md | 2 +- .../PairFrozen.sol/contract.PairFrozen.md | 2 +- .../contract.PairLockedLoans.md | 2 +- .../ERC20Base.sol/abstract.ERC20Base.md | 2 +- .../ERC20Base.sol/struct.ERC20BaseConfig.md | 2 +- .../abstract.ERC20DebtBase.md | 7 +- .../contract.ERC20DebtLiquidityToken.md | 2 +- .../contract.ERC20LiquidityToken.md | 2 +- .../contract.ERC4626DebtToken.md | 4 +- .../contract.ERC4626DepositToken.md | 2 +- .../HookRegistry.sol/contract.HookRegistry.md | 2 +- .../contract.TokenController.md | 6 +- .../function.deployFactory.md | 2 +- 52 files changed, 158 insertions(+), 124 deletions(-) diff --git a/docs/developer-guide/contracts/AmmalgamPair.sol/contract.AmmalgamPair.md b/docs/developer-guide/contracts/AmmalgamPair.sol/contract.AmmalgamPair.md index 45ac2ef2..e37e68b3 100644 --- a/docs/developer-guide/contracts/AmmalgamPair.sol/contract.AmmalgamPair.md +++ b/docs/developer-guide/contracts/AmmalgamPair.sol/contract.AmmalgamPair.md @@ -1,5 +1,5 @@ # AmmalgamPair -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/AmmalgamPair.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/AmmalgamPair.sol) **Inherits:** [IAmmalgamPair](/docs/developer-guide/contracts/interfaces/IAmmalgamPair.sol/interface.IAmmalgamPair.md), [TokenController](/docs/developer-guide/contracts/tokens/TokenController.sol/contract.TokenController.md) @@ -369,14 +369,7 @@ Liquidation based on change of saturation because of time. ```solidity -function resetSaturation( - Validation.InputParams memory inputParams, - address borrower, - address to, - uint256 depositLToBeTransferredInLAssets, - uint256 depositXToBeTransferredInXAssets, - uint256 depositYToBeTransferredInYAssets -) private; +function resetSaturation(Validation.InputParams memory inputParams, address borrower, address to) private; ``` **Parameters** @@ -385,9 +378,6 @@ function resetSaturation( |`inputParams`|`Validation.InputParams`|| |`borrower`|`address`|The account being liquidated.| |`to`|`address`|The account to send the liquidated deposit to| -|`depositLToBeTransferredInLAssets`|`uint256`|The amount of L to be transferred to the liquidator.| -|`depositXToBeTransferredInXAssets`|`uint256`|The amount of X to be transferred to the liquidator.| -|`depositYToBeTransferredInYAssets`|`uint256`|The amount of Y to be transferred to the liquidator.| ### liquidateLeverage diff --git a/docs/developer-guide/contracts/SaturationAndGeometricTWAPState.sol/contract.SaturationAndGeometricTWAPState.md b/docs/developer-guide/contracts/SaturationAndGeometricTWAPState.sol/contract.SaturationAndGeometricTWAPState.md index 2989d0d2..bf37f0a7 100644 --- a/docs/developer-guide/contracts/SaturationAndGeometricTWAPState.sol/contract.SaturationAndGeometricTWAPState.md +++ b/docs/developer-guide/contracts/SaturationAndGeometricTWAPState.sol/contract.SaturationAndGeometricTWAPState.md @@ -1,5 +1,5 @@ # SaturationAndGeometricTWAPState -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/SaturationAndGeometricTWAPState.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/SaturationAndGeometricTWAPState.sol) **Inherits:** Initializable, [ISaturationAndGeometricTWAPState](/docs/developer-guide/contracts/interfaces/ISaturationAndGeometricTWAPState.sol/interface.ISaturationAndGeometricTWAPState.md), OwnableUpgradeable @@ -249,7 +249,7 @@ function calcSatChangeRatioBips( uint256 liqSqrtPriceInYInQ72, address pairAddress, address account -) external view virtual isInitialized returns (uint256 ratioNetXBips, uint256 ratioNetYBips); +) external view virtual isInitialized returns (uint256 ratioBips); ``` **Parameters** @@ -265,8 +265,7 @@ function calcSatChangeRatioBips( |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.| ### getObservations diff --git a/docs/developer-guide/contracts/factories/AmmalgamFactory.sol/contract.AmmalgamFactory.md b/docs/developer-guide/contracts/factories/AmmalgamFactory.sol/contract.AmmalgamFactory.md index 66322b97..5fb8561c 100644 --- a/docs/developer-guide/contracts/factories/AmmalgamFactory.sol/contract.AmmalgamFactory.md +++ b/docs/developer-guide/contracts/factories/AmmalgamFactory.sol/contract.AmmalgamFactory.md @@ -1,5 +1,5 @@ # AmmalgamFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/factories/AmmalgamFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/factories/AmmalgamFactory.sol) **Inherits:** [IAmmalgamFactory](/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IAmmalgamFactory.md) diff --git a/docs/developer-guide/contracts/factories/ERC20DebtLiquidityTokenFactory.sol/contract.ERC20DebtLiquidityTokenFactory.md b/docs/developer-guide/contracts/factories/ERC20DebtLiquidityTokenFactory.sol/contract.ERC20DebtLiquidityTokenFactory.md index dd4d9e02..dbc5b716 100644 --- a/docs/developer-guide/contracts/factories/ERC20DebtLiquidityTokenFactory.sol/contract.ERC20DebtLiquidityTokenFactory.md +++ b/docs/developer-guide/contracts/factories/ERC20DebtLiquidityTokenFactory.sol/contract.ERC20DebtLiquidityTokenFactory.md @@ -1,5 +1,5 @@ # ERC20DebtLiquidityTokenFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/factories/ERC20DebtLiquidityTokenFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/factories/ERC20DebtLiquidityTokenFactory.sol) **Inherits:** [ITokenFactory](/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md) diff --git a/docs/developer-guide/contracts/factories/ERC20LiquidityTokenFactory.sol/contract.ERC20LiquidityTokenFactory.md b/docs/developer-guide/contracts/factories/ERC20LiquidityTokenFactory.sol/contract.ERC20LiquidityTokenFactory.md index 158afd54..d36008bf 100644 --- a/docs/developer-guide/contracts/factories/ERC20LiquidityTokenFactory.sol/contract.ERC20LiquidityTokenFactory.md +++ b/docs/developer-guide/contracts/factories/ERC20LiquidityTokenFactory.sol/contract.ERC20LiquidityTokenFactory.md @@ -1,5 +1,5 @@ # ERC20LiquidityTokenFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/factories/ERC20LiquidityTokenFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/factories/ERC20LiquidityTokenFactory.sol) **Inherits:** [ITokenFactory](/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md) diff --git a/docs/developer-guide/contracts/factories/ERC4626DebtTokenFactory.sol/contract.ERC4626DebtTokenFactory.md b/docs/developer-guide/contracts/factories/ERC4626DebtTokenFactory.sol/contract.ERC4626DebtTokenFactory.md index 44479635..68b41c90 100644 --- a/docs/developer-guide/contracts/factories/ERC4626DebtTokenFactory.sol/contract.ERC4626DebtTokenFactory.md +++ b/docs/developer-guide/contracts/factories/ERC4626DebtTokenFactory.sol/contract.ERC4626DebtTokenFactory.md @@ -1,5 +1,5 @@ # ERC4626DebtTokenFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/factories/ERC4626DebtTokenFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/factories/ERC4626DebtTokenFactory.sol) **Inherits:** [ITokenFactory](/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md) diff --git a/docs/developer-guide/contracts/factories/ERC4626DepositTokenFactory.sol/contract.ERC4626DepositTokenFactory.md b/docs/developer-guide/contracts/factories/ERC4626DepositTokenFactory.sol/contract.ERC4626DepositTokenFactory.md index 7b34e7a4..ee1d29b0 100644 --- a/docs/developer-guide/contracts/factories/ERC4626DepositTokenFactory.sol/contract.ERC4626DepositTokenFactory.md +++ b/docs/developer-guide/contracts/factories/ERC4626DepositTokenFactory.sol/contract.ERC4626DepositTokenFactory.md @@ -1,5 +1,5 @@ # ERC4626DepositTokenFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/factories/ERC4626DepositTokenFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/factories/ERC4626DepositTokenFactory.sol) **Inherits:** [ITokenFactory](/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md) diff --git a/docs/developer-guide/contracts/interfaces/IAmmalgamPair.sol/interface.IAmmalgamPair.md b/docs/developer-guide/contracts/interfaces/IAmmalgamPair.sol/interface.IAmmalgamPair.md index a130c3f6..e045b5ca 100644 --- a/docs/developer-guide/contracts/interfaces/IAmmalgamPair.sol/interface.IAmmalgamPair.md +++ b/docs/developer-guide/contracts/interfaces/IAmmalgamPair.sol/interface.IAmmalgamPair.md @@ -1,5 +1,5 @@ # IAmmalgamPair -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/IAmmalgamPair.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/IAmmalgamPair.sol) **Inherits:** [ITransferValidator](/docs/developer-guide/contracts/interfaces/callbacks/ITransferValidator.sol/interface.ITransferValidator.md) diff --git a/docs/developer-guide/contracts/interfaces/ISaturationAndGeometricTWAPState.sol/interface.ISaturationAndGeometricTWAPState.md b/docs/developer-guide/contracts/interfaces/ISaturationAndGeometricTWAPState.sol/interface.ISaturationAndGeometricTWAPState.md index b6a1508f..ad9ec7f4 100644 --- a/docs/developer-guide/contracts/interfaces/ISaturationAndGeometricTWAPState.sol/interface.ISaturationAndGeometricTWAPState.md +++ b/docs/developer-guide/contracts/interfaces/ISaturationAndGeometricTWAPState.sol/interface.ISaturationAndGeometricTWAPState.md @@ -1,5 +1,5 @@ # ISaturationAndGeometricTWAPState -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/ISaturationAndGeometricTWAPState.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/ISaturationAndGeometricTWAPState.sol) ## Functions @@ -156,7 +156,7 @@ function calcSatChangeRatioBips( uint256 liqSqrtPriceInYInQ72, address pairAddress, address account -) external view returns (uint256 ratioNetXBips, uint256 ratioNetYBips); +) external view returns (uint256 ratioBips); ``` **Parameters** @@ -172,8 +172,7 @@ function calcSatChangeRatioBips( |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 in saturation for account.| ### configLongTermInterval diff --git a/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.IBorrowCallback.md b/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.IBorrowCallback.md index d0f03544..5ea9b489 100644 --- a/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.IBorrowCallback.md +++ b/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.IBorrowCallback.md @@ -1,5 +1,5 @@ # IBorrowCallback -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/callbacks/IAmmalgamCallee.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/callbacks/IAmmalgamCallee.sol) ## Functions diff --git a/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ICallback.md b/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ICallback.md index 7dda2492..2f5ca57f 100644 --- a/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ICallback.md +++ b/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ICallback.md @@ -1,5 +1,5 @@ # ICallback -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/callbacks/IAmmalgamCallee.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/callbacks/IAmmalgamCallee.sol) **Inherits:** [ISwapCallback](/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ISwapCallback.md), [IBorrowCallback](/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.IBorrowCallback.md) diff --git a/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ISwapCallback.md b/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ISwapCallback.md index d6519fa9..24790a92 100644 --- a/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ISwapCallback.md +++ b/docs/developer-guide/contracts/interfaces/callbacks/IAmmalgamCallee.sol/interface.ISwapCallback.md @@ -1,5 +1,5 @@ # ISwapCallback -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/callbacks/IAmmalgamCallee.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/callbacks/IAmmalgamCallee.sol) *This interface should be implemented by anyone wishing to use callbacks in the `swap`, `borrow`, and `borrowLiquidity` functions in the IAmmalgamPair interface.* diff --git a/docs/developer-guide/contracts/interfaces/callbacks/ITransferValidator.sol/interface.ITransferValidator.md b/docs/developer-guide/contracts/interfaces/callbacks/ITransferValidator.sol/interface.ITransferValidator.md index 5dd7fcee..b89d5f96 100644 --- a/docs/developer-guide/contracts/interfaces/callbacks/ITransferValidator.sol/interface.ITransferValidator.md +++ b/docs/developer-guide/contracts/interfaces/callbacks/ITransferValidator.sol/interface.ITransferValidator.md @@ -1,5 +1,5 @@ # ITransferValidator -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/callbacks/ITransferValidator.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/callbacks/ITransferValidator.sol) This interface is intended for validating the solvency of an account when transfers occur. diff --git a/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IAmmalgamFactory.md b/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IAmmalgamFactory.md index 56841a14..ac0c0189 100644 --- a/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IAmmalgamFactory.md +++ b/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IAmmalgamFactory.md @@ -1,5 +1,5 @@ # IAmmalgamFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/factories/IAmmalgamFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/factories/IAmmalgamFactory.sol) **Inherits:** [IFactoryCallback](/docs/developer-guide/contracts/interfaces/factories/IFactoryCallback.sol/interface.IFactoryCallback.md), [IBeaconCallback](/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IBeaconCallback.md) diff --git a/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IBeaconCallback.md b/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IBeaconCallback.md index 21404d6c..825e2bd3 100644 --- a/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IBeaconCallback.md +++ b/docs/developer-guide/contracts/interfaces/factories/IAmmalgamFactory.sol/interface.IBeaconCallback.md @@ -1,5 +1,5 @@ # IBeaconCallback -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/factories/IAmmalgamFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/factories/IAmmalgamFactory.sol) ## Functions diff --git a/docs/developer-guide/contracts/interfaces/factories/IFactoryCallback.sol/interface.IFactoryCallback.md b/docs/developer-guide/contracts/interfaces/factories/IFactoryCallback.sol/interface.IFactoryCallback.md index 832f69ae..df064ef2 100644 --- a/docs/developer-guide/contracts/interfaces/factories/IFactoryCallback.sol/interface.IFactoryCallback.md +++ b/docs/developer-guide/contracts/interfaces/factories/IFactoryCallback.sol/interface.IFactoryCallback.md @@ -1,5 +1,5 @@ # IFactoryCallback -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/factories/IFactoryCallback.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/factories/IFactoryCallback.sol) This interface provides methods for getting the token factory configuration. diff --git a/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md b/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md index 44db468d..bc7404a5 100644 --- a/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md +++ b/docs/developer-guide/contracts/interfaces/factories/ITokenFactory.sol/interface.ITokenFactory.md @@ -1,5 +1,5 @@ # ITokenFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/factories/ITokenFactory.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/factories/ITokenFactory.sol) ## Functions diff --git a/docs/developer-guide/contracts/interfaces/tokens/IAmmalgamERC20.sol/interface.IAmmalgamERC20.md b/docs/developer-guide/contracts/interfaces/tokens/IAmmalgamERC20.sol/interface.IAmmalgamERC20.md index 39383c87..0109b965 100644 --- a/docs/developer-guide/contracts/interfaces/tokens/IAmmalgamERC20.sol/interface.IAmmalgamERC20.md +++ b/docs/developer-guide/contracts/interfaces/tokens/IAmmalgamERC20.sol/interface.IAmmalgamERC20.md @@ -1,5 +1,5 @@ # IAmmalgamERC20 -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/tokens/IAmmalgamERC20.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/tokens/IAmmalgamERC20.sol) **Inherits:** IERC20, IERC20Metadata, IERC20Permit diff --git a/docs/developer-guide/contracts/interfaces/tokens/IERC20DebtToken.sol/interface.IERC20DebtToken.md b/docs/developer-guide/contracts/interfaces/tokens/IERC20DebtToken.sol/interface.IERC20DebtToken.md index c77dd330..cfcb866f 100644 --- a/docs/developer-guide/contracts/interfaces/tokens/IERC20DebtToken.sol/interface.IERC20DebtToken.md +++ b/docs/developer-guide/contracts/interfaces/tokens/IERC20DebtToken.sol/interface.IERC20DebtToken.md @@ -1,5 +1,5 @@ # IERC20DebtToken -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/tokens/IERC20DebtToken.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/tokens/IERC20DebtToken.sol) **Inherits:** [IAmmalgamERC20](/docs/developer-guide/contracts/interfaces/tokens/IAmmalgamERC20.sol/interface.IAmmalgamERC20.md) diff --git a/docs/developer-guide/contracts/interfaces/tokens/IHookRegistry.sol/interface.IHookRegistry.md b/docs/developer-guide/contracts/interfaces/tokens/IHookRegistry.sol/interface.IHookRegistry.md index e9e8be77..0dda4303 100644 --- a/docs/developer-guide/contracts/interfaces/tokens/IHookRegistry.sol/interface.IHookRegistry.md +++ b/docs/developer-guide/contracts/interfaces/tokens/IHookRegistry.sol/interface.IHookRegistry.md @@ -1,5 +1,5 @@ # IHookRegistry -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/tokens/IHookRegistry.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/tokens/IHookRegistry.sol) ## Functions diff --git a/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/constants.ITokenController.md b/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/constants.ITokenController.md index 4dfba71e..fceefd97 100644 --- a/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/constants.ITokenController.md +++ b/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/constants.ITokenController.md @@ -1,5 +1,5 @@ # Constants -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/tokens/ITokenController.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/tokens/ITokenController.sol) ### DEPOSIT_L diff --git a/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/interface.ITokenController.md b/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/interface.ITokenController.md index 85f1e34c..1340b81d 100644 --- a/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/interface.ITokenController.md +++ b/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/interface.ITokenController.md @@ -1,5 +1,5 @@ # ITokenController -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/interfaces/tokens/ITokenController.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/interfaces/tokens/ITokenController.sol) The interface of a ERC20 facade for multiple token types with functionality similar to ERC1155. diff --git a/docs/developer-guide/contracts/libraries/Convert.sol/library.Convert.md b/docs/developer-guide/contracts/libraries/Convert.sol/library.Convert.md index ecb9c701..51077688 100644 --- a/docs/developer-guide/contracts/libraries/Convert.sol/library.Convert.md +++ b/docs/developer-guide/contracts/libraries/Convert.sol/library.Convert.md @@ -1,5 +1,5 @@ # Convert -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/Convert.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/Convert.sol) ## Functions diff --git a/docs/developer-guide/contracts/libraries/GeometricTWAP.sol/library.GeometricTWAP.md b/docs/developer-guide/contracts/libraries/GeometricTWAP.sol/library.GeometricTWAP.md index 0c5cc002..ef439064 100644 --- a/docs/developer-guide/contracts/libraries/GeometricTWAP.sol/library.GeometricTWAP.md +++ b/docs/developer-guide/contracts/libraries/GeometricTWAP.sol/library.GeometricTWAP.md @@ -1,5 +1,5 @@ # GeometricTWAP -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/GeometricTWAP.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/GeometricTWAP.sol) ## State Variables diff --git a/docs/developer-guide/contracts/libraries/Interest.sol/library.Interest.md b/docs/developer-guide/contracts/libraries/Interest.sol/library.Interest.md index f3d19359..b2d70cfd 100644 --- a/docs/developer-guide/contracts/libraries/Interest.sol/library.Interest.md +++ b/docs/developer-guide/contracts/libraries/Interest.sol/library.Interest.md @@ -1,5 +1,5 @@ # Interest -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/Interest.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/Interest.sol) This library is used for calculating and accruing interest. diff --git a/docs/developer-guide/contracts/libraries/Liquidation.sol/library.Liquidation.md b/docs/developer-guide/contracts/libraries/Liquidation.sol/library.Liquidation.md index 670ab145..f1a12ebe 100644 --- a/docs/developer-guide/contracts/libraries/Liquidation.sol/library.Liquidation.md +++ b/docs/developer-guide/contracts/libraries/Liquidation.sol/library.Liquidation.md @@ -1,5 +1,5 @@ # Liquidation -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/Liquidation.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/Liquidation.sol) ## State Variables @@ -45,13 +45,13 @@ uint256 private constant POSITIVE_PREMIUM_INTERCEPT_IN_BIPS = 4444; ``` -### LEVERAGE_LIQUIDATION_BREAK_EVEN_FACTOR +### LEVERAGE_LIQUIDATION_BREAK_EVEN_FACTOR_MAG2 The factor to controls the pace of the increase in the premium the leverage liquidation premium function. ```solidity -uint256 private constant LEVERAGE_LIQUIDATION_BREAK_EVEN_FACTOR = 5; +uint256 internal constant LEVERAGE_LIQUIDATION_BREAK_EVEN_FACTOR_MAG2 = 10; ``` @@ -127,11 +127,8 @@ function calculateNetDebtAndSeizedDeposits( function checkSaturationPremiums( ISaturationAndGeometricTWAPState saturationAndGeometricTWAPState, Validation.InputParams memory inputParams, - address borrower, - uint256 depositLToTransferInLAssets, - uint256 depositXToTransferInXAssets, - uint256 depositYToTransferInYAssets -) external view; + address borrower +) external view returns (uint256 seizeXAssets, uint256 seizeYAssets, uint256 seizeLAssets); ``` ### liquidateLeverageCalcDeltaAndPremium @@ -139,7 +136,7 @@ function checkSaturationPremiums( Calculate the amount to be closed (from both deposit and borrow) and premium to be paid. The formula for the premium is calculated with the average net borrow of X and Y $$B$$ and the net deposit of X and Y $$B$$ and a scaler $$S$$ that sets the pace at which -the premium increased, in code we call this `LEVERAGE_LIQUIDATION_BREAK_EVEN_FACTOR`, and +the premium increased, in code we call this `LEVERAGE_LIQUIDATION_BREAK_EVEN_FACTOR_MAG2`, and allowed leverage $$AL$$, `ALLOWED_LIQUIDITY_LEVERAGE`: ```math premium = \begin{cases} @@ -268,36 +265,17 @@ function convertLtvToPremium( |`maxPremiumInBips`|`uint256`|The maximum premium for the liquidator.| -### calcSaturationPremiumBips - -Calculate the premium the saturation liquidator is receiving given the borrowers deposit and the depositToTransfer to the liquidator. -The end premium is the max of the premiums in L, X, Y -If no saturation liq is requested (liquidationParams.saturationDepositLToBeTransferred==liquidationParams.saturationDepositXToBeTransferred==liquidationParams.saturationDepositYToBeTransferred==0), the premium will be 0 +### calcSaturationSeizedAssets ```solidity -function calcSaturationPremiumBips( - Validation.InputParams memory inputParams, - uint256 depositLToTransferInLAssets, - uint256 depositXToTransferInXAssets, - uint256 depositYToTransferInYAssets -) internal pure returns (uint256 premiumInBips); +function calcSaturationSeizedAssets( + uint256 depositedLAssets, + uint256 depositedXAssets, + uint256 depositedYAssets, + uint256 premiumInBips +) internal pure returns (uint256 seizedLAssets, uint256 seizedXAssets, uint256 seizedYAssets); ``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`inputParams`|`Validation.InputParams`|The params containing the position of the borrower.| -|`depositLToTransferInLAssets`|`uint256`|| -|`depositXToTransferInXAssets`|`uint256`|| -|`depositYToTransferInYAssets`|`uint256`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`premiumInBips`|`uint256`|The premium being received by the liquidator.| - ### calcSaturationMaxPremiumInBips diff --git a/docs/developer-guide/contracts/libraries/PartialLiquidations.sol/library.PartialLiquidations.md b/docs/developer-guide/contracts/libraries/PartialLiquidations.sol/library.PartialLiquidations.md index 77d125ee..7ccba644 100644 --- a/docs/developer-guide/contracts/libraries/PartialLiquidations.sol/library.PartialLiquidations.md +++ b/docs/developer-guide/contracts/libraries/PartialLiquidations.sol/library.PartialLiquidations.md @@ -1,5 +1,5 @@ # PartialLiquidations -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/PartialLiquidations.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/PartialLiquidations.sol) We allow liquidations to happen in parts when the position is spread across more than one tranche. These partial liquidations allow the liquidator to specify how many tranches they diff --git a/docs/developer-guide/contracts/libraries/QuadraticSwapFees.sol/library.QuadraticSwapFees.md b/docs/developer-guide/contracts/libraries/QuadraticSwapFees.sol/library.QuadraticSwapFees.md index 22a74753..9aa4934b 100644 --- a/docs/developer-guide/contracts/libraries/QuadraticSwapFees.sol/library.QuadraticSwapFees.md +++ b/docs/developer-guide/contracts/libraries/QuadraticSwapFees.sol/library.QuadraticSwapFees.md @@ -1,5 +1,5 @@ # QuadraticSwapFees -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/QuadraticSwapFees.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/QuadraticSwapFees.sol) **Author:** Will diff --git a/docs/developer-guide/contracts/libraries/Saturation.sol/library.Saturation.md b/docs/developer-guide/contracts/libraries/Saturation.sol/library.Saturation.md index a73338f0..e664ca40 100644 --- a/docs/developer-guide/contracts/libraries/Saturation.sol/library.Saturation.md +++ b/docs/developer-guide/contracts/libraries/Saturation.sol/library.Saturation.md @@ -1,5 +1,5 @@ # Saturation -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/Saturation.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/Saturation.sol) **Authors:** imi@1m1.io, Will duelingGalois@protonmail.com @@ -181,6 +181,18 @@ uint256 internal constant EXPECTED_SATURATION_LTV_PLUS_ONE_MAG2 = 185; ``` +### SAT_RESET_FOR_STRADDLE_SLOPE_BIPS +Slope for calculating premium when resetting saturation for straddle positions +where $$L^2 < X \cdot Y$$ transitions to $$L^2 > X \cdot Y$$. The current value is +50 * BIPS which allows for the premium to grow quickly as the straddle's window of +insolvency grows rapidly once they reach this transition point. + + +```solidity +uint256 internal constant SAT_RESET_FOR_STRADDLE_SLOPE_BIPS = 500_000; +``` + + ### SAT_CHANGE_OF_BASE_Q128 a constant used to change the log base from the tick math base to the saturation to leaf base. @@ -387,16 +399,6 @@ uint256 private constant NUMBER_OF_QUARTERS = 4; ``` -### SATURATION_LIQUIDATION_SCALER -We make the penalty slightly larger to hit our desired premium for exceeding the -time buffer. - - -```solidity -uint256 private constant SATURATION_LIQUIDATION_SCALER = 10_020; -``` - - ### TWO_Q72 $$2 * 2**72 * 2$$, used in saturation formula. @@ -1211,7 +1213,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 +expected loan to value of liquidation $$k$$, then the following formulas are what we are +calculating, +```math +\begin{align} +k &= +\begin{cases} +-\frac{L + \frac{X}{s_p}}{L + Y \cdot s_p} +\text{ if } L+ \frac{X}{s_p} < 0 +\\ +-\frac{L + Y \cdot s_p}{L + \frac{X}{s_p}} +\text{ if } L + Y \cdot s_p < 0 +\end{cases} +\\ +s_p &= +\begin{cases} +\frac{ +-(k+1)L + +\sqrt{\left((k+1)L\right)^2 - 4 \left( k\cdot Y \right) \left(X \right)} +}{ +2 \cdot k \cdot Y +} +\text{ if } L + \frac{X}{s_p} < 0 +\\ +\frac{ +-(k+1)L - +\sqrt{((k+1)L)^2-4(Y)(k\cdot X)} +}{ +2\cdot k +} +\text{ if } L + Y \cdot s_p < 0 +\end{cases} +\end{align} +``` +The equation gives four solutions due to the plus minus of the radical, but we choose the +direction due to the conditions. When we have a net debt of x, $$L + \frac{X}{s_p} < 0$$, +the loan to value will be increasing as the price decreases, thus we choose the positive +value of the radical. For the net debt of y, $$L + Y \cdot s_p < 0$$ we have the loan to +value increasing as the price increases, thus we use the negative value of the radical. Output guarantees $$0 \le liqSqrtPriceXInQ72 \le uint256(type(uint56).max) << 72$$ (fuzz tested and logic) @@ -1283,7 +1324,7 @@ function calcSatChangeRatioBips( uint256 liqSqrtPriceInYInQ72, address account, uint256 desiredSaturationMAG2 -) internal view returns (uint256 ratioNetXBips, uint256 ratioNetYBips); +) internal view returns (uint256 ratioBips); ``` **Parameters** @@ -1300,8 +1341,38 @@ function calcSatChangeRatioBips( |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 in saturation for account.| + + +### calcStraddlePremiumRatioBips + +Calculate the ratio bips for a straddle position transitioning from zero to positive saturation. +```math +r = \max\left(0, \left \lceil \frac{L^{2}-YX}{Y\cdot X} \cdot {S_{BIPS}}\right\rceil\right) +``` +The ratioBips encodes premium for downstream consumption: +```math +\text{ratioBips} = \text{premiumBips} \cdot \text{MAG1} + \text{BIPS} +``` +and premium is recovered as: `(ratioBips - BIPS) / MAG1`. + + +```solidity +function calcStraddlePremiumRatioBips( + uint256[6] memory userAssets +) private pure returns (uint256 ratioBips); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`userAssets`|`uint256[6]`|The user's position parameters.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`ratioBips`|`uint256`|The ratio in bips, or 0 if $$L^2 <= X \cdot Y$$.| ### calculateEndOfLiquidationAdjustment diff --git a/docs/developer-guide/contracts/libraries/TickMath.sol/library.TickMath.md b/docs/developer-guide/contracts/libraries/TickMath.sol/library.TickMath.md index 6f547b0b..66f49025 100644 --- a/docs/developer-guide/contracts/libraries/TickMath.sol/library.TickMath.md +++ b/docs/developer-guide/contracts/libraries/TickMath.sol/library.TickMath.md @@ -1,5 +1,5 @@ # TickMath -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/TickMath.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/TickMath.sol) Computes sqrt price for ticks of size B=(1-2^-9)^-1 as fixed point Q72 numbers. Supports prices between 2**-112 and 2**112-1 diff --git a/docs/developer-guide/contracts/libraries/TokenSymbol.sol/library.TokenSymbol.md b/docs/developer-guide/contracts/libraries/TokenSymbol.sol/library.TokenSymbol.md index 92328998..59e57edc 100644 --- a/docs/developer-guide/contracts/libraries/TokenSymbol.sol/library.TokenSymbol.md +++ b/docs/developer-guide/contracts/libraries/TokenSymbol.sol/library.TokenSymbol.md @@ -1,5 +1,5 @@ # TokenSymbol -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/TokenSymbol.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/TokenSymbol.sol) ## Functions diff --git a/docs/developer-guide/contracts/libraries/Uint16Set.sol/library.Uint16Set.md b/docs/developer-guide/contracts/libraries/Uint16Set.sol/library.Uint16Set.md index c1872326..99b992a3 100644 --- a/docs/developer-guide/contracts/libraries/Uint16Set.sol/library.Uint16Set.md +++ b/docs/developer-guide/contracts/libraries/Uint16Set.sol/library.Uint16Set.md @@ -1,5 +1,5 @@ # Uint16Set -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/Uint16Set.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/Uint16Set.sol) based on https://github.com/rob-Hitchens/SetTypes/blob/master/contracts/UintSet.sol diff --git a/docs/developer-guide/contracts/libraries/Validation.sol/library.Validation.md b/docs/developer-guide/contracts/libraries/Validation.sol/library.Validation.md index af34a9d1..f5f564a1 100644 --- a/docs/developer-guide/contracts/libraries/Validation.sol/library.Validation.md +++ b/docs/developer-guide/contracts/libraries/Validation.sol/library.Validation.md @@ -1,5 +1,5 @@ # Validation -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/Validation.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/Validation.sol) SPDX-License-Identifier: GPL-3.0-only diff --git a/docs/developer-guide/contracts/libraries/constants.sol/constants.constants.md b/docs/developer-guide/contracts/libraries/constants.sol/constants.constants.md index f0fc46f4..63326e78 100644 --- a/docs/developer-guide/contracts/libraries/constants.sol/constants.constants.md +++ b/docs/developer-guide/contracts/libraries/constants.sol/constants.constants.md @@ -1,5 +1,5 @@ # Constants -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/libraries/constants.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/libraries/constants.sol) ### B_IN_Q72 *This basis was a modification to Uniswap V3's basis, to fit ticks into int16 instead of diff --git a/docs/developer-guide/contracts/proxy/BeaconController.sol/contract.BeaconController.md b/docs/developer-guide/contracts/proxy/BeaconController.sol/contract.BeaconController.md index 6ccb1f0e..53a2b864 100644 --- a/docs/developer-guide/contracts/proxy/BeaconController.sol/contract.BeaconController.md +++ b/docs/developer-guide/contracts/proxy/BeaconController.sol/contract.BeaconController.md @@ -1,5 +1,5 @@ # BeaconController -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/BeaconController.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/BeaconController.sol) **Inherits:** [IBeaconController](/docs/developer-guide/contracts/proxy/BeaconController.sol/interface.IBeaconController.md), AccessControl diff --git a/docs/developer-guide/contracts/proxy/BeaconController.sol/interface.IBeaconController.md b/docs/developer-guide/contracts/proxy/BeaconController.sol/interface.IBeaconController.md index b6e532dc..d7d9f7ed 100644 --- a/docs/developer-guide/contracts/proxy/BeaconController.sol/interface.IBeaconController.md +++ b/docs/developer-guide/contracts/proxy/BeaconController.sol/interface.IBeaconController.md @@ -1,5 +1,5 @@ # IBeaconController -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/BeaconController.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/BeaconController.sol) ## Functions diff --git a/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.InitializablePair.md b/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.InitializablePair.md index b125b4fd..2a45e088 100644 --- a/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.InitializablePair.md +++ b/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.InitializablePair.md @@ -1,5 +1,5 @@ # InitializablePair -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/PairBeaconProxy.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/PairBeaconProxy.sol) **Inherits:** [IPairInitializable](/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/interface.IPairInitializable.md), Initializable diff --git a/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.PairBeaconProxy.md b/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.PairBeaconProxy.md index b43beede..21ccc746 100644 --- a/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.PairBeaconProxy.md +++ b/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.PairBeaconProxy.md @@ -1,5 +1,5 @@ # PairBeaconProxy -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/PairBeaconProxy.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/PairBeaconProxy.sol) **Inherits:** BeaconProxy diff --git a/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/interface.IPairInitializable.md b/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/interface.IPairInitializable.md index 3d13d075..65a06bf1 100644 --- a/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/interface.IPairInitializable.md +++ b/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/interface.IPairInitializable.md @@ -1,5 +1,5 @@ # IPairInitializable -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/PairBeaconProxy.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/PairBeaconProxy.sol) ## Functions diff --git a/docs/developer-guide/contracts/proxy/PairBlockAllTransfers.sol/contract.PairBlockAllTransfers.md b/docs/developer-guide/contracts/proxy/PairBlockAllTransfers.sol/contract.PairBlockAllTransfers.md index 0d836be5..a2cad8cf 100644 --- a/docs/developer-guide/contracts/proxy/PairBlockAllTransfers.sol/contract.PairBlockAllTransfers.md +++ b/docs/developer-guide/contracts/proxy/PairBlockAllTransfers.sol/contract.PairBlockAllTransfers.md @@ -1,5 +1,5 @@ # PairBlockAllTransfers -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/PairBlockAllTransfers.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/PairBlockAllTransfers.sol) **Inherits:** [AmmalgamPair](/docs/developer-guide/contracts/AmmalgamPair.sol/contract.AmmalgamPair.md) diff --git a/docs/developer-guide/contracts/proxy/PairFrozen.sol/contract.PairFrozen.md b/docs/developer-guide/contracts/proxy/PairFrozen.sol/contract.PairFrozen.md index 1cfa72a3..b3326c78 100644 --- a/docs/developer-guide/contracts/proxy/PairFrozen.sol/contract.PairFrozen.md +++ b/docs/developer-guide/contracts/proxy/PairFrozen.sol/contract.PairFrozen.md @@ -1,5 +1,5 @@ # PairFrozen -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/PairFrozen.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/PairFrozen.sol) **Inherits:** [InitializablePair](/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.InitializablePair.md) diff --git a/docs/developer-guide/contracts/proxy/PairLockedLoans.sol/contract.PairLockedLoans.md b/docs/developer-guide/contracts/proxy/PairLockedLoans.sol/contract.PairLockedLoans.md index b092e973..091b610b 100644 --- a/docs/developer-guide/contracts/proxy/PairLockedLoans.sol/contract.PairLockedLoans.md +++ b/docs/developer-guide/contracts/proxy/PairLockedLoans.sol/contract.PairLockedLoans.md @@ -1,5 +1,5 @@ # PairLockedLoans -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/proxy/PairLockedLoans.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/proxy/PairLockedLoans.sol) **Inherits:** [AmmalgamPair](/docs/developer-guide/contracts/AmmalgamPair.sol/contract.AmmalgamPair.md) diff --git a/docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md b/docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md index ba4da0ce..b25b6622 100644 --- a/docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md +++ b/docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md @@ -1,5 +1,5 @@ # ERC20Base -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/ERC20Base.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/ERC20Base.sol) **Inherits:** ERC20Hooks, Ownable, ERC20Permit, [IAmmalgamERC20](/docs/developer-guide/contracts/interfaces/tokens/IAmmalgamERC20.sol/interface.IAmmalgamERC20.md) diff --git a/docs/developer-guide/contracts/tokens/ERC20Base.sol/struct.ERC20BaseConfig.md b/docs/developer-guide/contracts/tokens/ERC20Base.sol/struct.ERC20BaseConfig.md index c60f834d..857159d0 100644 --- a/docs/developer-guide/contracts/tokens/ERC20Base.sol/struct.ERC20BaseConfig.md +++ b/docs/developer-guide/contracts/tokens/ERC20Base.sol/struct.ERC20BaseConfig.md @@ -1,5 +1,5 @@ # ERC20BaseConfig -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/ERC20Base.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/ERC20Base.sol) ```solidity diff --git a/docs/developer-guide/contracts/tokens/ERC20DebtBase.sol/abstract.ERC20DebtBase.md b/docs/developer-guide/contracts/tokens/ERC20DebtBase.sol/abstract.ERC20DebtBase.md index 35b8764b..0cee391b 100644 --- a/docs/developer-guide/contracts/tokens/ERC20DebtBase.sol/abstract.ERC20DebtBase.md +++ b/docs/developer-guide/contracts/tokens/ERC20DebtBase.sol/abstract.ERC20DebtBase.md @@ -1,5 +1,5 @@ # ERC20DebtBase -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/ERC20DebtBase.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/ERC20DebtBase.sol) **Inherits:** [ERC20Base](/docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md), [IERC20DebtToken](/docs/developer-guide/contracts/interfaces/tokens/IERC20DebtToken.sol/interface.IERC20DebtToken.md) @@ -26,12 +26,9 @@ function nonces( ### approve -*Standard ERC20 approve is disabled for debt tokens. -Allowances must be set via approveDebt using debt-specific semantics.* - ```solidity -function approve(address, uint256) public pure virtual override(ERC20, IERC20) returns (bool); +function approve(address spender, uint256 amount) public virtual override(ERC20, IERC20) returns (bool); ``` ### allowance diff --git a/docs/developer-guide/contracts/tokens/ERC20DebtLiquidityToken.sol/contract.ERC20DebtLiquidityToken.md b/docs/developer-guide/contracts/tokens/ERC20DebtLiquidityToken.sol/contract.ERC20DebtLiquidityToken.md index 49c58f0a..dec10cca 100644 --- a/docs/developer-guide/contracts/tokens/ERC20DebtLiquidityToken.sol/contract.ERC20DebtLiquidityToken.md +++ b/docs/developer-guide/contracts/tokens/ERC20DebtLiquidityToken.sol/contract.ERC20DebtLiquidityToken.md @@ -1,5 +1,5 @@ # ERC20DebtLiquidityToken -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/ERC20DebtLiquidityToken.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/ERC20DebtLiquidityToken.sol) **Inherits:** [ERC20DebtBase](/docs/developer-guide/contracts/tokens/ERC20DebtBase.sol/abstract.ERC20DebtBase.md) diff --git a/docs/developer-guide/contracts/tokens/ERC20LiquidityToken.sol/contract.ERC20LiquidityToken.md b/docs/developer-guide/contracts/tokens/ERC20LiquidityToken.sol/contract.ERC20LiquidityToken.md index 8f51988b..b7288a75 100644 --- a/docs/developer-guide/contracts/tokens/ERC20LiquidityToken.sol/contract.ERC20LiquidityToken.md +++ b/docs/developer-guide/contracts/tokens/ERC20LiquidityToken.sol/contract.ERC20LiquidityToken.md @@ -1,5 +1,5 @@ # ERC20LiquidityToken -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/ERC20LiquidityToken.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/ERC20LiquidityToken.sol) **Inherits:** [ERC20Base](/docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md) diff --git a/docs/developer-guide/contracts/tokens/ERC4626DebtToken.sol/contract.ERC4626DebtToken.md b/docs/developer-guide/contracts/tokens/ERC4626DebtToken.sol/contract.ERC4626DebtToken.md index 3cbef634..7a259208 100644 --- a/docs/developer-guide/contracts/tokens/ERC4626DebtToken.sol/contract.ERC4626DebtToken.md +++ b/docs/developer-guide/contracts/tokens/ERC4626DebtToken.sol/contract.ERC4626DebtToken.md @@ -1,5 +1,5 @@ # ERC4626DebtToken -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/ERC4626DebtToken.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/ERC4626DebtToken.sol) **Inherits:** ERC4626, [ERC20DebtBase](/docs/developer-guide/contracts/tokens/ERC20DebtBase.sol/abstract.ERC20DebtBase.md) @@ -149,7 +149,7 @@ function _withdraw( ```solidity -function approve(address account, uint256 balance) public pure override(ERC20, ERC20DebtBase, IERC20) returns (bool); +function approve(address spender, uint256 amount) public override(ERC20, ERC20DebtBase, IERC20) returns (bool); ``` ### allowance diff --git a/docs/developer-guide/contracts/tokens/ERC4626DepositToken.sol/contract.ERC4626DepositToken.md b/docs/developer-guide/contracts/tokens/ERC4626DepositToken.sol/contract.ERC4626DepositToken.md index a7ee1db6..35d75906 100644 --- a/docs/developer-guide/contracts/tokens/ERC4626DepositToken.sol/contract.ERC4626DepositToken.md +++ b/docs/developer-guide/contracts/tokens/ERC4626DepositToken.sol/contract.ERC4626DepositToken.md @@ -1,5 +1,5 @@ # ERC4626DepositToken -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/ERC4626DepositToken.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/ERC4626DepositToken.sol) **Inherits:** ERC4626, [ERC20Base](/docs/developer-guide/contracts/tokens/ERC20Base.sol/abstract.ERC20Base.md) diff --git a/docs/developer-guide/contracts/tokens/HookRegistry.sol/contract.HookRegistry.md b/docs/developer-guide/contracts/tokens/HookRegistry.sol/contract.HookRegistry.md index fcc54896..4a80072a 100644 --- a/docs/developer-guide/contracts/tokens/HookRegistry.sol/contract.HookRegistry.md +++ b/docs/developer-guide/contracts/tokens/HookRegistry.sol/contract.HookRegistry.md @@ -1,5 +1,5 @@ # HookRegistry -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/HookRegistry.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/HookRegistry.sol) **Inherits:** [IHookRegistry](/docs/developer-guide/contracts/interfaces/tokens/IHookRegistry.sol/interface.IHookRegistry.md), Ownable diff --git a/docs/developer-guide/contracts/tokens/TokenController.sol/contract.TokenController.md b/docs/developer-guide/contracts/tokens/TokenController.sol/contract.TokenController.md index 443f0516..976451b1 100644 --- a/docs/developer-guide/contracts/tokens/TokenController.sol/contract.TokenController.md +++ b/docs/developer-guide/contracts/tokens/TokenController.sol/contract.TokenController.md @@ -1,5 +1,5 @@ # TokenController -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/tokens/TokenController.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/tokens/TokenController.sol) **Inherits:** [InitializablePair](/docs/developer-guide/contracts/proxy/PairBeaconProxy.sol/contract.InitializablePair.md), [ITokenController](/docs/developer-guide/contracts/interfaces/tokens/ITokenController.sol/interface.ITokenController.md) @@ -88,7 +88,7 @@ uint112[6] private allShares; ### allAssets ```solidity -uint112[6] internal allAssets; +uint112[6] private allAssets; ``` @@ -237,7 +237,7 @@ function underlyingTokens() public view virtual override returns (IERC20, IERC20 ```solidity -function updateAssets(uint256 tokenType, uint112 assets) private; +function updateAssets(uint256 tokenType, uint112 assets) internal; ``` ### updateExternalLiquidity diff --git a/docs/developer-guide/contracts/utils/deployHelper.sol/function.deployFactory.md b/docs/developer-guide/contracts/utils/deployHelper.sol/function.deployFactory.md index 10f5adf2..9f69199d 100644 --- a/docs/developer-guide/contracts/utils/deployHelper.sol/function.deployFactory.md +++ b/docs/developer-guide/contracts/utils/deployHelper.sol/function.deployFactory.md @@ -1,5 +1,5 @@ # function deployFactory -[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/2b185eab2df708b55f7ffa534655c69f626e73b3/contracts/utils/deployHelper.sol) +[Git Source](https://github.com/Ammalgam-Protocol/core-v1/blob/308b70cbaad52276d27a3a7c1a1e210d635ddff3/contracts/utils/deployHelper.sol) ### deployFactory(address)