IBaseRebalancer

Git Source

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

NameTypeDescription
pendingAssets_uint128The amount of assets that are pending inclusion in the protocol.
maxLeverage_uint256The maximum leverage of the rebalancer.
currentPosId_Types.PositionIdThe 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

NameTypeDescription
minAssetDeposit_uint256The 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

NameTypeDescription
useraddressThe address of the user.

Returns

NameTypeDescription
data_IRebalancerTypes.UserDepositThe 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

NameTypeDescription
newPosIdTypes.PositionIdThe position ID of the new position.
previousPosValueuint128The 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

NameTypeDescription
minAssetDeposituint256The new minimum amount of assets to be deposited.