Installation
Clone the Repository
git clone https://github.com/metaDAOproject/futarchy-coingecko-api.git
cd futarchy-coingecko-api
Install Dependencies
This project uses Bun for superior performance: Configure Environment
Create a .env file based on the example:Edit .env with your configuration:SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_WS_URL=wss://api.mainnet-beta.solana.com
PORT=3000
DEX_FORK_TYPE=Custom
FACTORY_ADDRESS=YOUR_FACTORY_PROGRAM_ID
ROUTER_ADDRESS=YOUR_ROUTER_PROGRAM_ID
PROTOCOL_FEE_RATE=0.0025
Build and Start
For development with hot reload:
Make Your First Request
You can use the live API directly or run your own instance locally.
Using the Live API
The public API is available at https://market-api.metadao.fi:
curl https://market-api.metadao.fi/
This returns API information including version, available endpoints, and DEX configuration.
Get Ticker Data
Retrieve all DAO tickers with pricing and volume information:
curl https://market-api.metadao.fi/api/tickers
Local Development
If running locally, replace https://market-api.metadao.fi with http://localhost:3000 in the examples above.
Example Response
[
{
"ticker_id": "ZKFHiLAfAFMTcDAuCtjNW54VzpERvoe7PBF9mYgmeta_EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"base_currency": "ZKFHiLAfAFMTcDAuCtjNW54VzpERvoe7PBF9mYgmeta",
"target_currency": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"base_symbol": "ZKFG",
"base_name": "ZKFG",
"target_symbol": "USDC",
"target_name": "USD Coin",
"pool_id": "5FPGRzY9ArJFwY2Hp2y2eqMzVewyWCBox7esmpuZfCvE",
"last_price": "0.081340728222",
"base_volume": "30024.81040000",
"target_volume": "2441.23456789",
"liquidity_in_usd": "180138.45",
"bid": "0.080934024581",
"ask": "0.081747431863"
}
]
Health Check
Verify the API is running properly:
curl https://market-api.metadao.fi/health
Response:
{
"status": "healthy",
"timestamp": "2024-01-01T00:00:00.000Z",
"uptime": 3600.5
}
Success! Your API is now running and ready to serve data.
Next Steps
Configuration Guide
Learn about all configuration options
API Reference
Explore the tickers endpoint
Understand Pricing
Learn how prices are calculated
Error Handling
Learn how to handle errors