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

# Subgraph

#### Built With

* [TheGraph](https://thegraph.com/)
* And with ❤️

#### TheGraph Explorer:

**Mainnet (ChainID: 1)**

```
https://thegraph.com/explorer/subgraphs/HR7owbk45vXNgf8XXyDd7fRLuVo6QGYY6XbGjRCPgUuD?view=Overview&chain=arbitrum-one
```

**Optimism (ChainID: 10)**

```
https://thegraph.com/explorer/subgraphs/J7QQ4hkWLvfNBMAMxcYhzEfWw7ChJ9DM5qQsXcad5ewb?view=Overview&chain=arbitrum-one
```

**BSC (ChainID: 56)**

```
https://thegraph.com/explorer/subgraphs/5t5eG3Mc5ZEYUUjw5R2TWvYtVYxSZnsKFuNhpjAwUepb?view=Overview&chain=arbitrum-one
```

**Polygon (ChainID: 137)**

```
https://thegraph.com/explorer/subgraphs/7EwmQS7MyeY9BZC5xeAr25WgjcgbRNpAY95dZNBvqgja?view=Overview&chain=arbitrum-one
```

**Blast (ChainID: 238)**

```
https://thegraph.com/explorer/subgraphs/5Sia5PDi7BLF6VfBhvByBtHgqRCMkTNKrRD17cd4Ls86?view=Overview&chain=arbitrum-one
```

**Base (ChainID: 8453)**

```
https://thegraph.com/explorer/subgraphs/5dCiMYfUMh2RoT9AF8rnEYfKqU9eLv4e6GtPrTdD75sA?view=Overview&chain=arbitrum-one
```

**Arbitrum (ChainID: 42161)**

```
https://thegraph.com/explorer/subgraphs/9soNvLk5RWaJ3HtgJSsr9m5Nafo985kNyrArPM7iopUV?view=Overview&chain=arbitrum-one
```

**Avalanche (ChainID: 43114)**

```
https://thegraph.com/explorer/subgraphs/5t5eG3Mc5ZEYUUjw5R2TWvYtVYxSZnsKFuNhpjAwUepb?view=Overview&chain=arbitrum-one
```

**Sepolia (ChainID: 11155111) - Testnet**

```
https://thegraph.com/explorer/subgraphs/HafRrZ1KFWenXXxFisxSy2Nxyv7Atan7xXkc2rWFCddL?view=Overview&chain=arbitrum-one
```

**Optimism Sepolia (ChainID: 11155420) - Testnet**

```
https://thegraph.com/explorer/subgraphs/5dCiMYfUMh2RoT9AF8rnEYfKqU9eLv4e6GtPrTdD75sA?view=Overview&chain=arbitrum-one
```

**Base Sepolia (ChainID: 84532) - Testnet**

```
https://thegraph.com/explorer/subgraphs/CZxkjYEnom7ijhKv77n3Qf2WGuPMLkfVsyZzRB6EhMmP?view=Overview&chain=arbitrum-one
```

### Queries

#### Query a vesting token details

Retrieves the main information for a deployed vesting token

```graphql theme={null}
query VestingInfo($vestingToken: ID!) {
  vestingToken(id: $vestingToken) {
    id
    name
    symbol
    decimals
    redeemToken {
      id
      name
      symbol
      decimals
    }
    milestones(first: 1000) {
      timestamp
      ramp
      percentage
    }
    balance {
      allocation
      claimed
      claimable
      locked
      lastClaimedAt
    }
  }
}
```

#### Query a user's vesting balance by project

Retrieves the latest user's balance for all vesting tokens in a specific project.

```graphql theme={null}
query UserVestingsByProject(
  $userAddress: String!
  $vestingsTokens: [String!]!
  $first: Int = 1000
  $skip: Int = 0
) {
  holderBalances(
    first: $first
    skip: $skip
    where: { user: $userAddress, vestingToken_in: $vestingsTokens }
  ) {
    vestingToken {
      id
    }
    allocation
    claimed
  }
}
```

#### Query all vesting balances by project

Retrieves the overall vesting balances in a specific project.

```graphql theme={null}
query VestingsBalances(
  $vestingsTokens: [String!]!
  $first: Int = 1000
  $skip: Int = 0
) {
  vestingBalances(
    first: $first
    skip: $skip
    where: { vestingToken_in: $vestingsTokens }
  ) {
    vestingToken {
      id
    }
    allocation
    claimed
  }
}
```

#### Query all recipient's balances by vesting

Retrieves all of the recipient's balances by a specific vesting token.

```graphql theme={null}
query VestingRecipientBalances(
  $vestingToken: String!
  $first: Int = 1000
  $skip: Int = 0
) {
  holderBalances(
    first: $first
    skip: $skip
    where: { vestingToken: $vestingToken, isRecipient: true }
  ) {
    user
    allocation
    claimed
    balance
    updatedAt
    lastClaimedAt
    transferredIn
    transferredOut
  }
}
```

#### Query all the distributions by vesting

Retrieves all of the distributions made by a specific vesting token.

```graphql theme={null}
query VestingDistributionBatches(
  $vestingToken: String!
  $first: Int = 1000
  $skip: Int = 0
) {
  distributionBatches(
    first: $first
    skip: $skip
    where: { vestingToken: $vestingToken }
  ) {
    from
    totalAmount
    transactionHash
    blockTimestamp
    recipients {
      to
      value
    }
  }
}
```
