Skip to content

Commit

Permalink
Merge pull request #11 from curvefi/rewards
Browse files Browse the repository at this point in the history
Rewards
  • Loading branch information
Macket authored Dec 28, 2021
2 parents 11df1e1 + 7638349 commit 3edb354
Show file tree
Hide file tree
Showing 35 changed files with 5,965 additions and 445 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
- name: Changelog
id: Changelog
uses: scottbrenner/generate-changelog-action@master
with:
to-tag: HEAD
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
dist/**/*
lib/**/*
package-lock.json
test/temp.test.ts
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ import curve from "@curvefi/api";

console.log(await saave.stats.getTokenApy());
// [ '0.0167', '0.0417' ]

console.log(await saave.stats.getRewardsApy());
// [
// {
// token: '0x4da27a545c0c5B758a6BA100e3a049001de870f5',
// symbol: 'stkAAVE',
// apy: '0.5807714739298449'
// }
// ]
})()
````

Expand Down Expand Up @@ -658,3 +667,24 @@ await curve.estimateGas.crossAssetExchange('DAI', "WBTC", "1000", 0.01)
await curve.boosting.estimateGas.createLock('1000', 365)
```

## Rewards
```ts
const pool = new curve.Pool('susd');
// CRV
console.log(await pool.gaugeClaimableTokens());
// 0.006296257916265276
await pool.gaugeClaimTokens();
// Additional rewards
console.log(await pool.gaugeClaimableRewards());
// [
// {
// token: '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F',
// symbol: 'SNX',
// amount: '0.000596325465987726'
// }
// ]
await pool.gaugeClaimRewards();
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "1.14.0",
"version": "1.15.0",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"scripts": {
Expand Down
Loading

0 comments on commit 3edb354

Please sign in to comment.