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).
The below all return a Promise that resolves with the requested results.
binaryOptions.markets
Get all positional markets created.binaryOptions.optionTransactions
Get all transactions made to the positional markets.binaryOptions.trades
Get all trades made to the positional markets.binaryOptions.positionBalances({ account })
Get balances of positions for theaccount
.binaryOptions.rangedPositionBalances({ account })
Get balances of ranged positions for theaccount
.
binaryOptions.tokenTransactions({ account })
Get all the transactions made with THALES token from theaccount
.binaryOptions.stakers
Get all THALES stakers.
binaryOptions.vaultTransactions({ vault })
Get all the transactions made by thevault
.binaryOptions.vaultPnls({ vault })
Get all round PNLs for thevault
.binaryOptions.vaultUserTransactions({ vault })
Get all user transactions for thevault
.
binaryOptions.vaultPnls({ liquidityPool })
Get all round PNLs for theliquidityPool
.binaryOptions.liquidityPoolUserTransactions({ liquidityPool })
Get all user transactions for theliquidityPool
.
sportMarkets.markets
Get all sports markets created.sportMarkets.positionBalances({ account })
Get balances of positions for theaccount
.sportMarkets.marketTransactions
Get all transactions made to the sports markets.sportMarkets.overtimeVouchers({ account })
Get all Overtime vouchers for theaccount
.
sportMarkets.vaultTransactions({ vault })
Get all the transactions made by thevault
.sportMarkets.vaultPnls({ vault })
Get all round PNLs for thevault
.sportMarkets.vaultUserTransactions({ vault })
Get all user transactions for thevault
.
sportMarkets.vaultPnls({ liquidityPool })
Get all round PNLs for theliquidityPool
.sportMarkets.liquidityPoolUserTransactions({ liquidityPool })
Get all user transactions for theliquidityPool
.
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));
<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>
# get markets ordered from latest to earliest
npx thales-data binaryOptions.markets