# Market Data

Retrieves current price, cap, and bonding curve progress. Use before trading.

### Get Market Data
```typescript
import { initSDK, formatEther } from '@nadfun/sdk';

const nadSDK = initSDK({
    rpcUrl: "https://rpc.monad.xyz",
    privateKey: process.env.PRIVATE_KEY as `0x${string}`,
    network: 'mainnet',
});

export async function getMarketData(tokenAddress: string) {
    try {
        const state = await nadSDK.getCurveState(tokenAddress);
        return {
            price: formatEther(state.virtualMonReserves / state.virtualTokenReserves),
            marketCap: formatEther(state.marketCap),
            progress: state.progress, // % to graduation
            graduated: state.graduated
        };
    } catch (error) {
        console.error("Failed to fetch market data:", error);
        return null;
    }
}
```
