A tool for comparing FiRM markets before and after governance changes to verify safety.
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Create your
.envfile:cp .env.example .env
- Edit the
.envfile to add your API keys:ALCHEMY_API_KEY=your_alchemy_api_key COINGECKO_API_KEY=your_coingecko_api_key
Analyze a market directly from the command line:
python market-api.py --market 0x2D4788893DE7a4fB42106D9Db36b65463428FBD9 --vnet a2faaa07-ff72-4d7e-9f97-7ba16d356d88Options:
--market,-m: Ethereum address of the market to analyze--vnet,-v: Tenderly vnet ID of the fork to compare against
Run as a production API server:
python market-api.py --serveOr for development:
python market-api.py --serve --devOptions:
--serve: Run as an API server--dev: Use Flask's development server (not for production)--port,-p: Port to run the server on (default: 5000)
Example analysis of a market:
curl -X POST \
http://localhost:5000/api/analyze \
-H 'Content-Type: application/json' \
-d '{
"market_address": "0x2D4788893DE7a4fB42106D9Db36b65463428FBD9",
"vnet_id": "a2faaa07-ff72-4d7e-9f97-7ba16d356d88"
}'You can set the following environment variables in your .env file:
| Variable | Description |
|---|---|
ALCHEMY_API_KEY |
Your Alchemy API key (required) |
COINGECKO_API_KEY |
Your CoinGecko Pro API key (required for price comparison) |
The tool provides a structured JSON output with the following sections:
- Market Information: Basic details about the market and collateral token
- Oracle Information: Price and oracle implementation details
- Liquidation Parameters: Collateral factor, liquidation incentives, and self-liquidation risk
- Borrow Controller: Implementation version and parameter changes
- Active Positions: Analysis of active borrowers affected by the change
- Summary: Errors, warnings, and informational messages