Farming & gauge queries
Farming and gauge data live in separate subgraphs from the core pool data.
Eternal farmings
Endpoint: …/barkswap/farming
query EternalFarmings($pool: Bytes) {
eternalFarmings(where: { pool: $pool }) {
id
pool
reward
bonusReward
rewardRate
bonusRewardRate
rewardToken
bonusRewardToken
isDeactivated
nonce
minRangeLength
virtualPool
}
}
{ "pool": "0x1234abcd…" }
Only the active campaigns:
query ActiveFarmings {
eternalFarmings(where: { isDeactivated: false }) {
id
pool
}
}
Farm deposits
query Deposits($owner: Bytes, $pool: Bytes) {
deposits(where: { owner: $owner, pool: $pool }) {
id
owner
pool
liquidity
eternalFarming
}
}
{ "owner": "0xUSER…", "pool": "0x1234abcd…" }
Gauges
Endpoint: …/barkswap/gauges
query Gauges {
gauges {
id
pool
totalStaked
creator
internalBribe
externalBribe
createdAtTimestamp
}
}
Staked positions (gauge deposits)
GaugeDeposit records which position NFTs are staked in a gauge. unstakedAt is null while a
position is still staked.
query StakedPositions($staker: Bytes!) {
gaugeDeposits(where: { staker: $staker, unstakedAt: null }) {
id
tokenId
liquidity
staker
depositRef
stakedAt
gauge {
id
pool
}
}
}
{ "staker": "0xUSER…" }
See the schema reference for the full EternalFarming, Deposit, Gauge, and
GaugeDeposit shapes.