Environment
Language
Python 3.10.0
Alpaca SDK Version
alpaca-trade-api 1.4.1
Other Environment Details
Windows 10 Pro
PyCharm 2021.3.2 (Community Edition)
Problem
list_assets(asset_class=‘crypto’) returns the list twice
When I run the command to get the current list of crypto assets, I get a list of 42 assets. Looking at the list in more detail, it seems that the function returns the same list of 21 assets twice.
Paper or Live Trading?
Paper
Example Code
crypto_assets = api.list_assets(status='active', asset_class='crypto')
print(crypto_assets)
Output:
[Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '1f2ff7fd-8f70-4d1b-aea1-77fcb7716d12',
'marginable': False,
'name': 'Aave',
'shortable': False,
'status': 'active',
'symbol': 'AAVEUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '10d47ad4-8a8f-4dc7-8a7f-079c96c9fedb',
'marginable': False,
'name': 'Graph Token',
'shortable': False,
'status': 'active',
'symbol': 'GRTUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '71a012ba-9ac2-4b08-9cf0-e640f4e45f6c',
'marginable': False,
'name': 'ChainLink Token',
'shortable': False,
'status': 'active',
'symbol': 'LINKUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '0c077710-c350-4813-ad39-d6fe930a30ac',
'marginable': False,
'name': 'Litecoin',
'shortable': False,
'status': 'active',
'symbol': 'LTCUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'e226ac04-b041-4e1d-a63c-65dacd1f3bb0',
'marginable': False,
'name': 'Matic',
'shortable': False,
'status': 'active',
'symbol': 'MATICUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '3530c688-9af2-45ab-98f5-ea31926a64e2',
'marginable': False,
'name': 'Maker',
'shortable': False,
'status': 'active',
'symbol': 'MKRUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'a59e5f04-cb99-4756-9846-5dcdfc7f4553',
'marginable': False,
'name': 'Dai',
'shortable': False,
'status': 'active',
'symbol': 'DAIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '1cf35270-99ee-44e2-a77f-6fab902c7f80',
'marginable': False,
'name': 'Solana',
'shortable': False,
'status': 'active',
'symbol': 'SOLUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '714d258b-cfef-46be-8e00-9524ef9f42e4',
'marginable': False,
'name': 'PAX Gold',
'shortable': False,
'status': 'active',
'symbol': 'PAXGUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'e39a5235-eafc-499c-937e-0769c4908a80',
'marginable': False,
'name': 'Sushi',
'shortable': False,
'status': 'active',
'symbol': 'SUSHIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'c4ab268a-0ebf-4332-82d7-a8ddb90304a0',
'marginable': False,
'name': 'TRON',
'shortable': False,
'status': 'active',
'symbol': 'TRXUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '2d8de014-3e11-499d-9578-59efc83522ba',
'marginable': False,
'name': 'Tether',
'shortable': False,
'status': 'active',
'symbol': 'USDTUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '35f33a69-f5d6-4dc9-b158-4485e5e92e4b',
'marginable': False,
'name': 'Ethereum',
'shortable': False,
'status': 'active',
'symbol': 'ETHUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '24cc8b92-9c7a-41d6-96c0-20c2e9f85c18',
'marginable': False,
'name': 'Uniswap Protocol Token',
'shortable': False,
'status': 'active',
'symbol': 'UNIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '91cc2c51-0853-47bc-af0a-430d4fce38dc',
'marginable': False,
'name': 'Wrapped BTC',
'shortable': False,
'status': 'active',
'symbol': 'WBTCUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '2ad37938-f840-4465-aaa0-97d4d0e293bb',
'marginable': False,
'name': 'Yearn.Finance',
'shortable': False,
'status': 'active',
'symbol': 'YFIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'e52c17a4-7009-4962-9f71-465f1620874b',
'marginable': False,
'name': 'Basic Attention Token',
'shortable': False,
'status': 'active',
'symbol': 'BATUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '4d752b8a-3245-45ca-a407-336c6baca7e6',
'marginable': False,
'name': 'Bitcoin Cash',
'shortable': False,
'status': 'active',
'symbol': 'BCHUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '64bbff51-59d6-4b3c-9351-13ad85e3c752',
'marginable': False,
'name': 'Bitcoin',
'shortable': False,
'status': 'active',
'symbol': 'BTCUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '406f55c4-12c7-4723-8a73-7edb368b41b3',
'marginable': False,
'name': 'Shiba Inu',
'shortable': False,
'status': 'active',
'symbol': 'SHIBUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'a3ba8ac0-166d-460b-b17a-1f035622dd47',
'marginable': False,
'name': 'Dogecoin',
'shortable': False,
'status': 'active',
'symbol': 'DOGEUSD',
'tradable': True})]
[Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '1f2ff7fd-8f70-4d1b-aea1-77fcb7716d12',
'marginable': False,
'name': 'Aave',
'shortable': False,
'status': 'active',
'symbol': 'AAVEUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '10d47ad4-8a8f-4dc7-8a7f-079c96c9fedb',
'marginable': False,
'name': 'Graph Token',
'shortable': False,
'status': 'active',
'symbol': 'GRTUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '71a012ba-9ac2-4b08-9cf0-e640f4e45f6c',
'marginable': False,
'name': 'ChainLink Token',
'shortable': False,
'status': 'active',
'symbol': 'LINKUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '0c077710-c350-4813-ad39-d6fe930a30ac',
'marginable': False,
'name': 'Litecoin',
'shortable': False,
'status': 'active',
'symbol': 'LTCUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'e226ac04-b041-4e1d-a63c-65dacd1f3bb0',
'marginable': False,
'name': 'Matic',
'shortable': False,
'status': 'active',
'symbol': 'MATICUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '3530c688-9af2-45ab-98f5-ea31926a64e2',
'marginable': False,
'name': 'Maker',
'shortable': False,
'status': 'active',
'symbol': 'MKRUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'a59e5f04-cb99-4756-9846-5dcdfc7f4553',
'marginable': False,
'name': 'Dai',
'shortable': False,
'status': 'active',
'symbol': 'DAIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '1cf35270-99ee-44e2-a77f-6fab902c7f80',
'marginable': False,
'name': 'Solana',
'shortable': False,
'status': 'active',
'symbol': 'SOLUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '714d258b-cfef-46be-8e00-9524ef9f42e4',
'marginable': False,
'name': 'PAX Gold',
'shortable': False,
'status': 'active',
'symbol': 'PAXGUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'e39a5235-eafc-499c-937e-0769c4908a80',
'marginable': False,
'name': 'Sushi',
'shortable': False,
'status': 'active',
'symbol': 'SUSHIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'c4ab268a-0ebf-4332-82d7-a8ddb90304a0',
'marginable': False,
'name': 'TRON',
'shortable': False,
'status': 'active',
'symbol': 'TRXUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '2d8de014-3e11-499d-9578-59efc83522ba',
'marginable': False,
'name': 'Tether',
'shortable': False,
'status': 'active',
'symbol': 'USDTUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '35f33a69-f5d6-4dc9-b158-4485e5e92e4b',
'marginable': False,
'name': 'Ethereum',
'shortable': False,
'status': 'active',
'symbol': 'ETHUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '24cc8b92-9c7a-41d6-96c0-20c2e9f85c18',
'marginable': False,
'name': 'Uniswap Protocol Token',
'shortable': False,
'status': 'active',
'symbol': 'UNIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '91cc2c51-0853-47bc-af0a-430d4fce38dc',
'marginable': False,
'name': 'Wrapped BTC',
'shortable': False,
'status': 'active',
'symbol': 'WBTCUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '2ad37938-f840-4465-aaa0-97d4d0e293bb',
'marginable': False,
'name': 'Yearn.Finance',
'shortable': False,
'status': 'active',
'symbol': 'YFIUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'e52c17a4-7009-4962-9f71-465f1620874b',
'marginable': False,
'name': 'Basic Attention Token',
'shortable': False,
'status': 'active',
'symbol': 'BATUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '4d752b8a-3245-45ca-a407-336c6baca7e6',
'marginable': False,
'name': 'Bitcoin Cash',
'shortable': False,
'status': 'active',
'symbol': 'BCHUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '64bbff51-59d6-4b3c-9351-13ad85e3c752',
'marginable': False,
'name': 'Bitcoin',
'shortable': False,
'status': 'active',
'symbol': 'BTCUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': '406f55c4-12c7-4723-8a73-7edb368b41b3',
'marginable': False,
'name': 'Shiba Inu',
'shortable': False,
'status': 'active',
'symbol': 'SHIBUSD',
'tradable': True}), Asset({ 'class': 'crypto',
'easy_to_borrow': False,
'exchange': 'FTXU',
'fractionable': True,
'id': 'a3ba8ac0-166d-460b-b17a-1f035622dd47',
'marginable': False,
'name': 'Dogecoin',
'shortable': False,
'status': 'active',
'symbol': 'DOGEUSD',
'tradable': True})]
To simplify, I will print just the symbols:
crypto_assets = api.list_assets(status='active', asset_class='crypto')
for asset in crypto_assets:
print(asset.symbol)
Output:
AAVEUSD
GRTUSD
LINKUSD
LTCUSD
MATICUSD
MKRUSD
DAIUSD
SOLUSD
PAXGUSD
SUSHIUSD
TRXUSD
USDTUSD
ETHUSD
UNIUSD
WBTCUSD
YFIUSD
BATUSD
BCHUSD
BTCUSD
SHIBUSD
DOGEUSD
AAVEUSD
GRTUSD
LINKUSD
LTCUSD
MATICUSD
MKRUSD
DAIUSD
SOLUSD
PAXGUSD
SUSHIUSD
TRXUSD
USDTUSD
ETHUSD
UNIUSD
WBTCUSD
YFIUSD
BATUSD
BCHUSD
BTCUSD
SHIBUSD
DOGEUSD
You can see that the list of crypto assets starts with AAVEUSD
and ends with DOGEUSD
, but the list then prints again.
Any idea why this is happening? I don’t get the same problem when I get a list of NASDAQ assets.