API with endpoints to be used by the front end.
For local development, create .env file in the root with the following variables:
NETWORK=testnet
ENVIRONMENT=local
STARKSCAN_API_KEY=your_api_key_goes_here
And then run dev mode with Cargo:
cargo run -p carmine-api
To test Docker build, which runs in the production, set STARKSCAN_API_KEY in the docker-compose.yaml file and then run:
docker compose up
Path uses two variables: network and pool.
Allowed values for network:
mainnettestnet
Allowed values for pool:
eth-usdc-calleth-usdc-put
Options that can be currently traded with premia for size 1.
All events that are currently stored in the database.
All events triggered by the user_address.
If the user_address is eligible for an airdrop, this endpoint returns address, amount of tokens and hashes to produce Merkel tree root.
All options with volatility historic data.
Historic data of pool state for the given pool - mainnet only.
Last pool state for the given pool - mainnet only.
APY of the given pool - mainnet only.
The workspace consists of four crates:
Server using Actix with handlers.
Struct holding all the data and methods to update them.
Types used by all crates.
Functions for retrieving data from the Starknet blockchain. There is a Carmine struct for directly retrieving data from the carmine-protocol and functionality for retrieving data from Starkscan.