-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UUID from TradingClient.get_all_assets does not match UUID from TradingClient.get_all_positions() [Bug]: #490
Comments
@jose-main-sequence Thank you for the feedback. The difference of assets in list assets and list positions is expected behaviour and by design. Basically order assets and positions assets are different.
Do you have any issue/concern of this difference? |
Hi, thank you for the clarification. My next question is, how can someone
map an order to a position? In the case of equities, orders and positions
do match. I believe this originates from the design where all US equities
settle in USD. However, in the case of cryptocurrencies, how can a user
match an order with a position? Is there any endpoint that provides this
mapping? For example, can one obtain the UUID of BTCUSD (position asset)
before trading on it?
It will be good to add then the "settlement asset" UUID to the endpoint so
when i get BTC/ETH asset the response also shows me that this will settle
as ETHUSD (position valuation)
bests
…On Mon, 22 Jul 2024 at 08:25, hiohiohio ***@***.***> wrote:
@jose-main-sequence <https://github.com/jose-main-sequence> Thank you for
the feedback.
The difference of assets in list assets and list positions is expected
behaviour and by design.
Basically order assets and positions assets are different.
- orders are what you are trading it can be ETH/USD, BTC/USD, ETH/BTC,
- positions are basically what you hold, you could be holding ETH, BTC
, these are denoted by ETHUSD, BTCUSD
Do you have any issue/concern of this difference?
—
Reply to this email directly, view it on GitHub
<#490 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJ6FXM3BSW6EXTKUGWL3NFLZNSQXJAVCNFSM6AAAAABLCCC2GCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBSGE4DEMBSGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I think it depends on purpose of the mapping though. By the way, asset_id of equity could be changed by corporate actions in time as well as symbol.
Currently we do not provide the API endpoint.
Could you please elaborate on the reason/purpose of necessity of asset UUID of positions API? |
I understand. The main reason is to have proper mapping between our
database assets and Alpaca assets. A symbol alone is not sufficient; for
example, there is an asset in Alpaca with the ticker USD. If there is also
a USD asset in our database, this will create problems. Therefore, when we
collect positions from Alpaca, we want to map them to the positions in our
database. That's why having this mapping is important for us. Additionally,
we need a unique identifier for each asset that we hold or may hold. Thank
you for the advice regarding corporate actions, we will instead then build
our mappings differently.
…On Tue, 23 Jul 2024 at 08:31, hiohiohio ***@***.***> wrote:
how can someone map an order to a position? In the case of equities,
orders and positions
do match. I believe this originates from the design where all US equities
settle in USD. However, in the case of cryptocurrencies, how can a user
match an order with a position?
I think it depends on purpose of the mapping though.
As a one way for the crypto, you could divide the asset symbol into two
parts by slash (/).
i.e. <quote>/<base>, ETH/BTC => quote: ETH, base: BTC
Then you can then get two position assets by putting USD as suffix into
quote/base.
a. <quote>USD => ETHUSD
b. <base>USD => BTCUSD
By the way, asset_id of equity could be changed by corporate actions in
time as well as symbol.
Therefore, asset_id/symbol of orders vs positions cannot be matching 100%
for equity as well.
Is there any endpoint that provides this mapping?
For example, can one obtain the UUID of BTCUSD (position asset) before
trading on it?
Currently we do not provide the API endpoint.
And also I cannot remember/find the way to get UUID of BTCUSD other than
positions api.
It will be good to add then the "settlement asset" UUID to the endpoint so
when i get BTC/ETH asset the response also shows me that this will settle
as ETHUSD (position valuation)
Could you please elaborate on the reason/purpose of necessity of asset
UUID of positions API?
—
Reply to this email directly, view it on GitHub
<#490 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJ6FXM7IHWBKOYSDLESEQFLZNX2ENAVCNFSM6AAAAABLCCC2GCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBUGM2TMNBTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@jose-main-sequence Thank you for letting us know the details. Understood the reality of data mapping and data management. Please feel free to contact us if there are things we can help. |
Is there an existing issue for this?
Current Behavior
When i request TradingClient.get_all_assets() Bitcoin to USD with symbol BTC/USD has a uid 276e2673764b4ab6a611caf665ca6340, however when i query my position in th paper account I get BTCUSD with UUID of 64bbff5159d64b3c935113ad85e3c752. Also symbol is BTCUSD rather than BTC/USD
Expected Behavior
The expected behavior should be consistent UUID and symbols from
SDK Version I encountered this issue in
alpaca-py==0.28.0
Steps To Reproduce
Filled out the Steps to Reproduce section?
Anything else?
No response
The text was updated successfully, but these errors were encountered: