Skip to content

Commit

Permalink
add snrLLP and YsnrLLP
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-goliath committed Jul 8, 2023
1 parent d6aedf4 commit f0f2eb8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions coins/src/adapters/yield/beefy/beefy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const config = {
'0x9dbbBaecACEDf53d5Caa295b8293c1def2055Adc', // mooGmxGLP
'0x9e75f8298e458b76382870982788988a0799195b', // mooCurveWSTETH
'0xa64A8CAAd2c412baCf215A351FA60cDC2a08C0E8', // Yama PlvGLP
'0xAACB2FD100981d15cFdEc2BB54B06C5E6f1AdB35', // Yama snrLLP
],
},
ethereum: {
Expand Down
6 changes: 6 additions & 0 deletions coins/src/adapters/yield/level/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import getTokenPrices from "./level";

export function level(timestamp: number = 0) {
console.log("starting level finance");
return getTokenPrices(timestamp)
}
27 changes: 27 additions & 0 deletions coins/src/adapters/yield/level/level.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Write, } from "../../utils/dbInterfaces";
import {
addToDBWritesList,
} from "../../utils/database";
import { getApi } from "../../utils/sdk";

const oracles = [
'0xce676CbAb0B76F95A262Bd460a98B0157110D07a',
]

const chain = 'arbitrum'

export default async function getTokenPrices(timestamp: number) {
const writes: Write[] = [];
const api = await getApi(chain, timestamp, true)
const tranches = await api.multiCall({ abi: 'address:lpToken', calls: oracles })
const [ decimals, symbols, oraclePrice ] = await Promise.all([
api.multiCall({ abi: 'uint8:decimals', calls: tranches }),
api.multiCall({ abi: 'string:symbol', calls: tranches }),
api.multiCall({ abi: 'address:price', calls: oracles }),
])
tranches.forEach((token: any, i: number) => {
addToDBWritesList(writes, chain, token, oraclePrice[i] / (10 ** decimals[i]), decimals[i], symbols[i], timestamp, 'level-finance', 0.99)
})

return writes
}

0 comments on commit f0f2eb8

Please sign in to comment.