> For the complete documentation index, see [llms.txt](https://docs.satay.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.satay.finance/technical-overview/specialized-strategy-modules-legacy.md).

# Specialized Strategy Modules (Legacy)

## Overview

A strategy must define a set of functions and structs to operate on a vault. It interacts with `satay::base_strategy` and [Structured Prodocts](/technical-overview/structured-product-module-legacy.md).

## Identifier

`StrategyType` is used to identify a strategy and verify its authenticity in function calls via the witnessing pattern.

```rust
struct StrategyType has drop {}
```

## Initialize

Initialize the `Vault` referenced by `vault_id` with `debt_ratio` by calling `base_strategy::initialize` function with the `StrategyType` identifier.

```rust
public fun initialize(
    manager: &signer, 
    vault_id: u64, 
    debt_ratio: u64
)
```

## Harvest

Calls `structured_product::reinvest_returns` and deposits `StrategyCoin` to vault. Rebalances the debt position given the strategy's balance and `debt_ratio`. Only called if `harvest_trigger` returns `true`.

```rust
public entry fun harvest(    
    manager: &signer,    
    vault_id: u64
)
```

### Harvest Trigger

Returns a boolean regarding whether or not the vault manager should call `harvest` for `StrategyType`.

```rust
public entry fun harvest_trigger(    
    manager: &signer,    
    vault_id: u64
): bool
```

## Tend

Calls `structured_product::reinvest_returns` and deposits farmed `StrategyCoin` to the `Vault`

```
public entry fun harvest(    
    manager: &signer,    
    vault_id: u64
)
```

## Withdraw for User

Called by `user` when there is not enough `BaseCoin` in the vault, and the user wants to liquidate the respective amount of `StrategyCoin` for a given `share_amount` of `VaultCoin<BaseCoin>`.

```rust
public entry fun withdraw_for_user(    
    user: &signer,    
    manager_addr: address,    
    vault_id: u64,    
    share_amount: u64
)
```

## Admin Functions

Implement all of the [Admin Functions](/technical-overview/base-strategy-module-legacy.md#admin-functions) of the Base Strategy Module using the specialized strategy [Identifier](#identifier).
