# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augustdigital.io/developers/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
