# add_strategy · FT4 Rell API · Chromia Docs (concept)

> function add_ strategy(op: meta, account_ details: (gtv) -> account_details , action: ( account , gtv) -> unit?, required_ signers: (gtv) -> list<byte_ arr

Source: https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts.strategies/add_strategy/

FUNCTION

# add\_strategy

```signature
function add_strategy(op: meta, account_details: (gtv) -> account_details, action: (account, gtv) -> unit?, required_signers: (gtv) -> list<byte_array>?): map<text, _strategy>
```

[Source](https://gitlab.com/chromaway/ft4-lib/-/blob/development/rell/src/lib/ft4/core/accounts/strategies/module.rell#lines-192)

Used to add new strategies to the dapp. This does not need to be called for FT4-defined
strategies.

This function helps avoid a common issue where a strategy is registered with the wrong name.
If that happens, many functions of this module will throw errors pointing to that strategy
as missing, since they won't be able to find it.

Example usage:

Plain text

```
operation my_strategy(
    main: accounts.auth_descriptor,
    disposable: accounts.auth_descriptor? = null
) {
    strategies.require_register_account_next_operation();
}
function account_details(gtv) {
    val params = struct<ras_open>.from_gtv(gtv);
    val signers = accounts.get_signers(params.main);
    return strategies.account_details(
        account_id = accounts.get_account_id_from_signers(signers),
        main = params.main,
        disposable = params.disposable
    );
}
function my_custom_logic(accounts.account, gtv) {
    // custom logic that the strategy has to follow
}
@extend(strategies.strategy)
function () = strategies.add_strategy(
    op = rell.meta(my_strategy),
    account_details = account_details(*),
    action = my_custom_logic(*)
);
```

**Parameters**

* **op** — the custom operation that defines the strategy and its name
* **account\_details** — the function that retrieves the account details from `op`
* **action** — the function that implements the strategy logic. If null, `_no_action` is called.
* **required\_signers** — the function that determines the list of signers required. If it is null or the list is empty no signature is required

**See Also**

* [\_strategy](https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts.strategies/_strategy/) — for more information about the parameters of this function
* [\_no\_action](https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts.strategies/_no_action/) — for more information on performing no action

[View this page on docs.chromia.com](https://docs.chromia.com/pages/ft4-rell/-f-t4%20-library/lib.ft4.core.accounts.strategies/add_strategy.html)Generated API reference, mirrored from the live docs
