Portfolio optimizer

Introduction

The portfolio optimizer converts models forecasts into dollarized target positions, taking into considerations various constraints, including risk, GMV, max esposure by coin, etc.

It is solving a convex optimization problem at each rebalancing period.

Therefore, it is the first step into bulding the trading strategies framework on top of the quantitative framework.

Description

Consider an investor who wishes to allocate capital among NN securities at time t=0t=0 and hold them over a single period of time until t=ht=h. We denote p0,ip0,i the (known) price of security ii at the beginning of the investment period and Ph,iPh,i the (random) price of security ii at the end of the investment period t=ht=h. The rate of return of security ii over period hh is then modeled by the random variable Ri=Ph,i/p0,i1Ri=Ph,i/p0,i−1, and its expected value is denoted by μi=E(Ri)μi=E(Ri). The risk-averse investor seeks to maximize the return of the investment.

The part of investment risk called specific risk (the risk associated with each individual security) can be reduced (for a fixed expected rate of return) through diversification, which means the selection of multiple unrelated securities into a portfolio. Modern Portfolio Theory formalized this process by using variance as a measure of portfolio risk, and constructing a optimization problem.

To be able to solve the portfolio optimization problem, we have to assume that the investor knows the value of the expected return vector μμ and covariance matrix ΣΣ. In practice it is only possible to have estimates, which we denote by μμ and ΣΣ respectively.

Rebalancing a portfolio generates turnover, i. e., buying and selling of tokens to change the portfolio composition. The Markowitz model assumes that there are no costs associated with trading, but in reality, turnover incurs expenses. We take this into account in the form of transaction cost constraints.

Note that to be able to compare transaction costs with returns and risk, we need to aggregate them over the length of the investment time period.

Source: Mosek.

Methodology

Risk term: ΣΣ

Returns term: forecast_returns

TransactionCosts: 0.0015 * (x - current_notional) + k * (x - current_notional)^2

Where k = 0.001 * C * sigma / (MDV x p_t)

sigma: annualized volatilty in %

p_t: token price at time t

C: cost coefficent

MDV: median 90 days volume.

Objective function: U = returns - lanbda * risk - TransactionCosts

Constraints:

GMV < GMV_max

NMV < NMV_max

single_coin_exposure < single_coin_exposure_max

mdv < mdv_max

Problem to solve:

maximize U

subject to: constraints

Last updated