> ## Documentation Index
> Fetch the complete documentation index at: https://docs.octav.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscribe Snapshot

> Subscribe addresses to daily portfolio snapshots for historical tracking

Subscribe addresses to receive daily portfolio snapshots, enabling you to retrieve historical portfolio data starting from the subscription date.

<Info>
  **Cost:** 1200 credits per address per year (\$30)
</Info>

***

## Endpoint

```bash theme={null}
POST https://api.octav.fi/v1/subscribe-snapshot
```

### Request Body

<ParamField body="addresses" type="array" required>
  Array of address objects to subscribe for snapshots

  Each object contains:

  * `address` (string, required): EVM or SOL wallet address
  * `description` (string, optional): Label or description for the address

  ```json theme={null}
  {
    "addresses": [
      {
        "address": "0x6426af179aabebe47666f345d69fd9079673f6cd",
        "description": "Main Treasury"
      },
      {
        "address": "0x1234567890abcdef1234567890abcdef12345678",
        "description": ""
      }
    ]
  }
  ```
</ParamField>

<Note>
  Addresses must be valid and unique within the request. Duplicate addresses will be rejected.
</Note>

***

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.octav.fi/v1/subscribe-snapshot" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "addresses": [
        {
          "address": "0x6426af179aabebe47666f345d69fd9079673f6cd",
          "description": "Main Treasury"
        }
      ]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.octav.fi/v1/subscribe-snapshot', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      addresses: [
        {
          address: '0x6426af179aabebe47666f345d69fd9079673f6cd',
          description: 'Main Treasury'
        }
      ]
    })
  });

  const result = await response.json();
  console.log('Subscription result:', result);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.octav.fi/v1/subscribe-snapshot',
      headers={'Authorization': f'Bearer {api_key}'},
      json={
          'addresses': [
              {
                  'address': '0x6426af179aabebe47666f345d69fd9079673f6cd',
                  'description': 'Main Treasury'
              }
          ]
      }
  )

  result = response.json()
  print('Subscription result:', result)
  ```
</CodeGroup>

***

## How It Works

<Steps>
  <Step title="Subscribe Addresses">
    Call this endpoint with the addresses you want to track historically.
  </Step>

  <Step title="Daily Snapshots">
    Starting from the subscription date, daily portfolio snapshots are automatically captured for each subscribed address.
  </Step>

  <Step title="Query Historical Data">
    Use the [Historical Portfolio](/api/endpoints/historical-portfolio) endpoint to retrieve portfolio data from any date after subscription.
  </Step>
</Steps>

***

## Use Cases

<Tabs>
  <Tab title="Portfolio Tracking" icon="chart-line">
    Subscribe addresses to track portfolio performance over time:

    ```javascript theme={null}
    async function setupPortfolioTracking(addresses) {
      // Subscribe addresses for snapshots
      await fetch('https://api.octav.fi/v1/subscribe-snapshot', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${apiKey}`,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          addresses: addresses.map(addr => ({
            address: addr,
            description: `Tracked wallet ${addr.slice(0, 8)}...`
          }))
        })
      });

      console.log('Addresses subscribed! Historical data will be available starting tomorrow.');
    }
    ```
  </Tab>

  <Tab title="Treasury Management" icon="building-columns">
    Track multiple treasury addresses with descriptions:

    ```javascript theme={null}
    const treasuryAddresses = [
      { address: '0xabc...', description: 'Operations Treasury' },
      { address: '0xdef...', description: 'Development Fund' },
      { address: '0x123...', description: 'Marketing Budget' }
    ];

    await fetch('https://api.octav.fi/v1/subscribe-snapshot', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ addresses: treasuryAddresses })
    });
    ```
  </Tab>
</Tabs>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Subscribe Early" icon="clock">
    Historical data is only available from the subscription date forward. Subscribe addresses as soon as you need historical tracking to maximize data availability.
  </Accordion>

  <Accordion title="Use Descriptions" icon="tag">
    Add meaningful descriptions to addresses for easier identification when querying historical data or managing subscriptions.
  </Accordion>

  <Accordion title="Avoid Duplicates" icon="clone">
    The endpoint validates that all addresses in a request are unique. Check your existing subscriptions before adding new addresses.
  </Accordion>
</AccordionGroup>

***

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Historical Portfolio" icon="clock-rotate-left" href="/api/endpoints/historical-portfolio">
    Query snapshots from subscribed addresses
  </Card>

  <Card title="Portfolio" icon="wallet" href="/api/endpoints/portfolio">
    Current portfolio state
  </Card>
</CardGroup>
