Skip to content

Commit cb7e36f

Browse files
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
1 parent 232c938 commit cb7e36f

File tree

1 file changed

+108
-21
lines changed

1 file changed

+108
-21
lines changed

README.md

+108-21
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,63 @@ This subgraph is deployed under `/subgraphs/name/oceanprotocol/ocean-subgraph/`
4141

4242
```graphql
4343
{
44-
pools(orderBy: oceanReserve, orderDirection: desc) {
45-
consumePrice
46-
datatokenReserve
47-
oceanReserve
48-
spotPrice
49-
swapFee
50-
transactionCount
44+
pools(orderBy: baseTokenLiquidity, orderDirection: desc) {
45+
id
46+
datatoken {
47+
address
48+
}
49+
baseToken {
50+
symbol
51+
}
52+
baseTokenLiquidity
53+
datatokenLiquidity
5154
}
5255
}
5356
```
5457

55-
**All datatokens**
58+
**Pools with the highest liquidity**
5659

5760
```graphql
5861
{
59-
datatokens(orderBy: createTime, orderDirection: desc) {
60-
address
62+
pools(where: {datatokenLiquidity_gte: 1}, orderBy: baseTokenLiquidity, orderDirection: desc, first: 15) {
63+
id
64+
datatoken {
65+
address
66+
}
67+
baseToken {
68+
symbol
69+
}
70+
baseTokenLiquidity
71+
datatokenLiquidity
72+
}
73+
}
74+
```
75+
76+
**All Data NFTs**
77+
78+
```graphql
79+
{
80+
nfts(orderBy: createdTimestamp, orderDirection: desc, first: 1000){
81+
id,
82+
symbol,
83+
name,
84+
creator,
85+
createdTimestamp
86+
}
87+
}
88+
```
89+
90+
> Note: 1000 is the maximum number of items the subgraph can return.
91+
92+
**All Datatokens**
93+
94+
```graphql
95+
{
96+
tokens(where: {isDatatoken: true}, orderBy: createdTimestamp, orderDirection: desc, first: 1000) {
97+
id
6198
symbol
6299
name
63-
cap
64-
supply
65-
publisher
100+
address
66101
holderCount
67102
}
68103
}
@@ -72,19 +107,71 @@ This subgraph is deployed under `/subgraphs/name/oceanprotocol/ocean-subgraph/`
72107

73108
```graphql
74109
{
75-
poolTransactions(
76-
where: { userAddressStr: $userAddress }
77-
orderBy: timestamp
78-
orderDirection: desc
79-
) {
80-
poolAddressStr
110+
poolTransactions(
111+
orderBy: timestamp
112+
orderDirection: desc
113+
where: { user: $user }
114+
first: 1000
115+
) {
116+
baseToken {
117+
symbol
118+
address
119+
}
120+
baseTokenValue
121+
datatoken {
122+
symbol
123+
address
124+
}
125+
datatokenValue
126+
type
127+
tx
128+
timestamp
129+
pool {
130+
datatoken {
131+
id
132+
}
133+
id
134+
}
135+
}
81136
}
82-
}
83137
```
84138

85-
> Note: all ETH addresses like `$userAddress` in above example need to be passed in lowercase.
139+
> Note: all ETH addresses like `$user` in above example need to be passed as a lowercase string.
86140
141+
**All pool transactions for a given user in an individual pool**
142+
143+
```graphql
144+
{
145+
poolTransactions(
146+
orderBy: timestamp
147+
orderDirection: desc
148+
where: { pool: $pool, user: $user }
149+
first: 1000
150+
) {
151+
baseToken {
152+
symbol
153+
address
154+
}
155+
baseTokenValue
156+
datatoken {
157+
symbol
158+
address
159+
}
160+
datatokenValue
161+
type
162+
tx
163+
timestamp
164+
pool {
165+
datatoken {
166+
id
167+
}
168+
id
169+
}
170+
}
171+
}
172+
```
87173

174+
> Note: all ETH addresses like `$pool` and `$user` in above example need to be passed as a lowercase string.
88175
89176
## 🏊 Development on Barge
90177

0 commit comments

Comments
 (0)