Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Return ladders based on date/expiration or historical based on ticker/exp/call/put #35

Closed
jmaslek opened this issue Jul 24, 2021 · 7 comments
Assignees
Labels
backend backend related issues enhancement New feature or request

Comments

@jmaslek
Copy link

jmaslek commented Jul 24, 2021

Currently, one needs the chain ID (i.e 'AAPL210730C00145000'). Would it be possible to either have an endpoint that returns all of those chain numbers based on the ticker, expiration and call/put, or be able to call historical based on those parameters.

@Tyruiop
Copy link
Owner

Tyruiop commented Jul 26, 2021

I implemented the following API call
curl -X GET https://api.syncretism.io/ops/expirations/AAPL

I think that combined with the ladder call (e.g. curl -X GET https://api.syncretism.io/ops/ladder/PAYO/C/1626393600) it should allow you to do what you want, waiting for your reply to close the issue 🙏

@Tyruiop Tyruiop self-assigned this Jul 26, 2021
@Tyruiop Tyruiop added backend backend related issues enhancement New feature or request labels Jul 26, 2021
@jmaslek
Copy link
Author

jmaslek commented Jul 27, 2021

So having the expirations is awesome! Is it possible to do something that could be like (that lists all possible contracts):

curl -X GET https://api.syncretism.io/ops/contracts/{ticker}/{timestamp}

This would avoid having to loop through each expiration to get the ladder -> contractSymbol

@Tyruiop
Copy link
Owner

Tyruiop commented Jul 28, 2021

Isn't this equivalent to doing
curl -X GET https://api.syncretism.io/ops/ladder/PAYO/C/1626393600
followed by curl -X GET https://api.syncretism.io/ops/ladder/PAYO/P/1626393600

the idea would be to do both in one request and to only return the contract symbols ?

@jmaslek
Copy link
Author

jmaslek commented Jul 29, 2021

Pretty much. I am thinking the equivalent of the finance: Ticker("AAPL").option_chains(date).calls["contractSymbol"] merged with Ticker("AAPL").option_chains(date).puts["contractSymbol"] which returns the following:
Screen Shot 2021-07-29 at 3 55 22 PM

I am not sure exactly how the API's are done, but I would imagine a json response like {'call': call_chain_ids , 'puts': call_chain_ids}.

That may not be super clear or not super helpful to have for you.

@Tyruiop
Copy link
Owner

Tyruiop commented Jul 29, 2021

Done! You can try curl -X GET https://api.syncretism.io/ops/chain/PAYO/1626393600 to experiment with it, and thanks for the feature request!

@Tyruiop Tyruiop closed this as completed Jul 29, 2021
@jmaslek
Copy link
Author

jmaslek commented Jul 29, 2021

Awesome thanks! And what is the time stamp, I presume UNIX seconds?

@Tyruiop
Copy link
Owner

Tyruiop commented Jul 30, 2021

Yes, and even more specifically, it needs to be one of the timestamps provided by curl -X GET https://api.syncretism.io/ops/expirations/PAYO

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend backend related issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants