> For the complete documentation index, see [llms.txt](https://docs.augustdigital.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augustdigital.io/developers/api-reference.md).

# API Reference

## August Digital API Documentation

> For detailed API specifications, refer to our [OpenAPI documentation](https://api.augustdigital.io/api/v1/docs).

### Overview

This API provides access to subaccount management, swap functionality, and integrations with popular DeFi protocols.

**Base URL:** `/api/v1`\
**Authentication:** API Key (Header: `x-api-key`)

## Core Features

### Subaccount Management

* **Portfolio Overview**: Get comprehensive subaccount summaries including token balances, DeFi positions, and total account values
* **Health Monitoring**: Real-time health factor calculations for risk management
* **Multi-chain Support**: Manage assets across multiple blockchain networks

### Swap & Trading

* **Multi-market Quotes**: Get competitive swap quotes from various DEX aggregators
* **Cross-chain Swaps**: Execute token swaps across different blockchain networks
* **Fee Transparency**: Clear fee structure with normal and stable batch transaction fees

### DeFi Protocol Integrations

**Trader Joe (Avalanche DEX)**

* **Liquidity Management**: Deposit and withdraw from liquidity pools
* **Position Rebalancing**: Automated rebalancing of liquidity positions
* **Reward Claiming**: Claim accumulated trading fees and incentives

**Benqi (Avalanche Lending)**

* **Supply Assets**: Lend tokens to earn interest
* **Borrow Assets**: Borrow against collateral
* **Debt Management**: Repay loans and withdraw supplied assets

**Morpho (Advanced Lending)**

* **Vault APY Analytics**: Get real-time APY data for Morpho vaults

### Advanced Analytics

* **Historical Data**: Time-series data for APY, asset ratios, and performance metrics
* **Risk Assessment**: Health factor monitoring and loan-to-value calculations
* **Portfolio Insights**: Detailed breakdowns of positions across protocols and chains

## Authentication

All protected endpoints require an API key passed in the header:

```
x-api-key: YOUR_API_KEY
```

## Response Format

All API responses follow consistent JSON formatting with proper error handling and validation. The API uses standard HTTP status codes and provides detailed error messages for troubleshooting.

## Rate Limits & Best Practices

* Use the health check endpoint (`/ping`) to verify API connectivity
* Implement proper error handling for 422 validation errors
* Cache frequently accessed data like market information
* Use the `await_confirmation` parameter judiciously for transaction endpoints
