to analyze and test different models, algorithms and mock systems.
Generated based on number of days the protocol was open to risks due to the assets value and trading fees based on transactions in ETH/CRUIZE open pool in a dex. File: /v1_profit_loss/views
curl --location --request GET 'http://127.0.0.1:8000/revenue/v1?cruize_price=1&staked_asset_price=3000&dip_days=14&staked_eth_size=0.5&cover_pool=100000¤t_price_of_asset=2400&tuner=0.2&transactions_per_day=500'
To maintain an 80/20 Cruize/USDC ratio by interacting with the open market to determine whether to selling or buy back cruize tokens.
File: /smart_treasury/views/
curl --location --request GET 'http://127.0.0.1:8000/smart_treasury?usdc_pool=6000&cruize_pool=8000&lp_usdc=400&cruize_price=4'
To generate an assets historical data with high and low price of asset for any given period.
File: /tokens/views/historical_data
Example:
Generating historical data on a day by day basis for the last 30 days
will produce high and low value of the asset for each day.
Similarly, data for a month by month basis for the last 6 months will produce high and low for each month in the last 6 months.
curl --location --request GET 'http://127.0.0.1:8000/token_data/v1/historical_data/?token=BTC&conversion_token=USD&source=day&past_days=30'
Calculate Liquidation threshold for an asset based on high and low price of asset for each month for a set of months in the past.
File: /tokens/views/liquidation_threshold
curl --location --request GET 'http://127.0.0.1:8000/token_data/v1/liquidation_threshold/?token=BTC&conversion_token=USD&source=day&past_days=30'
This API endpoint returns a total funding fee paid over a given period
based on floating (changing) strike price for the hedged asset.
curl --location --request GET 'http://127.0.0.1:8000/options/funding_fee?token=ETH¤t_asset_price=2584&asset_vol=1&price_floor=0.85&period=7'
Other supported params:
- token='ETH',
- current_asset_price='2584',
- asset_vol=1,
- price_floor=0.85, # 85%
- underlying_asset_price=3000, # At the time of withdrawal or when an option is exercised
- option_market_price,
- strike_price,
- Clone the repo to your local computer.
- Open the project on Pycharm
- Create a conda environment:
conda create -n cr_scripts_venv python=3.7
Activate the conda environment:conda activate cr_scripts_venv - Set it as the default Python Interpreter for the project.
- Run
pip install -r requirements.txt - Run
python manage.py runserver