> ## 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.

# Onchain Architecture

> How deposits, direct protocol positions, and Ground RWA Vault positions move through Ground's onchain contracts and programs.

This page describes how stablecoins enter a Portfolio Wallet and then move through either a direct protocol position or a Ground RWA Vault position. The same API lifecycle applies across supported networks; execution uses the contracts or programs appropriate to the selected source.

## Funding a Portfolio Wallet

Funding and allocation are separate stages. An external transfer first becomes cash in the Portfolio Wallet. A later Ground-managed rebalance deploys that cash according to the wallet's strategy.

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
sequenceDiagram
    participant User as External Wallet
    participant PW as Portfolio Wallet
    participant API as Ground API

    User->>PW: Transfer selected stablecoin
    API->>API: Detect and confirm transfer
    API->>API: Post wallet cash balance
    API->>PW: Start eligible strategy allocation
```

Funds are allocated within compatible [allocation groups](https://docs.groundtech.co/v3/docs/portfolio-wallets/auto-rebalancing.md#allocation-groups). The selected group determines which positions and withdrawal destinations those funds can support. [Supported Chains](https://docs.groundtech.co/v3/docs/portfolio-wallets/supported-chains.md) describes stablecoin coverage and network movement.

## Signing Portfolio Wallet actions

Ground routes Portfolio Wallet signing requests to the configured signing service according to the wallet's configured policies. Ground then broadcasts the signed transaction on the selected network. Yield-source actions execute through Ground routing contracts or programs, while payouts transfer stablecoins to the withdrawal destination.

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
sequenceDiagram
    participant API as Ground API
    participant SC as Signing service
    participant PW as Portfolio Wallet
    participant Router as Ground Router

    API->>SC: Request Portfolio Wallet transaction signature
    SC-->>API: Return approved signed transaction
    API->>PW: Broadcast signed wallet transaction
    PW->>Router: Execute authorized yield-source action
```

Some actions require approval from the organization's configured signer before the signing service releases the signature. See [Transaction Approvals](https://docs.groundtech.co/v3/docs/portfolio-wallets/transaction-approvals.md) for the approval API and verification flow.

## Direct protocol positions

A direct protocol allocation supplies stablecoins to the selected protocol and leaves the resulting position token or vault share in the Portfolio Wallet. Redemption converts that position back into the source's stablecoin.

| Network | Onchain execution | Examples |
| - | - | - |
| EVM | MasterRouter resolves an approved adapter through AdapterRegistry; the adapter calls the protocol | Morpho, Aave |
| Solana | Ground's router program invokes the underlying protocol programs using wallet token accounts | Kamino, Figure |
| TRON | MasterRouter resolves the JustLend adapter through AdapterRegistry; the adapter supplies or redeems USDT | JustLend V1 |

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
sequenceDiagram
    participant PW as Portfolio Wallet
    participant Router as Ground Router
    participant Integration as Protocol Adapter or Program
    participant Protocol as Underlying Protocol

    PW->>Router: Execute yield-source action
    Router->>Integration: Route authorized action
    Integration->>Protocol: Supply stablecoin
    Protocol-->>PW: Issue protocol position
```

An exit follows the corresponding protocol's redeem path. Some direct protocols settle in one transaction; others require additional waiting or settlement steps before stablecoin is available for payout.

## Ground RWA Vault positions

Ground RWA Vault sources use dedicated vault contracts on EVM or vault programs on Solana. The Portfolio Wallet submits the source’s action through the corresponding Ground router, then holds a wallet-specific, non-transferable Ground receipt rather than an underlying provider instrument directly. Use the live catalog for available sources and their networks.

Depending on the product and available liquidity, a Ground RWA Vault deposit may settle immediately or use the following asynchronous deposit lifecycle:

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
sequenceDiagram
    participant PW as Portfolio Wallet
    participant Router as Ground Router
    participant GV as Ground Vault Contract or Program
    participant Provider as RWA Provider
    participant Processor as Vault Processor

    PW->>Router: Submit vault deposit request
    Router->>GV: Create wallet request
    GV->>Provider: Start provider settlement
    Provider-->>GV: Make underlying value claimable
    Processor->>GV: Process available settlement
    PW->>Router: Claim processed deposit
    Router->>GV: Claim deposit for wallet
    GV-->>PW: Issue non-transferable Ground receipt
```

Ground RWA Vault exits use the corresponding redemption lifecycle: the wallet requests redemption, provider settlement and vault processing complete, the wallet claims stablecoin, and Ground sends the payout to the withdrawal destination. Some vaults can settle through available onchain liquidity; otherwise the asynchronous path applies. Each withdrawal payout leg settles and pays out independently.

> [!NOTE]
>
> Processing policies in the [Assets](https://docs.groundtech.co/v3/docs/portfolio-wallets/yield-sources.md) catalog describe operational estimates. Actual completion depends on external fulfillment and vault processing. Because payout legs may settle at different times, each requires separate approval when signing keys are configured in the [developer portal](https://portal.groundtech.co). See [Transaction Approvals](https://docs.groundtech.co/v3/docs/portfolio-wallets/transaction-approvals.md) for details.

## Contract addresses

See [Contract Addresses](https://docs.groundtech.co/v3/docs/resources/addresses.md) for the canonical production and sandbox router, registry, adapter, Ground vault, bridge, and Solana program deployments.


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