credmark / product-backlog

Repo for product ideas
0 stars 0 forks source link

Portfolio VaR for Coinshift MVP #1

Open MattCMK opened 2 years ago

MattCMK commented 2 years ago

Coinshift asked us to provide some Risk Metrics they could add into their V2 Release and the obvious ones are Portfolio VaR and Sharpe Ratio.

They provided us with two examples, so renBTC and UMA DAO to calculate these metrics for their portfolio and show it to them for further discussion

leafyoung commented 2 years ago

1) initial version for renBTC and Curve LP position can be accessed here

https://gateway.credmark.com/api/?urls.primaryName=Run%20Model%20Requests#/Models/runModel-account.var

Input

{
  "slug": "account.var",
  "chainId": 1,
  "blockNumber": "15042787",
  "input": {
    "window": "100 days",
    "interval": 1,
    "confidence": 0.01,
    "address": "0x5291fBB0ee9F51225f0928Ff6a83108c86327636"
  }
}

Output

"output": {
    "cvar": [
      0.3154621908973168,
      0.000877125035358908,
      0.30641069255431524,
      0.3772499915130089
    ],
    "var": -33436.51297660628,
    "total_value": 255214.47074621348,
    "value_list": [
      [
        "0xeb4c2781e4eba804ce9a9803c67d0893436bb27d",
        3.18317764,
        20334.053121771798,
        64726.90322779618
      ],
      [
        "0xdac17f958d2ee523a2206206994597c13d831ec7",
        63257.47018771561,
        0.9991,
        63200.53846454667
      ],
      [
        "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
        3.117610649592754,
        20341.34,
        63416.378210987066
      ],
      [
        "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        55.494817967107956,
        1150.93,
        63870.650842883566
      ]
    ]
  },
  1. Work on financial position representation https://github.com/credmark/credmark-model-framework-py/issues/126
leafyoung commented 2 years ago

As a following-up for meeting on July 7th, the data requirement for phase 2 collaboration of Coinshift and Credmark.

https://docs.google.com/document/d/1ALPu9del8zpjA4xAoMc2nax4SSR47Amd5FzAlcMQ534/edit?usp=sharing