Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost #232

Merged
merged 98 commits into from
Jan 16, 2025
Merged

Boost #232

Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
bda707a
[for-new-stake] add contract for genesis
Cast0001 Jul 16, 2024
1e072b7
[for-new-stake] improve vaultMulticall
Cast0001 Jul 17, 2024
ad73ec0
[for-new-stake] improve getOsTokenPosition
Cast0001 Jul 17, 2024
3c0dcd0
[for-new-stake] add panding to getExitQueuePositions
Cast0001 Jul 17, 2024
d1e4d93
[for-new-stake] add stake calculator
Cast0001 Jul 22, 2024
bf6078e
[for-new-stake] improve stake calculator
Cast0001 Jul 25, 2024
0f247d3
[for-new-stake] improve abis
Cast0001 Jul 26, 2024
7c840c3
[for-new-stake] new stakecalculator
Cast0001 Jul 29, 2024
c5b5d0b
Merge branch 'main' into for-new-stake
Cast0001 Aug 2, 2024
c1426ce
[for-new-stake] change address
Cast0001 Aug 6, 2024
1eaee07
Merge branch 'main' into for-new-stake
Cast0001 Aug 7, 2024
f897102
[for-new-stake] improve versions
Cast0001 Aug 15, 2024
d9383ba
Merge branch 'main' into for-new-stake
Cast0001 Aug 15, 2024
0c492d8
Merge branch 'main' into for-new-stake
Cast0001 Aug 20, 2024
9cd9776
[for-new-stake] open AbortPromise
Cast0001 Aug 20, 2024
2a9b7a1
Merge branch 'main' into for-new-stake
Cast0001 Aug 23, 2024
3320f40
Merge branch 'main' into for-new-stake
Cast0001 Sep 9, 2024
193187b
[for-new-stake] replace address
Cast0001 Sep 12, 2024
d7e09fe
[for-new-stake] change exit queue
Cast0001 Sep 12, 2024
c6d440d
Merge branch 'main' into for-new-stake
Cast0001 Sep 12, 2024
862891a
[for-new-stake] change logic
Cast0001 Sep 17, 2024
11fcf5e
New createVault method (#169)
Cast0001 Sep 20, 2024
b059774
New subgraph (#171)
mike-diamond Sep 24, 2024
17d349d
Subgraph tvl apy (#172)
Cast0001 Sep 24, 2024
70088c7
[exit queue] Update request (#173)
mike-diamond Sep 25, 2024
54614dc
[parse exit request] Update exit queue fetch (#174)
mike-diamond Sep 25, 2024
e5dfa50
Vault user (#175)
mike-diamond Sep 26, 2024
df65d64
[get config] update get config (#177)
mike-diamond Sep 27, 2024
cbd4bf9
Add new methods getUserStats & getVaultStats (#176)
dfkadyr Sep 27, 2024
e6031cd
new addresses
Cast0001 Sep 27, 2024
22fb447
[new-stake-calculator] set new addresses (#178)
Cast0001 Sep 30, 2024
319b964
[add-genesis-to-vault] (#180)
Cast0001 Oct 2, 2024
04f2c8e
Merge branch 'main' into for-new-stake
Cast0001 Oct 2, 2024
5d48fc9
Add new methods getFiatRates & getUserExchangeRewards (#179)
dfkadyr Oct 3, 2024
9255d2d
[polishing] remove old & change harvest (#181)
Cast0001 Oct 4, 2024
5585157
Replace depositDataRoot & depositDataManager (#182)
dfkadyr Oct 7, 2024
df6d5a1
new-improves
dfkadyr Oct 9, 2024
8f82fb5
Merge branch 'main' into for-new-stake
Cast0001 Oct 9, 2024
b558aff
hide score percentiles
Cast0001 Oct 14, 2024
6a62ffa
fix types
Cast0001 Oct 14, 2024
c6c8f7b
Remove ScorePercentiles logic (#185)
dfkadyr Oct 16, 2024
d7f03c0
Boost apy (#187)
Cast0001 Oct 17, 2024
2a6782b
[boost-part-2] remove boost percent (#189)
Cast0001 Oct 18, 2024
a8fd30d
[boost ui] update boost data (#188)
mike-diamond Oct 18, 2024
0d812e6
remove duplicates (#186)
dfkadyr Oct 18, 2024
1ebe0f6
remove duplicates (#186) (#191)
dfkadyr Oct 23, 2024
95e9d4c
Improve ltv percent logic (#193)
dfkadyr Oct 23, 2024
05cb017
Boost methods (#192)
mike-diamond Oct 23, 2024
73bdd0a
add v2 to getVaultVersion, update holesky factories, add queuedShares…
dfkadyr Oct 23, 2024
61ddf1d
update holesky & mainnet factories (#194)
dfkadyr Oct 24, 2024
298575c
Boost apy (#187)
Cast0001 Oct 17, 2024
1e14e40
[boost-part-2] remove boost percent (#189)
Cast0001 Oct 18, 2024
be8758e
[boost ui] update boost data (#188)
mike-diamond Oct 18, 2024
69c7262
Boost methods (#192)
mike-diamond Oct 23, 2024
97cfb4f
Merge branch 'boost' of github.com:stakewise/v3-sdk into boost
Cast0001 Oct 24, 2024
ced7752
update holesky & mainnet factories (#196)
dfkadyr Oct 25, 2024
c801169
Boost part 3 (#195)
Cast0001 Oct 25, 2024
04fe0b0
Merge branch 'boost' of github.com:stakewise/v3-sdk into boost
Cast0001 Oct 25, 2024
5073d34
Unboost (#197)
mike-diamond Oct 28, 2024
d5d27fb
Boost updates (#198)
Cast0001 Oct 28, 2024
6aae25f
fix getBoost
Cast0001 Oct 29, 2024
640cfb8
add upgradeToAndCall to VaultMulticall (#200)
dfkadyr Oct 31, 2024
9fd7692
Fix user stats (#201)
Cast0001 Oct 31, 2024
8176f39
improve CODEOWNERS (#202)
Oct 31, 2024
656ba70
improve BigDecimal (#203)
dfkadyr-stakewise Nov 4, 2024
986e666
Unboost (#199)
mike-diamond Nov 4, 2024
94ee69b
[unboost vault] remove getBoostApy
mike-diamond Nov 5, 2024
3f18ad2
Unboost queue (#204)
Cast0001 Nov 5, 2024
65795c1
Fix queue (#205)
Cast0001 Nov 7, 2024
bf748b8
Add isDepositWithMint option (#206)
dfkadyr-stakewise Nov 8, 2024
5775c82
fix claim boost queue
Cast0001 Nov 11, 2024
7701049
Rewards data (#207)
Cast0001 Nov 14, 2024
de1f7cc
[calculate-user-stats] changes (#208)
Cast0001 Nov 15, 2024
08df0db
Fix boost lock (#209)
Cast0001 Nov 20, 2024
0670912
Add documentation website (#210)
dfkadyr-stakewise Nov 25, 2024
714c1b9
Migration and Search (#211)
dfkadyr-stakewise Nov 26, 2024
11cfa2d
remove RESTAKE logic (#212)
dfkadyr-stakewise Nov 27, 2024
1fbddf1
[new-addresses] setted (#213)
Cast0001 Nov 29, 2024
c1a4c94
change abi
Cast0001 Nov 29, 2024
78386fd
[rewards-fix] fixed (#214)
Cast0001 Nov 29, 2024
b9c2d88
[new-schema] changes (#215)
Cast0001 Dec 2, 2024
581493b
fix
Cast0001 Dec 2, 2024
4bd6dd4
Claim (#216)
mike-diamond Dec 3, 2024
0886964
Referrer (#218)
mike-diamond Dec 5, 2024
ed37d76
Update links, rename thresholdPercent to liqThresholdPercent (#219)
dfkadyr-stakewise Dec 6, 2024
4662624
Fiat rates and APY (#220)
Cast0001 Dec 9, 2024
3e221b8
[fix-apy] fixed (#222)
Cast0001 Dec 11, 2024
69a161a
remove apy in leverageStrategyPositionStats_collection (#223)
dfkadyr-stakewise Dec 11, 2024
9606551
Update graphql (#224)
mike-diamond Dec 12, 2024
0251c5d
[update stats] update stats requests (#225)
mike-diamond Dec 19, 2024
4ad4d30
Currencies (#227)
mike-diamond Dec 24, 2024
7b0902b
[boost-apy] add new boost actions to table (#226)
dfkadyr-stakewise Dec 25, 2024
5091f2c
[requests improve] update requests (#229)
mike-diamond Jan 6, 2025
08e299e
[codegen fix] update codegen types (#230)
mike-diamond Jan 8, 2025
571a4f8
[updates-for-apy] update fields (#231)
Cast0001 Jan 14, 2025
afa15c4
Merge branch 'main' into boost
Cast0001 Jan 16, 2025
3196306
set stage graph
Cast0001 Jan 16, 2025
627b884
fix build
Cast0001 Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@dfkadyr @mike-diamond @Cast0001
* @dfkadyr-stakewise @mike-diamond @Cast0001
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ node_modules
schema.graphql
src/types/graphql
src/contracts/types
src/contracts/vault/types
2 changes: 1 addition & 1 deletion .graphqlconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"extensions": {
"endpoints": {
"Subgraph GraphQL": {
"url": "https://holesky-graph.stakewise.io/subgraphs/name/stakewise/stakewise/graphql",
"url": "https://graphs.stakewise.io/holesky/subgraphs/name/stakewise/prod",
"headers": {
"user-agent": "JS GraphQL"
},
Expand Down
1,784 changes: 8 additions & 1,776 deletions README.md

Large diffs are not rendered by default.

253 changes: 243 additions & 10 deletions changelog/next-release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
- Breaking change: Removed `sdk.osToken.getConfig`. Use `sdk.vault.getVault` instead to get osToken config data `{ osTokenConfig: { ltvPercent, thresholdPercent } }`.
- Added canHarvest: boolean to `sdk.vault.getHarvestParams` response.

# Updates
### 1. `sdk.vault.getVault`

Expand All @@ -10,27 +7,263 @@
type AddedOutput = {
osTokenConfig: {
ltvPercent: string
thresholdPercent: string
liqThresholdPercent: string
}
queuedShares: string
allocatorMaxBoostApy: number
osTokenHolderMaxBoostApy: number
isGenesis: boolean
}
```

| Name | Description |
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `osTokenConfig` | contains the `ltvPercent`, which is the percentage used to calculate how much a user can mint in OsToken shares, and `thresholdPercent`, which is the liquidation threshold percentage used to calculate the health factor for the OsToken position |
| Name | Description |
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `osTokenConfig` | contains the `ltvPercent`, which is the percentage used to calculate how much a user can mint in OsToken shares, and `liqThresholdPercent`, which is the liquidation threshold percentage used to calculate the health factor for the OsToken position |
| `isGenesis` | This vault is owned by stakewise |
| `allocatorMaxBoostApy` | The average max boost APY earned in this vault by the allocator |
| `osTokenHolderMaxBoostApy` | The average max boost APY earned in this vault by the osToken holder |
| `queuedShares` | The total number of queued shares |

---
### 2. `sdk.vault.getHarvestParams`

#### New output format:

```ts
type Output = {
canHarvest: boolean // NEW
params: {
reward: string
proof: Array<string>
rewardsRoot: string
unlockedMevReward: string
}
}
```

---

### 3. Removed method
### `sdk.osToken.getAvgRewardsPerSecond`

---

### 4. Removed output field
### `sdk.osToken.getPosition`

Removed fee

```ts
type RemovedOutput = {
minted: {
fee: bigint
}
}
```

| Name | Description |
|----------------|------------------------------------|
| `boost.shares` | Count of osToken tokens with boost |

### 5. Added method getStakewiseStats
### `sdk.utils.getStakewiseStats`
#### Getting common stakewise data for the network

---

### 6. Added optional input field
### `sdk.vault.getExitQueuePositions`
#### Added Argument:

| Name | Type | Required |
|--------------|-----------|----------|
| isClaimed | `boolean` | **No** |

---

### 7. Removed output field
### `sdk.vault.getStakeBalance`

```ts
type RemovedOutput = {
shares: bigint
}
```
---

### 8. Deprecated method `sdk.osToken.getConfig`
### Use `sdk.vault.getVault` instead to get the result in `osTokenConfig` field.

---

### 9. Added methods
### `sdk.vault.getVaultStats` & `sdk.vault.getUserStats`
#### With the help of this data it is possible to build a chart.

---

### 10. Removed method `sdk.vault.getSnapshots`
### Use `sdk.vault.getVaultStats` instead

---

### 11. Updated method `sdk.vault.getUserRewards`
#### Updated output format:

```ts
type Output = Array<{
date: number
dailyRewards: number
dailyRewardsEur: number
dailyRewardsGbp: number
dailyRewardsUsd: number
}>
```

#### New arguments:

| Name | Type | Type | Description |
|--------------|----------|---------|-------------------------------|
| dateFrom | `number` | **Yes** | Time to start in milliseconds |
| dateTo | `number` | **Yes** | Time to end in milliseconds |
| userAddress | `string` | **Yes** | The user address |
| vaultAddress | `string` | **Yes** | The address of the vault |

---

### 12. Added method getFiatRates
### `sdk.utils.getFiatRates`
#### Getting fiat values for the network

---

### 13. Removed input field
### `sdk.vault.operate`
#### Removed depositDataRoot use `vault.setDepositDataRoot` instead
#### Removed depositDataManager use `vault.setDepositDataManager` instead

```ts
type RemovedInput = {
depositDataManager: string
depositDataRoot: string
}
```

---

### 14. Removed method `sdk.vault.getScorePercentiles`

---

### 15. Added method
### `sdk.boost.getData`
#### Get the address of the leverage strategy proxy contract
---

### 16. Added method
### `sdk.boost.getLeverageStrategyProxy`
#### Get the address of the leverage strategy proxy contract

---

### 17. Added method
### `sdk.utils.getPermitSignature`
#### Get permit signature for ERC20 token

---

### 18. Added method
### `sdk.boost.lock`
#### Boost your osToken apy using leverage staking

---

### 19. Added method
### `sdk.boost.unlock`
#### Unboost your boosted osToken

---

### 20. Added method
### `sdk.boost.claimQueue`
#### Claim user unboost queue

---

### 20. Changed output field
### `sdk.vault.getExitQueuePositions`

```ts
// Output changed type from bigint to string
positions[number]['exitQueueIndex']
```

---

### 21. Added method
### `sdk.utils.getFiatRatesByDay`
#### Get fiat data by day

---

### 22. `sdk.osToken.getAPY`

#### New output field:

```ts
type Output = {
apy: string
feePercent: number
}
```

---

### 23. Added input field `referrerAddress`
### `sdk.vault.deposit`
### `sdk.osToken.mint`

---

### 24. `sdk.utils.getFiatRates`

#### New output fields:

```ts
type AddedOutput = {
canHarvest: boolean
'USD/CNY': number
'USD/JPY': number
'USD/KRW': number
'USD/AUD': number
}
```

---

### 3. Removed method
### `sdk.vault.getVault`
### 25. `sdk.vault.getUserRewards`

#### New output fields:

```ts
type AddedOutput = {
dailyRewardsCny: number
dailyRewardsJpy: number
dailyRewardsKrw: number
dailyRewardsAud: number
}
```

---

### 26. `sdk.utils.getFiatRatesByDay`

#### New output fields:

```ts
type AddedOutput = {
usdToCnyRate: string
usdToJpyRate: string
usdToKrwRate: string
usdToAudRate: string
}
```
6 changes: 5 additions & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ if (process.env.NETWORK === 'gnosis') {
const config = configs[network]
const subgraphIndex = Number(process.env.SUBGRAPH_INDEX || 0)

const subgraphUrl = Array.isArray(config.api.subgraph)
let subgraphUrl = Array.isArray(config.api.subgraph)
? config.api.subgraph[subgraphIndex]
: config.api.subgraph

subgraphUrl = subgraphUrl.replace('prod', 'stage')

const urls: Record<string, string> = {
backend: config.api.backend,
subgraph: subgraphUrl,
Expand All @@ -30,6 +32,7 @@ console.log(`Generating types for network: ${config.network.id}`, urls)
// https://the-guild.dev/graphql/codegen/plugins/typescript/typescript
const typesConfig = {
maybeValue: 'T',
inputMaybeValue: 'Partial<T>',
defaultScalarType: 'string', // sets BigDecimal to string instead of any
noExport: true, // replaced with namespace
enumsAsTypes: true,
Expand All @@ -41,6 +44,7 @@ const typesConfig = {
// https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-urql
const requestsConfig = {
maybeValue: 'T',
inputMaybeValue: 'Partial<T>',
defaultScalarType: 'string',
operationResultSuffix: 'Payload', // gives suffix to payload type
noExport: false, // disables export by default
Expand Down
Loading
Loading