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

# Set up your gVault

> Set up your gVaults and configure the fees you charge customers.

## Before you start

Use your API key to list the gVaults available to your organization. Contact Ground to enable production access.

The examples use sandbox. For production, use `https://production.groundtech.co`
and your production API key.

## 1. List your gVaults

Keep your API key on your backend:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export GROUND_API_KEY="<your-api-key>"
export BASE_URL="https://sandbox.groundtech.co"
curl --fail-with-body "$BASE_URL/v3/gvaults" \
  -H "Authorization: Bearer $GROUND_API_KEY"
```

The response lists your available gVaults:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "data": [
    {
      "id": "8f4c52d7-62ab-4db9-a964-92f481f6b851",
      "assetId": "0031d484-d955-4612-b23b-d4d466c5abe6",
      "name": "Ground USTB gVault",
      "chain": "ethereum_sepolia",
      "contractAddress": "0x1111111111111111111111111111111111111111",
      "asset": {
        "symbol": "USDC",
        "contractAddress": "0x2222222222222222222222222222222222222222",
        "decimals": 6
      }
    }
  ]
}
```

If `data` is empty in sandbox, retry while setup completes. Contact Ground if
your gVaults remain unavailable.

If production access is disabled, the API returns `403`:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "error": "Gtoken access is not enabled for your organization. Please contact Ground admin.",
  "code": "product_not_enabled"
}
```

Use the values returned by your request:

| Field | Use |
| - | - |
| `id` | Use as `gVaultId` in fee and customer-access API requests |
| `assetId` | Identify the underlying investment: an asset UUID from the [asset catalog](https://docs.groundtech.co/api-reference/list-assets-v3.md). Several gVaults can share a source |
| `chain` | Select the customer's wallet network |
| `contractAddress` | Deposit, redeem and read share balances |
| `asset` | Identify the funding token and its decimals |

## 2. Read the current fees and limits

Set `GVAULT_ID` to your gVault's returned `id`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export GVAULT_ID="<your-gvault-id>"
curl --fail-with-body "$BASE_URL/v3/gvaults/$GVAULT_ID" \
  -H "Authorization: Bearer $GROUND_API_KEY"
```

`fees` shows your current settings. `feeUpdate` tracks the latest fee update and
is `null` before your first update.

Management fees accrue over time at an annual rate. Performance fees apply to gains above the
contract's high-water mark, the recorded share-value threshold for charging that
fee. Both accrue as shares to your fee recipient. Rates use percentages: `1` means 1%.

| Field in `fees` | Meaning |
| - | - |
| `feeRecipientAddress` | Recipient of your management and performance fee shares |
| `managementFeePct` | Your annual management rate |
| `performanceFeePct` | Your performance rate |
| `groundManagementFeePct` | Ground's annual management rate |
| `totalManagementFeePct` | Your management rate plus Ground's rate |
| `maxManagementFeePct` | Maximum combined annual management rate |
| `maxPerformanceFeePct` | Maximum performance rate |

The maximum rates are fixed when your gVault is deployed:

* Your maximum management rate is `maxManagementFeePct - groundManagementFeePct`.
  The combined rate must remain below 100%.
* Your performance rate cannot exceed `maxPerformanceFeePct`.

For example, if `maxManagementFeePct` is 99.99% and Ground's fee is 0.10%, you can
charge up to 99.89% per year in management fees.

Ground configures its management fee separately. The request below changes only
your fees. Ground-initiated fee changes also require your configured signer
approvals once signing is enabled.

## 3. Configure your fees

Set `FEE_RECIPIENT_ADDRESS` to the nonzero address that should receive your fee
shares. It must differ from Ground's recipient when either of your fees is
greater than zero.

This example sets your annual management fee to 0.20% and your performance fee to 15%:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export FEE_RECIPIENT_ADDRESS="<your-fee-recipient-address>"
curl --fail-with-body -X PATCH "$BASE_URL/v3/gvaults/$GVAULT_ID/fees" \
  -H "Authorization: Bearer $GROUND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"feeRecipientAddress":"'"$FEE_RECIPIENT_ADDRESS"'","managementFeePct":0.2,"performanceFeePct":15}'
```

Send only the fields you want to change. Set a rate to `0` to stop charging it.
Omitted fields keep their current values.

Fee changes execute automatically until signer approvals are enabled. After that,
your configured signers must approve each update in both sandbox and production.

A `202` response means the update is still processing, needs approval or is
waiting for confirmation. Check `status` to see what happens next. For example,
`awaiting_approval` means your signers need to approve:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "status": "awaiting_approval",
  "activityId": "01a1c873-a53b-7c26-8922-752334ca46d1"
}
```

For `awaiting_approval`, fetch the matching activity from
`GET /v3/approvals/pending`. Verify the requested fees, then use your
registered signing key with the
[approval API](https://docs.groundtech.co/v3/docs/portfolio-wallets/transaction-approvals.md#approving-an-activity).

A `200` response with `status: confirmed` means your requested fees are already in effect.

### Change your fee recipient

To change only the recipient, send `feeRecipientAddress`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export FEE_RECIPIENT_ADDRESS="<new-fee-recipient-address>"
curl --fail-with-body -X PATCH "$BASE_URL/v3/gvaults/$GVAULT_ID/fees" \
  -H "Authorization: Bearer $GROUND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"feeRecipientAddress":"'"$FEE_RECIPIENT_ADDRESS"'"}'
```

Your management and performance fees use the same recipient. Both rates stay
unchanged. Shares already earned remain with the original recipient, who can
[redeem them onchain](https://docs.groundtech.co/v3/docs/gtokens/deposit-and-redeem.md#redeem-earned-fees).

## 4. Confirm your update

After a `202` response, poll `GET /v3/gvaults/{gVaultId}` or use
[fee status webhooks](https://docs.groundtech.co/v3/docs/gtokens/webhooks.md):

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --fail-with-body "$BASE_URL/v3/gvaults/$GVAULT_ID" \
  -H "Authorization: Bearer $GROUND_API_KEY"
```

While your update is pending, `fees` shows the current settings and
`feeUpdate.requestedFees` shows the changes you requested:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "8f4c52d7-62ab-4db9-a964-92f481f6b851",
  "assetId": "0031d484-d955-4612-b23b-d4d466c5abe6",
  "name": "Ground USTB gVault",
  "chain": "ethereum_sepolia",
  "contractAddress": "0x1111111111111111111111111111111111111111",
  "asset": {
    "symbol": "USDC",
    "contractAddress": "0x2222222222222222222222222222222222222222",
    "decimals": 6
  },
  "fees": {
    "feeRecipientAddress": "0x3333333333333333333333333333333333333333",
    "performanceFeePct": 0,
    "maxPerformanceFeePct": 99.99,
    "managementFeePct": 0,
    "groundManagementFeePct": 0.1,
    "totalManagementFeePct": 0.1,
    "maxManagementFeePct": 99.99
  },
  "feeUpdate": {
    "status": "submitted",
    "transactionHash": "0xabababababababababababababababababababababababababababababababab",
    "activityId": "01a1c873-a53b-7c26-8922-752334ca46d1",
    "requestedFees": {
      "feeRecipientAddress": "0x3333333333333333333333333333333333333333",
      "managementFeePct": 0.2,
      "performanceFeePct": 15
    }
  }
}
```

Wait for `feeUpdate.status` to become `confirmed`, then check that `fees` matches
your request. In this example, `managementFeePct` becomes `0.2`,
`performanceFeePct` becomes `15` and `totalManagementFeePct` becomes `0.3`.
Wait for confirmation before sending another update.

### Resolve an incomplete update

| Result | What to do |
| - | - |
| Request times out | Read `fees` and `feeUpdate` before retrying |
| `awaiting_approval` | Approve the matching activity through the approval API |
| `409 gvault_fee_update_pending` | Wait for the active update to finish |
| `failed` | Check current fees and the transaction receipt before submitting a corrected request |
| Invalid rate or recipient | Check the fee limits and recipient requirements, then correct your request |

Contact Ground if the update cannot be resolved.

## Next step

[Admit customer wallets](https://docs.groundtech.co/v3/docs/gtokens/manage-gtoken-access.md), then integrate
[deposits and withdrawals](https://docs.groundtech.co/v3/docs/gtokens/deposit-and-redeem.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.