mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Updating readme example queries (#431)
* Adding pools with highest liquidity example query * Updating all pools query * Updating all data NFTs query * Updating All pool transactions for a given user * Adding example query: All pool transactions for a given user in an individual pool * Adding commnet to readme * Adding All Datatokens example query * Updating to show 1000 results
This commit is contained in:
parent
232c9387f4
commit
cb7e36fc98
129
README.md
129
README.md
@ -41,28 +41,63 @@ This subgraph is deployed under `/subgraphs/name/oceanprotocol/ocean-subgraph/`
|
|||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
{
|
{
|
||||||
pools(orderBy: oceanReserve, orderDirection: desc) {
|
pools(orderBy: baseTokenLiquidity, orderDirection: desc) {
|
||||||
consumePrice
|
id
|
||||||
datatokenReserve
|
datatoken {
|
||||||
oceanReserve
|
address
|
||||||
spotPrice
|
}
|
||||||
swapFee
|
baseToken {
|
||||||
transactionCount
|
symbol
|
||||||
|
}
|
||||||
|
baseTokenLiquidity
|
||||||
|
datatokenLiquidity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**All datatokens**
|
**Pools with the highest liquidity**
|
||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
{
|
{
|
||||||
datatokens(orderBy: createTime, orderDirection: desc) {
|
pools(where: {datatokenLiquidity_gte: 1}, orderBy: baseTokenLiquidity, orderDirection: desc, first: 15) {
|
||||||
address
|
id
|
||||||
|
datatoken {
|
||||||
|
address
|
||||||
|
}
|
||||||
|
baseToken {
|
||||||
|
symbol
|
||||||
|
}
|
||||||
|
baseTokenLiquidity
|
||||||
|
datatokenLiquidity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**All Data NFTs**
|
||||||
|
|
||||||
|
```graphql
|
||||||
|
{
|
||||||
|
nfts(orderBy: createdTimestamp, orderDirection: desc, first: 1000){
|
||||||
|
id,
|
||||||
|
symbol,
|
||||||
|
name,
|
||||||
|
creator,
|
||||||
|
createdTimestamp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: 1000 is the maximum number of items the subgraph can return.
|
||||||
|
|
||||||
|
**All Datatokens**
|
||||||
|
|
||||||
|
```graphql
|
||||||
|
{
|
||||||
|
tokens(where: {isDatatoken: true}, orderBy: createdTimestamp, orderDirection: desc, first: 1000) {
|
||||||
|
id
|
||||||
symbol
|
symbol
|
||||||
name
|
name
|
||||||
cap
|
address
|
||||||
supply
|
|
||||||
publisher
|
|
||||||
holderCount
|
holderCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,19 +107,71 @@ This subgraph is deployed under `/subgraphs/name/oceanprotocol/ocean-subgraph/`
|
|||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
{
|
{
|
||||||
poolTransactions(
|
poolTransactions(
|
||||||
where: { userAddressStr: $userAddress }
|
orderBy: timestamp
|
||||||
orderBy: timestamp
|
orderDirection: desc
|
||||||
orderDirection: desc
|
where: { user: $user }
|
||||||
) {
|
first: 1000
|
||||||
poolAddressStr
|
) {
|
||||||
|
baseToken {
|
||||||
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
|
baseTokenValue
|
||||||
|
datatoken {
|
||||||
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
|
datatokenValue
|
||||||
|
type
|
||||||
|
tx
|
||||||
|
timestamp
|
||||||
|
pool {
|
||||||
|
datatoken {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: all ETH addresses like `$userAddress` in above example need to be passed in lowercase.
|
> Note: all ETH addresses like `$user` in above example need to be passed as a lowercase string.
|
||||||
|
|
||||||
|
**All pool transactions for a given user in an individual pool**
|
||||||
|
|
||||||
|
```graphql
|
||||||
|
{
|
||||||
|
poolTransactions(
|
||||||
|
orderBy: timestamp
|
||||||
|
orderDirection: desc
|
||||||
|
where: { pool: $pool, user: $user }
|
||||||
|
first: 1000
|
||||||
|
) {
|
||||||
|
baseToken {
|
||||||
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
|
baseTokenValue
|
||||||
|
datatoken {
|
||||||
|
symbol
|
||||||
|
address
|
||||||
|
}
|
||||||
|
datatokenValue
|
||||||
|
type
|
||||||
|
tx
|
||||||
|
timestamp
|
||||||
|
pool {
|
||||||
|
datatoken {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> Note: all ETH addresses like `$pool` and `$user` in above example need to be passed as a lowercase string.
|
||||||
|
|
||||||
## 🏊 Development on Barge
|
## 🏊 Development on Barge
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user