# Cancel DCA Order Source: https://docs.avnu.fi/api/dca/cancel-order POST https://starknet.api.avnu.fi/dca/v3/orders/{address}/cancel Generate calldata to cancel an active DCA order and return remaining funds ## Overview Cancels an active DCA order and returns any remaining funds to the trader. This endpoint generates the calldata needed to execute the cancellation on-chain. ## Request DCA order contract address to cancel ## Response Network identifier (e.g., "0x534e5f4d41494e") Array of transaction calls to cancel the order Contract to call (the DCA order address) Function to call (cancel\_order) Function arguments ```bash cURL theme={null} curl -X POST "https://starknet.api.avnu.fi/dca/v3/orders/0x0a1b2c3d.../cancel" ``` ```typescript TypeScript theme={null} // Cancel a DCA order const orderAddress = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789"; const response = await fetch( `https://starknet.api.avnu.fi/dca/v3/orders/${orderAddress}/cancel`, { method: 'POST', } ); const { calls } = await response.json(); // Execute the cancellation const tx = await account.execute(calls); console.log(`Order cancelled: ${tx.transaction_hash}`); // Remaining funds are automatically returned to your wallet ``` ```python Python theme={null} import requests order_address = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789" response = requests.post( f'https://starknet.api.avnu.fi/dca/v3/orders/{order_address}/cancel' ) calls = response.json()['calls'] # Execute cancellation through your account # Remaining funds will be returned ``` ```json theme={null} { "chainId": "0x534e5f4d41494e", "calls": [ { "contractAddress": "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789", "entrypoint": "cancel_order", "calldata": [] } ] } ``` # Create DCA Order Source: https://docs.avnu.fi/api/dca/create-order POST https://starknet.api.avnu.fi/dca/v3/orders Generate calldata to create a dollar-cost averaging order on-chain ## Overview Creates a DCA (Dollar-Cost Averaging) order that automatically executes recurring swaps at specified intervals. Each order is deployed as a dedicated smart contract that manages your funds and executes trades autonomously. ## Request Address that will own the DCA order Token to sell over time Total amount to sell across all cycles Amount to sell in each cycle Token to purchase ISO 8601 duration format (e.g., "P1D" for daily, "PT12H" for 12 hours) * `PT1H` - Every hour * `PT6H` - Every 6 hours * `P1D` - Daily * `P1W` - Weekly * `P1M` - Monthly ISO 8601 start date (defaults to now) Price constraints for order execution Minimum acceptable buy amount per cycle (hex format) Maximum acceptable buy amount per cycle (hex format) ## Response Network identifier (e.g., "0x534e5f4d41494e") Array of transaction calls to create the order Contract to call Function to call Function arguments ```bash cURL theme={null} curl -X POST "https://starknet.api.avnu.fi/dca/v3/orders" \\ -H "Content-Type: application/json" \\ -d '{ "traderAddress": "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "sellTokenAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "sellAmount": "1000000000000000000", "sellAmountPerCycle": "100000000000000000", "buyTokenAddress": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "frequency": "P1D", "pricingStrategy": { "tokenToMinAmount": null, "tokenToMaxAmount": null } }' ``` ```typescript TypeScript theme={null} // Create a DCA order to buy $100 USDC daily with ETH const response = await fetch('https://starknet.api.avnu.fi/dca/v3/orders', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ traderAddress: account.address, sellTokenAddress: ETH_ADDRESS, sellAmount: ethers.parseEther("1"), // 1 ETH total sellAmountPerCycle: ethers.parseEther("0.1"), // 0.1 ETH per day buyTokenAddress: USDC_ADDRESS, frequency: "P1D", // Daily pricingStrategy: { tokenToMinAmount: null, // No minimum (market order) tokenToMaxAmount: null // No maximum } }) }); const { calls } = await response.json(); // Execute the calls to create the order await account.execute(calls); ``` ```python Python theme={null} import requests from datetime import datetime # Create a weekly DCA order order_data = { 'traderAddress': account_address, 'sellTokenAddress': ETH_ADDRESS, 'sellAmount': str(10**18), # 1 ETH total 'sellAmountPerCycle': str(10**17 * 25 // 100), # 0.25 ETH per week 'buyTokenAddress': STRK_ADDRESS, 'frequency': 'P1W', # Weekly 'startDate': datetime.now().isoformat(), 'pricingStrategy': { 'tokenToMinAmount': null, # No minimum (market order) 'tokenToMaxAmount': null # No maximum } } response = requests.post( 'https://starknet.api.avnu.fi/dca/v3/orders', json=order_data, ) calls = response.json()['calls'] # Execute calls through your account ``` ```json theme={null} { "chainId": "0x534e5f4d41494e", "calls": [ { "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entrypoint": "approve", "calldata": [ "0x073f6e3f2e5f8f8e7d3d2b1a0c9b8a7f6e5d4c3b2a1", "0xde0b6b3a7640000", "0x0" ] }, { "contractAddress": "0x073f6e3f2e5f8f8e7d3d2b1a0c9b8a7f6e5d4c3b2a1", "entrypoint": "deploy_dca_order", "calldata": [ "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0xde0b6b3a7640000", "0x16345785d8a0000", "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x15180", "0x0", "0x1" ] } ] } ``` ## Order Calculation **Number of cycles** = Total Amount ÷ Amount Per Cycle **Duration** = Number of Cycles × Frequency Example: 1 ETH total, 0.1 ETH per cycle, daily frequency = 10 days duration # Get DCA Orders Source: https://docs.avnu.fi/api/dca/get-orders GET https://starknet.api.avnu.fi/dca/v3/orders Retrieve all DCA orders for a specific trader address ## Overview Fetches all DCA orders created by a trader, with filtering options for order status and pagination support. Each order includes execution history, remaining cycles, and current status. ## Request Trader's wallet address (hex format) Filter by order status (`INDEXING`, `ACTIVE`, or `CLOSED`) Page number for pagination Number of orders per page (max: 50) Sort order. Format: `field,direction` * Fields: `createdAt`, `status`, `remainingCycles` * Direction: `asc` or `desc` ## Response Array of DCA order objects The order identifier (UUID format) The block number when the order was created The timestamp when the order was created (ISO 8601 format) The trader address (hex format) The order address (hex format) The transaction hash of the order creation The order class hash The sell token address (hex format) The total amount you want to invest (hex format) The amount that will be sold at each iteration (hex format) The buy token address (hex format) The start date of the order (ISO 8601 format) The end date of the order (ISO 8601 format) The close date of the order (ISO 8601 format) The duration between each iteration. Follows ISO 8601 standard The number of iterations The order status (`INDEXING`, `ACTIVE`, or `CLOSED`) The pricing strategy The buy token's min price you're agree to execute a trade The buy token's max price you're agree to execute a trade The amount already sold The amount already bought The average amount bought The number of executed trades The number of cancelled trades The number of pending trades The trades The amount sold The amount sold in USD The amount bought The amount bought in USD The expected trade date (ISO 8601 format) The trade status (`PENDING`, `SUCCEEDED`, or `CANCELLED`) The actual trade date (ISO 8601 format) The transaction hash of the trade The error reason. Defined only if the trade failed Page size Current page number (zero-based) Total number of orders Total pages available ```bash cURL theme={null} curl -X GET "https://starknet.api.avnu.fi/dca/v3/orders?traderAddress=0x0123...&status=ACTIVE" ``` ```typescript TypeScript theme={null} // Fetch active DCA orders const params = new URLSearchParams({ traderAddress: account.address, status: 'ACTIVE', page: '0', size: '10' }); const response = await fetch(`https://starknet.api.avnu.fi/dca/v3/orders?${params}` ); const data = await response.json(); console.log(`Found ${data.totalElements} active orders`); console.log(`Page ${data.number + 1} of ${data.totalPages}`); data.content.forEach(order => { console.log(`Order ${order.orderAddress}: ${order.sellTokenAddress} -> ${order.buyTokenAddress}`); }); ``` ```python Python theme={null} import requests params = { 'traderAddress': account_address, 'status': 'ACTIVE', 'page': 0, 'size': 10 } response = requests.get( 'https://starknet.api.avnu.fi/dca/v3/orders', params=params ) data = response.json() orders = data['content'] print(f"Found {data['totalElements']} active orders") print(f"Page {data['number'] + 1} of {data['totalPages']}") for order in orders: print(f"Order {order['orderAddress'][:10]}...") print(f" Status: {order['status']}") print(f" Sell: {order['sellTokenAddress']}") print(f" Buy: {order['buyTokenAddress']}") ``` ```json theme={null} { "content": [ { "id": "ae1a649c-a9fb-4130-835b-cb14e144e8c1", "blockNumber": 860820, "timestamp": "2024-10-31T16:01:15Z", "traderAddress": "0x25b..", "orderAddress": "0x50ab..", "creationTransactionHash": "0x6b65..", "orderClassHash": "0x2d5af3e59f6b180bb2190957b527dd4db61a2c1095d4fd1e75e3a89732c796b", "sellTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "sellAmount": "0xde0b6b3a7640000", "sellAmountPerCycle": "0x94079cd1a42aaa", "buyTokenAddress": "0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac", "startDate": "2024-10-31T16:01:15Z", "endDate": "2024-11-01T16:01:15Z", "closeDate": "2024-11-01T15:02:27.923Z", "frequency": "PT1H", "iterations": 24, "status": "CLOSED", "pricingStrategy": {}, "amountSold": "0xde0b6b3a763fff0", "amountBought": "0x214", "averageAmountBought": "0x16", "executedTradesCount": 24, "cancelledTradesCount": 0, "pendingTradesCount": 0, "trades": [ { "sellAmount": "0x94079cd1a42aaa", "sellAmountInUsd": 0.015667, "buyAmount": "0x17", "buyAmountInUsd": 0.016246, "expectedTradeDate": "2024-10-31T16:01:15Z", "status": "SUCCEEDED", "actualTradeDate": "2024-10-31T16:01:56.860Z", "txHash": "0x25a006ecd.." }, { "sellAmount": "0x94079cd1a42aaa", "sellAmountInUsd": 0.015561, "buyAmount": "0x16", "buyAmountInUsd": 0.015482, "expectedTradeDate": "2024-10-31T17:01:15Z", "status": "SUCCEEDED", "actualTradeDate": "2024-10-31T17:01:57.834Z", "txHash": "0x7972e18b2c.." } ] } ], "size": 25, "number": 0, "totalElements": 1, "totalPages": 1 } ``` ## Order Status * **INDEXING**: Order is being indexed after creation (temporary state) * **ACTIVE**: Order is currently active and executing * **CLOSED**: Order has been completed or cancelled # Get Market Data Source: https://docs.avnu.fi/api/markets/get-market-data GET https://starknet.impulse.avnu.fi/v3/tokens Retrieve market data for all popular tokens on Starknet ## Overview Returns market data for the most popular tokens on Starknet, including price, market cap, TVL, volume, and price changes. Essential for building market overview dashboards and token discovery features. ## Response Returns an array of `TokenMarketData` objects. Token contract address (hex format) Token name Token symbol Token decimals Token logo URL (nullable) Whether the token is verified CoinGecko identifier (nullable) Token tags: `Unknown`, `Verified`, `Community`, `Unruggable`, `AVNU` Recent price history for sparkline charts ISO 8601 timestamp Price in USD Starknet-specific market data Current price in USD Total Value Locked on Starknet in USD Price change in last 1 hour (USD) Price change percentage in last 1 hour (nullable) Price change in last 24 hours (USD) Price change percentage in last 24 hours (nullable) Price change in last 7 days (USD) Price change percentage in last 7 days (nullable) 24h volume on Starknet in USD 24h trading volume on Starknet in USD Global market data from external sources (nullable) Global price in USD Market capitalization in USD Fully diluted valuation in USD Market cap change in 24h (USD) Market cap change percentage in 24h ```bash cURL theme={null} curl "https://starknet.impulse.avnu.fi/v3/tokens" ``` ```typescript TypeScript theme={null} const response = await fetch('https://starknet.impulse.avnu.fi/v3/tokens'); const tokens = await response.json(); console.log(`Found ${tokens.length} tokens`); // Display top 5 by market cap tokens .filter(t => t.global?.usdMarketCap) .sort((a, b) => (b.global?.usdMarketCap || 0) - (a.global?.usdMarketCap || 0)) .slice(0, 5) .forEach((token, i) => { const change = token.starknet.usdPriceChangePercentage24h?.toFixed(2) ?? 'N/A'; console.log(`${i + 1}. ${token.symbol}: $${token.starknet.usd} (${change}%)`); }); ``` ```python Python theme={null} import requests response = requests.get('https://starknet.impulse.avnu.fi/v3/tokens') tokens = response.json() print(f"Found {len(tokens)} tokens") # Display top gainers (24h) gainers = sorted( tokens, key=lambda t: t['starknet'].get('usdPriceChangePercentage24h') or 0, reverse=True ) for token in gainers[:5]: change = token['starknet'].get('usdPriceChangePercentage24h', 0) print(f"{token['symbol']}: ${token['starknet']['usd']:.2f} (+{change:.2f}%)") ``` ```json theme={null} [ { "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "name": "Ether", "symbol": "ETH", "decimals": 18, "logoUri": "https://assets.avnu.fi/tokens/eth.svg", "verified": true, "coingeckoId": "ethereum", "tags": ["Verified"], "linePriceFeedInUsd": [ { "date": "2024-02-13T00:00:00Z", "value": 2420.50 }, { "date": "2024-02-14T00:00:00Z", "value": 2435.75 } ], "starknet": { "usd": 2435.75, "usdTvl": 45000000, "usdPriceChange1h": 5.25, "usdPriceChangePercentage1h": 0.22, "usdPriceChange24h": 45.50, "usdPriceChangePercentage24h": 1.90, "usdPriceChange7d": 120.30, "usdPriceChangePercentage7d": 5.20, "usdVolume24h": 12500000, "usdTradingVolume24h": 8500000 }, "global": { "usd": 2435.75, "usdMarketCap": 292500000000, "usdFdv": 292500000000, "usdMarketCapChange24h": 5400000000, "usdMarketCapChangePercentage24h": 1.88 } } ] ``` # Get Token Market Data Source: https://docs.avnu.fi/api/markets/get-token-market-data GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress} Retrieve detailed market data for a specific token ## Overview Returns comprehensive market data for a specific token including price, market cap, TVL, volume, price changes, and recent price history. ## Path Parameters Token contract address (hex format) ## Response Token contract address (hex format) Token name Token symbol Token decimals Token logo URL (nullable) Whether the token is verified CoinGecko identifier (nullable) Token tags: `Unknown`, `Verified`, `Community`, `Unruggable`, `AVNU` Recent price history for sparkline charts ISO 8601 timestamp Price in USD Starknet-specific market data Current price in USD Total Value Locked on Starknet in USD Price change in last 1 hour (USD) Price change percentage in last 1 hour (nullable) Price change in last 24 hours (USD) Price change percentage in last 24 hours (nullable) Price change in last 7 days (USD) Price change percentage in last 7 days (nullable) 24h volume on Starknet in USD 24h trading volume on Starknet in USD Global market data from external sources (nullable) Global price in USD Market capitalization in USD Fully diluted valuation in USD Market cap change in 24h (USD) Market cap change percentage in 24h ```bash cURL theme={null} curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" ``` ```typescript TypeScript theme={null} const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}` ); const token = await response.json(); console.log(`${token.symbol} Market Data:`); console.log(` Price: $${token.starknet.usd}`); console.log(` 24h Change: ${token.starknet.usdPriceChangePercentage24h?.toFixed(2)}%`); console.log(` Market Cap: $${(token.global?.usdMarketCap || 0).toLocaleString()}`); console.log(` Starknet TVL: $${token.starknet.usdTvl.toLocaleString()}`); ``` ```python Python theme={null} import requests token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}' ) token = response.json() print(f"{token['symbol']} Market Data:") print(f" Price: ${token['starknet']['usd']}") print(f" 24h Change: {token['starknet'].get('usdPriceChangePercentage24h', 0):.2f}%") print(f" Market Cap: ${token['global']['usdMarketCap']:,.0f}" if token.get('global') else " Market Cap: N/A") print(f" Starknet TVL: ${token['starknet']['usdTvl']:,.0f}") ``` ```json theme={null} { "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "name": "Ether", "symbol": "ETH", "decimals": 18, "logoUri": "https://assets.avnu.fi/tokens/eth.svg", "verified": true, "coingeckoId": "ethereum", "tags": ["Verified"], "linePriceFeedInUsd": [ { "date": "2024-02-13T00:00:00Z", "value": 2420.50 }, { "date": "2024-02-14T00:00:00Z", "value": 2435.75 } ], "starknet": { "usd": 2435.75, "usdTvl": 45000000, "usdPriceChange1h": 5.25, "usdPriceChangePercentage1h": 0.22, "usdPriceChange24h": 45.50, "usdPriceChangePercentage24h": 1.90, "usdPriceChange7d": 120.30, "usdPriceChangePercentage7d": 5.20, "usdVolume24h": 12500000, "usdTradingVolume24h": 8500000 }, "global": { "usd": 2435.75, "usdMarketCap": 292500000000, "usdFdv": 292500000000, "usdMarketCapChange24h": 5400000000, "usdMarketCapChangePercentage24h": 1.88 } } ``` # Get OHLCV Data Source: https://docs.avnu.fi/api/markets/ohlcv GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress}/prices/candle Retrieve candlestick (OHLCV) data for technical analysis and charting ## Overview Returns Open, High, Low, Close, and Volume (OHLCV) candlestick data for any token. Essential for building trading charts and performing technical analysis. ## Path Parameters Token contract address (hex format) ## Query Parameters Start date (ISO 8601 format) End date (ISO 8601 format) Candle timeframe: `1`, `5`, `15`, `1H`, `4H`, `1D`, `1W` Quote currency token address (defaults to USD) ## Response Returns an array of candlestick objects (`CandleDataPoint`). ISO 8601 timestamp for candle open Opening price Highest price during period Lowest price during period Closing price Total volume traded ```bash cURL theme={null} curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/prices/candle?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=4H" ``` ```typescript TypeScript theme={null} const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const endDate = new Date(); const startDate = new Date(endDate.getTime() - 24 * 60 * 60 * 1000); const params = new URLSearchParams({ startDate: startDate.toISOString(), endDate: endDate.toISOString(), resolution: '1H' }); const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/prices/candle?${params}` ); const candles = await response.json(); console.log(`Fetched ${candles.length} candles`); ``` ```python Python theme={null} import requests from datetime import datetime, timedelta token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' end_date = datetime.now() start_date = end_date - timedelta(days=7) params = { 'startDate': start_date.isoformat() + 'Z', 'endDate': end_date.isoformat() + 'Z', 'resolution': '4H' } response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/prices/candle', params=params ) candles = response.json() print(f"Fetched {len(candles)} candles") ``` ```json theme={null} [ { "date": "2024-02-05T00:00:00Z", "open": 2410.30, "high": 2425.80, "low": 2405.15, "close": 2418.60, "volume": 1250000 }, { "date": "2024-02-05T04:00:00Z", "open": 2418.60, "high": 2435.00, "low": 2415.25, "close": 2430.75, "volume": 1480000 }, { "date": "2024-02-05T08:00:00Z", "open": 2430.75, "high": 2445.90, "low": 2428.00, "close": 2435.50, "volume": 1620000 } ] ``` ## Resolution Values | Value | Description | | ----- | ----------- | | `1` | 1 minute | | `5` | 5 minutes | | `15` | 15 minutes | | `1H` | 1 hour | | `4H` | 4 hours | | `1D` | 1 day | | `1W` | 1 week | # Get Price Feed Source: https://docs.avnu.fi/api/markets/price-feed GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress}/prices/line Retrieve historical price data for charting and analysis ## Overview Fetch historical price data for any token with customizable time ranges and resolutions. Perfect for building price charts, analyzing trends, and backtesting strategies. ## Request Token contract address ISO 8601 start date (e.g., "2024-01-01T00:00:00Z") ISO 8601 end date (e.g., "2024-02-01T00:00:00Z") Data point frequency: * `1` - 1 minute * `5` - 5 minutes * `15` - 15 minutes * `1H` - 1 hour * `4H` - 4 hours * `1D` - 1 day * `1W` - 1 week Quote currency token address (defaults to USD) ## Response ISO 8601 date-time for this data point Price at this date ```bash cURL theme={null} curl -X GET "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/prices/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D" ``` ```typescript TypeScript theme={null} // Fetch 30 days of daily price data const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const endDate = new Date(); const startDate = new Date(); startDate.setDate(startDate.getDate() - 30); const params = new URLSearchParams({ startDate: startDate.toISOString(), endDate: endDate.toISOString(), resolution: '1D' }); const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/prices/line?${params}` ); const data = await response.json(); // Calculate price statistics const prices = data.map(d => d.value); const avgPrice = prices.reduce((a, b) => a + b) / prices.length; const maxPrice = Math.max(...prices); const minPrice = Math.min(...prices); console.log(`30-day stats: Avg: $${avgPrice}, High: $${maxPrice}, Low: $${minPrice}`); ``` ```python Python theme={null} import requests from datetime import datetime, timedelta import pandas as pd token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' end_date = datetime.now() start_date = end_date - timedelta(days=30) params = { 'startDate': start_date.isoformat() + 'Z', 'endDate': end_date.isoformat() + 'Z', 'resolution': '1D' } response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/prices/line', params=params ) data = response.json() # Convert to DataFrame for analysis df = pd.DataFrame(data) df['date'] = pd.to_datetime(df['date']) df.set_index('date', inplace=True) # Calculate moving averages df['MA7'] = df['value'].rolling(window=7).mean() df['MA30'] = df['value'].rolling(window=30).mean() ``` ```json theme={null} [ { "date": "2024-02-01T00:00:00Z", "value": 2320.50 }, { "date": "2024-02-02T00:00:00Z", "value": 2345.75 }, { "date": "2024-02-03T00:00:00Z", "value": 2380.20 }, { "date": "2024-02-04T00:00:00Z", "value": 2365.90 }, { "date": "2024-02-05T00:00:00Z", "value": 2410.30 }, { "date": "2024-02-06T00:00:00Z", "value": 2435.50 } ] ``` ## Resolution Guidelines **Recommended resolutions by time range:** * **\< 1 day**: 1 or 5 minute resolution * **1-7 days**: 15 minute or 1 hour resolution * **1-4 weeks**: 1 or 4 hour resolution * **1-3 months**: Daily resolution * **3+ months**: Weekly resolution # Get Transfer Volume Source: https://docs.avnu.fi/api/markets/transfer-volume GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress}/volumes/line Retrieve historical transfer volume data over time ## Overview Returns historical transfer volume data for a token over time. This includes all on-chain transfers, not just DEX trading activity. ## Path Parameters Token contract address (hex format) ## Query Parameters Start date (ISO 8601 format) End date (ISO 8601 format) Data point frequency: `1`, `5`, `15`, `1H`, `4H`, `1D`, `1W` ## Response Returns an array of volume data points (`DataPointWithUsd`). ISO 8601 timestamp Transfer volume in token amount Transfer volume in USD ```bash cURL theme={null} curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/volumes/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D" ``` ```typescript TypeScript theme={null} const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const endDate = new Date(); const startDate = new Date(endDate.getTime() - 7 * 24 * 60 * 60 * 1000); const params = new URLSearchParams({ startDate: startDate.toISOString(), endDate: endDate.toISOString(), resolution: '1D' }); const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/volumes/line?${params}` ); const volumeData = await response.json(); // Calculate total and average volume const total = volumeData.reduce((sum, d) => sum + d.valueUsd, 0); const avg = total / volumeData.length; console.log(`Total volume: $${total.toLocaleString()}`); console.log(`Average daily volume: $${avg.toLocaleString()}`); ``` ```python Python theme={null} import requests from datetime import datetime, timedelta token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' end_date = datetime.now() start_date = end_date - timedelta(days=7) params = { 'startDate': start_date.isoformat() + 'Z', 'endDate': end_date.isoformat() + 'Z', 'resolution': '1D' } response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/volumes/line', params=params ) volume_data = response.json() total = sum(d['valueUsd'] for d in volume_data) avg = total / len(volume_data) if volume_data else 0 print(f"Total volume: ${total:,.0f}") print(f"Average daily volume: ${avg:,.0f}") ``` ```json theme={null} [ { "date": "2024-02-13T00:00:00Z", "value": 6172.456, "valueUsd": 15000000 }, { "date": "2024-02-14T00:00:00Z", "value": 7612.789, "valueUsd": 18500000 }, { "date": "2024-02-15T00:00:00Z", "value": 5062.123, "valueUsd": 12300000 } ] ``` # Get TVL by Exchanges Source: https://docs.avnu.fi/api/markets/tvl-by-exchange GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress}/exchange-tvl Retrieve TVL (Total Value Locked) distribution across exchanges ## Overview Get current or historical TVL data showing how liquidity is distributed across different DEXs and AMMs. Essential for understanding market depth and optimal routing strategies. ## Request Token contract address ISO 8601 date for historical TVL (defaults to current) ## Response Exchange/DEX name TVL in token amount TVL in USD value ISO 8601 date-time for this TVL snapshot ```bash cURL theme={null} curl -X GET "https://starknet.impulse.avnu.fi/v3/tokens/0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8/exchange-tvl" ``` ```typescript TypeScript theme={null} // Get current TVL distribution for USDC const tokenAddress = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'; const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/exchange-tvl` ); const tvlData = await response.json(); // Display liquidity distribution const totalTvl = tvlData.reduce((sum, item) => sum + item.valueUsd, 0); console.log(`Total TVL: $${totalTvl.toLocaleString()}`); console.log(`Distributed across ${tvlData.length} exchanges:\n`); tvlData.sort((a, b) => b.valueUsd - a.valueUsd).forEach(item => { const share = (item.valueUsd / totalTvl) * 100; const bar = '█'.repeat(Math.floor(share / 2)); console.log(`${item.exchange.padEnd(15)} ${bar} ${share.toFixed(1)}% ($${item.valueUsd.toLocaleString()})`); }); ``` ```python Python theme={null} import requests import matplotlib.pyplot as plt token_address = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8' response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/exchange-tvl' ) tvl_data = response.json() # Create pie chart of TVL distribution exchanges = [item['exchange'] for item in tvl_data] values = [item['valueUsd'] for item in tvl_data] total_tvl = sum(values) plt.pie(values, labels=exchanges, autopct='%1.1f%%') plt.title(f'TVL Distribution - Total: ${total_tvl:,.0f}') plt.show() ``` ```json theme={null} [ { "exchange": "JediSwap", "value": 5234567.89, "valueUsd": 5235802.45, "date": "2024-02-14T12:00:00Z" }, { "exchange": "10kSwap", "value": 3456789.12, "valueUsd": 3458234.67, "date": "2024-02-14T12:00:00Z" }, { "exchange": "MySwap", "value": 2345678.90, "valueUsd": 2346789.34, "date": "2024-02-14T12:00:00Z" }, { "exchange": "SithSwap", "value": 1234567.89, "valueUsd": 1235432.10, "date": "2024-02-14T12:00:00Z" } ] ``` # Get TVL Feed Source: https://docs.avnu.fi/api/markets/tvl-feed GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress}/exchange-tvl/line Retrieve historical TVL data by exchange over time ## Overview Returns historical TVL (Total Value Locked) data for a token across different exchanges over time. Use this to build TVL trend charts and analyze liquidity changes. ## Path Parameters Token contract address (hex format) ## Query Parameters Start date (ISO 8601 format) End date (ISO 8601 format) Data point frequency: `1`, `5`, `15`, `1H`, `4H`, `1D`, `1W` ## Response Returns an array of TVL data points by exchange (`ExchangeDataPoint`). Exchange/DEX name TVL in token amount TVL in USD ISO 8601 timestamp ```bash cURL theme={null} curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/exchange-tvl/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D" ``` ```typescript TypeScript theme={null} const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const endDate = new Date(); const startDate = new Date(endDate.getTime() - 7 * 24 * 60 * 60 * 1000); const params = new URLSearchParams({ startDate: startDate.toISOString(), endDate: endDate.toISOString(), resolution: '1D' }); const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/exchange-tvl/line?${params}` ); const tvlData = await response.json(); // Group by exchange const byExchange = tvlData.reduce((acc, item) => { if (!acc[item.exchange]) acc[item.exchange] = []; acc[item.exchange].push(item); return acc; }, {}); Object.entries(byExchange).forEach(([exchange, data]) => { console.log(`${exchange}: ${data.length} data points`); }); ``` ```python Python theme={null} import requests from datetime import datetime, timedelta token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' end_date = datetime.now() start_date = end_date - timedelta(days=7) params = { 'startDate': start_date.isoformat() + 'Z', 'endDate': end_date.isoformat() + 'Z', 'resolution': '1D' } response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/exchange-tvl/line', params=params ) tvl_data = response.json() print(f"Fetched {len(tvl_data)} TVL data points") ``` ```json theme={null} [ { "exchange": "JediSwap", "value": 5234567.89, "valueUsd": 12750000, "date": "2024-02-13T00:00:00Z" }, { "exchange": "Ekubo", "value": 3456789.12, "valueUsd": 8420000, "date": "2024-02-13T00:00:00Z" }, { "exchange": "JediSwap", "value": 5345678.90, "valueUsd": 13020000, "date": "2024-02-14T00:00:00Z" }, { "exchange": "Ekubo", "value": 3567890.12, "valueUsd": 8690000, "date": "2024-02-14T00:00:00Z" } ] ``` # Get Volume by Exchange Source: https://docs.avnu.fi/api/markets/volume-by-exchange GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress}/exchange-volumes Retrieve trading volume distribution across exchanges ## Overview Returns trading volume data for a token distributed across different exchanges over a date range. Use this to understand where trading activity is happening. ## Path Parameters Token contract address (hex format) ## Query Parameters Start date (YYYY-MM-DD format) End date (YYYY-MM-DD format) ## Response Returns an array of volume data by exchange. Trading volume in token amount Trading volume in USD Exchange/DEX name Start date of the period (YYYY-MM-DD format) End date of the period (YYYY-MM-DD format) ```bash cURL theme={null} curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/exchange-volumes?startDate=2024-02-01&endDate=2024-02-14" ``` ```typescript TypeScript theme={null} const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const params = new URLSearchParams({ startDate: '2024-02-01', endDate: '2024-02-14' }); const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/exchange-volumes?${params}` ); const volumeData = await response.json(); // Calculate total volume by exchange const totalVolume = volumeData.reduce((sum, item) => sum + item.valueUsd, 0); volumeData .sort((a, b) => b.valueUsd - a.valueUsd) .forEach(item => { const share = (item.valueUsd / totalVolume) * 100; console.log(`${item.exchange}: $${item.valueUsd.toLocaleString()} (${share.toFixed(1)}%)`); }); ``` ```python Python theme={null} import requests token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' params = { 'startDate': '2024-02-01', 'endDate': '2024-02-14' } response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/exchange-volumes', params=params ) volume_data = response.json() # Calculate total and display distribution total = sum(item['valueUsd'] for item in volume_data) for item in sorted(volume_data, key=lambda x: -x['valueUsd']): share = (item['valueUsd'] / total) * 100 print(f"{item['exchange']}: ${item['valueUsd']:,.0f} ({share:.1f}%)") ``` ```json theme={null} [ { "value": 5234.567, "valueUsd": 2500000, "exchange": "Ekubo", "startDate": "2024-02-01", "endDate": "2024-02-14" }, { "value": 3789.123, "valueUsd": 1800000, "exchange": "JediSwap", "startDate": "2024-02-01", "endDate": "2024-02-14" } ] ``` # Get Volume Feed Source: https://docs.avnu.fi/api/markets/volume-feed GET https://starknet.impulse.avnu.fi/v3/tokens/{tokenAddress}/exchange-volumes/line Retrieve historical trading volume data by exchange over time ## Overview Returns historical trading volume data for a token across different exchanges over time with configurable resolution. Use this to build volume trend charts. ## Path Parameters Token contract address (hex format) ## Query Parameters Start date (ISO 8601 format) End date (ISO 8601 format) Data point frequency: `1`, `5`, `15`, `1H`, `4H`, `1D`, `1W` ## Response Returns an array of volume data points by exchange (`ExchangeDataPoint`). ISO 8601 timestamp Trading volume in token amount Trading volume in USD Exchange/DEX name ```bash cURL theme={null} curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/exchange-volumes/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D" ``` ```typescript TypeScript theme={null} const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const endDate = new Date(); const startDate = new Date(endDate.getTime() - 7 * 24 * 60 * 60 * 1000); const params = new URLSearchParams({ startDate: startDate.toISOString(), endDate: endDate.toISOString(), resolution: '4H' }); const response = await fetch( `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/exchange-volumes/line?${params}` ); const volumeData = await response.json(); // Group by exchange for charting const byExchange = volumeData.reduce((acc, item) => { if (!acc[item.exchange]) acc[item.exchange] = []; acc[item.exchange].push({ date: item.date, value: item.valueUsd }); return acc; }, {}); console.log(`Exchanges: ${Object.keys(byExchange).join(', ')}`); ``` ```python Python theme={null} import requests from datetime import datetime, timedelta token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' end_date = datetime.now() start_date = end_date - timedelta(days=7) params = { 'startDate': start_date.isoformat() + 'Z', 'endDate': end_date.isoformat() + 'Z', 'resolution': '4H' } response = requests.get( f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/exchange-volumes/line', params=params ) volume_data = response.json() print(f"Fetched {len(volume_data)} volume data points") ``` ```json theme={null} [ { "date": "2024-02-13T00:00:00Z", "value": 256.789, "valueUsd": 625000, "exchange": "Ekubo" }, { "date": "2024-02-13T00:00:00Z", "value": 184.567, "valueUsd": 450000, "exchange": "JediSwap" }, { "date": "2024-02-13T04:00:00Z", "value": 238.456, "valueUsd": 580000, "exchange": "Ekubo" }, { "date": "2024-02-13T04:00:00Z", "value": 172.345, "valueUsd": 420000, "exchange": "JediSwap" } ] ``` # Overview Source: https://docs.avnu.fi/api/overview REST API documentation for avnu services ## Base URL ### avnu base url Used to interact with avnu & fetch tokens metadata ```text Mainnet theme={null} https://starknet.api.avnu.fi ``` ```text Sepolia theme={null} https://sepolia.api.avnu.fi ``` ### impulse base url Used to fetch market data ```text Mainnet theme={null} https://starknet.impulse.avnu.fi ``` ```text Sepolia theme={null} https://sepolia.impulse.avnu.fi ``` ## Authentication (optional) Most endpoints are public. For higher rate limits or sponsored transactions, use an API key: ```bash theme={null} GET /endpoint Headers: x-api-key: your-api-key ``` Join our developer community on Telegram ## Available APIs All core APIs (Swap, DCA, Paymaster, Staking) are on **v3**. Markets and Token List remain on **v1** (stable). Get quotes and execute swaps (v3) Gasless & gasfree transactions (V1) Create and manage DCA orders (v3) Native token staking (v3) Real-time price feeds (v1) Token metadata and verification (v1) ## Rate Limits | Tier | Limit | Requirements | | ---------- | ------------- | ---------------- | | Public | 300 req/5min | None | | Integrated | Higher limits | API key required | ## SDKs Official TypeScript/JavaScript SDK ## Support Get help from developers API health monitoring # Monitor Sponsor Activity Source: https://docs.avnu.fi/api/paymaster/sponsor-activity GET https://starknet.api.avnu.fi/paymaster/v1/sponsor-activity Monitor your API key's sponsorship metrics and remaining credits ## Overview Returns detailed usage metrics for your API key's sponsored transactions including transaction counts, gas fees consumed in ETH and STRK, and remaining credits. This endpoint requires an API key and returns data for that specific key only. ## Headers Your paymaster API key for authentication ## Query Parameters Start date for activity query (ISO 8601 date-time). Default: 7 days ago End date for activity query (ISO 8601 date-time). Default: now ## Response The sponsor's name Total number of executed transactions Number of successful transactions Number of reverted transactions Total ETH paid for all transactions ETH paid for successful transactions ETH paid for reverted transactions Total STRK paid for all transactions STRK paid for successful transactions STRK paid for reverted transactions Remaining ETH credits (contact support to recharge when zero) Remaining STRK credits (contact support to recharge when zero) ```bash cURL theme={null} curl "https://starknet.api.avnu.fi/paymaster/v1/sponsor-activity?startDate=2024-11-01T00:00:00Z&endDate=2024-12-01T00:00:00Z" ``` ```typescript TypeScript theme={null} async function getSponsorActivity(apiKey: string) { const startDate = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(); const endDate = new Date().toISOString(); const params = new URLSearchParams({ startDate, endDate }); const response = await fetch( `https://starknet.api.avnu.fi/paymaster/v1/sponsor-activity?${params}`, { headers: { 'api-key': apiKey } } ); return await response.json(); } ``` ```python Python theme={null} import requests from datetime import datetime, timedelta def get_sponsor_activity(api_key): start_date = (datetime.now() - timedelta(days=7)).isoformat() end_date = datetime.now().isoformat() params = { 'startDate': start_date, 'endDate': end_date } headers = { 'api-key': api_key } response = requests.get( 'https://starknet.api.avnu.fi/paymaster/v1/sponsor-activity', params=params, headers=headers ) return response.json() ``` ```json Success theme={null} { "name": "my app", "succeededTxCount": 8297, "revertedTxCount": 0, "txCount": 8297, "succeededGasFees": "0x0", "revertedGasFees": "0x0", "gasFees": "0x0", "succeededStrkGasFees": "0x9b4bc7d495ab90fe0", "revertedStrkGasFees": "0x0", "strkGasFees": "0x9b4bc7d495ab90fe0", "remainingCredits": "0x0", "remainingStrkCredits": "0x8de42a4ed5ea442ee" } ``` ## Need More Credits? Reach out to recharge your sponsorship credits # Get Current Prices Source: https://docs.avnu.fi/api/prices/get-prices POST https://starknet.impulse.avnu.fi/v3/tokens/prices Fetch real-time prices for multiple tokens with Global and Starknet data ## Overview Returns current prices for up to 50 tokens in a single request. Provides both global market prices (from CoinGecko) and Starknet-specific on-chain prices, enabling accurate price comparisons across markets. ## Request Body Array of token contract addresses (1-50 tokens) ## Response Returns an array of `TokenPriceV3Dto` objects. Token contract address Token decimals On-chain Starknet market price Current price in USD on Starknet Global market price (from CoinGecko, when available) Current global price in USD ```bash cURL theme={null} curl -X POST "https://starknet.impulse.avnu.fi/v3/tokens/prices" \ -H "Content-Type: application/json" \ -d '{ "tokens": [ "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" ] }' ``` ```typescript TypeScript theme={null} // Fetch prices for multiple tokens const tokens = [ '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', // ETH '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8', // USDC '0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d' // STRK ]; const response = await fetch( 'https://starknet.impulse.avnu.fi/v3/tokens/prices', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tokens }) } ); const prices = await response.json(); // Display prices prices.forEach(price => { console.log(`Token: ${price.address.slice(0, 10)}...`); console.log(` Starknet USD: $${price.starknetMarket.usd.toFixed(2)}`); if (price.globalMarket) { console.log(` Global USD: $${price.globalMarket.usd.toFixed(2)}`); } console.log(` Decimals: ${price.decimals}`); }); ``` ```python Python theme={null} import requests tokens = [ '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', # ETH '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8', # USDC '0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d' # STRK ] response = requests.post( 'https://starknet.impulse.avnu.fi/v3/tokens/prices', json={'tokens': tokens} ) prices = response.json() # Calculate portfolio value using Starknet prices portfolio_value = sum( price['starknetMarket']['usd'] * holdings.get(price['address'], 0) for price in prices ) ``` ```json theme={null} [ { "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "decimals": 18, "starknetMarket": { "usd": 2435.50 }, "globalMarket": { "usd": 2436.12 } }, { "address": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "decimals": 6, "starknetMarket": { "usd": 1.0002 }, "globalMarket": { "usd": 1.0001 } }, { "address": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "decimals": 18, "starknetMarket": { "usd": 2.35 }, "globalMarket": { "usd": 2.34 } } ] ``` ## Price Comparison The V3 endpoint provides both **Starknet on-chain prices** and **global market prices**. This allows you to: * Detect arbitrage opportunities between Starknet and centralized exchanges * Display the most relevant price for your use case * Identify price discrepancies for trading strategies # Claim Rewards Source: https://docs.avnu.fi/api/staking/claim-rewards POST https://starknet.api.avnu.fi/staking/v3/pools/{poolAddress}/members/{userAddress}/claim-rewards Claim accumulated staking rewards ## Overview Generates transaction calls to claim accrued staking rewards from a pool. Rewards can be claimed anytime with no minimum threshold. ## Path Parameters Pool contract address User's wallet address ## Request User's wallet address If true, rewards are automatically restaked ## Response Network identifier Transaction calls to execute ```bash cURL theme={null} curl -X POST "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def/claim-rewards" \ -H "Content-Type: application/json" \ -d '{ "userAddress": "0x0456def...", "restake": false }' ``` ```typescript TypeScript theme={null} async function claimRewards( poolAddress: string, account: Account, restake: boolean = false ) { const response = await fetch( `https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${account.address}/claim-rewards`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ userAddress: account.address, restake }) } ); const { calls } = await response.json(); const tx = await account.execute(calls); return tx.transaction_hash; } ``` ```json Success theme={null} { "chainId": "0x534e5f4d41494e", "calls": [ { "contractAddress": "0x123abc", "entrypoint": "claim_rewards", "calldata": [] } ] } ``` # Claim Withdraw Source: https://docs.avnu.fi/api/staking/claim-withdraw POST https://starknet.api.avnu.fi/staking/v3/pools/{poolAddress}/members/{userAddress}/claim-withdraw Claim unbonded STRK after 21-day period ## Overview Claims STRK tokens that have completed the 21-day unbonding period. Only works if withdrawal was previously initiated and the waiting period has passed. ## Path Parameters Pool contract address User's wallet address ## Request User's wallet address ## Response Network identifier Transaction calls to execute ```bash cURL theme={null} curl -X POST "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def/claim-withdraw" \ -H "Content-Type: application/json" \ -d '{ "userAddress": "0x0456def..." }' ``` ```typescript TypeScript theme={null} async function claimWithdraw(poolAddress: string, account: Account) { const response = await fetch( `https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${account.address}/claim-withdraw`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ userAddress: account.address }) } ); const { calls } = await response.json(); const tx = await account.execute(calls); return tx.transaction_hash; } ``` ```json Success theme={null} { "chainId": "0x534e5f4d41494e", "calls": [ { "contractAddress": "0x123abc", "entrypoint": "claim_withdraw", "calldata": [] } ] } ``` # Get Member Source: https://docs.avnu.fi/api/staking/get-member GET https://starknet.api.avnu.fi/staking/v3/pools/{poolAddress}/members/{userAddress} Get user's staking position and rewards ## Overview Returns detailed information about a user's staking position in a specific pool. ## Path Parameters Pool contract address User's wallet address ## Response The staking token address The token price in USD The pool contract address The user's wallet address The staked amount (hex format) The staked amount in USD Unclaimed rewards amount (hex format) Unclaimed rewards in USD Amount pending withdrawal (hex format) Pending withdrawal amount in USD Timestamp when withdrawal will be available (ISO 8601 format) Total rewards claimed historically (hex format) Total claimed rewards in USD at historical prices Total claimed rewards in current USD value Array of user staking actions Block number of the action Date of the action (ISO 8601 format) User address Transaction hash Action type: `StakingStake`, `StakingInitiateWithdrawal`, `StakingCancelWithdrawal`, `StakingWithdraw`, or `StakingClaimRewards` Action-specific metadata Total count of user actions Expected yearly STRK rewards (hex format) Historical APR data Date of APR snapshot (ISO 8601 format) APR value at that date ```bash cURL theme={null} curl "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def..." ``` ```typescript TypeScript theme={null} async function getMemberPosition(poolAddress: string, userAddress: string) { const response = await fetch( `https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${userAddress}` ); return await response.json(); } ``` ```python Python theme={null} import requests def get_member_position(pool_address: str, user_address: str): response = requests.get( f'https://starknet.api.avnu.fi/staking/v3/pools/{pool_address}/members/{user_address}' ) return response.json() ``` ```json theme={null} { "tokenAddress": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "tokenPriceInUsd": 0.25, "poolAddress": "0x0abc123def456789...", "userAddress": "0x0123456789abcdef...", "amount": "0x4563918244f40000", "amountInUsd": 1250.00, "unclaimedRewards": "0x1bc16d674ec80000", "unclaimedRewardsInUsd": 50.00, "unpoolAmount": "0x0", "unpoolAmountInUsd": 0, "unpoolTime": null, "totalClaimedRewards": "0x6f05b59d3b20000", "totalClaimedRewardsHistoricalUsd": 180.50, "totalClaimedRewardsUsd": 200.00, "userActions": [ { "blockNumber": 123456, "date": "2024-10-15T10:30:00Z", "userAddress": "0x0123456789abcdef...", "transactionHash": "0xabc123...", "type": "StakingStake", "metadata": { "delegationPoolAddress": "0x0abc123def456789...", "oldDelegatedStake": "0x0", "newDelegatedStake": "0x4563918244f40000" } }, { "blockNumber": 125000, "date": "2024-11-01T14:00:00Z", "userAddress": "0x0123456789abcdef...", "transactionHash": "0xdef456...", "type": "StakingClaimRewards", "metadata": { "delegationPoolAddress": "0x0abc123def456789...", "rewardAddress": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "amount": "0x6f05b59d3b20000" } } ], "totalUserActionsCount": 2, "expectedYearlyStrkRewards": "0x8ac7230489e80000", "aprs": [ { "date": "2024-11-01T00:00:00Z", "apr": 0.085 }, { "date": "2024-10-31T00:00:00Z", "apr": 0.082 } ] } ``` # Get Staking Info Source: https://docs.avnu.fi/api/staking/get-pools GET https://starknet.api.avnu.fi/staking/v3 Get overall staking information and delegation pools ## Overview Returns overall staking information including all available delegation pools. Use this to display pool options to users. ## Response The self-staked amount (hex format) The self-staked amount in USD The operational address The reward address The staker address The commission rate Array of delegation pool information The pool contract address The staking token address Total amount staked in the pool (hex format) Total staked amount in USD Current annual percentage rate ```bash cURL theme={null} curl "https://starknet.api.avnu.fi/staking/v3" ``` ```typescript TypeScript theme={null} async function getStakingInfo() { const response = await fetch( 'https://starknet.api.avnu.fi/staking/v3' ); return await response.json(); } ``` ```python Python theme={null} import requests def get_staking_info(): response = requests.get( 'https://starknet.api.avnu.fi/staking/v3' ) return response.json() ``` ```json theme={null} { "selfStakedAmount": "0x56bc75e2d63100000", "selfStakedAmountInUsd": 1250.50, "operationalAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "rewardAddress": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "stakerAddress": "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "commission": 0.05, "delegationPools": [ { "poolAddress": "0x0abc123def456789...", "tokenAddress": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "stakedAmount": "0x152d02c7e14af6800000", "stakedAmountInUsd": 125000.00, "apr": 0.085 } ] } ``` # Initiate Withdraw Source: https://docs.avnu.fi/api/staking/initiate-withdraw POST https://starknet.api.avnu.fi/staking/v3/pools/{poolAddress}/members/{userAddress}/initiate-withdraw Start unstaking process (21-day unbonding) ## Overview Initiates withdrawal of staked STRK. After execution, tokens enter a 21-day unbonding period. During unbonding, tokens don't earn rewards. After 21 days, use `/claim-withdraw` to retrieve tokens. Tokens don't earn rewards during the 21-day unbonding period. ## Path Parameters Pool contract address User's wallet address ## Request User's wallet address Amount to unstake (hex format) ## Response Network identifier Transaction calls to execute ```bash cURL theme={null} curl -X POST "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def/initiate-withdraw" \ -H "Content-Type: application/json" \ -d '{ "userAddress": "0x0456def...", "amount": "0xde0b6b3a7640000" }' ``` ```typescript TypeScript theme={null} async function initiateWithdraw( poolAddress: string, amount: string, account: Account ) { const response = await fetch( `https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${account.address}/initiate-withdraw`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ userAddress: account.address, amount }) } ); const { calls } = await response.json(); const tx = await account.execute(calls); return tx.transaction_hash; } ``` ```json Success theme={null} { "chainId": "0x534e5f4d41494e", "calls": [ { "contractAddress": "0x123abc", "entrypoint": "initiate_withdraw", "calldata": ["0xde0b6b3a7640000", "0"] } ] } ``` # Stake Source: https://docs.avnu.fi/api/staking/stake POST https://starknet.api.avnu.fi/staking/v3/pools/{poolAddress}/members/{userAddress}/stake Deposit STRK to earn staking rewards ## Overview Generates transaction calls to stake STRK tokens in a validator pool. Returns calls that you execute to deposit tokens and start earning rewards. ## Path Parameters Pool contract address User's wallet address ## Request User's wallet address Amount of STRK to stake (hex format) ## Response Network identifier Transaction calls to execute Contract address Function name Call arguments ```bash cURL theme={null} curl -X POST "https://starknet.api.avnu.fi/staking/v3/pools/0x123abc/members/0x0456def/stake" \ -H "Content-Type: application/json" \ -d '{ "userAddress": "0x0456def...", "amount": "0xde0b6b3a7640000" }' ``` ```typescript TypeScript theme={null} async function stakeStrk(poolAddress: string, amount: string, account: Account) { // 1. Get staking calls const response = await fetch( `https://starknet.api.avnu.fi/staking/v3/pools/${poolAddress}/members/${account.address}/stake`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ userAddress: account.address, amount }) } ); const { calls } = await response.json(); // 2. Execute transaction const tx = await account.execute(calls); // 3. Wait for confirmation await account.waitForTransaction(tx.transaction_hash); return tx.transaction_hash; } // Usage const txHash = await stakeStrk( '0x123abc', '0xde0b6b3a7640000', // 1 STRK in hex account ); ``` ```python Python theme={null} from starknet_py.net.account.account import Account import requests async def stake_strk(pool_address: str, amount: str, account: Account): # Get calls response = requests.post( f'https://starknet.api.avnu.fi/staking/v3/pools/{pool_address}/members/{account.address}/stake', json={ 'userAddress': account.address, 'amount': amount } ) calls = response.json()['calls'] # Execute tx = await account.execute(calls) await account.wait_for_tx(tx.transaction_hash) return tx.transaction_hash ``` ```json Success theme={null} { "chainId": "0x534e5f4d41494e", "calls": [ { "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entrypoint": "approve", "calldata": ["0x123abc", "0xde0b6b3a7640000", "0"] }, { "contractAddress": "0x123abc", "entrypoint": "stake", "calldata": ["0xde0b6b3a7640000", "0"] } ] } ``` # Build Swap Calls Source: https://docs.avnu.fi/api/swap/build-swap POST https://starknet.api.avnu.fi/swap/v3/build Get transaction calls to execute a swap ## Overview Returns transaction calls needed to execute a swap based on a quote. You execute these calls with your account/wallet to complete the swap on-chain. ## Request Unique quote identifier (UUID) from the `/quotes` endpoint Address executing the swap (optional if provided during quote request) Maximum acceptable slippage (range: 0-1, e.g., 0.01 for 1%, default: 0.05 for 5%) If true, response includes approve call if necessary ## Response Network identifier (e.g., "0x534e5f4d41494e") Transaction calls to execute Contract address to call Function name to invoke Call data (array of strings) ```bash cURL theme={null} curl -X POST "https://starknet.api.avnu.fi/swap/v3/build" \ -H "Content-Type: application/json" \ -d '{ "quoteId": "0a5e3c8e-b5d2-4f1a-9c3d-7e6f5a4b3c2d", "takerAddress": "0x0123...abc", "slippage": 0.01, "includeApprove": true }' ``` ```typescript TypeScript theme={null} // Step 1: Get quote const params = new URLSearchParams({ sellTokenAddress: '0x049d...', buyTokenAddress: '0x053c...', sellAmount: '1000000000000000000', takerAddress: account.address }); const quoteResponse = await fetch( `https://starknet.api.avnu.fi/swap/v3/quotes?${params}` ); const quotes = await quoteResponse.json(); const quote = quotes[0]; // Step 2: Get execution calls const executeResponse = await fetch('https://starknet.api.avnu.fi/swap/v3/build', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ quoteId: quote.quoteId, takerAddress: account.address, slippage: 0.01, includeApprove: true }) }); const { calls } = await executeResponse.json(); // Step 3: Execute transaction const tx = await account.execute(calls); await account.waitForTransaction(tx.transaction_hash); console.log(`Swap complete: ${tx.transaction_hash}`); ``` ```python Python theme={null} import requests from starknet_py.net.account.account import Account # Step 1: Get quote params = { 'sellTokenAddress': '0x049d...', 'buyTokenAddress': '0x053c...', 'sellAmount': '1000000000000000000', 'takerAddress': account.address } quote_response = requests.get( 'https://starknet.api.avnu.fi/swap/v3/quotes', params=params, ) quotes = quote_response.json() quote = quotes[0] # Step 2: Get execution calls execute_response = requests.post( 'https://starknet.api.avnu.fi/swap/v3/build', json={ 'quoteId': quote['quoteId'], 'takerAddress': account.address, 'slippage': 0.01, 'includeApprove': True }, ) calls = execute_response.json()['calls'] # Step 3: Execute transaction tx = await account.execute(calls) print(f"Swap complete: {tx.transaction_hash}") ``` ```json Success theme={null} { "calls": [ { "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entrypoint": "approve", "calldata": ["0x123...", "1000000000000000000", "0"] }, { "contractAddress": "0x123abc...", "entrypoint": "swap", "calldata": ["0x049d...", "0x053c...", "1000000000000000000", "3150000000", "0"] } ] } ``` # Get Swap Quotes Source: https://docs.avnu.fi/api/swap/get-quotes GET https://starknet.api.avnu.fi/swap/v3/quotes Fetch optimized swap quotes across all Starknet liquidity sources ## Overview The quotes endpoint returns the best available swap routes with unique quote IDs for execution. Each quote includes: * Optimized routing across multiple DEXs * Gas estimation and fees * Slippage protection ## Request Token address to sell (hex format) Token address to buy (hex format) The amount of token user wants to sell. Either `sellAmount` or `buyAmount` required The exact amount of token user wants to buy. Either `sellAmount` or `buyAmount` required Address that will execute the swap Maximum number of quotes to return (range: 1-5) Fee in basis points (e.g., "30" for 0.3%). When specified, `integratorFeeRecipient` and `integratorName` are required. Address to receive integrator fees. Required when `integratorFees` is specified. Your integration identifier for tracking If true, only return direct swap routes (no multi-hop) ## Response Unique identifier for executing this quote (UUID) Token address being sold Amount of token to sell (hex format) USD value of sell amount Token address being purchased Amount of token to receive (hex format). Already includes all fees. USD value of buy amount Fee breakdown for the swap Token address used for fees Platform fees (hex format) Platform fees in USD Platform fees in basis points Integrator fees (hex format) Integrator fees in USD Integrator fees in basis points Network identifier (e.g., "0x534e5f4d41494e") Block at which quote was generated (hex format) Unix timestamp when quote expires in seconds Swap routing paths with protocol details DEX protocol identifier (e.g., "JediSwap", "Ekubo") Smart contract address Allocation percentage (1 = 100%) Input token for this route Output token for this route Nested routing steps (for multi-hop swaps) Number of alternative swaps available Estimated gas cost in STRK (hex format) Gas fees converted to USD Price impact in USD and in bps Current market price of sell token in USD Current market price of buy token in USD Projected slippage percentage ```bash cURL theme={null} curl "https://starknet.api.avnu.fi/swap/v3/quotes?sellTokenAddress=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7&buyTokenAddress=0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d&sellAmount=0x2386f26fc10000" ``` ```typescript TypeScript theme={null} const params = new URLSearchParams({ sellTokenAddress: '0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', buyTokenAddress: '0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d', sellAmount: '0x2386f26fc10000' }); const response = await fetch(`https://starknet.api.avnu.fi/swap/v3/quotes?${params}`); const quotes = await response.json(); console.log('Quote:', quotes); ``` ```python Python theme={null} import requests params = { 'sellTokenAddress': '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', 'buyTokenAddress': '0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d', 'sellAmount': '0x2386f26fc10000' } response = requests.get( 'https://starknet.api.avnu.fi/swap/v3/quotes', params=params, ) quotes = response.json() print('Quote:', quotes) ``` ```json Success theme={null} [ { "quoteId": "69ee30c9-5051-479e-9366-bde0584a2614", "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "sellAmount": "0x2386f26fc10000", "sellAmountInUsd": 28.2265, "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "buyAmount": "0xd005a71ea99678000", "buyAmountInUsd": 28.25618, "fee": { "feeToken": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "avnuFees": "0xda475abf000", "avnuFeesInUsd": 0.000002, "avnuFeesBps": "0xf", "integratorFees": "0x0", "integratorFeesInUsd": 0.0, "integratorFeesBps": "0x0" }, "chainId": "0x534e5f4d41494e", "blockNumber": "0x3ca1b4", "expiry": null, "routes": [ { "name": "Nostra", "address": "0x49ff5b3a7d38e2b50198f408fa8281635b5bc81ee49ab87ac36c8324c214427", "percent": 0.55, "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "routes": [], "alternativeSwapCount": 0 }, { "name": "Ekubo", "address": "0x5dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b", "percent": 0.45, "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", "routes": [], "alternativeSwapCount": 0 } ], "gasFees": "0x19b1b3cb5956130", "gasFeesInUsd": 0.013633, "priceImpact": 10.51, "sellTokenPriceInUsd": 2825.618, "buyTokenPriceInUsd": 0.117692, "estimatedSlippage": 0.00032 } ] ``` ## Best Practices With Starknet's block time of \~2 seconds, quotes become stale after just 1 block. Refresh quotes every 2-3 blocks before execution. Handle cases where no routes are available due to insufficient liquidity. # Get Sources Source: https://docs.avnu.fi/api/swap/get-sources GET https://starknet.api.avnu.fi/swap/v3/sources List all supported liquidity sources ## Overview Returns all DEXs and liquidity sources that avnu routes through. Use this to understand which protocols are supported and display routing information to users. ## Query Parameters Zero-based page index Page size Sorting criteria in format "property,(asc|desc)" ## Response Returns an array of liquidity source objects. DEX protocol name (e.g., "JediSwap", "Ekubo", "10kSwap") Source classification (currently "DEX") ```bash cURL theme={null} curl "https://starknet.api.avnu.fi/swap/v3/sources" \ ``` ```typescript TypeScript theme={null} async function getSources() { const response = await fetch( 'https://starknet.api.avnu.fi/swap/v3/sources', ); const sources = await response.json(); return sources; } ``` ```python Python theme={null} import requests response = requests.get( 'https://starknet.api.avnu.fi/swap/v3/sources', ) sources = response.json() print(f"Total sources: {len(sources)}") ``` ```json Success theme={null} [ { "name": "10kSwap", "type": "DEX" }, { "name": "Ekubo", "type": "DEX" }, { "name": "JediSwap", "type": "DEX" }, { "name": "MySwapCL", "type": "DEX" }, { "name": "Nostra", "type": "DEX" } ] ``` ## Related Endpoints Get quotes showing which sources are used # Get Token Source: https://docs.avnu.fi/api/tokens/get-token GET https://starknet.api.avnu.fi/v1/starknet/tokens/{addressOrSymbol} Fetch detailed information for a specific token ## Overview Returns detailed information for a specific token by its contract address or symbol. ## Path Parameters Token contract address (hex format) or symbol (e.g., "ETH", "USDC") ## Response Token contract address (hex format) Token name (e.g., "Ether", "USD Coin") Token symbol (e.g., "ETH", "USDC") Token decimals URL to token logo image (nullable) Last 24h trading volume in USD Additional token metadata Token tags: `Unknown`, `Verified`, `Community`, `Unruggable`, `AVNU` ```bash cURL theme={null} curl "https://starknet.api.avnu.fi/v1/starknet/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" ``` ```typescript TypeScript theme={null} const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const response = await fetch( `https://starknet.api.avnu.fi/v1/starknet/tokens/${tokenAddress}` ); const token = await response.json(); console.log(`${token.symbol}: ${token.name}`); console.log(`Decimals: ${token.decimals}`); console.log(`Tags: ${token.tags.join(', ')}`); ``` ```python Python theme={null} import requests token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' response = requests.get( f'https://starknet.api.avnu.fi/v1/starknet/tokens/{token_address}' ) token = response.json() print(f"{token['symbol']}: {token['name']}") print(f"Decimals: {token['decimals']}") print(f"Tags: {', '.join(token['tags'])}") ``` ```json theme={null} { "name": "Ether", "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "symbol": "ETH", "decimals": 18, "logoUri": "https://assets.avnu.fi/tokens/eth.svg", "lastDailyVolumeUsd": 12847392, "extensions": {}, "tags": ["Verified"] } ``` # Get Tokens Source: https://docs.avnu.fi/api/tokens/get-tokens GET https://starknet.api.avnu.fi/v1/starknet/tokens Fetch paginated list of tokens with optional filtering ## Overview Returns a paginated list of tokens available on Starknet with optional filtering by tags or search query. This endpoint is used by wallets, DEXs, and dApps across the Starknet ecosystem to display verified token information. ## Query Parameters Search filter for tokens by name, symbol, or address Filter by tags: `Unknown`, `Verified`, `Community`, `Unruggable`, `AVNU` Zero-based page index Page size Sorting criteria in format "property,(asc|desc)" ## Response Array of token objects Token contract address (hex format) Token name (e.g., "Ether", "USD Coin") Token symbol (e.g., "ETH", "USDC") Token decimals URL to token logo image (nullable) Last 24h trading volume in USD Additional token metadata Token tags: `Unknown`, `Verified`, `Community`, `Unruggable`, `AVNU` Page size Current page number (zero-based) Total number of tokens Total pages available ```bash cURL theme={null} curl "https://starknet.api.avnu.fi/v1/starknet/tokens?page=0&size=20" ``` ```typescript TypeScript theme={null} const params = new URLSearchParams({ page: '0', size: '20' }); const response = await fetch( `https://starknet.api.avnu.fi/v1/starknet/tokens?${params}` ); const data = await response.json(); console.log(`Found ${data.totalElements} tokens`); console.log(`Page ${data.number + 1} of ${data.totalPages}`); data.content.forEach(token => { console.log(`${token.symbol}: ${token.name}`); }); ``` ```python Python theme={null} import requests params = { 'page': 0, 'size': 20 } response = requests.get( 'https://starknet.api.avnu.fi/v1/starknet/tokens', params=params ) data = response.json() tokens = data['content'] print(f"Found {data['totalElements']} tokens") print(f"Page {data['number'] + 1} of {data['totalPages']}") for token in tokens: print(f"{token['symbol']}: {token['name']}") ``` ```json theme={null} { "content": [ { "name": "Ether", "address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "symbol": "ETH", "decimals": 18, "logoUri": "https://assets.avnu.fi/tokens/eth.svg", "lastDailyVolumeUsd": 12847392, "extensions": {}, "tags": ["Verified"] }, { "name": "USD Coin", "address": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "symbol": "USDC", "decimals": 6, "logoUri": "https://assets.avnu.fi/tokens/usdc.svg", "lastDailyVolumeUsd": 8234561, "extensions": {}, "tags": ["Verified"] } ], "size": 20, "number": 0, "totalElements": 156, "totalPages": 8 } ``` ## Token Tags * **Verified** - Manually verified by avnu team * **Community** - Community-approved tokens * **Unruggable** - Tokens from Unruggable platform * **AVNU** - avnu ecosystem tokens * **Unknown** - Unverified tokens # Overview Source: https://docs.avnu.fi/docs/dca/index Automate recurring token purchases on Starknet Reduce volatility exposure with automated recurring buy orders executed on-chain. **Recurring Buy** is our implementation of Dollar-Cost Averaging (DCA) - a proven investment strategy that reduces timing risk by spreading purchases over regular intervals. ## How It Works Each recurring buy order is a dedicated smart contract that: * Is owned by your address * Is allowed to spend your sell token * Executes swaps at scheduled intervals, directly from your wallet * Can be canceled anytime **Sell tokens** never leave your wallet, your dedicated DCA smart contract only execute trades directly on your account. ## Use Cases Buy tokens weekly to average entry price Systematic token accumulation for protocols Spread large purchases across multiple intervals Invest fixed amounts regardless of price ## SDK Methods ### Data Fetching * `getDcaOrders(params)` - Fetch user's recurring buy orders ### Simple Integration * `executeCreateDca(params)` - Create recurring buy order with automatic approvals * `executeCancelDca(params)` - Cancel active recurring buy order ### Advanced Integration * `createDcaToCalls(order)` - Build recurring buy creation calls for custom execution * `cancelDcaToCalls(orderAddress)` - Build cancellation calls ```typescript theme={null} // Simple integration const result = await executeCreateDca({ provider: account, order: { sellTokenAddress: USDC_ADDRESS, buyTokenAddress: STRK_ADDRESS, sellAmount: parseUnits('1200', 6).toString(), sellAmountPerCycle: parseUnits('100', 6).toString(), frequency: moment.duration(1, 'week'), traderAddress: account.address } }); // Advanced: compose with other operations const dcaCalls = createDcaToCalls(order); const swapCalls = quoteToCalls(quote, slippage, account.address); await account.execute([...swapCalls, ...dcaCalls]); ``` ## Parameters ### Create Recurring Buy Order The recurring buy order configuration object. Token to spend (e.g., USDC address) Token to accumulate (e.g., STRK address) Total budget to spend (in smallest unit, e.g., wei) Amount to spend per execution (in smallest unit) Time between purchases (using `moment` Duration) Optional price limits. If the price is outside these bounds, the trade is skipped. Minimum amount of buy tokens to receive per cycle (slippage protection) Maximum amount of buy tokens to receive per cycle (limit price) Address of the user creating the order ## Execution Details **Automated execution:** * avnu executors monitor all active orders * Trades execute within 5 minutes of scheduled time * Each trade uses solver routing for best price * Failed trades are retried automatically **Fully Gas Free:** avnu covers all gas fees for recurring buy execution. Users pay 0 gas for their automated purchases. **MEV Protection & Safety:** * **Randomized Execution:** We introduce randomness in execution triggering to proactively avoid potential MEV attacks. * **Price Impact Guard:** There is a by-design **5% price impact safety limit**. If a trade would cause >5% price impact, it will fail to protect the user. **Constraints:** * Minimum interval: 1 hour * Maximum executions: 1000 per order ## Examples ### Weekly STRK Accumulation \$100 of STRK every week for 12 weeks: ```typescript theme={null} import { executeCreateDca } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; import moment from 'moment'; const result = await executeCreateDca({ provider: account, // Starknet AccountInterface order: { sellTokenAddress: USDC_ADDRESS, buyTokenAddress: STRK_ADDRESS, sellAmount: parseUnits('1200', 6).toString(), // Total budget: 1200 USDC sellAmountPerCycle: parseUnits('100', 6).toString(), // $100 per buy frequency: moment.duration(1, 'week'), // Frequency using moment pricingStrategy: { tokenToMinAmount: parseUnits('200', 18).toString(), // Min 200 STRK per 100 USDC (Max price ~0.50 USDC/STRK) tokenToMaxAmount: parseUnits('250', 18).toString(), // Max 250 STRK per 100 USDC (Min price ~0.40 USDC/STRK) }, traderAddress: account.address } }); console.log('Recurring Buy Order Created:', result.transactionHash); ``` ### Cancel an Order ```typescript theme={null} import { executeCancelDca } from '@avnu/avnu-sdk'; const result = await executeCancelDca({ provider: account, orderAddress: '0x...' // The address of the recurring buy order contract }); console.log('Recurring Buy Order Cancelled:', result.transactionHash); ``` ### Fetch Active Orders ```typescript theme={null} import { getDcaOrders, DcaOrderStatus } from '@avnu/avnu-sdk'; const orders = await getDcaOrders({ traderAddress: account.address, status: DcaOrderStatus.ACTIVE, page: 0, size: 10 }); console.log('Active Orders:', orders.content); ``` ## API Reference Complete HTTP endpoint reference and integration guide → ## Advanced Features Step-by-step production integration # Integration Guide Source: https://docs.avnu.fi/docs/dca/integration-guide Recurring Buy integration guide ## Overview Integrating Recurring Buy involves managing the lifecycle of an order: 1. **Creation**: Execute the recurring buy order transaction (Standard or Advanced). 2. **Monitoring**: Fetch active orders to display in your UI. 3. **Cancellation**: Allow users to close orders and retrieve remaining funds. ## SDK Integration Flows The SDK provides two methods for creating recurring buy orders, depending on your needs: ### 1. Standard Flow (`executeCreateDca`) Use this for a simple, standalone recurring buy creation. * **Handles everything**: Automatically checks allowance, builds the approval transaction (if needed), and executes the recurring buy creation. * **Best for**: Standard UIs where the user just wants to "Create Order". ### 2. Advanced Flow (`createDcaToCalls`) Use this when you need to compose the recurring buy creation with other actions (multicall). * **Returns Calls**: Generates the necessary Starknet `Call` objects (including approval if needed). * **Flexible**: You can bundle these calls with other transactions (e.g., a swap or a deposit) and execute them atomically. * **Best for**: Complex flows, batching transactions, or using a custom account implementation. ## 1. Creating an Order Use `executeCreateDca` to create the order. Ensure you import `moment` for the frequency. ```typescript theme={null} import { executeCreateDca } from '@avnu/avnu-sdk'; import moment from 'moment'; const response = await executeCreateDca({ provider: account, order: { sellTokenAddress: '0x...', buyTokenAddress: '0x...', sellAmount: '1000000000000000000', // 1 ETH sellAmountPerCycle: '100000000000000000', // 0.1 ETH frequency: moment.duration(1, 'day'), pricingStrategy: {}, traderAddress: account.address } }); ``` ## 2. Monitoring Orders Use `getDcaOrders` to fetch a user's orders. You can filter by status: * `INDEXING` - Order is being indexed after creation (temporary) * `ACTIVE` - Order is currently executing * `CLOSED` - Order completed or cancelled ```typescript theme={null} import { getDcaOrders, DcaOrderStatus } from '@avnu/avnu-sdk'; const { content: orders } = await getDcaOrders({ traderAddress: account.address, status: DcaOrderStatus.ACTIVE, page: 0, size: 20, sort: 'timestamp,desc' }); orders.forEach(order => { console.log(`Order ${order.id}: ${order.amountSold} sold, ${order.amountBought} bought`); }); ``` ## 3. Cancelling an Order Users can cancel active orders to stop execution and retrieve unspent funds. ```typescript theme={null} import { executeCancelDca } from '@avnu/avnu-sdk'; await executeCancelDca({ provider: account, orderAddress: order.orderAddress // From the order object }); ``` # Overview Source: https://docs.avnu.fi/docs/index Complete documentation for building on avnu ## SDK Philosophy The avnu SDK is organized into three categories: * **Data Fetching (`get*` methods)**: Essential for all integrations. Fetch quotes, orders, tokens, and market data. Examples: `getQuotes()`, `getDcaOrders()`, `getTokens()`, `getMarketData()` * **Simple Integration (`execute*` methods)**: One-call solutions that handle everything automatically - approvals, building calls, and execution. Examples: `executeSwap()`, `executeCreateDca()`, `executeStake()` * **Advanced Integration (`*ToCalls` methods)**: Build Call\[] objects for custom flows, multicalls, or manual execution. Examples: `quoteToCalls()`, `createDcaToCalls()`, `stakeToCalls()` ## Products Solver-optimized swaps that tackle complex routing problems in real-time to maximize net output. Recurring token purchases with automated execution and flexible scheduling. Let users pay gas in any token, or sponsor their transactions entirely. Real-time prices, liquidity depth, and volume data for all Starknet tokens. Verified token metadata, logos, and contract addresses. ## Smart contracts List all related avnu smart contracts(swap, staking, dca, ...) ## Resources REST API documentation TypeScript/JavaScript SDK Complete avnu dApp integration Telegram community ## AI Assistance We provide a `CLAUDE.md` file in our SDK repository. Use it to give your AI assistant full context on our codebase and patterns. # Get Market Data Source: https://docs.avnu.fi/docs/markets/get-market-data Fetch market data for all tokens using the SDK ## Overview Get comprehensive market data for all verified tokens on Starknet, including prices, volume, market cap, and price changes. Perfect for building token lists, market screeners, and portfolio trackers. ## SDK Method ```typescript theme={null} getMarketData( options?: AvnuOptions ): Promise ``` ## Parameters Optional SDK configuration Custom Impulse API base URL (default: `https://starknet.impulse.avnu.fi`) Public key for response verification ## Returns Returns `Promise` - Array of market data for all tokens. ```typescript theme={null} interface TokenMarketData { address: string; name: string; symbol: string; decimals: number; logoUri?: string | null; coingeckoId?: string | null; verified: boolean; tags: TokenTag[]; // defaults to [] linePriceFeedInUsd: DataPoint[]; starknet: StarknetMarket; global: GlobalMarket | null; } interface StarknetMarket { usd: number; usdTvl: number; usdPriceChange1h: number; usdPriceChangePercentage1h: number | null; usdPriceChange24h: number; usdPriceChangePercentage24h: number | null; usdPriceChange7d: number; usdPriceChangePercentage7d: number | null; usdVolume24h: number; usdTradingVolume24h: number; } interface GlobalMarket { usd: number; usdMarketCap: number; usdFdv: number; usdMarketCapChange24h: number; usdMarketCapChangePercentage24h: number; } interface DataPoint { date: string; value: number; } ``` ## Example ```typescript Basic Usage theme={null} import { getMarketData } from '@avnu/avnu-sdk'; const marketData = await getMarketData(); console.log(`Total tokens: ${marketData.length}`); // Display top 10 by market cap const topByMarketCap = marketData .filter(t => t.global?.usdMarketCap) .sort((a, b) => (b.global?.usdMarketCap || 0) - (a.global?.usdMarketCap || 0)) .slice(0, 10); topByMarketCap.forEach((token, i) => { console.log(`${i + 1}. ${token.symbol}: $${token.starknet.usd.toFixed(2)}`); console.log(` Market Cap: $${((token.global?.usdMarketCap || 0) / 1e6).toFixed(2)}M`); console.log(` 24h Change: ${token.starknet.usdPriceChangePercentage24h?.toFixed(2) || 'N/A'}%`); }); ``` ## Related Get detailed data for a specific token Fetch historical price data REST API endpoints Learn about Markets API # Get Price Feed Source: https://docs.avnu.fi/docs/markets/get-price-feed Fetch historical price data for charting and analysis using the SDK ## Overview Get historical price data for any token with customizable time ranges and resolutions. Returns line or candlestick data perfect for building price charts, analyzing trends, and backtesting strategies. ## SDK Method ```typescript theme={null} getPriceFeed( tokenAddress: string, feedProps: PriceFeedProps, quoteTokenAddress?: string, options?: AvnuOptions ): Promise ``` ## Parameters Token contract address to get price history for Price feed configuration Data format: `PriceFeedType.LINE` or `PriceFeedType.CANDLE` Time period: * `FeedDateRange.ONE_HOUR` * `FeedDateRange.ONE_DAY` * `FeedDateRange.ONE_WEEK` * `FeedDateRange.ONE_MONTH` * `FeedDateRange.ONE_YEAR` Data point frequency: * `FeedResolution.ONE_MIN` - 1 minute * `FeedResolution.FIVE_MIN` - 5 minutes * `FeedResolution.FIFTEEN_MIN` - 15 minutes * `FeedResolution.HOURLY` - 1 hour * `FeedResolution.FOUR_HOUR` - 4 hours * `FeedResolution.DAILY` - 1 day * `FeedResolution.WEEKLY` - 1 week Quote currency address (defaults to USD). Use ETH address for ETH-denominated prices. Optional SDK configuration ## Returns Returns `Promise` for LINE type or `Promise` for CANDLE type. ```typescript theme={null} // LINE type response interface DataPoint { date: string; // ISO 8601 timestamp value: number; // Price value } // CANDLE type response interface CandleDataPoint { date: string; // ISO 8601 timestamp open: number; high: number; low: number; close: number; volume: number; } ``` ## Examples ```typescript Line Chart Data theme={null} import { getPriceFeed, PriceFeedType, FeedDateRange, FeedResolution } from '@avnu/avnu-sdk'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; // Get 7-day price history with 1-hour resolution const priceData = await getPriceFeed( ETH, { type: PriceFeedType.LINE, dateRange: FeedDateRange.ONE_WEEK, resolution: FeedResolution.HOURLY } ); console.log(`Fetched ${priceData.length} data points`); priceData.forEach(point => { console.log(`${point.date}: $${point.value.toFixed(2)}`); }); // Calculate price statistics const prices = priceData.map(p => p.value); const avgPrice = prices.reduce((a, b) => a + b) / prices.length; const maxPrice = Math.max(...prices); const minPrice = Math.min(...prices); console.log(`7-day Stats: Avg: $${avgPrice.toFixed(2)}, High: $${maxPrice.toFixed(2)}, Low: $${minPrice.toFixed(2)}`); ``` ```typescript Candlestick Data theme={null} import { getPriceFeed, PriceFeedType, FeedDateRange, FeedResolution } from '@avnu/avnu-sdk'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; // Get 30-day candlestick data with daily resolution const candleData = await getPriceFeed( ETH, { type: PriceFeedType.CANDLE, dateRange: FeedDateRange.ONE_MONTH, resolution: FeedResolution.DAILY } ); candleData.forEach(candle => { const color = candle.close > candle.open ? '🟢' : '🔴'; console.log(`${color} ${candle.date}`); console.log(` O: $${candle.open.toFixed(2)} H: $${candle.high.toFixed(2)}`); console.log(` L: $${candle.low.toFixed(2)} C: $${candle.close.toFixed(2)}`); }); ``` ```typescript ETH-Denominated Prices theme={null} import { getPriceFeed, PriceFeedType, FeedDateRange, FeedResolution } from '@avnu/avnu-sdk'; const USDC = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; // Get USDC price in ETH terms const usdcInEth = await getPriceFeed( USDC, { type: PriceFeedType.LINE, dateRange: FeedDateRange.ONE_DAY, resolution: FeedResolution.HOURLY }, ETH // Quote in ETH instead of USD ); usdcInEth.forEach(point => { console.log(`${point.date}: ${point.value.toFixed(6)} ETH`); }); ``` ## Resolution Guidelines **Recommended resolutions by time range:** | Time Range | Best Resolution | Data Points | | ---------- | --------------- | ------------- | | 1 hour | 1 or 5 min | 12-60 points | | 1 day | 5 or 15 min | 96-288 points | | 1 week | 1 hour | 168 points | | 1 month | 4 hour or 1 day | 30-180 points | | 1 year | 1 day or 1 week | 52-365 points | ## Related Get current market data for all tokens Get detailed data for a specific token REST API price history endpoint Learn about Markets API # Get Token Data Source: https://docs.avnu.fi/docs/markets/get-token-data Fetch market data for a specific token using the SDK ## Overview Get detailed market data for a specific token including current price, volume, market cap, price changes, and TVL. Use this for token detail pages, price widgets, and portfolio tracking. ## SDK Method ```typescript theme={null} getTokenMarketData( tokenAddress: string, options?: AvnuOptions ): Promise ``` ## Parameters Token contract address (hex format with 0x prefix) Optional SDK configuration Custom Impulse API base URL (default: `https://starknet.impulse.avnu.fi`) Public key for response verification ## Returns Returns `Promise` - Market data for the specified token. ```typescript theme={null} interface TokenMarketData { address: string; name: string; symbol: string; decimals: number; logoUri?: string | null; coingeckoId?: string | null; verified: boolean; tags: TokenTag[]; // defaults to [] linePriceFeedInUsd: DataPoint[]; starknet: StarknetMarket; global: GlobalMarket | null; } interface StarknetMarket { usd: number; usdTvl: number; usdPriceChange1h: number; usdPriceChangePercentage1h: number | null; usdPriceChange24h: number; usdPriceChangePercentage24h: number | null; usdPriceChange7d: number; usdPriceChangePercentage7d: number | null; usdVolume24h: number; usdTradingVolume24h: number; } interface GlobalMarket { usd: number; usdMarketCap: number; usdFdv: number; usdMarketCapChange24h: number; usdMarketCapChangePercentage24h: number; } interface DataPoint { date: string; value: number; } ``` ## Examples ```typescript Basic Usage theme={null} import { getTokenMarketData } from '@avnu/avnu-sdk'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const ethData = await getTokenMarketData(ETH); console.log(`${ethData.symbol} (${ethData.name})`); console.log(`Price: $${ethData.starknet.usd.toFixed(2)}`); console.log(`Market Cap: $${((ethData.global?.usdMarketCap || 0) / 1e9).toFixed(2)}B`); console.log(`24h Volume: $${(ethData.starknet.usdVolume24h / 1e6).toFixed(2)}M`); console.log(`24h Change: ${ethData.starknet.usdPriceChangePercentage24h?.toFixed(2) || 'N/A'}%`); console.log(`TVL: $${(ethData.starknet.usdTvl / 1e6).toFixed(2)}M`); ``` ## Related Get data for all tokens Fetch historical price data REST API endpoints Learn about Markets API # Get TVL Data Source: https://docs.avnu.fi/docs/markets/get-tvl-data Fetch Total Value Locked data by exchange using the SDK ## Overview Get TVL (Total Value Locked) data for a token across different exchanges. Two functions are available: TVL snapshot by exchange at a specific date and historical TVL feed. ## SDK Methods ### getTVLByExchange Get TVL snapshot distribution across exchanges at a specific date. ```typescript theme={null} getTVLByExchange( tokenAddress: string, simpleDateProps: SimpleDateProps, options?: AvnuOptions ): Promise ``` ### getExchangeTVLFeed Get historical TVL data over time with configurable resolution. ```typescript theme={null} getExchangeTVLFeed( tokenAddress: string, feedProps: FeedProps, options?: AvnuOptions ): Promise ``` ## Parameters Token contract address Date configuration for snapshot Optional date for snapshot (defaults to current date). Can be ISO 8601 string or Date object. Feed configuration with resolution `ONE_HOUR`, `ONE_DAY`, `ONE_WEEK`, `ONE_MONTH`, `ONE_YEAR` `ONE_MIN`, `FIVE_MIN`, `FIFTEEN_MIN`, `HOURLY`, `FOUR_HOUR`, `DAILY`, `WEEKLY` ## Returns ```typescript theme={null} interface ExchangeDataPoint { date: string; value: number; valueUsd: number; exchange: string; } ``` ## Examples ```typescript TVL Snapshot by Exchange theme={null} import { getTVLByExchange } from '@avnu/avnu-sdk'; const USDC = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'; // Get current TVL snapshot (no date = now) const tvlData = await getTVLByExchange(USDC, {}); // Calculate total TVL and display distribution const totalTvl = tvlData.reduce((sum, item) => sum + item.valueUsd, 0); tvlData .sort((a, b) => b.valueUsd - a.valueUsd) .forEach(item => { const share = (item.valueUsd / totalTvl) * 100; console.log(`${item.exchange}: $${item.valueUsd.toLocaleString()} (${share.toFixed(1)}%)`); }); ``` ```typescript Historical TVL Snapshot theme={null} import { getTVLByExchange } from '@avnu/avnu-sdk'; const USDC = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'; // Get TVL at a specific date const tvlData = await getTVLByExchange( USDC, { date: '2024-01-01' } ); console.log(`TVL snapshot for ${tvlData[0]?.date || '2024-01-01'}:`); tvlData.forEach(item => { console.log(`${item.exchange}: $${item.valueUsd.toLocaleString()}`); }); ``` ```typescript Historical TVL Feed theme={null} import { getExchangeTVLFeed, FeedDateRange, FeedResolution } from '@avnu/avnu-sdk'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const tvlFeed = await getExchangeTVLFeed( ETH, { dateRange: FeedDateRange.ONE_WEEK, resolution: FeedResolution.DAILY } ); // Group by exchange for charting const byExchange = tvlFeed.reduce((acc, item) => { if (!acc[item.exchange]) acc[item.exchange] = []; acc[item.exchange].push({ date: item.date, value: item.valueUsd }); return acc; }, {} as Record); console.log(`Exchanges tracked: ${Object.keys(byExchange).join(', ')}`); ``` ## Related Get trading volume by exchange REST API endpoint # Get Volume Data Source: https://docs.avnu.fi/docs/markets/get-volume-data Fetch trading volume data by exchange using the SDK ## Overview Get trading volume data for a token across different exchanges. Three functions are available: aggregated volume by exchange, historical volume feed per exchange, and transfer volume. ## SDK Methods ### getVolumeByExchange Get aggregated volume distribution across exchanges for a date range. ```typescript theme={null} getVolumeByExchange( tokenAddress: string, simpleProps: SimpleFeedProps, options?: AvnuOptions ): Promise ``` ### getExchangeVolumeFeed Get historical volume data over time with configurable resolution, broken down by exchange. ```typescript theme={null} getExchangeVolumeFeed( tokenAddress: string, feedProps: FeedProps, options?: AvnuOptions ): Promise ``` ### getTransferVolumeFeed Get historical transfer volume (all on-chain transfers, not just DEX trades). ```typescript theme={null} getTransferVolumeFeed( tokenAddress: string, feedProps: FeedProps, options?: AvnuOptions ): Promise ``` ## Parameters Token contract address Date range configuration `ONE_HOUR`, `ONE_DAY`, `ONE_WEEK`, `ONE_MONTH`, `ONE_YEAR` Feed configuration with resolution `ONE_HOUR`, `ONE_DAY`, `ONE_WEEK`, `ONE_MONTH`, `ONE_YEAR` `ONE_MIN`, `FIVE_MIN`, `FIFTEEN_MIN`, `HOURLY`, `FOUR_HOUR`, `DAILY`, `WEEKLY` ## Returns ```typescript theme={null} // getVolumeByExchange response interface ExchangeRangeDataPoint { value: number; valueUsd: number; exchange: string; startDate: string; endDate: string; } // getExchangeVolumeFeed response interface ExchangeDataPoint { date: string; value: number; valueUsd: number; exchange: string; } // getTransferVolumeFeed response interface DataPointWithUsd { date: string; value: number; valueUsd: number; } ``` ## Examples ```typescript Volume by Exchange theme={null} import { getVolumeByExchange, FeedDateRange } from '@avnu/avnu-sdk'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const volumeData = await getVolumeByExchange( ETH, { dateRange: FeedDateRange.ONE_WEEK } ); // Each entry represents an exchange's volume for the period volumeData.forEach(item => { console.log(`${item.exchange}: $${item.valueUsd.toLocaleString()}`); console.log(` Period: ${item.startDate} to ${item.endDate}`); }); // Calculate total volume const totalVolume = volumeData.reduce((sum, item) => sum + item.valueUsd, 0); console.log(`Total Volume: $${totalVolume.toLocaleString()}`); ``` ```typescript Historical Volume Feed theme={null} import { getExchangeVolumeFeed, FeedDateRange, FeedResolution } from '@avnu/avnu-sdk'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const volumeFeed = await getExchangeVolumeFeed( ETH, { dateRange: FeedDateRange.ONE_DAY, resolution: FeedResolution.HOURLY } ); console.log(`${volumeFeed.length} data points`); // Group by exchange for charting const byExchange = volumeFeed.reduce((acc, item) => { if (!acc[item.exchange]) acc[item.exchange] = []; acc[item.exchange].push({ date: item.date, value: item.valueUsd }); return acc; }, {} as Record); Object.entries(byExchange).forEach(([exchange, data]) => { console.log(`${exchange}: ${data.length} points`); }); ``` ```typescript Transfer Volume theme={null} import { getTransferVolumeFeed, FeedDateRange, FeedResolution } from '@avnu/avnu-sdk'; const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'; const transferVolume = await getTransferVolumeFeed( ETH, { dateRange: FeedDateRange.ONE_WEEK, resolution: FeedResolution.DAILY } ); transferVolume.forEach(item => { console.log(`${item.date}: $${item.valueUsd.toLocaleString()}`); }); ``` ## Related Get liquidity data by exchange REST API endpoint # Overview Source: https://docs.avnu.fi/docs/markets/index Token prices and market data on Starknet Access price feeds, liquidity metrics, and trading volume directly from Starknet—no external oracles needed. Updated every minute Sourced from avnu Liquidity Graph Per-DEX volume and TVL **Display & Analytics Only:** Market data is intended for display purposes and analytics only. Do not use this data for automated decision-making or trading strategies, as it does not benefit from active monitoring or guaranteed uptime. ## How It Works Markets API uses the **avnu Liquidity Graph** - a real-time index of all liquidity pools on Starknet, updated every block. Monitors all supported AMM pools at every block: * Pool reserves and liquidity depth * Token pair information * Real-time state updates * Provide both global market price (if available) & starknet market price For tokens without direct ETH or USDC pairs: * Chain through multiple tokens * Example: TOKEN → STRK → ETH → USDC * Calculate final price via intermediate hops Prices and metrics refresh every minute. Historical data available with configurable resolution. ## Feed pricing methodology Token prices are computed through a two-step process: 1. **Starknet Price Feed** - Calculates token prices in ETH using the avnu Liquidity Graph (on-chain pool states) 2. **External ETH/USD Price** - Combined with the above to derive final USD valuations ### Pool Price Estimation Rather than using marginal pool prices (which suffer from price impact and arbitrage), avnu samples swap functions using a combination of fix-point approximations and sampling to minimize distortion. ### Final Price Calculation For a given asset pair, each pool trading these assets is priced and the median of these prices is defined as the current Starknet price for the given pair. ### Indirect Pricing For tokens without direct ETH pairs: 1. Find the largest connected pool (e.g., TOKEN → STRK) 2. Compute: `Price(TOKEN→ETH) = Price(TOKEN→STRK) × Price(STRK→ETH)` 3. Repeat recursively until reaching ETH ## Quick Start ```typescript Get market verified Tokens theme={null} import { getMarketData } from '@avnu/avnu-sdk'; const tokens = await getMarketData(); tokens.forEach(token => { console.log({ symbol: token.symbol, price: token.starknet.usd, marketCap: token.global?.usdMarketCap, volume24h: token.starknet.usdVolume24h, priceChange24h: token.starknet.usdPriceChangePercentage24h, }); }); ``` ## Use Cases Display real-time token prices and portfolio values without external API dependencies Build price charts, volume analysis, and market screeners with historical data Calculate TVL, track liquidity, and monitor token prices for lending and yield farming Analyze exchange dominance, liquidity trends, and trading patterns across Starknet ## Related Trade tokens at best prices Get verified token metadata Automate recurring buys View Markets on avnu app # Migrate from v3 to v4 Source: https://docs.avnu.fi/docs/migration/sdk-v4-migration Migrate from avnu SDK v3 to v4 - Breaking changes, new features, and step-by-step guide. avnu SDK v4 introduces significant improvements including a new paymaster architecture leveraging starknet.js, streamlined function naming, enhanced type safety with Zod validation, and new services for market data and staking. If you encounter any missing changes, please [let us know](https://t.me/avnu_developers) and we will update this guide. This guide covers **breaking changes** that require code modifications. Review each section carefully before upgrading. ## Quick Summary * **Function Renaming**: `fetch*` functions renamed to `get*` (e.g., `fetchQuotes` → `getQuotes`) * **Paymaster Architecture**: Now uses starknet.js `PaymasterInterface` instead of SDK-internal handling * **`executeSwap` Signature**: Changed from positional arguments to a single params object * **DCA Service**: Refactored with new `*ToCalls` + `execute*` pattern * **Type Changes**: `Quote`, `Route`, `Page`, and other types have structural changes * **Slippage**: Now expressed as decimal (0.01 = 1%) consistently ## Prerequisites Before migrating, ensure you have: ```bash theme={null} # Update starknet.js to v8.9+ (required for PaymasterInterface) npm install starknet@^8.9.1 # Update the SDK npm install @avnu/avnu-sdk@^4.0.0 ``` Node.js >= 22 is required for SDK v4.0.0. ## Breaking Changes ### Swap Service #### Function Renaming | v3 Function | v4 Function | Notes | | :------------------------------- | :----------------------------- | :------------------------- | | `fetchQuotes()` | `getQuotes()` | Same functionality | | `fetchSources()` | `getSources()` | Same functionality | | `fetchBuildExecuteTransaction()` | `quoteToCalls()` | Returns `AvnuCalls` | | `calculateMinAmount()` | `calculateMinReceivedAmount()` | Slippage semantics changed | #### New Function * `calculateMaxSpendAmount(amount, slippage)` - Calculate max spend amount for exactTokenTo swaps #### Removed Functions * `fetchPrices()` - Use `getQuotes()` or the new Impulse service `getPrices()` * `fetchBuildSwapTypedData()` - Paymaster flow refactored * `fetchExecuteSwapTransaction()` - Paymaster flow refactored #### `executeSwap` Signature Change ```typescript v3 theme={null} import { executeSwap } from '@avnu/avnu-sdk'; const response = await executeSwap( account, // AccountInterface quote, // Quote { // ExecuteSwapOptions executeApprove: true, slippage: 0.005, }, { baseUrl: '...' } // AvnuOptions ); ``` ```typescript v4 theme={null} import { executeSwap } from '@avnu/avnu-sdk'; const response = await executeSwap( { // InvokeSwapParams provider: account, // AccountInterface quote, // Quote slippage: 0.005, // Required (decimal: 0.005 = 0.5%) executeApprove: true, }, { baseUrl: '...' } // AvnuOptions ); ``` #### `quoteToCalls` Change ```typescript v3 theme={null} import { fetchBuildExecuteTransaction } from '@avnu/avnu-sdk'; const { calls } = await fetchBuildExecuteTransaction( quoteId, takerAddress, slippage, true // includeApprove ); ``` ```typescript v4 theme={null} import { quoteToCalls } from '@avnu/avnu-sdk'; const { calls, chainId } = await quoteToCalls({ quoteId, slippage: 0.005, takerAddress, // optional executeApprove: true, }); ``` ### DCA Service The DCA service has been refactored with a new pattern separating call building from execution. #### Function Renaming | v3 Function | v4 Function | | :--------------------- | :------------------- | | `fetchGetOrders()` | `getDcaOrders()` | | `fetchCreateOrder()` | `createDcaToCalls()` | | `fetchCancelOrder()` | `cancelDcaToCalls()` | | `executeCreateOrder()` | `executeCreateDca()` | | `executeCancelOrder()` | `executeCancelDca()` | #### Removed Functions These low-level functions have been removed in favor of the new pattern: * `fetchEstimateFeeCreateOrder()` * `fetchEstimateFeeCancelOrder()` * `fetchBuildCreateOrderTypedData()` * `fetchBuildCancelOrderTypedData()` * `fetchExecuteCreateOrder()` * `fetchExecuteCancelOrder()` #### Type Renaming | v3 Type | v4 Type | | :---------------- | :------------------- | | `CreateOrderDto` | `CreateDcaOrder` | | `OrderReceipt` | `DcaOrder` | | `OrderStatus` | `DcaOrderStatus` | | `Trade` | `DcaTrade` | | `TradeStatus` | `DcaTradeStatus` | | `GetOrdersParams` | `GetDcaOrdersParams` | #### DCA Migration Example ```typescript v3 theme={null} import { executeCreateOrder, fetchGetOrders } from '@avnu/avnu-sdk'; // Get orders const orders = await fetchGetOrders({ traderAddress }); // Create order const response = await executeCreateOrder( account, order, { gasless: true, gasTokenAddress: '0x...' } ); ``` ```typescript v4 theme={null} import { executeCreateDca, getDcaOrders } from '@avnu/avnu-sdk'; // Get orders const orders = await getDcaOrders({ traderAddress }); // Create order const response = await executeCreateDca({ provider: account, order, // Paymaster now uses starknet.js PaymasterInterface }); ``` ### Paymaster (Critical Change) The paymaster architecture has fundamentally changed. V3's built-in gasless handling has been replaced with starknet.js `PaymasterInterface` integration. #### v3 Approach (Removed) In v3, gasless transactions were handled internally by the SDK: ```typescript theme={null} // v3 - NO LONGER WORKS const response = await executeSwap(account, quote, { gasless: true, gasTokenAddress: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', maxGasTokenAmount: BigInt('1000000000000000000'), }); ``` #### v4 Approach (New) In v4, you must use a `PaymasterInterface` from starknet.js: ```typescript theme={null} import { executeSwap } from '@avnu/avnu-sdk'; // PaymasterInterface comes from starknet.js import { PaymasterInterface } from 'starknet'; // Create your paymaster provider (implementation depends on your setup) const paymasterProvider: PaymasterInterface = /* your paymaster implementation */; const response = await executeSwap({ provider: account, quote, slippage: 0.005, paymaster: { active: true, provider: paymasterProvider, params: executionParams, // ExecutionParameters from starknet.js }, }); ``` #### New Paymaster Functions The SDK now exposes dedicated paymaster functions for advanced use cases: * `buildPaymasterTransaction()` - Build a transaction for the paymaster * `signPaymasterTransaction()` - Sign the typed data * `executePaymasterTransaction()` - Execute the signed transaction * `executeAllPaymasterFlow()` - Helper that chains all three steps For detailed paymaster configuration, refer to the [starknet.js documentation](https://www.starknetjs.com/docs/guides/outsideExecution) and the [AVNU Paymaster docs](/docs/paymaster/index). ### Token Service The token service has minimal breaking changes. New functions have been added: * `fetchTokenByAddress(tokenAddress)` - Get a specific token by address * `fetchVerifiedTokenBySymbol(symbol)` - Get a verified token by symbol ### Type Changes #### `Quote` Type ```typescript theme={null} // v3 interface Quote { buyAmountWithoutFees: bigint; buyAmountWithoutFeesInUsd: number; gasFees: bigint; gasFeesInUsd: number; avnuFees: bigint; avnuFeesInUsd: number; avnuFeesBps: bigint; integratorFees: bigint; integratorFeesInUsd: number; integratorFeesBps: bigint; liquiditySource: string; gasless: Gasless; // ... } // v4 interface Quote { fee: Fee; // Consolidated fee structure priceImpact: number; // New estimatedSlippage?: number; // New gasFees: bigint; gasFeesInUsd?: number; // Now optional // ... } interface Fee { feeToken: string; avnuFees: bigint; avnuFeesInUsd: number; avnuFeesBps: bigint; integratorFees: bigint; integratorFeesInUsd: number; integratorFeesBps: bigint; } ``` #### `Route` Type ```typescript theme={null} // v3 interface Route { routeInfo?: Map; // ... } // v4 interface Route { routeInfo?: Record; // Changed from Map to Record alternativeSwapCount: number; // New field // ... } ``` #### `Source` Type ```typescript theme={null} // v3 interface Source { name: string; address: string; // Removed in v4 icon?: string; // Removed in v4 type: SourceType; } // v4 interface Source { name: string; type: SourceType; } ``` #### `SourceType` Enum ```typescript theme={null} // v3 enum SourceType { DEX = 'DEX', MARKET_MAKER = 'MARKET_MAKER', SOLVER = 'SOLVER', // Removed in v4 ORDERBOOK = 'ORDERBOOK', } // v4 enum SourceType { DEX = 'DEX', MARKET_MAKER = 'MARKET_MAKER', TOKEN_WRAPPER = 'TOKEN_WRAPPER', // New ORDERBOOK = 'ORDERBOOK', } ``` #### `Page` Type ```typescript theme={null} // v3 interface Page { content: T[]; totalPages: number; totalElements: number; size: number; number: number; // Field name in v3 } // v4 interface Page { content: T[]; totalPages: number; totalElements: number; size: number; page: number; // Renamed from 'number' to 'page' } ``` ### Slippage Semantics Slippage is now consistently expressed as a **decimal** value. | Value | Meaning | | :------ | :------------ | | `0.001` | 0.1% slippage | | `0.005` | 0.5% slippage | | `0.01` | 1% slippage | | `0.05` | 5% slippage | ```typescript theme={null} // Correct usage in v4 const minReceived = calculateMinReceivedAmount(amount, 0.005); // 0.5% slippage const maxSpend = calculateMaxSpendAmount(amount, 0.01); // 1% slippage ``` ### Gas Fees Denomination Gas fees are now denominated in **STRK** instead of **ETH**. In v3, the `gasFees` field in quotes was denominated in ETH (WEI). Starting from v4, gas fees are denominated in STRK (FRI). ```typescript theme={null} // v3 - Gas fees in ETH (WEI) const gasFeesInEth = quote.gasFees; // BigInt in WEI // v4 - Gas fees in STRK (FRI) const gasFeesInStrk = quote.gasFees; // BigInt in FRI ``` ## New Features (Non-Breaking) ### Impulse Service (Market Data) New service for market data, prices, volume, and TVL: ```typescript theme={null} import { getMarketData, getTokenMarketData, getPriceFeed, getPrices, getVolumeByExchange, getTVLByExchange, FeedDateRange, PriceFeedType, FeedResolution, } from '@avnu/avnu-sdk'; // Get popular tokens with market data const marketData = await getMarketData(); // Get price feed for a token const priceFeed = await getPriceFeed( tokenAddress, { type: PriceFeedType.CANDLE, dateRange: FeedDateRange.ONE_DAY, resolution: FeedResolution.HOURLY, } ); ``` ### Staking Service New service for AVNU stake delegation: ```typescript theme={null} import { getAvnuStakingInfo, getUserStakingInfo, stakeToCalls, executeStake, } from '@avnu/avnu-sdk'; // Get staking info const stakingInfo = await getAvnuStakingInfo(); // Stake tokens const response = await executeStake({ provider: account, poolAddress: '0x...', amount: BigInt('1000000000000000000'), }); ``` ### Zod Validation All API responses are now validated and transformed using Zod schemas: * Automatic hex string to BigInt conversion * Automatic ISO string to Date conversion * Runtime type safety ## Migration Checklist ```bash theme={null} npm install @avnu/avnu-sdk@^4.0.0 starknet@^6.0.0 ``` Replace `fetch*` imports with `get*`: ```typescript theme={null} // Before import { fetchQuotes, fetchSources } from '@avnu/avnu-sdk'; // After import { getQuotes, getSources } from '@avnu/avnu-sdk'; ``` Change from positional arguments to params object: ```typescript theme={null} // Before executeSwap(account, quote, options, avnuOptions) // After executeSwap({ provider: account, quote, slippage, ...options }, avnuOptions) ``` If using gasless transactions, implement `PaymasterInterface` from starknet.js. Replace old DCA functions with new pattern: * `fetchGetOrders` → `getDcaOrders` * `executeCreateOrder` → `executeCreateDca` * `executeCancelOrder` → `executeCancelDca` * `Page.number` → `Page.page` * `Route.routeInfo` is now `Record` instead of `Map` * Access fees via `quote.fee` instead of individual fee fields Ensure all slippage values are decimals (0.01 = 1%). Run your test suite and verify all functionality works as expected. ## Troubleshooting The function has been renamed to `getQuotes`. Update your import: ```typescript theme={null} import { getQuotes } from '@avnu/avnu-sdk'; ``` The `Page` type's `number` field has been renamed to `page`: ```typescript theme={null} // Before const currentPage = result.number; // After const currentPage = result.page; ``` Gasless handling has moved to starknet.js `PaymasterInterface`. You need to: 1. Create a `PaymasterInterface` implementation 2. Pass it via the `paymaster` parameter See the [Paymaster section](#paymaster-critical-change) for details. Fee fields are now consolidated under `quote.fee`: ```typescript theme={null} // Before const fees = quote.avnuFees; // After const fees = quote.fee.avnuFees; ``` `routeInfo` changed from `Map` to `Record`: ```typescript theme={null} // Before (Map) const value = route.routeInfo?.get('key'); // After (Record) const value = route.routeInfo?.['key']; ``` ## Resources * [AVNU SDK GitHub Repository](https://github.com/avnu-labs/avnu-sdk) * [Dapp Example](https://github.com/avnu-labs/avnu-sdk/tree/develop/dapp-example) * [starknet.js Documentation](https://www.starknetjs.com/) * [AVNU Paymaster Documentation](/docs/paymaster/index) * [AVNU Developer Telegram](https://t.me/avnu_developers) # avnu paymaster Source: https://docs.avnu.fi/docs/paymaster/avnu avnu paymaster instance ## Endpoints | Environment | Paymaster URL | | ------------------- | ------------------------------------ | | **Mainnet** | `https://starknet.paymaster.avnu.fi` | | **Sepolia Testnet** | `https://sepolia.paymaster.avnu.fi` | ## Supported Tokens (avnu Instance) The avnu paymaster accepts the most liquid ERC-20 tokens on Starknet: **Stablecoins:** USDC, USDT, DAI **Native:** ETH, STRK **BTC Variants:** WBTC, solvBTC, LBTC, xWBTC, xtBTC **DeFi:** EKUBO, NSTR, LORDS **LST:** wstETH, Endur derivatives Token support is automatically updated based on trading volume and liquidity. Running your own instance gives you full control over accepted tokens. ## Monitoring Your Usage Track your sponsored transactions and gas costs using the [Sponsor Activity API](/api/paymaster/sponsor-activity): ```typescript theme={null} async function getSponsorActivity(apiKey: string) { const startDate = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(); const endDate = new Date().toISOString(); const params = new URLSearchParams({ startDate, endDate }); const response = await fetch( `https://starknet.api.avnu.fi/paymaster/v1/sponsor-activity?${params}`, { headers: { 'api-key': apiKey } } ); const stats = await response.json(); console.log('Total transactions:', stats.txCount); console.log('Successful:', stats.succeededTxCount); console.log('Reverted:', stats.revertedTxCount); console.log('STRK gas fees:', stats.strkGasFees); console.log('Remaining STRK credits:', stats.remainingStrkCredits); } ``` Set up alerts when `remainingStrkCredits` fall below a threshold to avoid service interruption. # Overview Source: https://docs.avnu.fi/docs/paymaster/index Gasless and gasfree transactions on Starknet **Paymaster** enables users to pay transaction fees in any ERC-20 token (gasless) or have fees fully sponsored by dApps (gasfree). Invented and standardized by avnu through [SNIP-9](https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-9.md) and [SNIP-29](https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-29.md), this removes the friction of requiring STRK for gas, dramatically improving user onboarding. The Propulsion Program covers your user's gas fees with monthly USD reimbursements **avnu pioneered paymaster on Starknet:** * Created the paymaster standard * Co-Authored SNIP-9 (Outside Execution) and SNIP-29 (Paymaster) with StarkWare, Ready and Braavos * Built the first production-ready implementation * Open-sourced the entire stack ## Two Options **Fastest path to production** * Production-ready infrastructure * No ops overhead * Supports top traded tokens * Optional Propulsion Program funding **Full control & customization** * Accept any ERC-20 as gas * Custom sponsorship logic * Self-hosted infrastructure * Open-source codebase ## Gasless vs Gasfree | Mode | Who Pays | User Experience | Requirements | | ----------- | ------------------------------------- | ------------------------ | --------------------- | | **Gasless** | User pays in USDC, USDT, or any token | No STRK needed for gas | No API key required | | **Gasfree** | You sponsor (dApp covers fees) | Completely free for user | avnu API key required | ## Gasless: User Pays in Tokens Users pay gas fees in any supported token instead of STRK. Perfect for wallets and apps where users hold stablecoins but no native tokens. ### Quick Example ```typescript theme={null} import { PaymasterRpc } from 'starknet'; import { executeSwap } from '@avnu/avnu-sdk'; const paymasterProvider = new PaymasterRpc({ nodeUrl: 'https://starknet.paymaster.avnu.fi', headers: { 'x-paymaster-api-key': process.env.AVNU_PAYMASTER_API_KEY }, // Only for sponsored mode }); // Gasless: User pays in USDC const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.005, // 0.5% paymaster: { active: true, provider: paymasterProvider, params: { version: '0x1', feeMode: { mode: 'default', gasToken: '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8' // USDC } } } }); ``` **No API key needed for gasless** - Users simply need sufficient token balance. ## Gasfree: You Sponsor Gas Your dApp covers all gas costs, providing a completely free experience for users. Ideal for onboarding, premium features, or when subsidized by the [Starknet Propulsion Program](/docs/paymaster/propulsion-program). ### Getting Started with Gasfree Fill out the integration form and join our developer community: 1. **Apply:** [Request an API key](https://forms.gle/D4f4Nj3hWVn5E9Yv7) Once you've filled the form, please follow up on [Telegram](https://t.me/avnu_developers) to expedite your request. 2. **Join Developer Groups:** * [Telegram Developers](https://t.me/avnu_developers) - Direct support channel You'll receive your API key within 2 business days after review. **Option 1: Propulsion Program (Recommended)** Apply for the [Starknet Propulsion Program](https://propulsion.starknet.org) to get up to **\$1M in gas fees covered** with monthly USD reimbursements. **Option 2: Self-Fund** The avnu team will reach out to you to deposit STRK into the paymaster balance in STRK tokens. Add your API key for sponsored transactions: ```typescript theme={null} import { PaymasterRpc } from 'starknet'; import { executeSwap } from '@avnu/avnu-sdk'; const paymasterProvider = new PaymasterRpc({ nodeUrl: 'https://starknet.paymaster.avnu.fi', headers: { 'x-paymaster-api-key': process.env.AVNU_PAYMASTER_API_KEY }, }); // Gasfree: You sponsor const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.005, // 0.5% paymaster: { active: true, provider: paymasterProvider, params: { version: '0x1', feeMode: { mode: 'sponsored' } } } }); ``` **Security:** Never expose API keys in frontend code. Use server-side proxy for gasfree transactions. ## Integration Guides Full integration guide: [starknetjs.com/docs/guides/account/paymaster](https://starknetjs.com/docs/guides/account/paymaster) Full integration guide: [starknet-react.com/docs/paymaster-providers](https://www.starknet-react.com/docs/paymaster-providers) Live demo: [starknet-react.com/demo](https://www.starknet-react.com/demo) ## Standards & SNIPs avnu created and maintains the paymaster standards for Starknet: Enables account abstraction and gasless transactions. Accounts must be SNIP-9 compatible to use paymaster. Defines the paymaster protocol for sponsored and alternative-token gas payments on Starknet. Both standards were authored and proposed by avnu to establish paymaster as a core Starknet primitive. ## Next Steps Learn more about avnu paymaster instance Apply for \$1M gas coverage # Propulsion Program Source: https://docs.avnu.fi/docs/paymaster/propulsion-program Get up to $1M in gas fee coverage from Starknet Foundation ## Overview The **Starknet Foundation Propulsion Program** provides gas fee reimbursements for projects building on Starknet, making gasfree transactions financially sustainable for growing dApps. Substantial gas fee reimbursements to support your growth Regular reimbursements in USD, not locked STRK Start sponsoring transactions without initial capital Coverage grows with your dApp's usage Submit your application to the Starknet Foundation → ## How It Works Apply at [propulsion.starknet.org](https://propulsion.starknet.org) with your project details and gas sponsorship use case. Request your API key from avnu and integrate gasfree transactions into your dApp. See [Integration Guides](/docs/paymaster/index#integration-guides). Contact us on [Telegram](https://t.me/avnu_developers) to get started with the Propulsion Program. Monitor your sponsored transactions via the [Paymaster Dashboard](/docs/paymaster/avnu#monitoring-your-usage). ## Perfect Use Cases Sponsor first transactions for new users to remove entry barriers Cover gas for liquidity providers to bootstrap TVL growth Enable seamless in-game transactions without crypto knowledge Increase voter participation by sponsoring voting transactions ## Get Started Submit your Propulsion Program application Get avnu Paymaster access Join our Telegram for quick help Explore paymaster documentation # Get Prices Source: https://docs.avnu.fi/docs/prices/get-prices Fetch current prices for multiple tokens using the SDK ## Overview Get real-time prices for up to 50 tokens in a single request. Returns both global market prices (CoinGecko) and Starknet on-chain prices. ## SDK Method ```typescript theme={null} getPrices( tokenAddresses: string[], options?: AvnuOptions ): Promise ``` ## Parameters Array of token contract addresses (1-50 tokens) Optional SDK configuration ## Returns ```typescript theme={null} interface TokenPrice { address: string; decimals: number; globalMarket: { usd: number } | null; // CoinGecko price starknetMarket: { usd: number } | null; // On-chain price } type TokenPriceResponse = TokenPrice[]; ``` ## Example ```typescript theme={null} import { getPrices } from '@avnu/avnu-sdk'; const tokens = [ '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', // ETH '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8', // USDC '0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d' // STRK ]; const prices = await getPrices(tokens); prices.forEach(price => { const starknet = price.starknetMarket?.usd ?? 'N/A'; const global = price.globalMarket?.usd ?? 'N/A'; console.log(`${price.address.slice(0, 10)}... Starknet: $${starknet}, Global: $${global}`); }); ``` ## Related Get comprehensive market data for all tokens REST API endpoint # Claim Rewards Source: https://docs.avnu.fi/docs/staking/claim-rewards Harvest or restake rewards Use `executeClaimRewards` to claim your earned staking rewards. You can optionally choose to restake them immediately. ## Usage ```typescript theme={null} import { executeClaimRewards } from '@avnu/avnu-sdk'; const result = await executeClaimRewards({ provider: account, poolAddress: '0x...', restake: true, // Set to true to compound rewards }); ``` ## Parameters If `true`, rewards are automatically restaked. If `false`, they are sent to the user's wallet. The Starknet account. The staking pool address. Optional paymaster configuration for gasless staking. # Get Info Source: https://docs.avnu.fi/docs/staking/get-info Fetch Earn data Retrieve information about a user's Earn position or the protocol status. ## Get User Earn Info ```typescript theme={null} import { getUserStakingInfo } from '@avnu/avnu-sdk'; const STRK_ADDRESS = '0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d'; const info = await getUserStakingInfo( STRK_ADDRESS, // Token address account.address, // User address { avnuPublicKey: '...' } // Optional ); console.log('Staked Amount:', info.amount); console.log('Staked Amount (USD):', info.amountInUsd); console.log('Unclaimed Rewards:', info.unclaimedRewards); console.log('Unclaimed Rewards (USD):', info.unclaimedRewardsInUsd); console.log('Pool Address:', info.poolAddress); console.log('Expected Yearly STRK Rewards:', info.expectedYearlyStrkRewards); ``` ### UserStakingInfo Interface ```typescript theme={null} interface UserStakingInfo { tokenAddress: string; tokenPriceInUsd: number; poolAddress: string; userAddress: string; amount: bigint; amountInUsd: number | undefined; unclaimedRewards: bigint; unclaimedRewardsInUsd: number | undefined; unpoolAmount: bigint; unpoolAmountInUsd: number | undefined; unpoolTime: Date | undefined; totalClaimedRewards: bigint; totalClaimedRewardsHistoricalUsd?: number; totalClaimedRewardsUsd: number; userActions: Action[]; totalUserActionsCount: number; expectedYearlyStrkRewards: bigint; aprs: Apr[]; } ``` ## Get avnu Earn Info ```typescript theme={null} import { getAvnuStakingInfo } from '@avnu/avnu-sdk'; const stats = await getAvnuStakingInfo({ avnuPublicKey: '...' }); // Optional options console.log('Self Staked Amount:', stats.selfStakedAmount); console.log('Commission:', stats.commission); console.log('Delegation Pools:', stats.delegationPools); // Access pool-specific data stats.delegationPools.forEach(pool => { console.log(`Pool ${pool.poolAddress}:`); console.log(` Token: ${pool.tokenAddress}`); console.log(` Staked: ${pool.stakedAmount}`); console.log(` APR: ${pool.apr}%`); }); ``` ### StakingInfo Interface ```typescript theme={null} interface StakingInfo { selfStakedAmount: bigint; selfStakedAmountInUsd: number | undefined; operationalAddress: string; rewardAddress: string; stakerAddress: string; commission: number; delegationPools: DelegationPool[]; } interface DelegationPool { poolAddress: string; tokenAddress: string; stakedAmount: bigint; stakedAmountInUsd: number | undefined; apr: number; } ``` # Overview Source: https://docs.avnu.fi/docs/staking/index Integrate native staking into your application avnu Earn allows users to stake tokens directly through your application, earning rewards while maintaining full custody. **Earn** is our native staking solution for Starknet tokens, starting with STRK and expanding to other assets like BTC variants. Users can delegate their tokens to earn network rewards. ## Features Stake tokens directly to the Starknet staking protocol via avnu's infrastructure. Claim rewards or restake them to compound earnings. Initiate withdrawals and claim funds after the 7-day unbonding period. ## SDK Methods ### Data Fetching * `getUserStakingInfo(tokenAddress, userAddress)` - Fetch user's staking position * `getAvnuStakingInfo(tokenAddress)` - Fetch protocol-wide staking stats ### Simple Integration * `executeStake(params)` - Stake tokens with automatic approvals * `executeInitiateUnstake(params)` - Start 7-day unbonding period * `executeUnstake(params)` - Claim unstaked tokens after unbonding * `executeClaimRewards(params)` - Claim or restake rewards ### Advanced Integration * `stakeToCalls(poolAddress, amount)` - Build staking calls for custom execution * `initiateUnstakeToCalls(poolAddress, amount)` - Build unstaking initiation calls * `unstakeToCalls(poolAddress)` - Build unstaking claim calls * `claimRewardsToCalls(poolAddress, restake)` - Build reward claim calls ```typescript theme={null} // Simple integration const result = await executeStake({ provider: account, poolAddress: '0x362dc7da60bfddc8e3146028dfd94941c6e22403c98b5947104e637543b475d', amount: parseUnits('100', 18) }); // Advanced: compose with other operations const stakeCalls = stakeToCalls(poolAddress, amount); const swapCalls = quoteToCalls(quote, slippage, account.address); await account.execute([...swapCalls, ...stakeCalls]); ``` ## Available Actions Deposit tokens into the staking pool. Withdraw tokens from the staking pool. Harvest earned staking rewards. Fetch user staking positions and pool stats. # Stake Source: https://docs.avnu.fi/docs/staking/stake Stake tokens using the SDK Use `executeStake` to deposit tokens into a staking pool. ## Usage ```typescript theme={null} import { executeStake } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const result = await executeStake({ provider: account, // Starknet Account poolAddress: '0x0362dc7da60bfddc8e3146028dfd94941c6e22403c98b5947104e637543b475d', // avnu $STRK delegation pool amount: parseUnits('100', 18), // Amount to stake (in wei) }); console.log('Transaction Hash:', result.transactionHash); ``` ## Parameters The Starknet account executing the transaction. The address of the staking pool contract. The amount of tokens to stake (in smallest unit, e.g., wei). Optional paymaster configuration for gasless staking. # Unstake Source: https://docs.avnu.fi/docs/staking/unstake Withdraw tokens from the staking pool Unstaking is a two-step process: 1. **Initiate Unstake**: Request to withdraw funds. This starts the 7-day unbonding period. 2. **Unstake**: Claim the funds after the 7-day unbonding period has passed. ## 1. Initiate Unstake ```typescript theme={null} import { executeInitiateUnstake } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const result = await executeInitiateUnstake({ provider: account, poolAddress: '0x...', amount: parseUnits('50', 18), }); ``` ## 2. Claim Unstaked Funds ```typescript theme={null} import { executeUnstake } from '@avnu/avnu-sdk'; const result = await executeUnstake({ provider: account, poolAddress: '0x...', }); ``` ## Parameters ### Initiate Unstake Amount to withdraw. ### Common Parameters The Starknet account. The staking pool address. Optional paymaster configuration for gasless staking. # Integrator Fees Source: https://docs.avnu.fi/docs/swap/add-fees Earn revenue on every swap through your integration Earn revenue on every swap by adding integrator fees. Fees are specified in basis points and sent directly to your recipient address on-chain. ## Parameters Fee in basis points as bigint (10n = 0.1%, 100n = 1%) Address to receive fee payments Your protocol/platform identifier (for analytics) ## SDK Example ```typescript theme={null} import { getQuotes, executeSwap } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const quotes = await getQuotes({ sellTokenAddress: ethAddress, buyTokenAddress: usdcAddress, sellAmount: parseUnits('1', 18), takerAddress: account.address, integratorFees: 10n, // 0.1% (10 bps) integratorFeeRecipient: '0xYourFeeRecipientAddress', integratorName: 'YourProtocolName', }); // Execute swap with fees const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.001, }); console.log('Swap executed:', result.transactionHash); ``` ## How It Works **Fee Calculation:** * Fees are specified in basis points (bps) * Transferred directly to your recipient address on-chain **Fee Token Selection:** The contract automatically selects the best token to collect fees using an on-chain priority mechanism. Stablecoins are preferred, followed by major assets (ETH, wstETH, WBTC, STRK, etc.). The fee token is selected automatically based on the swap route - you don't need to specify it. ## Best Practices Setting your integrator name helps with: * Analytics and volume tracking * Support and troubleshooting * Potential partnership opportunities ## Related Back to main swap documentation View complete API parameters # Execute Swap Source: https://docs.avnu.fi/docs/swap/execute-swap Execute a swap transaction using a quote ## Overview Execute a swap in one function call. The SDK handles building calls, approvals, and transaction execution automatically. ## SDK Method ```typescript theme={null} executeSwap( params: InvokeSwapParams, options?: AvnuOptions ): Promise ``` ## Parameters The quote object returned by `getQuotes` Maximum slippage as a decimal (0..1). E.g., 0.001 = 0.1%, 0.01 = 1% The Starknet account executing the swap Whether to automatically handle token approvals Optional paymaster configuration ## Example ```typescript Basic Swap theme={null} import { RpcProvider, Account } from 'starknet'; import { getQuotes, executeSwap } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; // ... setup provider and account ... // 1. Get quotes const quotes = await getQuotes({ sellTokenAddress: ETH_ADDRESS, buyTokenAddress: USDC_ADDRESS, sellAmount: parseUnits('1', 18), takerAddress: account.address, }); // 2. Execute swap const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.005, // 0.5% }); console.log('Transaction hash:', result.transactionHash); ``` ```typescript With Paymaster theme={null} // Execute gasless swap const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.005, // 0.5% paymaster: { active: true, provider: paymasterProvider, // Your Paymaster instance params: {} // Paymaster params } }); ``` ```typescript Manual Approval theme={null} // If token is already approved const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.005, // 0.5% executeApprove: false, }); ``` ## Response ```typescript theme={null} { transactionHash: '0x...' } ``` ## Slippage Protection Slippage is defined as a **decimal** (0..1 range): * `0.001` = 0.1% * `0.005` = 0.5% * `0.01` = 1% The SDK automatically calculates the minimum received amount: `minAmount = buyAmount * (1 - slippage)` ## Token Approval By default (`executeApprove: true`), the SDK: 1. Checks the user's current allowance for the avnu router. 2. If insufficient, adds an `approve` call to the transaction. 3. Executes `approve` and `swap` in a single multicall (atomic). ## Best Practices With Starknet's block time of \~2 seconds, quotes become stale after just 1 block. Refresh quotes every block before execution. * Stable pairs: 0.001 - 0.003 (0.1% - 0.3%) * Regular pairs: 0.005 - 0.01 (0.5% - 1%) * Volatile pairs: 0.01 - 0.03 (1% - 3%) Implement retry logic with exponential backoff for network issues. # Get Quotes Source: https://docs.avnu.fi/docs/swap/get-quotes Fetch optimized swap quotes using the SDK ## Overview Get the best quotes from on-chain and off-chain liquidity sources. The SDK automatically converts amounts to the correct format and handles response parsing. ## SDK Method ```typescript theme={null} getQuotes( request: QuoteRequest, options?: AvnuOptions ): Promise ``` ## Parameters Quote request parameters Token address to sell (hex format) Token address to buy (hex format) Amount to sell in smallest unit. Either `sellAmount` or `buyAmount` required. Amount to buy in smallest unit. Either `sellAmount` or `buyAmount` required. Address that will execute the swap Number of quotes to return (1-5) Array of source names to exclude from routing Fee in basis points (e.g., 30n for 0.3%) Address to receive integrator fees (required when integratorFees is set) Your integration identifier for tracking Optional SDK configuration Custom API base URL (default: `https://starknet.api.avnu.fi`) Custom Impulse API base URL for market data (default: `https://starknet.impulse.avnu.fi`) AbortSignal to cancel the request Public key for response verification ## Returns Returns `Promise` - Array of quotes sorted by best output first. ### Quote Interface ```typescript theme={null} interface Quote { quoteId: string; sellTokenAddress: string; sellAmount: bigint; sellAmountInUsd: number; buyTokenAddress: string; buyAmount: bigint; buyAmountInUsd: number; fee: Fee; blockNumber?: number; chainId: string; expiry?: number | null; routes: Route[]; gasFees: bigint; // In FRI gasFeesInUsd?: number; priceImpact: number; sellTokenPriceInUsd?: number; buyTokenPriceInUsd?: number; exactTokenTo?: boolean; estimatedSlippage?: number; } ``` ### Fee Interface ```typescript theme={null} interface Fee { feeToken: string; avnuFees: bigint; avnuFeesInUsd: number; avnuFeesBps: bigint; integratorFees: bigint; integratorFeesInUsd: number; integratorFeesBps: bigint; } ``` ### Route Interface ```typescript theme={null} interface Route { name: string; address: string; percent: number; sellTokenAddress: string; buyTokenAddress: string; routeInfo?: Record; routes: Route[]; // Nested routes for multi-hop swaps alternativeSwapCount: number; } ``` ## Example ```typescript Basic Usage theme={null} import { getQuotes } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const ETH = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"; const USDC = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"; const quotes = await getQuotes({ sellTokenAddress: ETH, buyTokenAddress: USDC, sellAmount: parseUnits('1', 18), takerAddress: account.address, }); console.log('Best quote:', quotes[0].buyAmount); console.log('Routes:', quotes[0].routes); ``` ```typescript Multiple Quotes theme={null} // Get top 3 quotes to compare const quotes = await getQuotes({ sellTokenAddress: ETH, buyTokenAddress: USDC, sellAmount: parseUnits('10', 18), takerAddress: account.address, size: 3, }); quotes.forEach((quote, i) => { console.log(`Quote ${i + 1}:`, quote.buyAmount); }); ``` ```typescript With Integrator Fees theme={null} const quotes = await getQuotes({ sellTokenAddress: ETH, buyTokenAddress: USDC, sellAmount: parseUnits('1', 18), takerAddress: account.address, integratorFees: 30n, // 0.3% fee integratorFeeRecipient: '0x...', integratorName: 'MyDeFiApp', }); ``` ```typescript Buy Exact Amount theme={null} // Specify how much you want to buy instead of sell const quotes = await getQuotes({ sellTokenAddress: ETH, buyTokenAddress: USDC, buyAmount: parseUnits('1000', 6), // Buy exactly 1000 USDC takerAddress: account.address, }); console.log('You need to sell:', quotes[0].sellAmount, 'ETH'); ``` ## Quote Response ```typescript theme={null} { quoteId: "abc123def456", sellTokenAddress: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", sellAmount: 1000000000000000000n, sellAmountInUsd: 3245.12, buyTokenAddress: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", buyAmount: 3250450000n, buyAmountInUsd: 3250.45, fee: { feeToken: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", avnuFees: 0n, avnuFeesInUsd: 0, avnuFeesBps: 0n, integratorFees: 0n, integratorFeesInUsd: 0, integratorFeesBps: 0n }, chainId: "0x534e5f4d41494e", priceImpact: 0.0016, gasFees: 15000n, gasFeesInUsd: 0.05, routes: [ { name: "JediSwap", address: "0x...", percent: 60, sellTokenAddress: "0x049d...", buyTokenAddress: "0x053c...", routes: [], alternativeSwapCount: 0 }, { name: "Ekubo", address: "0x...", percent: 40, sellTokenAddress: "0x049d...", buyTokenAddress: "0x053c...", routes: [], alternativeSwapCount: 0 } ] } ``` ## Best Practices For the most reliable trading experience, always use the avnu Token List to filter for verified tokens. This avoids scams and ensures compatibility. **SDK Method:** ```typescript theme={null} import { fetchTokens } from '@avnu/avnu-sdk'; // Fetch verified tokens const tokens = await fetchTokens({ tags: ['Verified'], page: 0, size: 100 }); ``` With Starknet's block time of \~2 seconds, the likelihood of a quote becoming stale increases exponentially with each passing block. For the highest success rate, refresh quotes every block before execution. The SDK uses native `bigint` for all token amounts. Use `parseUnits()` from ethers to convert decimal amounts: ```typescript theme={null} import { parseUnits } from 'ethers'; // Convert 1.5 ETH (18 decimals) to bigint const amount = parseUnits('1.5', 18); ``` ```typescript theme={null} const quotes = await getQuotes({...}); if (quotes.length === 0) { console.error('No routes found for this token pair'); return; } ``` Always include your app name for better support: ```typescript theme={null} const quotes = await getQuotes({ // ... other params integratorName: 'MyDeFiApp' }); ``` ## Related Execute the swap using a quote # Overview Source: https://docs.avnu.fi/docs/swap/index Best-price swaps across all Starknet liquidity avnu aggregates every liquidity source on Starknet (AMMs, CLOBs, and market makers) and uses competing solver algorithms to find the best execution path for your trade. Each solver tackles a complex optimization problem: splitting trades across hundreds of potential routes while balancing price impact, gas costs, slippage dynamics, and transaction success probability. We run multiple strategies in parallel, benchmark against direct market maker quotes, and select the solution that maximizes your net output. Build a working swap implementation in 5 minutes → ## SDK Methods ### Data Fetching * `getQuotes(request)` - Fetch optimized swap quotes ### Simple Integration * `executeSwap(params)` - Complete swap with automatic approvals ### Advanced Integration * `quoteToCalls(quote, slippage, takerAddress)` - Build swap calls for custom execution ```typescript theme={null} // Simple integration const quotes = await getQuotes({ ... }); const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 100 // 1% }); // Advanced: compose with other operations const swapCalls = quoteToCalls(quote, slippage, account.address); const otherCalls = [...]; await account.execute([...swapCalls, ...otherCalls]); ``` ## How Solvers Work Finding the optimal trade route on Starknet is a complex challenge. With tens of thousands of liquidity pools, varying gas costs, and fragmented liquidity across AMMs, CLOBs, and market makers, identifying the absolute best price is a non-trivial mathematical problem. For every trade, the solver must navigate a vast search space: * **Fragmented Liquidity:** Liquidity is split across multiple protocols and pools. * **Gas vs. Price:** A better price might cost more in gas. The solver must calculate the *net* benefit. * **Multi-Hop Routing:** Direct swaps aren't always best. Sometimes routing through 2 or 3 intermediate tokens yields a higher output. * **Real-Time Constraints:** Market conditions change in milliseconds. This is an **NP-hard optimization problem**. There is no simple formula to solve it. It requires sophisticated infrastructure to explore millions of possibilities in real-time. We have spent years building and refining our solver infrastructure to handle this complexity for you. * **Comprehensive Aggregation:** We integrate every significant liquidity source on Starknet. * **Advanced Optimization:** Our solvers run competing strategies in parallel to find the global maximum for your trade. * **Battle-Tested:** We power a significant portion of Starknet's trading volume, ensuring reliability and execution quality. * **Zero Maintenance:** You get best-in-class execution without maintaining your own indexers or routing logic. **Trade:** 10 ETH → USDC **Naive approach (single pool):** * Output: 32,450 USDC * Price impact: 0.8% **avnu Solver (optimized split):** * Splits trade across multiple pools (e.g., 60% Pool A, 40% Pool B) * Uses multi-hop routes when beneficial * Output: 32,612 USDC * Price impact: 0.3% **Result:** +\$162 better execution ## SDK Integration ```typescript Complete Example theme={null} import { RpcProvider, Account } from 'starknet'; import { getQuotes, executeSwap } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const provider = new RpcProvider({ nodeUrl: 'https://rpc.starknet.lava.build:443' }); const account = new Account( provider, process.env.ACCOUNT_ADDRESS!, process.env.PRIVATE_KEY! ); const ethAddress = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"; const usdcAddress = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"; // Fetch solver-optimized quotes const quotes = await getQuotes({ sellTokenAddress: ethAddress, buyTokenAddress: usdcAddress, sellAmount: parseUnits('1', 18), takerAddress: account.address, }); console.log('Solver route:'); quotes[0].routes.forEach(route => { console.log(` ${route.percent}% via ${route.name}`); }); // Execute with optimized routing const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.001 }); await provider.waitForTransaction(result.transactionHash); console.log('✅ Swap complete:', result.transactionHash); ``` ```typescript Exclude Sources theme={null} const quotes = await getQuotes({ sellTokenAddress: ethAddress, buyTokenAddress: usdcAddress, sellAmount: parseUnits('1', 18), takerAddress: account.address, excludeSources: ['10kSwap', 'SithSwap'], }); ``` ## Understanding Quote Response ```typescript theme={null} { "blockNumber": "0x0", "quoteId": "abc123", "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "sellAmount": "1000000000000000000", "buyAmount": "3250450000", // Optimized output "buyAmountInUsd": 3250.45, "sellAmountInUsd": "3251", "priceImpact": 20, // 0.2% price impact "gasFees": "0x1234", "gasFeesInUsd": 0.15, "fee": { "feeToken": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "avnuFees": "0x1234", "avnuFeesInUsd": 0.012, "avnuFeesBps": 15, "integratorFees": "0x0", "integratorFeesInUsd": 0, "integratorFeesBps": 0 }, "routes": [ { "percent": 60, "name": "JediSwap", "sellAmount": "600000000000000000", "buyAmount": "1950270000" }, { "percent": 40, "name": "Ekubo", "sellAmount": "400000000000000000", "buyAmount": "1300180000" } ] } ``` **Key metrics:** * `buyAmount`: Maximum output after solver optimization * `priceImpact`: Price impact (lower is better) * `gasFeesInUsd`: Total gas cost including all hops * `routes`: How the solver split your trade **Quote Expiration:** With Starknet's block time of \~2 seconds, quotes become stale after just 1 block. The more blocks that pass, the higher the probability your quote is outdated. Refresh quotes every block before execution to ensure accuracy. ## Advanced Features Earn revenue on every swap through your integration ## API Reference Complete HTTP endpoint reference, authentication, and request/response formats # Fetch Tokens Source: https://docs.avnu.fi/docs/tokens/fetch-tokens Get token list with filtering and search using the SDK ## Overview Fetch exchangeable tokens from avnu with optional filtering by tags and search. The SDK handles pagination and response parsing automatically. ## SDK Method ```typescript theme={null} fetchTokens( request?: GetTokensRequest, options?: AvnuOptions ): Promise> ``` ## Parameters Optional request parameters Page number for pagination Number of tokens per page (max 1000) Search by token name or symbol Filter by tags: `Verified`, `Community`, `Unruggable`, `AVNU`, `Unknown` Optional SDK configuration Custom API base URL Public key for response verification ## Returns Returns `Promise>` - Paginated response with token list. ```typescript theme={null} interface Page { content: Token[]; totalPages: number; totalElements: number; size: number; number: number; } type TokenTag = 'Unknown' | 'Verified' | 'Community' | 'Unruggable' | 'AVNU'; interface Token { address: string; name: string; symbol: string; decimals: number; logoUri: string | null; lastDailyVolumeUsd: number; extensions: { [key: string]: string }; tags: TokenTag[]; } ``` ## Examples ```typescript Fetch All Tokens theme={null} import { fetchTokens } from '@avnu/avnu-sdk'; // Get first 100 tokens const result = await fetchTokens(); console.log(`Total tokens: ${result.totalElements}`); console.log(`Tokens on this page: ${result.content.length}`); result.content.forEach(token => { console.log(`${token.symbol}: ${token.name}`); console.log(` Address: ${token.address}`); console.log(` Tags: ${token.tags.join(', ')}`); }); ``` ```typescript Filter by Tags theme={null} import { fetchTokens } from '@avnu/avnu-sdk'; // Get only verified tokens const verifiedTokens = await fetchTokens({ tags: ['Verified'] }); console.log(`Found ${verifiedTokens.content.length} verified tokens`); ``` ```typescript Search Tokens theme={null} import { fetchTokens } from '@avnu/avnu-sdk'; // Search for USDC-related tokens const usdcTokens = await fetchTokens({ search: 'USDC', size: 10 }); usdcTokens.content.forEach(token => { console.log(`${token.symbol} - ${token.name}`); }); ``` ## Token Tags Available tags to filter tokens: | Tag | Description | | ------------ | ---------------------------------------------------- | | `Verified` | Manually verified by avnu team | | `Community` | Community-approved (3+ avnu Working Group approvals) | | `Unruggable` | Unruggable memecoin | | `AVNU` | avnu team verified token | | `Unknown` | Token without verification status | ## Related Learn about verification and token tags REST API endpoint documentation # Overview Source: https://docs.avnu.fi/docs/tokens/index Community-verified token data for all Starknet ERC20 tokens ## The Most Comprehensive Token API on Starknet Access real-time data on every tradable ERC20 token with community verification, enriched metadata, and safety scores. 7-member avnu Working Group reviews every token Every new token indexed the moment it appears on-chain Logos, tags, verification status, and more ## Quick Start ```typescript Fetch All Tokens theme={null} import { fetchTokens } from '@avnu/avnu-sdk'; const page = await fetchTokens({ page: 0, size: 100 }); page.content.forEach(token => { console.log({ name: token.name, symbol: token.symbol, address: token.address, verified: token.tags.includes('Community') || token.tags.includes('AVNU'), logo: token.logoUri, }); }); ``` ## Token Tags A token can include tags: * **Verified** - Tokens that include the tag `Community` or `AVNU` * **Unknown** - Untagged tokens that user must import to swap on app.avnu.fi. Tokens would either be Verified or Unknown. * **Community** - Tokens that are verified by the avnu community * **avnu** - Tokens that are verified by the avnu team * **Unruggable** - Unruggable memecoin [https://www.unruggable.meme/](https://www.unruggable.meme/) **Duplicate Handling:** If multiple tokens share the same name or symbol, they are all displayed by default. However, if one of these tokens is `Verified`, only the verified version will be returned, and all `Unknown` duplicates will be hidden. This policy helps prevent confusion and protects users from potential scams or impersonations. ### Sorting Tokens are sorted by `lastDailyVolumeUsd` desc (non verified tokens don't have lastDailyVolumeUsd), `Verified`, tokens with `logoUri`, `Unruggable` and by name asc. ## Verify Your Token Get your token reviewed by the avnu Working Group → ### What is the avnu Working Group? The **avnu Working Group** is a group of 7 trusted community members who review token submissions to ensure user safety. Tokens need **3+ approvals** to receive the `Community` verification tag. ### Two Verification Paths 1. **Community Verification** - Submit at [community.avnu.fi](https://community.avnu.fi) * Requires minimum \$20K TVL and \$2K daily volume * Reviewed by avnu Working Group members * Typically approved within 24-48 hours * Receives `Community` tag 2. **avnu Verification** - For major launches * Contact the avnu team on [Telegram](https://t.me/avnu_developers) for expedited verification * Direct review by avnu team * Ideal for high-profile token launches needing immediate support * Receives `AVNU` tag Big launch coming up? The avnu team can manually verify tokens for major projects. Reach out on [Telegram](https://t.me/avnu_developers) for priority review. ## Performance Optimization Use `If-None-Match` and `etag` headers to check if resources have changed. The server returns `304 Not Modified` if unchanged, saving bandwidth and improving load times. ## Rate Limits **Public API:** 300 requests per 5 minutes (free, no API key required) Need higher rate limits? Contact us on [Telegram](https://t.me/avnu_developers) for custom limits available to integration partners. ## FAQ Real-time. New tokens and approvals appear within minutes. No. The Token List API is completely free and public. **AVNU:** Tokens verified by the avnu **Community:** Tokens verified by the avnu community **Unruggable:** Unruggable memecoins from unruggable.meme Tokens with `AVNU` or `Community` tags are considered "Verified" Yes! Join [Telegram](https://t.me/avnu_developers) to suggest improvements. ## Related Trade verified tokens with best execution Submit and review tokens Complete endpoint documentation # Your First Swap Source: https://docs.avnu.fi/get-started/first-swap Build a working token swap in 5 minutes ## What You'll Accomplish By the end of this guide, you'll have: * ✅ Installed the avnu SDK * ✅ Fetched the best swap quote * ✅ Executed a token swap on Starknet ## Prerequisites Download from [nodejs.org](https://nodejs.org/) ## Step 1: Install the SDK ```bash npm theme={null} npm install @avnu/avnu-sdk ``` ```bash yarn theme={null} yarn add @avnu/avnu-sdk ``` ```bash pnpm theme={null} pnpm add @avnu/avnu-sdk ``` ## Step 2: Initialize Your Account ```typescript theme={null} import { RpcProvider, Account } from 'starknet'; // Setup provider & account from starknet.js const provider = new RpcProvider({ nodeUrl: 'https://rpc.starknet.lava.build:443' }); const account = new Account( provider, 'YOUR_ACCOUNT_ADDRESS', 'YOUR_PRIVATE_KEY' ); // Or use hook from starknet-react const { account } = useAccount(); ``` **Security Note:** Never hardcode private keys in production. ## Step 3: Fetch Swap Quotes ```typescript theme={null} import { getQuotes } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const ethAddress = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"; const strkAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"; const quotes = await getQuotes({ sellTokenAddress: ethAddress, buyTokenAddress: strkAddress, sellAmount: parseUnits('0.001', 18), // 0.001 ETH takerAddress: account.address, size: 3, // Get top 3 quotes (optional, default: 1) excludeSources: [], // Exclude specific DEXs (optional) }); console.log('Best quote:', quotes[0]); console.log('Estimated output:', quotes[0].buyAmount); console.log('Gas fees:', quotes[0].gasFees); console.log('Route:', quotes[0].routes); ``` **Optional Parameters:** * `size`: Number of quotes to return (default: 1) * `excludeSources`: Array of source names to exclude * `integratorFees`: Your integration fees in bps * `integratorFeeRecipient`: Address to receive fees * `integratorName`: Your platform name * `onlyDirect`: if you want only direct routes ## Step 4: Execute the Swap ```typescript theme={null} import { executeSwap } from '@avnu/avnu-sdk'; const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.001, // 0.1% slippage tolerance }); console.log('Transaction hash:', result.transactionHash); ``` **Default Behavior:** * `executeApprove: true` - Automatically approves token spending if needed * `slippage` - Required parameter for price protection * Reverts if price moves beyond slippage tolerance ## Complete Example ```typescript Complete Code theme={null} import { RpcProvider, Account } from 'starknet'; import { getQuotes, executeSwap } from '@avnu/avnu-sdk'; import { parseUnits, formatUnits } from 'ethers'; const ethAddress = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"; const strkAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"; async function main() { // Setup provider & account from starknet.js const provider = new RpcProvider({ nodeUrl: 'https://rpc.starknet.lava.build:443' }); const account = new Account( provider, process.env.ACCOUNT_ADDRESS!, process.env.PRIVATE_KEY! ); // Fetch quotes const quotes = await getQuotes({ sellTokenAddress: ethAddress, buyTokenAddress: strkAddress, sellAmount: parseUnits('0.001', 18), takerAddress: account.address, }); console.log(`Buying ${formatUnits(quotes[0].buyAmount, 18)} STRK`); // Execute swap const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.001, // 0.1% }); // Wait for confirmation await provider.waitForTransaction(result.transactionHash); console.log('✅ Done:', result.transactionHash); } main().catch(console.error); ``` ```typescript With Integration Fees theme={null} import { RpcProvider, Account } from 'starknet'; import { getQuotes, executeSwap } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const ethAddress = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"; const strkAddress = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"; async function main() { const provider = new RpcProvider({ nodeUrl: 'https://rpc.starknet.lava.build:443' }); const account = new Account( provider, process.env.ACCOUNT_ADDRESS!, process.env.PRIVATE_KEY! ); // Fetch quotes with integration fees const quotes = await getQuotes({ sellTokenAddress: ethAddress, buyTokenAddress: strkAddress, sellAmount: parseUnits('0.001', 18), takerAddress: account.address, integratorFees: 10n, // 0.1% fee (10 bps) integratorFeeRecipient: '0xYOUR_FEE_RECIPIENT', integratorName: 'MyDApp', }); const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.01, // 1% }); await provider.waitForTransaction(result.transactionHash); console.log('✅ Swap complete:', result.transactionHash); } main().catch(console.error); ``` ```env Environment Variables theme={null} ACCOUNT_ADDRESS=0x... PRIVATE_KEY=0x... ``` ## Next Steps Sponsor gas or multi-token gas payments Complete REST API docs Add automated recurring buys ## Resources REST API documentation TypeScript/JavaScript SDK Telegram community # Overview Source: https://docs.avnu.fi/get-started/overview Start building with avnu in minutes avnu is Starknet's liquidity infrastructure. We aggregate all DEXs, CLOBs, and market makers, then use competing solver algorithms to find optimal execution paths for every trade - solving complex routing problems in real-time while you focus on building your product. ## Quick Start ```bash theme={null} npm install @avnu/avnu-sdk ``` ```typescript theme={null} import { getQuotes } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; const quotes = await getQuotes({ sellTokenAddress: ethAddress, buyTokenAddress: strkAddress, sellAmount: parseUnits('1', 18), takerAddress: account.address, }); ``` ```typescript theme={null} import { executeSwap } from '@avnu/avnu-sdk'; const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.001 }); ``` Build a working swap integration in 5 minutes → ## What You Can Build Solver-optimized swaps that aggregate all liquidity sources and maximize net output through real-time multi-objective optimization. Recurring token purchases with automated execution. Let users pay gas in any token, or sponsor transactions entirely. Real-time prices, liquidity, and volume data. Verified token metadata and contract addresses. ## Why Build on avnu? Competing solvers tackle NP-hard optimization problems in real-time, maximizing your users' net output while minimizing slippage and gas costs. Access every DEX, CLOB, and market maker on Starknet without managing multiple integrations or routing logic. Gasless swaps and pay-gas-in-any-token eliminate the need for users to hold ETH. Battle-tested infrastructure trusted by major Starknet wallets and applications. ## Development Environment ### Prerequisites * Node.js and npm/yarn * Basic TypeScript knowledge ### Networks `https://starknet.api.avnu.fi` Production environment `https://sepolia.api.avnu.fi` Test environment ### Rate Limits Public API: **300 requests per 5 minutes** Need higher limits? [Join our developer group](https://t.me/avnu_developers) ## Resources REST API documentation TypeScript/JavaScript SDK Telegram community # avnu - Your All-in-One Trading Hub on Starknet Source: https://docs.avnu.fi/introduction
Your All-in-One Trading Hub on Starknet
Build or Trade with avnu
Best trading execution, DCA, paymaster, token lists & more - everything you need in one platform
50+
Integrations
Trusted by leading protocols
\$3B+
Volume
All-time trading volume
#1
DEX Aggregator
On Starknet
Start with Best-Price Swaps
Competing solver algorithms solve NP-hard optimization problems in real-time to maximize net output
Solvers tackle NP-hard optimization problems in real-time to maximize your net output.
Aggregates all liquidity sources: AMMs, CLOBs, and market makers across Starknet.
Smart routing splits trades across hundreds of potential routes while minimizing slippage and gas.
Battle-tested infrastructure trusted by major Starknet wallets and applications.
Zero infrastructure required - we handle all the complexity.
Integrate swaps via REST API for full customization and control. Get started in 5 minutes with our TypeScript SDK.
```typescript SDK theme={null} import { getQuotes, executeSwap } from '@avnu/avnu-sdk'; import { parseUnits } from 'ethers'; // Get best quote const quotes = await getQuotes({ sellTokenAddress: usdcAddress, buyTokenAddress: strkAddress, sellAmount: parseUnits('1000', 6), // 1000 USDC takerAddress: account.address, }); // Execute swap const result = await executeSwap({ provider: account, quote: quotes[0], slippage: 0.001, // 0.1% }); ``` ```bash API theme={null} curl -X POST "https://starknet.api.avnu.fi/v3/swap/quotes" \ -H "Content-Type: application/json" \ -d '{ "sellTokenAddress": "0x053c...", "buyTokenAddress": "0x04718...", "sellAmount": "1000000000", "takerAddress": "0x..." }' ```
Your Complete Trading Toolkit
All the tools you need to build or trade on Starknet - in one place
Solver-optimized swaps that tackle complex routing problems in real-time to maximize net output. Recurring token purchases with automated execution and flexible scheduling. Let users pay gas in any token, or sponsor their transactions entirely. Real-time prices, liquidity depth, and volume data for all Starknet tokens. Verified token metadata, logos, and contract addresses. Smart contracts, audits, and integration guides.
Trusted by Leading Protocols
Ready Ready
StarkWare StarkWare
Braavos Braavos
Xverse Xverse
Focustree Focustree
Kulipa Kulipa
Endur
Starknet Foundation Starknet Foundation
50+ integrators
Get direct support from our engineering team. Stay updated with the latest announcements.
Ready to Get Started?
Whether you're building the next big DeFi app or looking for the best trades on Starknet, avnu has you covered
# AI Integration Source: https://docs.avnu.fi/resources/ai-integration Use avnu Developers documentation with AI coding assistants ## MCP Server Access the entire avnu Developers documentation through Anthropic's Model Context Protocol (MCP) for seamless AI-assisted development. Use this MCP endpoint with Claude Desktop, Claude Code, or any MCP-compatible AI tool ### Available Tools The MCP server provides the following tools: Search across the avnu Developers knowledge base to find relevant information, code examples, API references, and guides. Use this tool when you need to: * Answer questions about avnu Developers * Find specific documentation * Understand how features work * Locate implementation details The search returns contextual content with titles and direct links to the documentation pages. ## LLMs.txt Files We provide machine-readable documentation files following the [llms.txt standard](https://llmstxt.org/) for direct AI consumption: **Compact index** - A structured list of all documentation pages with titles, descriptions, and URLs. Perfect for AI tools to understand what's available. **Full content** - Complete documentation content in a single file. Ideal for feeding entire docs context to LLMs. ## Context7 [Context7](https://context7.com/) injects up-to-date documentation directly into your LLM prompts. Just say "use context7" and it fetches the latest docs automatically. ### Install ```bash theme={null} claude mcp add context7 -- npx -y @upstash/context7-mcp@latest ``` Add to `~/.cursor/mcp.json`: ```json theme={null} { "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp@latest"] } } } ``` Add to `claude_desktop_config.json`: ```json theme={null} { "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp@latest"] } } } ``` ### Use with avnu Add "use context7" to any prompt: ```text theme={null} Build a token swap using avnu SDK. use context7 ``` ```text theme={null} How do I integrate avnu paymaster for gasless transactions? use context7 ``` Context7 will fetch the latest avnu documentation and inject it into context. ## Setup Instructions Add the MCP server to your Claude Desktop configuration: ```json macOS theme={null} { "mcpServers": { "avnu-docs": { "url": "https://docs.avnu.fi/mcp" } } } ``` ```json Windows theme={null} { "mcpServers": { "avnu-docs": { "url": "https://docs.avnu.fi/mcp" } } } ``` **Configuration file location:** * macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` * Windows: `%APPDATA%\Claude\claude_desktop_config.json` The MCP server can be used directly in Claude Code IDE extension: 1. Open your project in VS Code with Claude Code installed 2. Add MCP server configuration to `.claude/settings.json`: ```json theme={null} { "mcpServers": { "avnu-docs": { "url": "https://docs.avnu.fi/mcp" } } } ``` 3. Claude Code will automatically connect to the MCP server 4. Use natural language to query avnu documentation while coding Check out the `.claude/commands/` directory in your project for pre-built prompts specific to avnu development. Enable the avnu documentation in Cursor AI: 1. Open Cursor Settings 2. Navigate to AI Settings → MCP 3. Add the MCP server: ``` https://docs.avnu.fi/mcp ``` 4. Restart Cursor to apply changes ## Example Queries Once connected, you can ask your AI assistant questions like: "How do I get a swap quote from avnu?" "Show me how to use the paymaster API" "Build a swap integration with TypeScript" "How do I stake STRK tokens?" "Why am I getting insufficient balance error?" "How do slippage settings work?" "What's the best way to handle integrator fees?" "How should I optimize gas for swaps?" ## Benefits of AI-Assisted Development Get instant answers to questions without leaving your code editor Generate boilerplate code for common integration patterns Learn recommended approaches directly from documentation Quickly troubleshoot issues with contextual help Explore features and capabilities through natural language Access the latest documentation automatically ## Feedback & Support Share feedback on AI integration and get help from the avnu team # Brand Kit Source: https://docs.avnu.fi/resources/brand-kit avnu logos and brand guidelines ## avnu Brand Assets Download official avnu logos and brand guidelines. Complete package with logos in all formats ## Logo Variations ### Wordmark (Recommended) The avnu wordmark is our primary logo for most use cases including websites, presentations, and marketing materials. avnu Wordmark Blue avnu Wordmark White avnu Wordmark Alt Blue avnu Wordmark Alt White ### Logo Elements The abstract logo elements work best for profile pictures, app icons, and compact spaces. avnu Logo Main avnu Logo Blue avnu Logo White ### Alt Logo Elements Alternative logo variations for specific use cases. avnu Logo Alt avnu Logo Alt Blue avnu Logo Alt White ## Brand Colors
**Primary Blue** \#3761F6
**Secondary Yellow** \#FFE164
**Dark Blue** \#09104F
**Dark Night** \#080915
## Usage Guidelines * Use official logos from the brand kit * Maintain clear space around logo * Include "Powered by avnu" attribution * Don't modify logo colors or proportions ## Questions? Join our [Telegram community](https://t.me/avnu_fi) or contact [brand@avnu.fi](mailto:brand@avnu.fi) for custom assets or co-marketing opportunities. # Contracts & Audits Source: https://docs.avnu.fi/resources/contracts avnu smart contract addresses and security audits # Swap | Role | Address | | ------------- | -------------------------------------------------------------------- | | **Exchange** | `0x04270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f` | | **Forwarder** | `0x0127021a1b5a52d3174c2ab077c2b043c80369250d29428cee956d76ee51584f` | # DCA | Role | Address | | ---------------- | -------------------------------------------------------------------- | | **Orchestrator** | `0x0492139c56af6faf77119b6bca3b6d40f559af6b7b23778f068dd9ca08e407c5` | # Staking ## Validator Addresses | Role | Address | | --------------- | -------------------------------------------------------------------- | | **Staker** | `0x036963c7b56f08105FfDD7f12560924bdc0cB29Ce210417eCbC8bF3C7E4b9090` | | **Reward** | `0x36963c7b56f08105ffdd7f12560924bdc0cb29ce210417ecbc8bf3c7e4b9090` | | **Operational** | `0x54f4784af6820c8feef75e87ede8c5dd53a65f33bcbe6714b5684448650a7db` | ## Pools | Token | Pool Address | | ----------- | ------------------------------------------------------------------- | | **STRK** | `0x362dc7da60bfddc8e3146028dfd94941c6e22403c98b5947104e637543b475d` | | **WBTC** | `0x2ea6a4ffce4c5e779451e043a9a24c9c0b0f784d9cc0f393bc1c801e3f8f2e3` | | **tBTC** | `0x750b4ecd1eef45cc74db3538277a869ced288f813e2faa00e0a5ae46243bbaa` | | **SolvBTC** | `0x262f5a1240bf2d61ca36c4eb3a57ff4ae0a183046d3dcab35d0880b7d1776dd` | | **LBTC** | `0x7ce7161e46e796e6034e3ead311d431567654116f3cffacefe37a2e17464a8f` | **Note:** Sepolia contract addresses may differ from mainnet. Always verify on [Voyager Sepolia](https://sepolia.voyager.online). ## Security Audits avnu smart contracts have undergone **3 independent security audits**: **Date:** January 2024 **Scope:** Exchange contract **Findings:** 0 critical, 0 high **Date:** March 2024 **Scope:** Forwarder & Paymaster **Findings:** 0 critical, 0 high **Date:** May 2024 **Scope:** Orchestrator & DCA **Findings:** 0 critical, 1 medium (resolved) ## Source Code Core smart contracts (Exchange, Forwarder, Orchestrator) TypeScript SDK for integration ## Verification All contracts are verified on Starknet block explorers: Verified source code Contract details ## Security & Best Practices Security is our top priority. We follow industry best practices and cooperate with security researchers to ensure the safety of our protocol. If you identify a potential vulnerability, please reach out to us immediately. We actively encourage responsible disclosure and welcome collaboration with the security community. Contact [security@avnu.fi](mailto:security@avnu.fi) for responsible disclosure # Privacy Policy Source: https://docs.avnu.fi/resources/privacy-policy avnu Privacy Policy **Last modified: December 8, 2025** This Privacy Policy (the "Policy") explains how 419 Dev Labs (together with its affiliates, "avnu", "Alpha Road", "Company", "we", "our", or "us") collects, uses, stores, shares and protects information when you access or use: * [https://avnu.fi](https://avnu.fi), [https://app.avnu.fi](https://app.avnu.fi) and all related subdomains, * our trading interfaces, router, paymaster, intents engine and staking dashboards, * our APIs, SDKs, analytics pages or other web applications, * and any other properties, features, tools or services made available by avnu (collectively, the "Services"). By accessing or using the Services, you acknowledge that you have read and understood this Policy. This Policy forms part of our [Terms & Conditions](/resources/terms-of-service). *** ## 1. High-Level Summary avnu is a **non-custodial** interface and infrastructure provider. * First/last name * Postal address * Date of birth * Email address * Private keys / seed phrases * Public on-chain data (wallet address, transactions) * Quote-level and swap-level logs * Limited off-chain analytics data * Technical and performance diagnostics **We do not run account systems and do not identify users directly.** We use third-party analytics tools (e.g., Google Analytics, Hotjar, Vercel Analytics, Sentry) to understand platform usage and improve performance and security. **We never sell user data.** We minimize collection wherever possible. We continuously work to integrate privacy-preserving tooling (proxies, anonymization, local-first analytics, opt-outs). *** ## 2. Information We Collect We categorise the data we collect into three groups: ### 2.1 Public On-Chain Data (Non-Personal Data) When you interact with the Services, we may automatically read or process: * wallet addresses, * transactions you sign, * token balances, * routes executed via avnu, * events and logs emitted by smart contracts, * on-chain states required to compute quotes. This information is **public by design**. We do not control or modify blockchain transparency. ### 2.2 Technical & Device Information (Pseudonymous Off-Chain Data) We collect limited, pseudonymous technical metadata such as: * browser type and version * device type (mobile, tablet, desktop) * language preferences * pages visited, clicks, UI interactions * timestamps & session duration * network performance metrics * referrers and URL paths * aggregated usage statistics **We do not collect** personally identifying information such as name, email, or phone number. **We do not attempt** to link technical metadata to an individual identity. ### 2.3 Operational, Routing & Security Data To provide high-performance routing and maintain platform integrity, we log: * quote requests and parameters, * swap attempts, success and failure metrics, * slippage settings, route selections, transaction hashes, * suspicious or abusive patterns (e.g., spam queries, scraping, automated flooding), * API key usage patterns (if integrating via Developer Tools), * errors, exceptions and performance bottlenecks. We use this to: * improve routing quality, * protect the system from abusive or malicious behaviour, * detect anomalies, * maintain network reliability, * enforce rate limits and prevent platform degradation. *** ## 3. How We Use Data We use the data we collect for the following purposes: ### 3.1 Providing and improving the Services This includes: * computing quotes, routes, gas estimations, and simulations, * operating the router, paymaster, staking dashboard, and on-chain interactions, * monitoring app stability and infrastructure performance, * building analytics that help us improve swap routing and execution, * upgrading our systems and features based on usage patterns. ### 3.2 Customer support We may use technical logs and public blockchain data to: * troubleshoot user-reported execution issues, * diagnose errors or routing anomalies, * provide explanations or insights into expected vs. actual execution. Because we are non-custodial, **we cannot modify, reverse, or cancel any user transaction**. ### 3.3 Safety and security We may use data to: * detect and prevent abusive or fraudulent behaviour, * investigate bugs, exploits or suspicious patterns, * block harmful traffic or compromised wallets, * maintain platform reliability. This includes logging repeated failed transactions, unusual quote patterns, or automated scraping that degrades performance. ### 3.4 Legal obligations We may process or share information where: * required by law, * requested by regulators, law enforcement or competent authorities, * necessary to comply with sanctions, AML/CTF obligations (where applicable), * necessary to enforce our Terms & Conditions. ### 3.5 Aggregated & anonymized analytics We may combine or anonymize datasets to: * analyse product usage, * identify trends, * measure system performance, * guide product development decisions. Aggregated data contains no personal identifiers and cannot reasonably be traced back to an individual. *** ## 4. How We Share Data We share only the minimum necessary information with the third-party tools we use: ### 4.1 Service Providers **Sentry** Used for: * application monitoring, * error tracking, * debugging performance issues. **Google Analytics, Vercel Analytics, Hotjar** Used for: * understanding how users interact with the app, * improving UI/UX, * identifying performance bottlenecks, * conducting anonymized behavioural analysis. These tools do not receive blockchain private keys, names, emails, or other direct identifiers from us. **Vercel** Used for: * hosting, * serverless execution, * CDN delivery of the front-end interface. Vercel may log request metadata (IP address, request headers). We do not attempt to link that metadata to personal identities. ### 4.2 Legal disclosures We may share information if: * required by law, * necessary to comply with sanctions or AML rules, * responding to subpoenas, regulatory inquiries, or lawful investigations, * needed to protect our rights, users, or the integrity of the Services. ### 4.3 No sale of data **We never sell or rent user data.** *** ## 5. Legal Bases for Processing (GDPR) Where GDPR applies, we process data based on one or more of the following legal bases: | Legal Basis | Description | | ------------------------ | ------------------------------------------------------------------------------------------------ | | **Consent** | When you use our Services or accept cookies | | **Contract performance** | To operate the router, paymaster, staking dashboard, or API | | **Legal obligations** | Complying with applicable laws or regulatory inquiries | | **Legitimate interest** | Improving the Services, ensuring security, preventing abuse, and generating anonymized analytics | *** ## 6. Your Rights (GDPR & Equivalent Frameworks) Where applicable, you have the right to: | Right | Description | | ----------------------- | --------------------------------------------------------------- | | **Access** | Request a copy of personal data we may hold | | **Rectify** | Request corrections to inaccurate information | | **Erase** | Request deletion of personal data (subject to legal allowances) | | **Restrict processing** | Request limits on certain forms of processing | | **Object** | Object to processing based on legitimate interest | | **Data portability** | Receive data in a structured, machine-readable format | | **Withdraw consent** | At any time, where processing is based on consent | **Blockchains cannot be edited** We cannot modify: * your wallet address, * transaction history, * token balances, * on-chain state. Blockchain immutability is outside our control. *** ## 7. Data Retention We retain data only as long as needed to: * operate the Services, * comply with legal obligations, * detect and prevent abuse, * resolve disputes, * improve performance and routing quality. We may retain aggregated or anonymized data indefinitely. *** ## 8. Data Security We implement reasonable technical and organizational measures to protect data, including: * encrypted communications (HTTPS), * strict access controls, * minimal data collection by design, * ongoing audits of analytics providers, * infrastructure security hardening. However, no system can guarantee perfect security. We do not control the security of blockchains or user wallets. *** ## 9. International Data Transfers We may process or store data on servers operated by third-party providers located in various jurisdictions. Where required, we rely on: * Standard Contractual Clauses (SCCs), * adequacy decisions, * or other lawful mechanisms. *** ## 10. Changes to This Policy We may update this Policy from time to time. Material changes will be reflected via an updated "Last modified" date. **Your continued use of the Services indicates that you have reviewed and accepted the updated Policy.** *** ## 11. Contact If you have questions, complaints, or requests under this Policy, contact us: [privacy@avnu.fi](mailto:privacy@avnu.fi) We may request additional information to verify your identity before processing your request. # Support Source: https://docs.avnu.fi/resources/support Get help building with avnu ## Developer Support avnu provides comprehensive developer support to help you integrate successfully. Telegram Developer Group Developer Support Email ## Community Join our active developer community: * **Telegram**: Real-time help from avnu engineers * **GitHub**: Report issues and request features * **Twitter**: Latest updates and announcements ## API Status Check [health.avnu.fi](https://health.avnu.fi) for real-time API health monitoring. # Terms of Service Source: https://docs.avnu.fi/resources/terms-of-service avnu Terms & Conditions **Last modified: January 12, 2026** This Agreement (the "Terms") is between you and 419 Dev Labs (together with its affiliates, "Company", "419 Dev Labs", "avnu", "Alpha Road", "we", "us", or "our") and governs your access to and use of: * the website avnu.fi and all related subdomains, * our web and mobile applications, widgets and embeddable modules, * our APIs, SDKs and developer tools, * any avnu interfaces for trading, routing, intents, gasless transactions, or staking, * and any other products, features, content or services we make available from time to time (collectively, the "Services" and any website/application, the "Site"). By clicking or tapping any button or box marked "accept", "agree", "sign", "sign message", "OK" (or similar) or by accessing or using the Services in any way, you: * acknowledge that you have read and understood these Terms; * agree to be bound by these Terms and our [Privacy Policy](/resources/privacy-policy); and * represent and warrant that you have the legal capacity and authority to enter into these Terms for yourself and, if applicable, on behalf of any organization you represent. **If you do not agree to these Terms, do not access or use the Services.** *** ## 1. Eligibility & Restrictions ### 1.1 Age and capacity You may use the Services only if: * you are at least 18 years old (or the age of majority in your jurisdiction, if higher); and * you have full power, authority and capacity to enter into these Terms. If you use the Services on behalf of a company or other legal entity (an "Organization"): * "you" and "your" refer to both you individually and that Organization; and * you represent and warrant that you have authority to bind that Organization to these Terms. **For users located in the United Kingdom:** Your use of Bridge Services does not constitute an endorsement of cryptocurrency trading by avnu or any third party. Bridge Services should not be regarded as an investment recommendation, financial advice, or inducement to trade cryptoassets. You acknowledge the speculative nature of cryptoassets and that you may lose some or all of your funds. ### 1.2 Sanctioned and restricted jurisdictions By using the Services, you represent, warrant and covenant that you are not: * a citizen, resident, or located in, incorporated in, or otherwise organized under the laws of: * the United States of America (each an "American"); or * Cuba, Iran, Myanmar (Burma), North Korea, China, Syria, the regions of Crimea, Donetsk or Luhansk, or * any country, region or territory that is the subject of comprehensive country-wide or region-wide economic sanctions by the United States, Canada, the United Kingdom, Switzerland or the European Union (collectively, "Sanctioned Territories"); * listed on, or owned or controlled by any person listed on, any sanctions- or watch-list maintained by the United Nations, the U.S. government (including OFAC), the European Union or its Member States, the United Kingdom, Switzerland or any other relevant sanctions authority; * using the Services for the benefit of any such person or entity; or * under the age of eighteen (18). You must not use any technology (including VPNs, proxies, Tor, or similar) or other means to circumvent these restrictions. We may restrict, block or terminate access to the Services at our sole discretion where we believe such restrictions are necessary to comply with applicable laws or sanctions programs. ### 1.3 Your legal compliance responsibility You are solely responsible for ensuring that your access to and use of the Services complies with all laws, rules and regulations applicable to you, including: * anti-money laundering (AML), * counter-terrorist financing (CTF), * anti-corruption and anti-bribery, * tax, securities and derivatives laws, * sanctions and export control laws, * and any licensing, registration or reporting obligations. We do not guarantee that the Services are legal or appropriate for use in your jurisdiction. We have no obligation to inform you of any such legal restrictions or liabilities. *** ## 2. Description of Services ### 2.1 Trading & routing interfaces The Services provide non-custodial interfaces and infrastructure that may include, among other things: * an on-chain swap / DEX aggregator that sources liquidity and routes orders across various protocols, smart contracts and liquidity pools; * order routing, intent, RFQ or pricing engines; * gas management or paymaster features (e.g. gasless transactions where we pay network fees under certain conditions); * dashboards, analytics or other informational tools; and * other tools that allow you to construct and submit transactions to supported networks. **We do not provide brokerage, custody, portfolio management, investment advice, or any regulated financial service. We do not at any time take custody of your digital assets.** ### 2.2 Staking & validator services We may operate or expose staking, delegation or validator services (together, "Staking Services"), such as allowing you to delegate tokens to a validator we operate or support. * Staking is non-custodial: you always hold your assets in your own wallet or protocol account. * We do not guarantee any level of rewards, uptime, slashing protection or network behavior. * Rewards (if any) are distributed according to the underlying network's rules and are outside our control. * Details of staking mechanics, commission and other parameters may be described in documentation, dashboards or interfaces and are incorporated by reference into these Terms. ### 2.3 Paymaster Services #### 2.3.1 Nature of Paymaster Services avnu may provide optional gas sponsorship services ("Paymaster Services") that allow certain transactions submitted through supported wallets, frontends, or integrations to be executed with gas fees partially or fully sponsored by avnu or by third-party gas sponsors. The Paymaster Services are: * non-custodial, * optional, * provided solely at avnu's discretion, * not guaranteed, * and may be modified, restricted, or discontinued at any time. The Paymaster Services do not constitute brokerage, custody, payment processing, credit, financial guarantees, or any regulated financial service. All transactions remain fully constructed and cryptographically signed by your own wallet. #### 2.3.2 No Guarantee of Sponsorship or Execution You understand and agree that avnu does not guarantee: * that any transaction will be sponsored, * that any gas fee will be paid on your behalf, * that sponsorship will be available for any particular Wallet, route, asset, integration, or user, * that transaction execution will succeed if sponsorship is attempted, * or that gas sponsorship will reduce costs, improve execution, or provide consistent performance. Paymaster Services are subject to dynamic internal rules, availability constraints, and operational limits. #### 2.3.3 Conditions Under Which Sponsorship May Fail A transaction may fail to receive gas sponsorship or may revert due to factors including, but not limited to: * insufficient paymaster balance, * internal rate limits, spam detection, or usage thresholds, * suspicious or abusive activity originating from your Wallet, integration, or API usage, * unsupported calldata, assets, contract interactions, or network, * upstream relayer, bundler, or RPC outages, * network congestion, reorgs, or gas-price volatility, * changes in sponsorship rules, eligibility logic, or allocation policies. If sponsorship fails, you may be required to resubmit and pay gas fees yourself. avnu is not responsible for any losses caused by failed or incomplete sponsorship. #### 2.3.4 No Custody or Responsibility for User Assets Providing gas sponsorship does not imply that avnu: * holds, manages, or controls user assets, * initiates, alters, or approves transactions, * monitors or modifies user signing behavior, * guarantees execution or price outcomes. Transactions are always initiated and signed by your own self-custodial Wallet. avnu cannot reverse, modify, or cancel any transaction. #### 2.3.5 Liability Disclaimer for Paymaster Usage To the maximum extent permitted by law, avnu shall not be liable for any losses, damages, delays, slippage, failed trades, reverted transactions, MEV impact, or unexpected execution results arising from: * sponsored, partially sponsored, or non-sponsored transactions, * incorrect or fluctuating gas settings, * execution differences caused by gas sponsorship logic, * failures of network infrastructure or third-party bundlers/relayers, * changes in sponsorship rules or availability, * abusive, automated, or excessive usage patterns, * or any other technical or protocol-related risks. You remain solely responsible for verifying and understanding all transaction parameters before signing. #### 2.3.6 Abuse Prevention and Enforcement avnu reserves the right to: * limit, restrict, or block Paymaster access for specific Wallets, IPs, API keys, integrations, or transactions, * impose dynamic rate limits, * decline sponsorship for transactions deemed high-risk, abusive, or harmful to system performance, * suspend Paymaster Services globally or selectively at any time. For the purposes of preventing abuse, improving performance, and ensuring network integrity, avnu may log, analyze, and monitor Paymaster-related interactions in accordance with our [Privacy Policy](/resources/privacy-policy). #### 2.3.7 Changes to Paymaster Rules avnu may modify, update, or discontinue Paymaster rules, sponsorship logic, coverage amounts, supported assets, or eligibility requirements at any time without notice. Your continued use of the Services constitutes acceptance of all such modifications. ### 2.4 APIs, SDKs & integrations We may provide APIs, SDKs, libraries, webhooks or other developer tools (collectively, "Developer Tools") and may integrate with third-party wallets, dApps, frontends or services. If you integrate or build on top of our Developer Tools: * you are fully responsible for your own application, * you must ensure your use complies with these Terms and all applicable laws, and * you must not misrepresent your integration as being endorsed, audited or operated by avnu unless we explicitly agree in writing. ### 2.5 Incentive / rewards programs We may from time to time offer incentives, rewards, loyalty programs, airdrops, points or similar (collectively, "Incentive Programs"). * Participation is optional and at your own risk. * We may modify, suspend or terminate any Incentive Program at any time, with or without notice. * No Incentive Program guarantees any future token, value, yield or listing. ### 2.6 Bridge Services The Bridge feature available through our Services is powered by Near Intents (also known as "1Click Swap" or "1CS"), infrastructure operated by Defuse Protocol. When you use Bridge Services, you are also subject to the [Near Intents Terms of Service](https://docs.near-intents.org/near-intents/integration/distribution-channels/1click-terms-of-service). By using Bridge Services, you acknowledge and agree that: * **(a)** Bridge Services involve cross-chain asset transfers using experimental infrastructure that may be suspended, modified, or discontinued at any time without notice; * **(b)** Cross-chain transactions are irreversible once initiated and may involve delays due to blockchain confirmation times, network congestion, or solver availability; * **(c)** You are solely responsible for verifying deposit addresses, supported assets, minimum amounts, and all transaction parameters before initiating any bridge transaction; * **(d)** Neither avnu nor Defuse Protocol custody your assets at any time during the bridging process; * **(e)** Bridge Services are provided "AS IS" without warranties of any kind, and aggregate liability for any claims arising from Bridge Services is limited to USD \$100; * **(f)** You will not use Bridge Services to circumvent sanctions, engage in money laundering, or facilitate any illegal activity. *** ## 3. Non-Custodial Nature & Wallets ### 3.1 Your wallet, your responsibility The Services interact with self-custodial wallets and smart contracts you control. You may connect a compatible wallet (a "Wallet") to use the Services. * We do not create or host wallets for you. * We never have access to your private keys, seed phrase, password or recovery information. * You remain solely responsible for securing your Wallet and backing up your keys. If you lose access to your Wallet or keys, we cannot recover your assets or reverse transactions. You irrevocably waive any claim against us related to loss of keys, Wallet mismanagement or unauthorized access to your Wallet. ### 3.2 Transaction construction and broadcast When you use the Services to submit a transaction: * the transaction is constructed and signed by your Wallet (or other client you control), * you are solely responsible for verifying all transaction details (assets, amounts, slippage, contract addresses, fees, etc.) before signing, and * once broadcast to the network, the transaction is irreversible under normal circumstances. We do not guarantee any transaction will be mined, confirmed, executed as expected, or remain in the same state due to reorgs, forks, MEV, network congestion, oracle issues or protocol bugs. *** ## 4. Fees, Commissions & Taxes ### 4.1 Swap service fees avnu charges a service fee on swaps and similar interactions executed via the Services (the "Service Fee"). * As of the Last Modified date, the Service Fee is typically in the range of **0.02% – 0.15%** of the notional amount of the trade, depending on route complexity and other factors. * The actual Service Fee for a given transaction will generally be displayed in the interface before you confirm the transaction, either explicitly or as part of the price/route. * Service Fees may be taken in the input asset, output asset, or another supported token, including by adjusting the effective exchange rate or routing path. * We may change, add or remove any Service Fees at any time, in our sole discretion. Any such changes apply prospectively to transactions initiated after the change. * **Service Fees are non-refundable** under any circumstances, including failed or reverted transactions, network issues, protocol exploits, or user mistakes. ### 4.2 Staking commission For Staking Services, avnu charges a commission on staking rewards (the "Staking Commission"). * As of the Last Modified date, the Staking Commission is **10% (ten percent)** of the gross staking rewards attributable to your delegation or stake, as measured by the underlying protocol. * The Staking Commission may be captured directly at the protocol level or via our validator configuration, reward distribution logic or equivalent mechanics. * The Staking Commission is deducted before rewards, if any, are credited to you. * We may change the Staking Commission at any time, in our sole discretion, subject to any protocol-level constraints. ### 4.3 Third-party fees In addition to avnu fees, you may also incur: * network gas fees charged by the blockchain, * protocol-level fees (e.g., DEX or pool fees), * bridge fees or wrapping/unwrapping costs, * fees charged by your Wallet provider or other third parties. We do not control these fees and are not responsible for any changes or inaccuracies in them. ### 4.4 Taxes You are solely responsible for: * determining whether, and to what extent, taxes apply to any transaction, reward, airdrop, gain, loss, or event in connection with your use of the Services; and * reporting and remitting such taxes to the appropriate tax authorities. We do not provide tax advice and do not calculate or withhold any taxes on your behalf. *** ## 5. Risks & No Guarantees ### 5.1 High-risk technology By using the Services, you acknowledge and agree that: * blockchain systems, smart contracts, zero-knowledge systems and cryptoassets are experimental, volatile and high-risk; * the value, liquidity and legal status of any digital asset may change rapidly and unpredictably; * you may lose some or all of your funds, including due to: * smart contract bugs or vulnerabilities, * protocol exploits or design flaws, * oracle failures or manipulation, * MEV, front-running or sandwich attacks, * network congestion, chain reorganizations or forks, * slashing, penalties or validator misbehavior, * UI bugs, misquotes, integration errors or data delays, * mistakes made by you, including choosing 100% slippage or other extreme settings. You should not use the Services with funds you cannot afford to lose. ### 5.2 Quotes, slippage and execution Any price, route, simulation, "best price", "expected output" or similar information shown in the Services is **informational only** and may differ from actual execution. * You choose your own slippage tolerance and transaction parameters. * If you set a very high or 100% slippage, your entire input may be swapped into unexpected assets or at extremely unfavorable rates. * We are not responsible for bad prices, unexpected execution due to your slippage settings, changes in on-chain state between quote and execution, or any loss resulting from your transaction parameters. **You are solely responsible for reviewing all parameters and understanding the consequences before signing.** ### 5.3 No professional advice; no fiduciary duties All information provided via the Services is for **informational purposes only** and does not constitute: * investment, trading, legal, tax, accounting or other professional advice; * any solicitation, offer, recommendation or endorsement to buy, sell or hold any asset. You should consult your own professional advisers before making any decision. To the maximum extent permitted by law, you acknowledge and agree that: * we owe no fiduciary duties to you or any third party; and * any duties that may exist at law or in equity are hereby disclaimed, waived and eliminated to the fullest extent permitted by law. *** ## 6. Prohibited Uses You may only use the Services for lawful purposes and in accordance with these Terms. You agree not to: * **Violate any applicable law**, regulation, sanctions program or third-party rights. * **Use the Services on behalf of or for the benefit of** any sanctioned or otherwise prohibited person. * **Exploit or harm** minors or vulnerable persons. * **Transfer or use digital assets** that do not legally belong to you or that you have no right to use. * **Engage in:** * market manipulation (including spoofing, wash trading or layering), * abusive trading practices, * fraud, rugpulls, Ponzi schemes or other unlawful activities. * **Interfere with, disrupt or degrade** the operation of the Services, including: * attempting to gain unauthorized access to any system or account, * deploying malware or conducting denial-of-service attacks, * scraping or harvesting data in violation of applicable law. * **Reverse engineer, decompile, disassemble**, circumvent technical protections, or otherwise attempt to derive the source code of any part of the Services, except to the extent permitted by applicable mandatory law. * **Use automated tools** (bots, scripts, crawlers) in a way that burdens or harms the Services or other users. * **Impersonate** any person or entity or misrepresent your affiliation with any person or entity. * **Use VPNs, proxies or other tools** for the purpose of circumventing jurisdictional, sanctions or eligibility restrictions. We may investigate and take any action we deem appropriate (including suspending or terminating access, and cooperating with law enforcement) in connection with any suspected violation of this Section. *** ## 7. API & Developer Tool Terms If you use any avnu API, SDK or Developer Tools, you agree that: * Your use is subject to these Terms and any additional documentation, rate limits, usage rules or policies we publish. * We may suspend, limit or revoke access at any time if we believe your use: * violates these Terms, * degrades or harms the Services or other users, or * poses legal, security or reputational risk. * You must not: * resell our API or provide it as a competing service without our written consent; * use our API to misrepresent prices, routes or fees to end users; or * falsely imply that your product is developed, audited or controlled by avnu. * You are solely responsible for any application you build on top of our Developer Tools and for all actions taken using your API keys. *** ## 8. No Warranties The Services are provided on an **"AS IS"** and **"AS AVAILABLE"** basis without warranties of any kind. To the maximum extent permitted by law, we, our officers, directors, employees, contractors, agents and affiliates expressly disclaim all warranties, whether express, implied or statutory, including but not limited to: * warranties of merchantability, * fitness for a particular purpose, * non-infringement, * title, * quiet enjoyment, accuracy, or reliability, * and any warranties arising out of course of dealing or usage of trade. Without limiting the foregoing, we do not warrant that: * the Services will be secure, error-free, uninterrupted or available at any particular time or place; * any defects or errors will be corrected; * any content, data or information is accurate, complete, up-to-date or free from technical inaccuracies; * the Services or any related software are free of viruses, vulnerabilities or harmful components; or * any transaction will achieve any particular outcome or execution quality. **Your use of the Services is entirely at your own risk.** *** ## 9. Limitation of Liability To the maximum extent permitted by applicable law, in no event shall the Company, its officers, directors, employees, contractors, agents, representatives, or affiliates be liable to you or any third party for: * any indirect, incidental, special, punitive, exemplary or consequential damages, including loss of profits, loss of revenue, loss of data, loss of goodwill or business interruption; * any loss or damage arising out of or relating to: * user errors (e.g., wrong address, incorrect parameters, extreme slippage), * loss of private keys, passwords or access to your Wallet, * transaction failures, delays, reorgs or unexpected execution, * bugs or vulnerabilities in smart contracts, protocols, bridges, or underlying blockchains, * protocol exploits, hacks, theft, fraud, or attacks (including MEV, front-running or oracle manipulation), * interruption, suspension or termination of the Services, * third-party services, infrastructure or integrations, * any change in law, regulation or tax treatment of digital assets. **In all cases, our aggregate liability shall be limited to the greater of:** * the total amount of fees you paid directly to avnu for the relevant transaction(s) during the three (3) months preceding the event giving rise to the claim; or * **one hundred U.S. dollars (USD 100)** (or equivalent in another currency). Some jurisdictions do not allow the exclusion or limitation of certain damages, so the above limitations may not apply to you. In such cases, our liability shall be limited to the maximum extent permitted by applicable law. *** ## 10. Indemnification You agree to defend, indemnify and hold harmless the Company, its affiliates and their respective shareholders, members, directors, officers, employees, contractors and agents from and against any and all claims, demands, actions, proceedings, damages, losses, liabilities, fines, penalties, costs and expenses (including reasonable attorneys' fees) arising out of or relating to: * your access to or use of the Services; * your violation of these Terms or any applicable law, rule or regulation; * your violation of any third-party right, including any intellectual property, privacy or proprietary right; or * any other party's access to or use of the Services with your assistance or using any device, account or Wallet that you own or control. *** ## 11. Intellectual Property ### 11.1 Ownership All rights, title and interest in and to the Services, including all software, code, interfaces, designs, logos, trademarks, service marks, content, graphics, text, documentation and other materials (collectively, "avnu IP"), are owned by the Company or its licensors. Except for the limited license expressly granted below, nothing in these Terms confers any rights in or to avnu IP, whether by implication, estoppel or otherwise. ### 11.2 Limited license Subject to these Terms, we grant you a limited, personal, revocable, non-exclusive, non-transferable, non-sublicensable license to access and use the Site and Services solely for your own personal or internal business purposes. You may not: * copy, modify, adapt, distribute, sell, lease, sublicense or otherwise exploit avnu IP; * remove, obscure or alter any copyright, trademark or other proprietary notices; or * use any avnu trademarks, names or logos without our prior written consent. We may revoke this license at any time and for any reason. ### 11.3 Your content & feedback You retain ownership of any content, data or materials you submit through the Services ("User Content"). You grant us a worldwide, non-exclusive, royalty-free, sublicensable and transferable license to use, reproduce, modify, adapt, publish, translate, create derivative works of, distribute, perform and display such User Content as reasonably necessary to operate, improve and promote the Services and to comply with legal obligations. If you provide any suggestions, ideas, bug reports or other feedback about the Services ("Feedback"), you agree that we may use such Feedback without restriction and without any obligation or compensation to you. *** ## 12. Privacy We may process personal data in connection with your use of the Services. Our practices are described in our Privacy Policy, available at: Read our Privacy Policy By using the Services, you acknowledge that you have read and understood our Privacy Policy and that we may collect, use and share your information as described therein. *** ## 13. Third-Party Services & Links The Services may reference, integrate, or link to third-party: * websites, protocols, DEXes, bridges (including Near Intents/Defuse Protocol), oracles, wallets, on-ramps, off-ramps, analytics tools, or infrastructure; * smart contracts or applications not controlled by us; * content, promotions, offers, or advertising. We do not control and are not responsible for any third-party services or content. Your use of any third-party service is solely between you and that third party and may be subject to separate terms and policies. We are not responsible for any loss or damage arising from your use of, or reliance upon, any third-party service or content. *** ## 14. Changes to Services & Terms We may, at any time and in our sole discretion: * add, remove, modify, suspend or discontinue any part of the Services; * modify these Terms, including our fee structure or supported jurisdictions. When we make material changes to these Terms, we may update the "Last modified" date and, where required by law or where we deem appropriate, provide additional notice (e.g., via the Site or email). **Your continued use of the Services after any changes to the Terms constitutes your acceptance of the revised Terms.** If you do not agree to the updated Terms, you must stop using the Services. *** ## 15. Termination We may, in our sole discretion and without liability to you, with or without notice, for any reason or no reason: * suspend or terminate your access to all or part of the Services; * block or restrict your Wallet or IP from interacting with the Services; * take any other measures we deem necessary or appropriate. Sections of these Terms that by their nature should survive termination shall survive, including but not limited to: No Warranties, Limitation of Liability, Indemnification, Intellectual Property, Governing Law & Arbitration, and Miscellaneous. You may stop using the Services at any time. Because the Services are non-custodial, termination of your access does not affect your underlying assets on the blockchain. *** ## 16. Governing Law & Arbitration ### 16.1 Governing law These Terms, and any dispute or claim arising out of or in connection with them or their subject matter or formation (including non-contractual disputes or claims), shall be governed by and construed in accordance with the **laws of the British Virgin Islands**, unless otherwise required by applicable law. ### 16.2 Binding arbitration Any dispute, controversy or claim arising out of or relating to these Terms, the Services, or any transaction you perform using the Services (a "Dispute") shall be finally resolved by arbitration in accordance with the **BVI International Arbitration Centre Arbitration Rules** (the "Rules") in force at the time the arbitration is initiated. * The seat of arbitration shall be the British Virgin Islands. * The language of the arbitration shall be English. * The arbitral tribunal shall consist of one (1) arbitrator, appointed in accordance with the Rules. **You and the Company waive any right to have any Dispute resolved in a court of law (other than to enforce an arbitral award) and to a trial by jury, to the fullest extent permitted by law.** ### 16.3 No class actions To the fullest extent permitted by law, all Disputes must be brought in an individual capacity, and not as a plaintiff or class member in any purported class, collective or representative proceeding. *** ## 17. Compliance, KYC & AML We reserve the right, but not the obligation, to: * conduct KYC/AML checks or require you to provide certain information and documentation (e.g., passport, ID, proof of address, source of funds) if deemed necessary by us or required by law; * refuse, restrict or terminate your access to the Services if you fail to provide such information or if we reasonably suspect that your use of the Services is linked to money laundering, terrorism financing, fraud, sanctions evasion, or any other illegal activity; * share any information we deem necessary with competent authorities where required by law or when we believe in good faith that such disclosure is reasonably necessary. *** ## 18. Miscellaneous ### 18.1 Entire agreement These Terms (including any documents incorporated by reference, such as our Privacy Policy and any specific program terms) constitute the entire agreement between you and us regarding the Services and supersede all prior or contemporaneous agreements, understandings or communications, whether written or oral. ### 18.2 Assignment You may not assign, transfer or delegate any of your rights or obligations under these Terms without our prior written consent. We may freely assign or transfer our rights and obligations under these Terms without restriction. ### 18.3 Severability If any provision of these Terms is determined to be invalid, illegal or unenforceable, such provision shall be enforced to the maximum extent permitted, and the remaining provisions shall remain in full force and effect. ### 18.4 No waiver Our failure to enforce any right or provision of these Terms shall not be deemed a waiver of such right or provision. Any waiver must be in writing to be effective. ### 18.5 Language These Terms may be translated into other languages. In case of any discrepancy or conflict between the English version and a translated version, the English version shall prevail. ### 18.6 Contact If you have questions, claims, complaints or suggestions regarding these Terms or the Services, you may contact us at: [legal@avnu.fi](mailto:legal@avnu.fi) # Circle USDC Migration Source: https://docs.avnu.fi/updates/circle-usdc-migration Everything you need to know about the migration from USDC.e to native USDC on Starknet. Circle USDC Migration Circle USDC Migration # Circle USDC.e to USDC Migration Circle is launching native USDC on Starknet, replacing the bridged USDC.e as the standard stablecoin. This guide covers the migration process, timeline, and how avnu supports this transition. ## Quick Recap For the upcoming **USDC.e → native USDC migration**: * **Migration Support**: avnu will integrate both the migration contract and liquidity pools. Our routing engine will automatically route users to the option offering the best rate at execution. * **Token List Update**: On migration day, we will automatically update our token list. The current USDC address will be replaced by the new native one, and we'll create a fresh **USDC.e** entry for the bridged token. * **Seamless Integration**: All our integrators (wallets like Ready, Braavos, Xverse, Keplr, etc.) will receive these updates instantly. ## Timeline * **Official Launch**: December 3, 1 pm UTC (8 AM EDT). * Circle public announcement of CCTP + native USDC * **12 pm UTC**: We merge the token list update (USDC.e and USDC token). ## Addresses ### Mainnet | Contract | Address | | :--------------------- | :------------------------------------------------------------------- | | **New Native USDC** | `0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb` | | **Legacy USDC.e** | `0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8` | | **Migration Contract** | `0x07bffc7f6bda62b7bee9b7880579633a38f7ef910e0ad5e686b0b8712e216a19` | ### Sepolia Testnet | Contract | Address | | :--------------------- | :------------------------------------------------------------------ | | **New Native USDC** | `0x512feac6339ff7889822cb5aa2a86c848e9d392bb0e3e237c008674feed8343` | | **Legacy USDC.e** | `0x53b40a647cedfca6ca84f542a0fe36736031905a9639a7f19a3c1e66bfd5080` | | **Migration Contract** | `0x431cba89859cfd85283cf34b99ad53bf53d66c41844a7698d9179900b103813` | ## Resources * [Circle CCTP Documentation](https://developers.circle.com/cctp/starknet-contracts) * [StarkGate Migration Portal](http://starkgate.starknet.io/migrate-usdc) (Live on Dec 3)