1

I'm looking to list all unique assets on the network, per this endpoint/sdk.

I understand there are interesting public aggregations of this information, such as:

When I check this endpoint, I see:

>>> pprint(horizon.assets())
{'_embedded': {'records': [{'_links': {'toml': {'href': ''}},
                            'amount': '4000000000.0000000',
                            'asset_code': '0000',
                            'asset_issuer': 'GABPCGEMJIYUJDZX776447T6GG7SDXUTWU7WKHUQZ2JJLRHASAQ5MRLR',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 53,
                            'paging_token': '0000_GABPCGEMJIYUJDZX776447T6GG7SDXUTWU7WKHUQZ2JJLRHASAQ5MRLR_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '0.0000000',
                            'asset_code': '0',
                            'asset_issuer': 'GCXNL5HM2S72K5HPSKYC7I4EF2GLAPPH2PUOP5S2G32YCAFDOV36I2M7',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 0,
                            'paging_token': '0_GCXNL5HM2S72K5HPSKYC7I4EF2GLAPPH2PUOP5S2G32YCAFDOV36I2M7_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '10000.0000000',
                            'asset_code': '10',
                            'asset_issuer': 'GANERK6YVYX5GUQBF4BN7PNFC6VX2Q54VFU53DK3UOC4O7CHXZEFZM47',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 1,
                            'paging_token': '10_GANERK6YVYX5GUQBF4BN7PNFC6VX2Q54VFU53DK3UOC4O7CHXZEFZM47_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '10000.0000000',
                            'asset_code': '10',
                            'asset_issuer': 'GBNSVOPN4XNQYEHL4GGPZF2EWL3NQZC6UTLFLXQSDB7XASTYS7RMGMZR',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 1,
                            'paging_token': '10_GBNSVOPN4XNQYEHL4GGPZF2EWL3NQZC6UTLFLXQSDB7XASTYS7RMGMZR_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '10000.0000000',
                            'asset_code': '10',
                            'asset_issuer': 'GCHBU6XOES7VT77HGBYCMXEK7ODK5HPLA36G3AMPKNBJ3PXIYHPG6WQX',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 1,
                            'paging_token': '10_GCHBU6XOES7VT77HGBYCMXEK7ODK5HPLA36G3AMPKNBJ3PXIYHPG6WQX_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '10000.0000000',
                            'asset_code': '10',
                            'asset_issuer': 'GCKJ3ANESYKGT4PWUXUIHRYWXLVP4EDLCVWFXX5VPMGNR3IGV6UHL6BM',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 1,
                            'paging_token': '10_GCKJ3ANESYKGT4PWUXUIHRYWXLVP4EDLCVWFXX5VPMGNR3IGV6UHL6BM_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '10000.0000000',
                            'asset_code': '10',
                            'asset_issuer': 'GCNTBVWJNBF7AJRQ7B5KDFK57RV5634FRZDCH26L6SMWTQNTCBNFWK5H',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 1,
                            'paging_token': '10_GCNTBVWJNBF7AJRQ7B5KDFK57RV5634FRZDCH26L6SMWTQNTCBNFWK5H_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '10000.0000000',
                            'asset_code': '10',
                            'asset_issuer': 'GDORDESN2MTZBZJSHY4AMOMP4VGKZDETRWYTH6S6Q33EK23W5BKU4H2T',
                            'asset_type': 'credit_alphanum4',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 1,
                            'paging_token': '10_GDORDESN2MTZBZJSHY4AMOMP4VGKZDETRWYTH6S6Q33EK23W5BKU4H2T_credit_alphanum4'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '9200001.0000000',
                            'asset_code': '120784',
                            'asset_issuer': 'GCUEE3Q3WWQWD7L43KZCE5X3EFONBQDHA7EL6AUTXKFRCRNSEWGP52MQ',
                            'asset_type': 'credit_alphanum12',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 95,
                            'paging_token': '120784_GCUEE3Q3WWQWD7L43KZCE5X3EFONBQDHA7EL6AUTXKFRCRNSEWGP52MQ_credit_alphanum12'},
                           {'_links': {'toml': {'href': ''}},
                            'amount': '9400000.0000000',
                            'asset_code': '121102',
                            'asset_issuer': 'GCUEE3Q3WWQWD7L43KZCE5X3EFONBQDHA7EL6AUTXKFRCRNSEWGP52MQ',
                            'asset_type': 'credit_alphanum12',
                            'flags': {'auth_immutable': False,
                                      'auth_required': False,
                                      'auth_revocable': False},
                            'num_accounts': 95,
                            'paging_token': '121102_GCUEE3Q3WWQWD7L43KZCE5X3EFONBQDHA7EL6AUTXKFRCRNSEWGP52MQ_credit_alphanum12'}]},
 '_links': {'next': {'href': 'https://horizon-testnet.stellar.org/assets?cursor=121102_GCUEE3Q3WWQWD7L43KZCE5X3EFONBQDHA7EL6AUTXKFRCRNSEWGP52MQ_credit_alphanum12&limit=10&order=asc'},
            'prev': {'href': 'https://horizon-testnet.stellar.org/assets?cursor=0000_GABPCGEMJIYUJDZX776447T6GG7SDXUTWU7WKHUQZ2JJLRHASAQ5MRLR_credit_alphanum4&limit=10&order=desc'},
            'self': {'href': 'https://horizon-testnet.stellar.org/assets?cursor=&limit=10&order=asc'}}}
>>> 

(On the testnet)

How should I interpret this? From information here, it looks like I can expect asset type and asset code, but it's unclear what is unique, or how best to interpret this information for basic data analysis, like understanding how much of what assets are available.

1

Assets are uniquely identified by their asset_code and asset_issuer.

Taking the first record as an example, there is no such thing as the 0000 asset. But there is an asset which is "0000" issued by GABPCGEMJIYUJDZX776447T6GG7SDXUTWU7WKHUQZ2JJLRHASAQ5MRLR

(I've never thought to ask or test if asset_type also forms part of the identifier, but I expect it doesn't. EDIT: From brief testing, asset_type does not form part of the identifier, because it's implicit in the length of the asset_code).

amount is the cumulative amount in circulation. num_accounts is the number of accounts trusting the asset.

  • "amount" is the cumulative amount in circulation of the asset across all issuers, or the cumulative amount of the the asset_code+asset_issuer combo? – Mittenchops Mar 15 at 16:48
  • 1
    Code+issuer. You cannot assume any relationship between assets simply because they have the same code. I might issue a USDT token that represents cheese sticks. The code alone is not enough. – Synesso Mar 15 at 22:52
  • Is there an on-chain way to do an aggregation of an item that actually is the same thing? Eg, suppose I really want to see how much /actual/ ETH or USD is on the market across all issuers? Or is this necessarily foolhardy because we must always consider the issuer’s credit? If the latter, are there systems in practice for pooling credit together to make the trade require less due diligence? – Mittenchops Mar 15 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.