# Hyperbeat Ultra UBTC

### General Vault Information

* **Vault Name:** Hyperbeat Ultra UBTC
* **Vault Token Symbol:** hbBTC
* **Chain:** hyperevm
* **Chain ID:** 999
* **Vault Contract Address:** `0xc061d38903b99aC12713B550C2CB44B221674F94`
* **Vault Token Decimals (hbBTC):** 8
* **Main Deposit Token:** UBTC
  * **Address:** `0x9FDBdA0A5e284c32744D2f17Ee5c74B284993463`
  * **Decimals:** 8

#### Useful Link

* **Contract on explorer:**  [View on hyperscan](https://www.hyperscan.com/address/0xc061d38903b99aC12713B550C2CB44B221674F94?tab=index)
* **UBTC Token on explorer:** [View on hyperscan](https://www.hyperscan.com/token/0x9FDBdA0A5e284c32744D2f17Ee5c74B284993463)
* **Vault Logo:**  [Brand kit](https://www.hyperbeat.org/brand)

{% file src="/files/hHVAdNSP709Bv8cpfQ6g" %}
Here is the complete ABI of the contract for reference - OPTIONAL
{% endfile %}

## Actions:

### Depositing Tokens

To deposit UBTC tokens into the hbBTC vault.

**Steps:**

1. **Check Allowance:**
   * Before depositing, check if the vault contract is authorized to spend the user's UBTC tokens.
   * Call the `allowance(address owner, address spender)` function on the UBTC token contract.
     * `owner`: User's address.
     * `spender`: hbBTC vault contract address.
2. **Approve Spending if necessary:**
   * If the allowance is less than the amount to deposit, the user must approve the vault contract.
   * Call the `approve(address spender, uint256 value)` function on the UBTC token contract.
     * `spender`: hbBTC vault contract address.
     * `value`: Amount of UBTC to approve (in atomic units, e.g., `amount * 10**8`).
3. **Perform Deposit:**
   * Once sufficient approval is granted, call the `deposit(uint256 assets, address receiver)` function on the hbBTC vault contract.
     * `assets`: Amount of UBTC to deposit (in atomic units, e.g., `amount * 10**8`).
     * `receiver`: Address that will receive the hbBTC tokens (usually the user's address).

### Requesting Withdrawal of Tokens (hbBTC)

To withdraw underlying assets from the vault in exchange for hbBTC tokens.

**Steps:**

1. **Request Redeem:**
   * Call the `requestRedeem(uint256 shares, address receiverAddr, address holderAddr)` function on the hbBTC vault contract.
     * `shares`: Amount of hbBTC tokens to withdraw (in atomic units, e.g., `amount * 10**8`).
     * `receiverAddr`: Address that will receive the underlying assets (usually the user's address).
     * `holderAddr`: Owner of the hbBTC tokens (usually the user's address).
   * **Note:** It is recommended to simulate this transaction using `contract.requestRedeem.staticCall(...)` or the `previewRedeem(shares)` function before sending it to check for potential errors and estimate the received assets.

#### Previewing Amounts (Optional but recommended)

The vault contract provides useful preview functions:

* `previewDeposit(uint256 assets) returns (uint256 shares)`: Returns the number of vault shares that would be received for a given amount of assets.
* `previewRedeem(uint256 shares) returns (uint256 assets)`: Returns the amount of assets that would be received for a given number of vault shares.

### Additional Information

* **Token Balance (BalanceOf):**
  * To get a user's UBTC token balance, call `balanceOf(address account)` on the UBTC contract.
  * To get a user's hbBTC token (vault shares) balance, call `balanceOf(address account)` on the hbBTC vault contract.
* **Withdrawal Processing Period:** Please note that withdrawals (after `requestRedeem`) can take up to 2 days to be processed. Once processed, the assets are automatically sent to the `receiverAddr` specified during the `requestRedeem` call. There is no separate manual claim step required by the user after the processing period.
* **Checking Withdrawal Status:**
  * To check the amount of assets that are claimable (or have been claimed) for a specific date for a given receiver, you can use the `getClaimableAmountByReceiver` function on the vault contract.
  * `getClaimableAmountByReceiver(uint256 year, uint256 month, uint256 day, address receiverAddr) view returns (uint256)`
    * `year`: The year of the withdrawal request.
    * `month`: The month of the withdrawal request (1-12).
    * `day`: The day of the withdrawal request.
    * `receiverAddr`: The address of the receiver of the withdrawal.
  * This function returns the amount of assets (in atomic units) that are claimable for that specific date and receiver. If a withdrawal has been processed for that date, it will reflect the amount. If no withdrawal was scheduled or processed for that date for the receiver, it will return 0.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hyperbeat.org/hyperbeat-builder-codes/vaults/hyperbeat-ultra-ubtc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
