Quickstart
Get started with the Futarchy DEX API in under 5 minutes
Installation
- Clone the Repositorybash
git clone https://github.com/metaDAOproject/futarchy-coingecko-api.git cd futarchy-coingecko-api - Install Dependencies
This project uses Bun for superior performance:
bashbun install - Configure Environment
Create a
.envfile based on the example:bashcp example.env .envEdit
.envwith your configuration:envSOLANA_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 Startbash
bun run build bun startFor development with hot reload:
bashbun run dev
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:
bash
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
curl https://market-api.metadao.fi/api/tickersJavaScript
const response = await fetch('https://market-api.metadao.fi/api/tickers');
const data = await response.json();
console.log(data);Python
import requests
response = requests.get('https://market-api.metadao.fi/api/tickers')
data = response.json()
print(data)Local Development
If running locally, replace https://market-api.metadao.fi with http://localhost:3000 in the examples above.
Example Response
json
[
{
"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:
bash
curl https://market-api.metadao.fi/healthResponse:
json
{
"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
Was this page helpful?