# Architecture

To help illustrate how a Platform utilizes the Alluvial APIs to support its Liquid Collective protocol integration, this guide introduces a few fictional characters:

* Acme Custodian Corp: Financial institution that is a Platform for the Liquid Collective protocol and will offer its customers the ability to participate in the Liquid Collective protocol by staking ETH.
* Alice: user of Acme Custodian Corp
* Bob: user of Acme Custodian Corp

### Custodial vs. Non-Custodial wallets

A custodial wallet's private key(s) are held by either a 3rd party or by the financial institution that is servicing the wallet account on behalf of the customer. In this example, Alice and Bob have a custodial account with Acme Corp and Acme Corp owns / has access to the private key associated with Alice's and Bob's wallet addresses.

Below is an example of the flow of funds, showing how the staking action by Alice and Bob will flow through Acme's architecture and the Alluvial APIs.

{% hint style="info" %}
Architectural components in the Acme Infrastructure box are for illustrative purposes.
{% endhint %}

![Custodial flow of funds](https://3059818499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrNQhExRQsha4MbFFjxD%2Fuploads%2Fgit-blob-00fa8fc7c8021fec97495de245181b89f0263fe7%2Fcustodial-flow-of-funds.png?alt=media)

Non-custodial (or self-managed) wallets are those in which the customer holds the private keys. In this example, Alice is the only one with access to the private key for her wallet.

The largest differences between the two flow of funds diagrams are the wallet ownership and actions (i.e. signing transactions).

{% hint style="info" %}
Architectural components in the Acme Infrastructure box are for illustrative purposes.
{% endhint %}

![Non custodial flow of funds](https://3059818499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrNQhExRQsha4MbFFjxD%2Fuploads%2Fgit-blob-4d4e63d83915bf2b099c541a363360a8c8f5d776%2Fnon-custodial-flow-of-funds.png?alt=media)

### Segregated vs. Omnibus Accounts

#### Segregated account(s)

A segregated account structure is one where each customer at the financial institution (ex. Acme Corp) has their own unique, separate account. In this example, both Alice and Bob have their own unique Ethereum address associated with their individual accounts at Acme Corp.

![Segregated accounts](https://3059818499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrNQhExRQsha4MbFFjxD%2Fuploads%2Fgit-blob-e9925fcf245561976fce3d483a4a683abe4c19b4%2Faccount-architecture-segregated.png?alt=media)

Based on the example segregated account structure, you can see how Acme Corp will map its internal accounts to the technical resources (Organization, Depositor, Wallet) created when interacting with the Alluvial API.

![Segregated accounts mapping](https://3059818499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrNQhExRQsha4MbFFjxD%2Fuploads%2Fgit-blob-38ae4dced382404dbaca1ee485587677800009ce%2Faccount-mapping-segragated.png?alt=media)

#### Omnibus account(s)

An omnibus account is an account structure in which all users' accounts are grouped into a single wallet address.

![Omnibus accounts](https://3059818499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrNQhExRQsha4MbFFjxD%2Fuploads%2Fgit-blob-c30d29852bfeee7d4685d1f2b8bbb28f17f99aad%2Faccount-architecture-omnibus.png?alt=media\&token=aa5a6ceb-0d29-4f09-8e3e-421e1523c51a)

Below is an image of how to map Acme's architecture to resources (Organization, Depositor, and Wallet) created via Alluvial's API.

Alluvial isn't aware of, and at no time has control over, the underlying account structure Acme implements. Acme will create a Depositor object that represents all of the internal customers.

{% hint style="warning" %}
Review the Depositor states [(deny, pause, reactivate, and remove)](https://docs.alluvial.finance/api-reference/onboarding) as applying these states will impact all underlying customers.
{% endhint %}

![Omnibus accounts mapping](https://3059818499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrNQhExRQsha4MbFFjxD%2Fuploads%2Fgit-blob-2e5fc10462e1fd3159006cb8105086189c0f6df1%2Faccount-mapping-omnibus.png?alt=media)
