Skip to content

Commit

Permalink
Fix price for sync swap and add notification system
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandersazonof committed Jul 8, 2024
1 parent 58af246 commit e698666
Show file tree
Hide file tree
Showing 14 changed files with 1,074 additions and 159 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/tests/.bin/
/graph-zksync.iml
/yarn.lock
/tests/.latest.json
.env
124 changes: 12 additions & 112 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Harvest sub graph
# Harvest ZkSync Subgraph


## Pre deploy
```
## execute
chmod +x deploy.sh
## create .env and add DEPLOY_URL
nano .env
DEPLOY_URL=..
```

## Setup

- Install dependencies `yarn install`
Expand All @@ -9,114 +19,4 @@


## Queries

For query use this urls:
<https://api.thegraph.com/subgraphs/id/{id}>
#### ID you can take from dashboard

- **Ethereum** - https://thegraph.com/hosted-service/subgraph/harvestfi/harvest-finance
- **Polygon** - https://thegraph.com/hosted-service/subgraph/harvestfi/harvest-finance-polygon
- **Arbitrum** - https://thegraph.com/hosted-service/subgraph/harvestfi/harvest-finance-arbitrum
- **Base** - https://thegraph.com/hosted-service/subgraph/harvestfi/harvest-finance-base


### Get all vaults
{
vaults {
id
name
pool {
id
}
strategy {
id
}
underlying {
id
name
symbol
}
decimal
createAtBlock
timestamp
}
}

### Get last tvl by vault address
- Example for **FARM_USDC**: 0xf0358e8c3cd5fa238a29301d0bea3d63a17bedbe
- Please, use all addresses in **lowercase**

###
{
tvls(
where: {vault: "0xf0358e8c3cd5fa238a29301d0bea3d63a17bedbe"}
orderBy: createAtBlock
orderDirection: desc
) {
value
totalSupply
sharePriceDivDecimal
createAtBlock
}
}


- `value` - TVL in usd
- `sharePriceDivDecimal` - `sharePrice` / (10 ** `decimal`)

### Get last apy by vault address

{
apyRewards(
first: 1,
where: {vault: "0xab7fa2b2985bccfc13c6d86b1d5a17486ab1e04c"}
orderBy: createAtBlock
orderDirection: desc
) {
apy
createAtBlock
}

apyAutoCompounds(
first: 1,
where: {vault: "0xab7fa2b2985bccfc13c6d86b1d5a17486ab1e04c"}
orderBy: createAtBlock
orderDirection: desc
) {
apy
createAtBlock
}
}

### Get first 100 last apy by vault address, in timestamp from 11/09/2022 @ 1:15pm to 11/09/2022 @ 1:15pm


{
apyRewards(
first: 100,
where: {
timestamp_gte: "1648059270",
timestamp_lte: "1667999735",
vault: "0xab7fa2b2985bccfc13c6d86b1d5a17486ab1e04c"
}
orderBy: createAtBlock
orderDirection: desc
) {
apy
createAtBlock
}

apyAutoCompounds(
first: 100,
where: {
timestamp_gte: "1648059270",
timestamp_lte: "1667999735",
vault: "0xab7fa2b2985bccfc13c6d86b1d5a17486ab1e04c"
}
orderBy: createAtBlock
orderDirection: desc
) {
apy
createAtBlock
}
}
TBD
Loading

0 comments on commit e698666

Please sign in to comment.