# Strategy API

## Quickstart example: Launch SMO (Smart Order) strategy

### Exchange account

Some strategies run on single account and some on multiple accounts. In this example we will launch SMO strategy on single Bybit account. You need to obtain you exchange account ID first by calling this endpoint:

```
GET /as/v3/accounts
```

You should receive list of your accounts:

```json
200 OK
[
    {
        "id": "99998",
        "createdAt": "2024-08-19T16:32:03.900Z",
        "userId": "42",
        "name": "Bybit",
        "exchangeCode": "BYB",
        "exchange": "BYB",
        "description": "Bybit",
        "apiKey": "nt2jRz4sDBXINYNsAb8H",
        "validatedAt": "2025-01-17T07:26:16.466Z",
        "spot": {
            "isActive": true
        },
        "futures": {
            "isActive": true,
            "settings": {}
        },
        "isMain": true,
        "eventTime": "2025-09-22T12:54:25.732Z",
        "accountType": "SUB_ACCOUNT",
        "whitelistedIps": [
            ""
        ],
        "permissions": [
            ...
        ]
    },
    {
        "id": "99999",
        "createdAt": "2024-10-30T10:09:16.536Z",
        "userId": "42",
        "name": "Binance",
        "exchangeCode": "BIN",
        "exchange": "BIN",
        "description": "Binance",
        "apiKey": "rFTZsjDdrt07NFsHQLCx",
        "validatedAt": "2025-01-17T07:26:21.984Z",
        "spot": {
            "isActive": true
        },
        "futures": {
            "isActive": true,
            "settings": {}
        },
        "isMain": true,
        "eventTime": "2025-09-22T12:54:25.732Z",
        "accountType": "SUB_ACCOUNT",
        "whitelistedIps": [
            ""
        ],
        "permissions": [
            ...
        ]
    }
]
```

As you see, Bybit account has ID of `99998`, so that's what you have to pass as `accountId` in create strategy request.

### Products metadata

Some strategies trade on a single product and some on multiple products. In this example we will launch SMO which is trading on a single product. We need a product code to pass to API when launching strategy. Volven uses its own internal product codes. You can retrieve them (along with more information about products) by calling following endpoint:

```
GET /mms/v2/productDetails
```

or, if you want to narrow results to a single exchange, pass `exchangeCode` query parameter with one of following exchange codes:

* `BIN` - Binance
* `BYB` - Bybit
* `OKX` - OKX
* `CRYPTO` - Crypto.com
* `IB` - Interactive Brokers
* `VB` - TÝR Markets

```
GET /mms/v2/productDetails?exchangeCode=BYB
```

You will receive a list of supported products. Example response (shortened) would look like this:

```json
[
    {
        "productCode": "btcusdt",
        "exchangeProductCode": "BTCUSDT",
        "exchangeCode": "BYB",
        "base": "BTC",
        "quote": "USDT",
        "minSize": "0.000001",
        "maxSize": "17000",
        "minPrice": "0.01",
        "minNotionalValue": "5",
        "sizeIncrement": "0.000001",
        "priceIncrement": "0.01",
        "productType": "SPOT",
        "name": "BTC/USDT",
        "tradingViewSymbol": "BYBIT:BTCUSDT",
        "walletTypes": [
            "BYBIT_SPOT",
            "BYBIT_UNIFIED_TRADING"
        ],
        "volvenName": "BTC/USDT",
        "contractValue": "",
        "contractValueCurrency": "",
        "removed": false
    },
    {
        "productCode": "btcusdt_f",
        "exchangeProductCode": "BTCUSDT",
        "exchangeCode": "BYB",
        "base": "BTC",
        "quote": "USDT",
        "minSize": "0.001",
        "maxSize": "1190.000",
        "minPrice": "0.10",
        "sizeIncrement": "0.001",
        "priceIncrement": "0.10",
        "productType": "FUTURES",
        "name": "BTCUSDT USDT Perpetual",
        "contractType": "PERPETUAL",
        "tradingViewSymbol": "BYBIT:BTCUSDT.P",
        "walletTypes": [
            "BYBIT_DERIVATIVES",
            "BYBIT_UNIFIED_TRADING"
        ],
        "contractCategory": "LINEAR",
        "volvenName": "BTCUSDT Perpetual",
        "contractValue": "",
        "contractValueCurrency": "",
        "removed": false
    }
]
```

{% hint style="warning" %}
Keep in mind that Volven doesn't support all products, if you are interested in a particular product that's not on this list feel free to contact support.&#x20;
{% endhint %}

You need to pass `productCode` as in input to the strategy. Also pay attention to `minSize` (minimum order size in base currency), `minNotionalValue` (minimum order size in quote currency), `sizeIncrement` and `priceIncrement` when providing size/price inputs to the strategy.

### Create strategy

In order to launch SMO strategy send following request:

```json
POST /strategy-orchestrator/strategies/action/create
{
  "strategyType": "SMO",
  "productCode": "btcusdt_f",
  "accountId": "99998",
  "side": "BUY",
  "size": 0.1,
  "priceLimit": 95000,
  "orderMaxSize": 0.03,
  "aggressiveness": 0.5,
  "triggerPrice": 94000,
  "useSpikeProtection": false,
  "alwaysPassive": true,
  "autoRun": true,
}
```

If everything is correct you should receive:

```json
201 Created
{
  "strategyId": "string"
}
```

In case of request validation error you will get explanation of what is wrong:

```json
400 Bad Request
{
  "timestamp": "2025-09-15T14:56:35.228+00:00",
  "status": "400",
  "error": "Bad Request",
  "message": "Validation failed",
  "path": "/strategy-orchestrator/strategies/SMO/action/create",
  "errors": [
    {
      "field": "aggressiveness",
      "description": "must be between 0 and 1"
    },
    {
      "field": "orderMaxSize",
      "description": "must be greater than 0"
    },
    {
      "field": "priceLimit",
      "description": "must be greater than 0"
    },
    {
      "field": "side",
      "description": "must match \"BUY|SELL\""
    }
  ]
}
```

## Full API specification

For more information look into OpenAPI specification described in this document subpages
