# Vote Escrow

{% hint style="warning" %}
Vote Escrow system is only available for V2 pools
{% endhint %}

### Locks

## Get all VE locks for a Tezos address

<mark style="color:blue;">`GET`</mark> `https://api.plenty.network/ply/locks`

This endpoint returns an array of objects where each object contains information about a VE lock, its ID, base value, timestamp of expiry, attachment status, current voting power, available and used voting power for the present epoch, and voting power in the next epoch.

#### Query Parameters

| Name    | Type   | Description               |
| ------- | ------ | ------------------------- |
| address | String | Tezos address of the user |

{% tabs %}
{% tab title="200: OK Successfully returned list of locks" %}

```typescript
{
  result: {
    id: string;
    owner: string;
    baseValue: string; // Amount of PLY locked
    endTs: string; // Ending timestamp
    attached: boolean; // `true` if attached to a gauge
    epochVotingPower: string; // Current max usable voting power of the lock
    currentVotingPower: string; // Voting power at present second
    availableVotingPower: string; // Unused voting power in the present epoch
    nextEpochVotingPower: string; // Voting power for the next epoch
  }[];
}
```

{% endtab %}
{% endtabs %}

### Bribes

## Get all bribes added in a specific epoch

<mark style="color:blue;">`GET`</mark> `https://api.plenty.network/ply/bribes`

This endpoint returns an array of objects where each object contains information about the bribes added to a specific pool.

#### Query Parameters

| Name  | Type    | Description                          |
| ----- | ------- | ------------------------------------ |
| epoch | Integer | Epoch for which bribes are requested |

{% tabs %}
{% tab title="200: OK Successfully returned list of bribes for an epoch" %}

```typescript
[
  {
    pool: string; // The pool to which the bribe was added
    bribes: {
      value: string; // Amount of tokens added without decimals
      price: string; // Price of each decimal scaled token 
      name: string; // Token symbol
    }[];
  };
]
```

{% endtab %}
{% endtabs %}

## Get all bribes provided by a specific Tezos address

<mark style="color:blue;">`GET`</mark> `https://api.plenty.network/ply/bribes-provider`

This endpoint returns an array of objects where each object contains information about the bribe added by the provided Tezos address.

#### Query Parameters

| Name                                      | Type   | Description                     |
| ----------------------------------------- | ------ | ------------------------------- |
| address<mark style="color:red;">\*</mark> | String | Tezos address of bribe provider |

{% tabs %}
{% tab title="200: OK Successfully returned list of bribes added by the address" %}

```typescript
[
  {
    value: string; // Amount of tokens added with decimals
    name: string; // Token symbol
    amm: string; // Pool to which bribe was added
    epoch: string; // Epoch at which bribe was added
    price: string; // Price of each decimal scaled token
 }
]
```

{% endtab %}
{% endtabs %}

### Pools

## Get incentivisation details of all pools added to the VE system

<mark style="color:blue;">`GET`</mark> `https://api/plenty.network/ply/pools`

This endpoint returns an array of objects where each object contains information about an incentivised pool, its current and future epoch APR and all bribes of the present epoch,&#x20;

{% tabs %}
{% tab title="200: OK Successfully returned a list of incentivised pools" %}

<pre class="language-typescript"><code class="lang-typescript">[
  {
    pool: string; 
    bribes: {
      value: string; // Amount of tokens added with decimals
      price: string; // Price of one decimal scaled token
      name: string; // Token symbol
    }[];
    apr: string; // Percentage APR
    futureApr: string;
<strong>  };
</strong>]
</code></pre>

{% endtab %}
{% endtabs %}

### Voting Rewards

## Get all unclaimed voting rewards for a Tezos address

<mark style="color:blue;">`GET`</mark> `https://api.plenty.network/ply/votes`

This endpoint returns an array of objects where each object contains information about unclaimed fees and bribes for a specific epoch.&#x20;

#### Query Parameters

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| address<mark style="color:red;">\*</mark> | String | User's Tezos address |

{% tabs %}
{% tab title="200: OK Successfully returned list of unclaimed rewards" %}

```typescript
[
  {
    votesUnclaimed: {
      epoch: string;
      amm: string; // Tezos address of the pool
      votes: string; // Votes casted for this pool
      fee: {
        token1Fee: string;
        token2Fee: string;
        token1Symbol: string;
        token2Symbol: string;
      };
      bribes: {
        amm: string;
        epoch: string;
        bribeId: string;
        provider: string;
        value: string;
        name: string;
      }[];
      unclaimedBribes: number[];
      feeClaimed: boolean;
      voteShare: string;
    }[];
    lockId: string;
  };
]
```

{% endtab %}
{% endtabs %}

### V2 Position

## Get all v2 liquidity positions of a Tezos address

<mark style="color:blue;">`GET`</mark> `https://api.plenty.network/ply/positions`

This endpoint returns an array of objects where each object contains information about a v2 liquidity position of the user, its staked gauge balance, wallet balance, boosted balance and token, and APR of the pool involved.

#### Query Parameters

| Name    | Type   | Description               |
| ------- | ------ | ------------------------- |
| address | String | Tezos address of the user |

{% tabs %}
{% tab title="200: OK Successfully returned a list of positions" %}

```typescript
[
  {
    amm: string; // Pool to which position belongs to
    lqtBalance: string; // Liquidity token balance
    stakedBalance: string; // LP tokens staked in gauge
    derivedBalance: string; // Boosted balance
    boostTokenId: string; // veNFT used for the boost
    poolAPR: {
      current: string; // Current epoch APR
      future: string; // Future epoch APR
    };
  }
]
```

{% endtab %}
{% endtabs %}
