> For the complete documentation index, see [llms.txt](https://own-protocol.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://own-protocol.gitbook.io/docs/buy-side-mint/buy-side-protocol-functions.md).

# Buy-side Protocol Functions

AssetPool Functions for Buy-side LPs

**Deposit and Claim**

```solidity
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

```solidity
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**

```solidity
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

```solidity
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**

```solidity
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

```solidity
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**

```solidity
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

```solidity
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<br>

**Other User Functions**

```solidity
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

```solidity
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
