User Protocol Functions
AssetPool Functions for Users
Deposit and Claim
Purpose: Initiate a deposit of reserve tokens to mint synthetic asset tokens
Parameters:
amount
: Amount of reserve tokens to depositcollateralAmount
: Amount of collateral to provide (must meet minimum requirement)
Note: This creates a pending request that will be processed in the next cycle
Purpose: Claim minted asset tokens after a deposit request has been processed
Parameters:
user
: Address of the user claiming the assets
Note: Can only be called after a deposit request and cycle completion
Redemption and Withdrawal
Purpose: Request to redeem synthetic asset tokens back to reserve tokens
Parameters:
amount
: Amount of synthetic asset tokens to redeem
Note: This creates a pending redemption request for the next cycle
Purpose: Claim reserve tokens after a redemption request has been processed
Parameters:
user
: Address of the user claiming the reserves
Note: Can only be called after a redemption request and cycle completion
Collateral Management
Purpose: Deposit additional collateral for an existing position
Parameters:
user
: Address of the user receiving the collateralamount
: Amount of collateral to add
Purpose: Withdraw excess collateral if above the minimum requirement
Parameters:
amount
: Amount of collateral to reduce
Note: Will fail if trying to withdraw below the required collateral ratio
Emergency Functions
Purpose: Emergency exit when the pool is halted
Parameters:
amount
: Amount of asset tokens to burn and exit with
Note: Can only be used when the pool is in a halted state
Liquidation Functions
Purpose: Initiate liquidation of an undercollateralized position
Parameters:
user
: Address of the user to liquidateamount
: Amount of asset tokens to liquidate (max 30% of position)
Note: Caller must have the asset tokens to cover the liquidation
Other User Functions
Purpose: Check the collateral health status of a user
Returns: 3 = Healthy, 2 = Warning, 1 = Liquidatable
Purpose: Get detailed information about a user's current position in the protocol
Parameters:
user
: Address of the user
Returns:
assetAmount
: Amount of synthetic asset tokens the user holdsdepositAmount
: Amount of reserve tokens the user has depositedcollateralAmount
: Amount of collateral the user has provided
Last updated