# ConvexAIEth

#### **`calc_wrapped_from_want`**

Menghitung jumlah token yang diinginkan setelah dibungkus.

```
function calc_wrapped_from_want(uint256 want_amount) public view override returns (uint256)
```

**Parameter:**

| Nama         | Jenis   | Deskripsi                    |
| ------------ | ------- | ---------------------------- |
| want\_amount | uint256 | Jumlah token yang diinginkan |

**Nilai hasil:**

| Jenis   | Deskripsi                                |
| ------- | ---------------------------------------- |
| uint256 | Jumlah wrapped token setelah perhitungan |

#### **`unwrap`**

Jika jumlah wrapped lebih besar dari 0, hapus jumlah wrapped dari likuiditas kurva dan saldo deposit kontrak ke wrapped ethereum.

```
function unwrap(uint256 wrapped_amount) internal override returns (uint256 result_val)
```

**Parameter:**

| Nama            | Jenis   | Deskripsi                         |
| --------------- | ------- | --------------------------------- |
| wrapped\_amount | uint256 | Jumlah wrapped token untuk dibuka |

**Nilai hasil:**

| Nama        | Jenis   | Deskripsi                   |
| ----------- | ------- | --------------------------- |
| result\_val | uint256 | Jumlah token setelah dibuka |

#### **`wrap`**

Menghitung jumlah wrapped dari jumlah yang diinginkan, menghapus wrapped token dari wrapped ethereum dan setelah mengonversinya, menyimpannya ke pool kurva.

```
function wrap(uint256 want_amount) internal override returns (uint256 expected_return)
```

**Parameter:**

| Nama         | Jenis   | Deskripsi                         |
| ------------ | ------- | --------------------------------- |
| want\_amount | uint256 | Jumlah token yang ingin dibungkus |

**Nilai hasil:**

| Nama             | Jenis   | Deskripsi                      |
| ---------------- | ------- | ------------------------------ |
| expected\_return | uint256 | Jumlah token setelah dibungkus |

#### **`prepareReturn`**

Menghitung kurva dan token cembung dan menukarnya ke ETH, menjual hadiah ekstra, setelah itu selesai, menghitung dan mengembalikan nilai keuntungan, kerugian, dan pembayaran utang.

```
function prepareReturn(uint256 _debtOutstanding) internal override returns (uint256 _profit, uint256 _loss, uint256 _debtPayment)
```

**Parameter:**

| Nama              | Jenis   | Deskripsi    |
| ----------------- | ------- | ------------ |
| \_debtOutstanding | uint256 | Nilai hutang |

**Nilai hasil:**

| Nama          | Jenis   | Deskripsi                        |
| ------------- | ------- | -------------------------------- |
| \_profit      | uint256 | Jumlah keuntungan yang diperoleh |
| \_loss        | uint256 | Jumlah kerugian                  |
| \_debtPayment | uint256 | Jumlah hutang yang harus dibayar |


---

# 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.octusbridge.io/ob-id/integrate/octus-bridge-contracts/ethereum/strategies-section/convexaieth.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.
