IBaseRebalancer
Functions
getCurrentStateData
Returns the necessary data for the USDN protocol to update the position.
function getCurrentStateData()
external
view
returns (uint128 pendingAssets_, uint256 maxLeverage_, Types.PositionId memory currentPosId_);
Returns
| Name | Type | Description |
|---|---|---|
pendingAssets_ | uint128 | The amount of assets that are pending inclusion in the protocol. |
maxLeverage_ | uint256 | The maximum leverage of the rebalancer. |
currentPosId_ | Types.PositionId | The ID of the current position (tick == NO_POSITION_TICK if no position). |
getMinAssetDeposit
Returns the minimum amount of assets a user can deposit in the rebalancer.
function getMinAssetDeposit() external view returns (uint256 minAssetDeposit_);
Returns
| Name | Type | Description |
|---|---|---|
minAssetDeposit_ | uint256 | The minimum amount of assets that can be deposited by a user. |
getUserDepositData
Returns the data regarding the assets deposited by the provided user.
function getUserDepositData(address user) external view returns (IRebalancerTypes.UserDeposit memory data_);
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The address of the user. |
Returns
| Name | Type | Description |
|---|---|---|
data_ | IRebalancerTypes.UserDeposit | The data regarding the assets deposited by the provided user. |
updatePosition
Indicates that the previous version of the position was closed and a new one was opened.
If previousPosValue equals 0, it means the previous version got liquidated.
function updatePosition(Types.PositionId calldata newPosId, uint128 previousPosValue) external;
Parameters
| Name | Type | Description |
|---|---|---|
newPosId | Types.PositionId | The position ID of the new position. |
previousPosValue | uint128 | The amount of assets left in the previous position. |
setMinAssetDeposit
Sets the minimum amount of assets to be deposited by a user.
The new minimum amount must be greater than or equal to the minimum long position of the USDN protocol. This function can only be called by the owner or the USDN protocol.
function setMinAssetDeposit(uint256 minAssetDeposit) external;
Parameters
| Name | Type | Description |
|---|---|---|
minAssetDeposit | uint256 | The new minimum amount of assets to be deposited. |