Protocol Documentation
  • Getting Started
    • Overview
    • Own Protocol 101
    • Protocol Philosophy
  • Protocol Flow
  • Contract Architecture
  • Protocol Calculations
  • FAQ's
  • Legal Notice
  • User
    • User Guide
    • User Protocol Functions
  • Interest Rate Curve
  • User Collateral & Liquidation
  • Yield bearing Reserve
  • Pool Halt & Exit
  • Stock Splits
  • Liquidity Provider
    • LP Guide
    • LP Protocol Functions
  • LP Collateral & Liquidation
  • Market-Making Yield
  • LP Short Strategy
  • Market Landscape
    • Competition
  • Future Potential
Powered by GitBook
On this page
  1. User

User Protocol Functions

AssetPool Functions for Users

Deposit and Claim

function depositRequest(uint256 amount, uint256 collateralAmount) external
  • Purpose: Initiate a deposit of reserve tokens to mint synthetic asset tokens

  • Parameters:

    • amount: Amount of reserve tokens to deposit

    • collateralAmount: Amount of collateral to provide (must meet minimum requirement)

  • Note: This creates a pending request that will be processed in the next cycle

function claimAsset(address user) external
  • 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

function redemptionRequest(uint256 amount) external
  • 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

function claimReserve(address user) external
  • 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

function addCollateral(address user, uint256 amount) external
  • Purpose: Deposit additional collateral for an existing position

  • Parameters:

    • user: Address of the user receiving the collateral

    • amount: Amount of collateral to add

function reduceCollateral(uint256 amount) external
  • 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

function exitPool(uint256 amount) external
  • 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

function liquidationRequest(address user, uint256 amount) external
  • Purpose: Initiate liquidation of an undercollateralized position

  • Parameters:

    • user: Address of the user to liquidate

    • amount: Amount of asset tokens to liquidate (max 30% of position)

  • Note: Caller must have the asset tokens to cover the liquidation

Other User Functions

function getUserCollateralHealth(address assetPool, address user) external view returns (uint8 health)
  • Purpose: Check the collateral health status of a user

  • Returns: 3 = Healthy, 2 = Warning, 1 = Liquidatable

function userPositions(address user) external view returns (uint256 assetAmount, uint256 depositAmount, uint256 collateralAmount)
  • 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 holds

    • depositAmount: Amount of reserve tokens the user has deposited

    • collateralAmount: Amount of collateral the user has provided

PreviousUser GuideNextInterest Rate Curve

Last updated 1 month ago