owned this note
owned this note
Published
Linked with GitHub
# Liquidity Pools
###### tags: `connector`, `liquidity-pools`, `specs`
[TOC]
---
## Versions
This section contains the iterations of liquidity pools and focuses on the technical implementation of the messages and associated logic
* [V1](https://centrifuge.hackmd.io/VulYS64LRx6V2fxNyo7-3w?both)
* [V2](https://centrifuge.hackmd.io/B1J4j3w_SimwzL6W470DdQ?both)
* [Vx](/AWgd9vyITmSDE9-dm-irnw)
## Types and Properties
### Tokens
All supported, non-tranche tokens, tokens on the Centrifuge Chain MUST be identifiable by an the inner value of the`xcm::GeneralIndex(uint128)` -- i.e. an `uint128`.
:::danger
:warning: It is **HIGHLY** important that all tokens FROM other domains do NOT clash with local tokens identifier AND that we ensure as best as possible to NOT clash with identifiers from other parachain projects → not dealing with collisions and then mapping per domain is the reason here.
:::
:::info
:bulb: Using the `unit128` allows us to handle only one conversion between ID and enum for both Connectors and XCM. Note: See [registry 1](https://github.com/colorfulnotion/xcm-global-registry) or [registry 2](https://github.com/open-web3-stack/token-resources). Polkadot cleary has not yet fully made a good choice/lead here
:::
It is important that
* ALL domains use the same mapping for token to general index
:::info
:bulb: This allows us to have one generic transfer message for all fungibles we support and have a safe mapping on Centrifuge Chain into our `enum CurrencyId` as also on the EVM side map into smart contract addresses.
:::
:::info
:bulb: We only support "incoming" fungibles. I.e. we do not allow to send our local USDC or AUSD to another domain. "Incoming" tokens MUST be identified on a per domain-token-combination.
E.g.
* Ethereum sends DAI → `WrappedEthDai` on our chain
* Avalance sends DAI → `WrappedAvalanceDai` on our chain
:::
### Domains
Domains must be identifiable via an `uint8+uint64`. Where
* `uint8` specifies the consensus "world" -- EVM or Parachain currently
* `uint64` specifies the id the chain has in this world
:::info
:bulb: This allows us to serialize into the rust based `struct Domain` and have an easy way to identify stuff on the EVM side via byte comparison.
:::
### Directionality
:::info
:bulb: Not all messages are allowed to be send from all domains. Hence, messages have a directionality.
:::
* Outgoing messages: `Centrifuge` > `OtherDomains`
* `Centrifuge` MUST reject those messages
* `OtherDomains` MUST process those messages
* Incoming messages: `OtherDomains` > `Centrifuge`
* `Centrifuge` MUST process those messages
* `OtherDomains` MUST reject those messages
* Bidirectional messages: `Centrifuge` <> `OtherDomains`
* `Centrifuge` MUST process those messages
* `OtherDomains` MUST process those messages
* Unidirectional messages:
* `Centrifuge` <> `OtherDomains`
* `Centrifuge` MUST process those messages
* `OtherDomains` MUST process those messages
* Relaying messages: `OtherDomains` > `Centrifuge` > `OtherDomains`
* `Centrifuge` CAN relay these messages from one domain to the other. This might include processing on the `Centrifuge` side
* `OtherDomains` MUST process those messages
## Messages
**Below is the complete list of messages that liquidity pools supports.**
### `Invalid`
:::info
:bulb: An invalid message
:::
* `call_type` = 0
* Bidirectional
| Bytes | Type | Description |
| ----- | -------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
---
### `MessageProof`
:::info
:bulb: Related to multi-router aggregation.
* Can be called by anyone
:::
* `call_type` = 1
* Outgoing message
| Bytes | Type | Description |
| -------- | ----------- | -------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-32 | [uint8; 32] | Hash of the message |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported on Centrifuge Chain. Required for audit.
:::
---
### `InitiateMessageRecovery`
:::info
:bulb: Related to multi-router aggregation.
* Must only be callable by root
:::
* `call_type` = 2
* Outgoing message
| Bytes | Type | Description |
| -------- | ----------- | -------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-32 | [uint8; 32] | Hash of the message |
| 33-64 | [uint8; 32] | Address of the router |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported on Centrifuge Chain. Required for audit.
:::
---
### `DisputeMessageRecovery`
:::info
:bulb: Related to multi-router aggregation. Similar to `ScheduleUpgrade`.
* Must only be callable by root
:::
* `call_type` = 3
* Outgoing message
| Bytes | Type | Description |
| -------- | ----------- | -------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-32 | [uint8; 32] | Hash of the message |
| 33-64 | [uint8; 32] | Address of the router |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported on Centrifuge Chain. Required for audit.
:::
---
### `Batch`
:::info
:bulb: Contains a batch of LP messages. Ensures the correct order of execution on the receiving side.
* MUST NOT allow nested `batch` messages - so `batch` inside of `batch`
:::
* `call_type` = 4
* Outgoing message
#### `V1` → `V2`
* Added in `v2`
---
### `ScheduleUpgrade`
* `call_type` = 5
* Outgoing message
| Bytes | Type | Description |
| ----- | ------------------- | ------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-20 | [uint8; 20] | The address of the `upgrade` |
---
### `CancelUpgrade`
* `call_type` = 6
* Outgoing message
| Bytes | Type | Description |
| ----- | ------------------- | ------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-20 | [uint8; 20] | The address of the `upgrade` |
---
### `RecoverTokens`
:::info
:bulb: Similar to `ScheduleUpgrade`.
* Must only be callable by root
:::
* `call_type` = 7
* Outgoing message
| Bytes | Type | Description |
| -------- | ----------- | -------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-32 | [uint8; 32] | Target contract |
| 33-64 | [uint8; 32] | Token to recover |
| 65-96 | [uint8; 32] | User to send the tokens to |
| 97-128 | uint256 | Amount of tokens to recover |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported on Centrifuge Chain. Optional for audit.
:::
---
### `UpdateCentrifugeGasPrice`
:::info
:bulb: Update Centrifuge Gas Price
:::
* `call_type` = 8
* Outgoing message
| Bytes | Type | Description |
| ----- | -------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-16 | uint128 | The new gas price |
| 17-25 | uint64 | Timestamp the `price` was computed |
:::warning
:construction: Not yet supported on Centrifuge Chain. Required for audit.
:::
---
### `AddAsset`
:::info
:bulb: Add a currency to a domain, i.e., register the `currency id -> EVM Address` mapping.
:::
* `call_type` = 9
* Outgoing message
| Bytes | Type | Description |
| ----- | -------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-16 | uint128 | The Centrifuge Connector's global id for this `currency` |
| 17-36 | EVM address (20 bytes) | The corresponding EVM address of the currency |
#### `V1` → `V2`
* Renamed from `AddCurrency` in `v2`
---
### `AddPool`
* `call_type` = 10
* Outgoing message
| Bytes | Type | Description |
| ----- | -------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
---
### `AddTranche`
* `call_type` = 11
* Outgoing message
:::info
:bulb: The `decimals` of a tranche MUST be equal to the `decimals` of a pool. Hence, we do not send this information here. Consuming domains MUST take care of storing the `decimals` upon receiving an `AddPool` message.
:::
| Bytes | Type | Description |
| ----- | ------------------- | ------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-152 | [uint8; 128] (utf-8)| The `token_name` of the tranche tokens |
| 153-184| [uint8; 32] (utf-8) | The `token_symbol` of the tranche tokens |
| 185 | uint8 | The `decimals` of the tranche token |
| 186-217| [uint8; 32] | The `hook` address which will be hardcoded for now |
---
### `AllowAsset`
:::info
:bulb: Allow a currency to be used as a currency for investing in pools
:::
* `call_type` = 12
* Outgoing message
| Bytes | Type | Description |
| ----- | -------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | uint128 | The `currency`, i.e., the Centrifuge Connector's global currency id |
#### `V1` → `V2`
* Renamed from `AllowInvestmentCurrency` in `v2`
---
### `DisallowAsset`
:::info
:bulb: Disallow a currency to be used as a currency for investing in pools
:::
* `call_type` = 13
* Outgoing message
| Bytes | Type | Description |
| ----- | -------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | uint128 | The `currency`, i.e., the Centrifuge Connector's global currency id |
#### `V1` → `V2`
* Renamed from `DisallowInvestmentCurrency` in `v2`
---
### `UpdateTrancheTokenPrice`
* `call_type` = 14
* Outgoing message
| Bytes | Type | Description |
| ------ | ----------- | -------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-40 | uint128 | The Connector's global `currency` id that the price is denominated in |
| 41-56 | uint128 | The `price` of a tranche token |
| 57-64 | uint64 | Timestamp the `price` was computed |
---
### `UpdateTrancheTokenMetadata`
* `call_type` = 15
* Outgoing message
| Bytes | Type | Description |
| ------ | ------------------- | ------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-152 | [uint8; 128] (utf-8)| The `token_name` of the tranche tokens |
| 153-184| [uint8; 32] (utf-8) | The `token_symbol` of the tranche tokens |
---
### `UpdateTrancheHook`
* `call_type` = 16
* Outgoing message
| Bytes | Type | Description |
| ------ | ------------------- | ------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-51 | [uint8; 32] | The new global `hook` address |
---
### `TransferAssets`
:::info
:bulb: A transfer of non-tranche tokens fungibles. For v2, it will only support stable-coins.
:::
* `call_type` = 17
* Bidirectional message
:::danger
:warning: A domain MUST NOT accept every incoming token. The sender MUST ensure the receiver will not reject.
:::
| Bytes | Type | Description |
| ------ | ----------- | ------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-16 | uint128 | The Connector's global `currency` id |
| 17-48 | [uint8; 32] | The address of the `receiver` |
| 49-64 | uint128 | The `amount` being transferred |
---
### `TransferTrancheTokens`
* `call_type` = 18
* Bidirectional message & relaying message
:::info
:bulb: We need a separate transfer message, dedicated to tranche tokens, as the tokens are not deterministic for us and we can not have a sane mapping from `uint128` to them, without knowing `pool_id` and `tranche_id`.
:::
| Bytes | Type | Description |
| ------ | ----------- | ------------------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-33 | (uint8, uint64) | The `destinationDomain` of the message to be sent to |
| 34-65 | [uint8; 32] | The `destinationAddress`, i.e., the address of the `receiver` in the `destinationDomain` |
| 66-81 | uint128 | The `amount` being transferred |
___
### `UpdateRestriction`
:::info
:bulb: Wrapper for messages related to restriction
:::
* `call_type` = 19
* Outgoing message
| Bytes | Type | Description |
| ----- | ----------- | ------------------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-?? | ?? | The nested restriction `update` , see below for details |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported on Centrifuge Chain. Required for audit.
:::
___
### `UpdateRestriction.UpdateMember`
* `UpdateRestriction call_type` = 1
* Outgoing message
| Bytes | Type | Description |
| ----- | ----------- | ------------------------------------------------------------ |
| 0 | uint8 | The `UpdateRestriction call_type` of the message |
| 1-32 | [uint8; 32] | The address of the `user` that is being whitelisted |
| 33-40 | uint64 | `validUntil`: The epoch value date representing the date until which that the `user` is allowlisted |
#### `V1` → `V2`
* Changed to nested variant of `UpdateRestriction` in `v2`
___
### `UpdateRestriction.Freeze`
:::info
:bulb: Disallows an investor to further invest into the given liquidity pool.
:::
* `UpdateRestriction call_type` = 2
* Outgoing message
| Bytes | Type | Description |
| ----- | ----------- | ------------------------------------------------------------ |
| 0 | uint8 | The `UpdateRestriction call_type` of the message |
| 1-32 | [uint8; 32] | The address of the `user` that is being frozen |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported on Centrifuge Chain. Required for audit.
:::
---
### `UpdateRestriction.Unfreeze`
:::info
:bulb: Revert freeze
:::
* `call_type` = 3
* Outgoing message
| Bytes | Type | Description |
| ----- | ----------- | ------------------------------------------------------------ |
| 0 | uint8 | The `UpdateRestriction call_type` of the message |
| 1-32 | [uint8; 32] | The address of the `user` that is being unfrozen |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported on Centrifuge Chain. Required for audit.
:::
---
### `DepositRequest`
* `call_type` = 20
* Incoming message
:::info
:bulb: We deliberately allow to choose the token that is used for investing. At the beginning the contracts will ensure that the used token equals the pool currency. On both the sending side and on Centrifuge. Later, we can change that if we have token swaps.
:::
| Bytes | Type | Description |
| ----- | ----------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id that is used for investing |
| 73-88 | uint128 | The `amount` the order should be increased by |
#### `V1` → `V2`
* Renamed from `IncreaseInvestOrder` in `v2`
---
### `RedeemRequest`
* `call_type` = 22
* Incoming message
| Bytes | Type | Description |
| ----- | ----------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout |
| 73-88 | uint128 | The `amount` the order should be increased by |
#### `V1` → `V2`
* Renamed from `IncreaseRedeemOrder` in `v2`
---
### `FulfilledDepositRequest`
* `call_type` = 21
* Outgoing message
:::info
:bulb: This message is automatically sent when a (partially) processed investment is collected. It takes care of moving the collected funds into the holding of `investor`.
:::
| Bytes | Type | Description |
| ------- | ----------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global foreign `currency` id in which the investment was realized |
| 73-88 | uint128 | The `currency_payout` amount which was invested during epoch execution |
| 89-104 | uint128 | The `tranche_tokens_payout` amount received for the investment made |
#### `V1` → `V2`
* Renamed from `ExecutedCollectInvest` in `v2`
---
### `FulfilledRedeemRequest`
* `call_type` = 22
* Outgoing message
:::info
:bulb: This message is automatically sent when a (partially) processed redemption is collected. It takes care of moving the collected funds into the holding of `investor`.
:::
| Bytes | Type | Description |
| ------- | ----------- | ----------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global foreign `currency` id for the payout |
| 73-88 | uint128 | The `currency_payout` amount received for the redemption made |
| 89-104 | uint128 | The `tranche_tokens_payout` amount which was redeemed during epoch execution |
#### `V1` → `V2`
* Renamed from `ExecutedCollectRedeem` in `v2`
---
### `CancelDepositRequest`
* `call_type` = 23
* Incoming message
:::info
:bulb: This message is a special version of [DecreaseInvestOrder](#DecreaseInvestOrder) required for ERC-4626. On the Centrifuge Chain side, it will simply call `decrease` with the unprocessed investment amount.
:::
:::info
:bulb: This message, if successful, triggers a message being sent back to the sending domain. The message will take care of refunding the investor with the unprocessed investment amount. The `investor` address is used as the receiver of those tokens. See [ExecutedDecreaseInvestOrder](#ExecutedDecreaseInvestOrder) for details.
:::
| Bytes | Type | Description |
| ------ | ----------- | ------------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout |
#### `V1` → `V2`
* Renamed from `CancelInvestOrder` in `v2`
---
### `CancelRedeemRequest`
* `call_type` = 24
* Incoming message
:::info
:bulb: This message is a special version of [DecreaseRedeemOrder](#DecreaseRedeemOrder) required for ERC-4626. On the Centrifuge Chain side, it will simply call `decrease` with the unprocessed investment amount.
:::
:::info
:bulb: This message, if successful, triggers a message being sent back to the sending domain. The message will take care of refunding the investor with the unprocessed redemption amount. The `investor` address is used as the receiver of those tokens. See [ExecutedDecreaseRedeemOrder](#ExecutedDecreaseRedeemOrder) for details.
:::
| Bytes | Type | Description |
| ------ | ----------- | ------------------------------------------------------ |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout |
#### `V1` → `V2`
* Renamed from `CancelRedeemOrder` in `v2`
---
### `FulfilledCancelDepositRequest`
* `call_type` = 25
* Outgoing message
:::info
:bulb: This message is automatically sent when an unprocessed investment order in `pool_currency` is decreased and the currency fully swapped back to the specified (return) `currency`. In case the `pool` and `return` currencies mismatch, this message is dispatched asynchronously.
:::
| Bytes | Type | Description |
| ------- | ----------- | ---------------------------------------------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout of the decreased (unprocessed investment) |
| 73-88 | uint128 | The `currency_payout` amount that was actually executed in the original `DecreaseInvestOrder` message, i.e., the amount by which the investment order was actually decreased by (after swapping). |
| 89-104 | uint128 | The `fulfilled` denominated in the `foreign` payment currency, i.e., the unprocessed and processed (but not yet collected) investment converted into `foreign`. |
#### `V1` → `V2`
* Renamed from `ExecutedDecreaseInvestOrder` in `v2`
---
### `FulfilledCancelRedeemRequest`
* `call_type` = 26
* Outgoing message
:::info
:bulb: This message is automatically sent when an unprocessed redemption order is decreased. It takes care of refunding the investor with the given amount the order was reduced by. The `investor` address is used as the receiver of those tokens.
:::
| Bytes | Type | Description |
| ------- | ----------- | ---------------------------------------------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id in which `DecreaseRedeemOrder` was realized |
| 73-88 | uint128 | The `tranche_tokens_payout` amount that was actually executed in the original `DecreaseRedeemOrder` message, i.e., the amount by which the redemption order was actually decreased by |
#### `V1` → `V2`
* Renamed from `ExecutedDecreaseRedeemOrder` in `v2`
---
### `TriggerRedeemRequest`
:::info
:bulb: We will need the ability to force redemptions on Centrifuge Chain at some point. This is just the lower-level message on the Solidity side to support that eventual feature.
* MUST only be callable to root
:::
* `call_type` = 27
* Outgoing message
| Bytes | Type | Description |
| ------ | ----------- | -------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout |
| 73-88 | uint128 | The `amount` that should be redeemed |
#### `V1` → `V2`
* Added in `v2`
:::warning
:construction: Not yet supported in Solidity and Centrifuge Chain. Not required for audit.
:::
## Deprecated Messages
:::info
:bulb: All below messages have been deprecated.
:::
### `DecreaseDepositRequest`
* Incoming message
:::info
:bulb: We deliberately allow to choose the token that is used for investing. At the beginning the contracts will ensure that the used token equals the pool currency. On both the sending side and on Centrifuge. Later, we can change that if we have token swaps.
:::
:::info
:bulb: This message, if succesful, triggers a message being sent back to the sending domain. The message will take care of re-funding the investor with the given amount the order was reduced with. The `investor` address is used as the receiver of that tokens. See [FulfilledDepositRequest](#FulfilledDepositRequest) for details.
:::
| Bytes | Type | Description |
| ----- | ----------- | ---------------------------------------------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout |
| 73-88 | uint128 | The `amount` the order should be decreased by
___
### `DecreaseRedeemRequest`
* Incoming message
:::info
:bulb: This message, if succesful, triggers a message being sent back to the sending domain. The message will take care of re-funding the investor with the given amount the order was reduced with. The `investor` address is used as the receiver of that tokens. See [FulfilledRedeemRequest](#FulfilledRedeemRequest) for details.
:::
| Bytes | Type | Description |
| -------- | ----------- | -----------------------------------------------|
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout |
| 73-88 | uint128 | The `amount` the order should be decreased by |
___
### `CollectInvest`
* Incoming message
:::info
:bulb: This message, if succesful, triggers a message being sent back to the sending domain. The message will take care of moving the collected funds into the holding of `investor`. See [FulfilledDepositRequest](#FulfilledDepositRequest) for details.
:::
| Bytes | Type | Description |
| ----- | ----------- | -------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | u128 | The Connector's global `currency` id in which the investment was realised
___
### `CollectRedeem`
* Incoming message
:::info
:bulb: This message, if succesful, triggers a message being sent back to the sending domain. The message will take care of moving the collected funds into the holding of `investor`. See [FulfilledRedeemRequest](#FulfilledRedeemRequest) for details.
:::
| Bytes | Type | Description |
| ----- | ----------- | --------------------------------------------------- |
| 0 | uint8 | The `call_type` of the message |
| 1-8 | uint64 | The `pool_id` |
| 9-24 | [uint8; 16] | The `tranche_id` |
| 25-56 | [uint8; 32] | The address of the `investor` |
| 57-72 | uint128 | The Connector's global `currency` id for the payout |
---