File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed
handlers/liquidity-gauge-apr Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11# backend
22
3+ ## 1.56.6
4+
5+ ### Patch Changes
6+
7+ - 1b9df4f: fix handling preferred gauge APRs
8+ - 2768be6: fix handling PREFERRED gauge
9+
310## 1.56.5
411
512### Patch Changes
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import { AprService } from '../';
22import { Chain } from '@prisma/client' ;
33
44async function calculationExample (
5- chain : Chain = 'MAINNET ' ,
6- poolId = '0x3de27efa2f1aa663ae5d458857e731c129069f29000200000000000000000588 ' ,
5+ chain : Chain = 'POLYGON ' ,
6+ poolId = '0xe2f706ef1f7240b803aae877c9c762644bb808d80002000000000000000008c2 ' ,
77) {
88 const service = new AprService ( ) ;
99
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ export class LiquidityGaugeAprHandler implements AprHandler {
3131 const aprItems : Omit < PrismaPoolAprItem , 'createdAt' | 'updatedAt' > [ ] = [ ] ;
3232
3333 for ( const pool of pools ) {
34- const gauge = pool . staking . find ( ( s ) => s . type === 'GAUGE' ) ?. gauge ;
34+ const gauges = pool . staking . filter ( ( s ) => s . type === 'GAUGE' ) . map ( ( s ) => s . gauge ) ;
35+ const gauge = gauges . sort ( ( a , b ) => ( a ?. status === 'PREFERRED' ? - 1 : 1 ) ) ?. [ 0 ] ;
3536
3637 if ( ! gauge || ! gauge . rewards || ! pool . dynamicData || pool . dynamicData . totalShares === '0' ) {
3738 continue ;
Original file line number Diff line number Diff line change 11{
22 "name" : " backend" ,
3- "version" : " 1.56.5 " ,
3+ "version" : " 1.56.6 " ,
44 "description" : " Backend service for Beethoven X and Balancer" ,
55 "repository" : " https://github.com/balancer/backend" ,
66 "author" : " Beethoven X" ,
You can’t perform that action at this time.
0 commit comments