forked from hal909/ethers-express
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
35 lines (27 loc) · 1.1 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {contracts} from './src/constants'
import {getTruStat} from './src/tru'
import {getTfiTotalSupply, getPoolValue, getPoolJoined, getPoolExited} from './src/tfi'
import {getTruPrice} from './src/price'
import {getAPY} from './src/truefarm'
import {getAllLoanCreated} from './src/loan'
getTruStat().then(res => console.log(res))
getTruPrice().then(res => console.log(res))
getTfiTotalSupply().then(res => console.log("TFI totalSupply: " + res))
getPoolValue().then(res => console.log("Pool value: " + res + " TUSD"))
getAPY(contracts.trueFarmTfi).then(res => console.log("TrueFi LP Daily: " + res[0] + "%" + " Weekly: " + res[1] + "%" + " APY: " + res[2] + "%"))
getAPY(contracts.trueFarmUniEth).then(res => console.log("Uniswap ETH/TRU Daily: " + res[0] + "%" + " Weekly: " + res[1] + "%" + " APY: " + res[2] + "%"))
getAllLoanCreated().then(res => {
res.forEach(element => {
console.log(element)
})
})
getPoolJoined().then(res => {
res.forEach(element => {
console.log(element)
})
})
getPoolExited().then(res => {
res.forEach(element => {
console.log(element)
})
})