> For the complete documentation index, see [llms.txt](https://docs.octusbridge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octusbridge.io/ob-id/integrate/octus-bridge-contracts/ethereum/strategies-section/basestrategy.md).

# BaseStrategy

#### **`harvestTrigger`**

Memberikan sinyal kepada keeper bahwa harvest() harus dipanggil. Penjaga akan memberikan perkiraan biaya bensin yang akan mereka bayarkan untuk memanggil harvest() dan fungsi ini harus menggunakan perkiraan itu untuk membuat keputusan apakah memanggilnya "layak" untuk penjaga.

```
function harvestTrigger(uint256 callCost) public virtual view returns (bool)
```

**Parameter:**

| Nama     | Jenis   | Deskripsi                              |
| -------- | ------- | -------------------------------------- |
| callCost | uint256 | Jumlah biaya untuk memanggil harvest() |

**Nilai hasil:**

| Jenis | Deskripsi                                                   |
| ----- | ----------------------------------------------------------- |
| bool  | Benar jika harvest() harus dipanggil, salah jika sebaliknya |

#### **`harvest`**

Memanen Strategi, mengenali setiap keuntungan atau kerugian dan menyesuaikan posisi Strategi.

```
function harvest() external virtual onlyKeepers
```

**Acara yang dikeluarkan:**

* Harvested(profit, loss, debtPayment, debtOutstanding)

#### **`withdraw`**

Menarik \_amountNeeded ke cadangan

```
function withdraw(uint256 _amountNeeded) external virtual returns (uint256 _loss)
```

**Parameter:**

| Nama           | Jenis   | Deskripsi                  |
| -------------- | ------- | -------------------------- |
| \_amountNeeded | uint256 | Jumlah token untuk ditarik |

**Nilai hasil:**

| Nama   | Jenis   | Deskripsi                                           |
| ------ | ------- | --------------------------------------------------- |
| \_loss | uint256 | Setiap kerugian yang dibuat saat melikuidasi tokens |

#### **`prepareMigration`**

Melakukan apa pun yang diperlukan untuk mempersiapkan Strategi ini untuk migrasi, seperti mentransfer cadangan atau token LP, CDP, atau token atau penyimpan nilai lainnya.

```
function prepareMigration(address _newStrategy) internal virtual
```

**Parameter:**

| Nama          | Jenis   | Deskripsi                     |
| ------------- | ------- | ----------------------------- |
| \_newStrategy | address | Alamat cadangan strategi baru |

#### **`migrate`**

Mentransfer semua token yang diinginkan dari strategi ini ke strategi baru. Hanya bisa dipanggil oleh pemerintahan atau cadangan.

```
function migrate(address _newStrategy) external
```

**Parameter:**

| Nama          | Jenis   | Deskripsi                     |
| ------------- | ------- | ----------------------------- |
| \_newStrategy | address | Alamat cadangan strategi baru |

#### **`sweep`**

Menghapus token dari Strategi ini yang bukan merupakan jenis token yang dikelola oleh Strategi ini.

```
function sweep(address _token) external virtual onlyGovernance
```

**Parameter:**

| Nama    | Jenis   | Deskripsi                                                       |
| ------- | ------- | --------------------------------------------------------------- |
| \_token | address | Alamat token untuk ditransfer keluar dari cadangan strategi ini |

**Acara yang dikeluarkan:**

* `IERC20Upgradeable(_token).safeTransfer(governance()`, `IERC20Upgradeable(_token).balanceOf(address(this)))`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.octusbridge.io/ob-id/integrate/octus-bridge-contracts/ethereum/strategies-section/basestrategy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
