Skip to content

Commit

Permalink
Removing all unused functions of liquid staked base apr, left just xB…
Browse files Browse the repository at this point in the history
…oo, because idk what to do with the spooky apr service yet;
  • Loading branch information
Luiz Gustavo Abou Hatem De Liz committed Aug 29, 2023
1 parent fd7f136 commit a836720
Showing 1 changed file with 0 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,47 +1,10 @@
import axios from 'axios';

export class LiquidStakedBaseAprService {
//TODO - remove this, i
public async getWstEthBaseApr(): Promise<number> {
const { data } = await axios.get<{
data: { aprs: [{ timeUnix: number; apr: number }]; smaApr: number };
}>('https://eth-api.lido.fi/v1/protocol/steth/apr/sma');
return data.data.smaApr / 100;
}

public getSftmxBaseApr(): number {
return 0.046;
}

//TODO - Remove this, since it's already in ib-linear-apr-handlers
public async getAnkrFtmBaseApr(): Promise<number> {
const { data } = await axios.get<{ services: { serviceName: string; apy: string }[] }>(
'https://api.staking.ankr.com/v1alpha/metrics',
{},
);

const ankrFtmApy = data.services.find((service) => service.serviceName === 'ftm');
return parseFloat(ankrFtmApy?.apy || '0') / 100;
}
//TODO - Remove this, since it's already in ib-linear-apr-handlers
public async getAnkrEthBaseApr(): Promise<number> {
const { data } = await axios.get<{ services: { serviceName: string; apy: string }[] }>(
'https://api.staking.ankr.com/v1alpha/metrics',
{},
);

const ankrEthApy = data.services.find((service) => service.serviceName === 'eth');
return parseFloat(ankrEthApy?.apy || '0') / 100;
}

public async getXBooBaseApr(): Promise<number> {
const { data } = await axios.get<string>('https://api.spooky.fi/api/xboo', {});
return parseFloat(data) / 100;
}

public getREthBaseApr(): number {
return 0.0425;
}
}

export const liquidStakedBaseAprService = new LiquidStakedBaseAprService();

0 comments on commit a836720

Please sign in to comment.