About Portfolios
In Polymesh, all assets (excluding the native token POLYX) are held at the identity level. This allows Polymesh to enforce compliance in real-time based on claims also held at the identity level.
To allow users to organize their assets underneath their identity, and to flexibly assign key permissions and custody, Polymesh has the concept of portfolios. A particular asset can have different balances across portfolios within the same identity.
Every identity has a default portfolio. This is where assets are received, and where assets are moved to when a portfolio is deleted. Transfers of assets between portfolios of the same identity are always possible and not subject to any compliance rules.
Users can assign one custodian per portfolio they own. A portfolio can contain any number of different assets.
Portfolios can be managed on the Polymesh Portal or in the Polymesh App.
To manage portfolios in the Polymesh Portal, please follow this guide.
This guide is based on the Polymesh App and is broken down into the following main sections:
How to manage portfolios with the Polymesh app
How to manage portfolios with the Polymesh app
Creating a portfolio with the Polymesh app
1. Go to the Polymesh App then fill in the data as per below:
- using the selected account: Select your Polymesh account
- submit the following extrinsic: Select
portfolio
thencreatePortfolio(name)
- name: Enter a name for your portfolio
Click here to see this image at full resolution. - Once all data are filled, click on
Submit Transaction
at the right corner of the page
2. A confirmation window will appear, click on Sign and Submit
and then sign the transaction with your wallet.
How to retrieve your Portfolio ID
Retrieve Portfolio ID by querying the blockchain
Go to the Polymesh App then fill in the data as per below:
- selected state query: Select
portfolio
thenportfolio(PolymeshPrimitivesIdentityId, u64)
- Paste your DID from your wallet (which begins with 0x) to the field Identity: PolymeshPrimitivesIdentityId
- Click off the “include option” toggle
- Click the
+
button at the top right to see then you will see all the portfolios and portfolio ID's associated with your DID at the bottom of the page
Click here to see this image at full resolution.
Retrieve Portfolio ID from the Polymesh Block Explorer
1. Open the Polymesh Block Explorer and search for your Polymesh key (it begins with 2)
2. In the Extrinsics tab, look for the action "portfolio (create_portfolio)" then click on the Extrinsic ID
Click here to see this image at full resolution.
3. On the new page scroll down to the event with the action "portfolio (PortfolioCreated)"
Click here to see this image at full resolution.
Delete a portfolio with the Polymesh app
A portfolio can be deleted only if it has no funds.
- Go to the Polymesh App then fill in the data as per below:
- using the selected account: Select your Polymesh account
- submit the following extrinsic: Select
portfolio
thendeletePortfolio(num)
- num: This is the Portfolio ID or number. Enter the number of the portfolio you want to delete
Click here to see this image at full resolution.
- Once all data are filled, click on
Submit Transaction
at the right corner of the page: - Another popup window will appear, click on
Sign and Submit
and then sign the transaction with your wallet.
Moving assets between Portfolios with the Polymesh app
1. Go to the Polymesh App then fill in the data as per below:
- using the selected account: Select your Polymesh account
- submit the following extrinsic: Select
portfolio
thenmovePortfolioFunds(from, to ,items)
Click here to see this image at full resolution. - From:
- did: Enter your Polymesh DID which begins with 0x.
- Kind: This is the portfolio that holds the token you want to send. Keep it as
Default
if this is your default portfolio (named "Unassigned" on the Polymesh Dashboard). If it is one of your named/user portfolios, enter the number of it.
Note: The first portfolio you create has the number 1 and it increments by 1 for any new portfolio you create afterward.
Click here to see this image at full resolution.
- To:
- did: Enter your Polymesh DID which begins with 0x.
- Kind: This is the destination portfolio. Keep it as
Default
if this is your default portfolio (named "Unassigned" on the Polymesh Dashboard). If it is one of your named/user portfolios, enter the number of it.
Note: The first portfolio you create has the number 1 and it increments by 1 for any new portfolio you create afterward.
Click here to see this image at full resolution.
- PolymeshPrimitivesTicker: Enter the asset ticker in HEX format
Click here to see this image at full resolution.
Note: Use a HEX converter like this one. For the Output delimiter string, select "None".
Example: The ticker name is "testtoken", which is "4D79207465737420746F6B656E" in HEX.
This HEX value should be padded with zeros to be 12 bytes like "74657374746F6B656E00000" with a 0x prefix, so the value you should enter is "0x74657374746F6B656E00000".
Fill up the ticker field with zeros until the message in red disappears from the bottom of the page. - amount: Enter the amount of the asset you would like to transfer
- memo (optional): You can enter a memo in HEX format for the transfer if needed.
Click here to see this image at full resolution.
Note: Use a HEX converter like this one. For the Output delimiter string, select "None".
Example: The memo is "testmemo", which is "746573746D656D6F" in HEX.
This HEX value should be padded with zeros to be 32 bytes like "746573746D656D6F000000000000000000000000000000000000000000000000" with a 0x prefix, so the value you should enter is "0x746573746D656D6F000000000000000000000000000000000000000000000000".
Fill up the memo field with zeros until the below message in red disappears:
Click here to see this image at full resolution.
2. Once all data are filled, click onSubmit Transaction
at the right corner of the page:
3. Another popup window will appear, click on Sign and Submit
and then sign the transaction with your wallet.
Common errors and solutions
- PortfolioDoesNotExist: This means that if one or both of the portfolios reference an invalid portfolio. Check if the portfolio number is correct.
- Destination_is_same_portfolio: This means that both the sender and receiver portfolios are the same. Check if the portfolio number is correct.
- DifferentIdentityPortfolios: This means that the sender and receiver portfolios belong to different identities. The identity must be the same for both portfolios.
- UnauthorizedCustodian: This means that the secondary portfolio manager user is not authorized as the custodian of the sending portfolio. Make sure that the secondary portfolio man
- InsufficientPortfolioBalance: This means that the sender does not have enough free balance of the sending token on his portfolio. Make sure that the sender has enough tokens in their portfolio.
Managing Portfolio Managers with the Polymesh app
Step 1: Portfolio owner to authorize the secondary portfolio manager
1. A portfolio can only have one owner and optionally one custodian/secondary portfolio manager.
2. Go to the Polymesh App then fill in the data as per below:
- using the selected account: Select your Polymesh account
- submit the following extrinsic: Select
Identity
thenaddAutorization
Click here to see this image at full resolution. - target: select
Identity
- Identity: Enter the DID (which begins with 0x) which holds the portfolio you want to add a manager.
Click here to see this image at full resolution. - data: Select
PortfolioCustody
- did: Enter the new secondary portfolio manager's DID (which begins with 0x).
- kind: This is the portfolio you want to assign a secondary portfolio manager. Keep it as
Default
if this is your default portfolio (named "Unassigned" on the Polymesh Dashboard). If it is one of your named/user portfolios, enter the number of it.
Note: The first portfolio you create has the number 1 and it increments by 1 for any new portfolio you create afterwards.
Click here to see this image at full resolution. - expiry (optional): Enter the expiry date and time in Unix timestamp format. You can use a converter like this one.
Click here to see this image at full resolution.
2. Once all data are filled, click onSubmit Transaction
at the right corner of the page:
3. Another popup window will appear, click on Sign and Submit
and then sign the transaction with your wallet.
Step 2: Portfolio owner to retrieve the Auth ID
Go to the Polymesh App then fill in the data as per below:
- Selected state query: select
Identity
thenAuthorizations
- Paste your DID from your wallet (which begins with 0x) to the field Identity: PolymeshPrimitivesIdentityId
Click here to see this image at full resolution. - Click off the “include option” toggle
- Click the
+
button at the top right to see the AuthID
Click here to see this image at full resolution. - This will get you the authorization IDs for the PortfolioCustody (52064 in this example). Copy them as you will need it at the next step :
Step 3: New portfolio manager to accept portfolio custody
1. Go to the Polymesh App then fill in the data as per below:
- using the selected account: Select your Polymesh account
- submit the following extrinsic: Select
portfolio
thenacceptPortfolioCustody
- authId: Enter the AuthID you've gathered in the previous step
Click here to see this image at full resolution.
2. Once all data are filled, click onSubmit Transaction
at the right corner of the page:
3. Another popup window will appear, click on Sign and Submit
and then sign the transaction with your wallet.
If you have any questions or issues, feel free to open a conversation with our support team through the Polymesh Community page.
Comments
0 comments
Please sign in to leave a comment.