Skip to content

Commit

Permalink
resolving code climate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliiiu committed May 9, 2024
1 parent d810ccf commit 812ac59
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 92 deletions.
91 changes: 0 additions & 91 deletions src/data/treasury-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,94 +287,3 @@ export const chain = {
Matic: 'matic',
Frax: 'frax',
}

export const fraxLendQueryObject = {
query: `
query fraxlendArbitrumPairs {
pairs {
...fraxlendPairDetail
dailyHistory(first: 1, orderBy: timestamp, orderDirection: desc) {
id
exchangeRate
totalAssetAmount
totalAssetShare
totalCollateral
totalBorrowAmount
totalBorrowShare
totalBorrowValue
totalAssetValue
totalCollateralValue
interestPerSecond
utilization
totalFeesAmount
totalFeesShare
lastAccrued
timestamp
}
}
}
fragment fraxlendPairDetail on Pair {
address
name
symbol
oracleDivideAddress {
id
decimals
}
oracleMultiplyAddress {
id
decimals
}
maxLTV
liquidationFee
maturity
pauseStatus
lenderWhitelistActive
borrowerWhitelistActive
asset {
symbol
decimals
address
name
}
collateral {
symbol
decimals
address
name
}
rateContract {
id
rateType
rateName
interestHalfLife
minInterest
maxInterest
minUtilization
maxUtilization
maxVertexUtilization
utilizationPrecision
maxFullUtilRate
maxTargetUtil
minFullUtilRate
minTargetUtil
rateHalfLife
ratePrec
utilPrec
vertexRatePercent
vertexUtil
zeroUtilRate
}
positions(orderBy: borrowedAssetShare, orderDirection: desc) {
user {
id
}
borrowedAssetShare
depositedCollateralAmount
lentAssetShare
timestamp
}
}
`,
operationName: 'fraxlendArbitrumPairs',
}
91 changes: 91 additions & 0 deletions src/services/treasury/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,94 @@ export const DAILY_TREASURY = gql`
}
}
`

export const fraxLendQueryObject = {
query: `
query fraxlendArbitrumPairs {
pairs {
...fraxlendPairDetail
dailyHistory(first: 1, orderBy: timestamp, orderDirection: desc) {
id
exchangeRate
totalAssetAmount
totalAssetShare
totalCollateral
totalBorrowAmount
totalBorrowShare
totalBorrowValue
totalAssetValue
totalCollateralValue
interestPerSecond
utilization
totalFeesAmount
totalFeesShare
lastAccrued
timestamp
}
}
}
fragment fraxlendPairDetail on Pair {
address
name
symbol
oracleDivideAddress {
id
decimals
}
oracleMultiplyAddress {
id
decimals
}
maxLTV
liquidationFee
maturity
pauseStatus
lenderWhitelistActive
borrowerWhitelistActive
asset {
symbol
decimals
address
name
}
collateral {
symbol
decimals
address
name
}
rateContract {
id
rateType
rateName
interestHalfLife
minInterest
maxInterest
minUtilization
maxUtilization
maxVertexUtilization
utilizationPrecision
maxFullUtilRate
maxTargetUtil
minFullUtilRate
minTargetUtil
rateHalfLife
ratePrec
utilPrec
vertexRatePercent
vertexUtil
zeroUtilRate
}
positions(orderBy: borrowedAssetShare, orderDirection: desc) {
user {
id
}
borrowedAssetShare
depositedCollateralAmount
lentAssetShare
timestamp
}
}
`,
operationName: 'fraxlendArbitrumPairs',
}
3 changes: 2 additions & 1 deletion src/utils/treasury-utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import config from '@/config'
import { fraxLendQueryObject, TokensType } from '@/data/treasury-data'
import { TokensType } from '@/data/treasury-data'
import {
ContractDetailsType,
TreasuryTokenType,
} from '@/types/TreasuryTokenType'
import axios from 'axios'
import { calculateAPR } from './LockOverviewUtils'
import { fraxLendQueryObject } from '@/services/treasury/queries'

const TOKEN_MINIMUM_VALUE = 4000

Expand Down

0 comments on commit 812ac59

Please sign in to comment.