npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

thales-data

v3.0.19

Published

[![npm version](https://badge.fury.io/js/thales-data.svg)](https://badge.fury.io/js/thales-data) [![Discord](https://img.shields.io/discord/906484044915687464.svg?color=768AD4&label=discord&logo=https%3A%2F%2Fdiscordapp.com%2Fassets%2F8c9701b98ad4372b58f

Downloads

652

Readme

thales-data

npm version Discord Twitter Follow

This is a collection of utilities to query Thales data from Ethereum. This data has been indexed by The Graph via the subgraph the Thales team maintains (the subgraph code repo).

Supported queries

The below all return a Promise that resolves with the requested results.

Thales

Markets

  1. binaryOptions.markets Get all positional markets created.
  2. binaryOptions.optionTransactions Get all transactions made to the positional markets.
  3. binaryOptions.trades Get all trades made to the positional markets.
  4. binaryOptions.positionBalances({ account }) Get balances of positions for the account.
  5. binaryOptions.rangedPositionBalances({ account }) Get balances of ranged positions for the account.

Token

  1. binaryOptions.tokenTransactions({ account }) Get all the transactions made with THALES token from the account.
  2. binaryOptions.stakers Get all THALES stakers.

Vaults

  1. binaryOptions.vaultTransactions({ vault }) Get all the transactions made by the vault.
  2. binaryOptions.vaultPnls({ vault }) Get all round PNLs for the vault.
  3. binaryOptions.vaultUserTransactions({ vault }) Get all user transactions for the vault.

Liquidity Pool

  1. binaryOptions.vaultPnls({ liquidityPool }) Get all round PNLs for the liquidityPool.
  2. binaryOptions.liquidityPoolUserTransactions({ liquidityPool }) Get all user transactions for the liquidityPool.

Overtime

Markets

  1. sportMarkets.markets Get all sports markets created.
  2. sportMarkets.positionBalances({ account }) Get balances of positions for the account.
  3. sportMarkets.marketTransactions Get all transactions made to the sports markets.
  4. sportMarkets.overtimeVouchers({ account }) Get all Overtime vouchers for the account.

Vaults

  1. sportMarkets.vaultTransactions({ vault }) Get all the transactions made by the vault.
  2. sportMarkets.vaultPnls({ vault }) Get all round PNLs for the vault.
  3. sportMarkets.vaultUserTransactions({ vault }) Get all user transactions for the vault.

Liquidity Pool

  1. sportMarkets.vaultPnls({ liquidityPool }) Get all round PNLs for the liquidityPool.
  2. sportMarkets.liquidityPoolUserTransactions({ liquidityPool }) Get all user transactions for the liquidityPool.

Use this as a node or webpack dependency

const thalesData = require('thales-data'); // common js
// or
import thalesData from 'thales-data'; // es modules

// query and log resolved results
thalesData.binaryOptions
	.markets({
		network: 1, // mainnet
		max: 1000, // return first 1000 records
	})
	.then(markets => console.log(markets));

Use in a browser

<script src="https://cdn.jsdelivr.net/npm/thales-data/browser.js"></script>
<script>
	window.thalesData.binaryOptions
		.markets({
			network: 1, // mainnet
			max: 1000, // return first 1000 records
		})
		.then(console.log);
</script>

How to query via the npm library (CLI)

# get markets ordered from latest to earliest
npx thales-data binaryOptions.markets