Skip to content

Commit 733b08a

Browse files
committed
more work on imports, prettier sort order
1 parent e0f7643 commit 733b08a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+261
-208
lines changed

.prettierrc

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
"trailingComma": "all",
44
"tabWidth": 2,
55
"semi": false,
6-
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
6+
"importOrder": [
7+
"<THIRD_PARTY_MODULES>",
8+
"^@",
9+
"^[./]"
10+
],
711
"importOrderSeparation": true,
812
"importOrderSortSpecifiers": true,
9-
"importOrderParserPlugins": ["typescript", "decorators-legacy"],
10-
"plugins": ["@trivago/prettier-plugin-sort-imports"]
13+
"importOrderParserPlugins": [
14+
"typescript"
15+
],
16+
"plugins": [
17+
"@trivago/prettier-plugin-sort-imports"
18+
]
1119
}

dev.env

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
TS_NODE_BASEURL=./lib
12
DB_NAME=squid
23
DB_PORT=23798
34
GQL_PORT=4350

package-lock.json

+153-119
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

squid-ousd.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ deploy:
1818
cmd: [ "sqd", "process:ousd:prod" ]
1919
env:
2020
RPC_ENV: RPC_ENDPOINT_RETH
21+
TS_NODE_BASEURL: './lib'
2122
api:
23+
env:
24+
TS_NODE_BASEURL: './lib'
2225
cmd:
2326
- npx
2427
- squid-graphql-server

squid.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,25 @@ deploy:
2222
cmd: [ "sqd", "process:arbitrum:prod" ]
2323
env:
2424
RPC_ENV: RPC_ENDPOINT_RETH
25+
TS_NODE_BASEURL: './lib'
2526
- name: oeth-processor
2627
cmd: [ "sqd", "process:oeth:prod" ]
2728
env:
2829
RPC_ENV: RPC_ENDPOINT_RETH
30+
TS_NODE_BASEURL: './lib'
2931
- name: ogv-processor
3032
cmd: [ "sqd", "process:ogv:prod" ]
3133
env:
3234
RPC_ENV: RPC_ENDPOINT_RETH
35+
TS_NODE_BASEURL: './lib'
3336
- name: other-processor
3437
cmd: [ "sqd", "process:mainnet:prod" ]
3538
env:
3639
RPC_ENV: RPC_ENDPOINT_RETH
40+
TS_NODE_BASEURL: './lib'
3741
api:
42+
env:
43+
TS_NODE_BASEURL: './lib'
3844
cmd:
3945
- npx
4046
- squid-graphql-server

src/main-arbitrum.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import 'tsconfig-paths/register'
12
import { arbitrum } from 'viem/chains'
3+
4+
import { run } from '@processor'
25

36
import { erc20 } from './arbitrum'
47
import { ccip } from './oeth/processors/ccip'
5-
import { run } from './processor'
68

79
export const processor = {
810
chainId: arbitrum.id,

src/main-mainnet.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import 'tsconfig-paths/register'
2+
3+
import { run } from '@processor'
14
import * as exchangeRates from '@shared/post-processors/exchange-rates'
25
import { processStatus } from '@templates/processor-status'
36

47
import { erc20s } from './mainnet/processors/erc20s'
58
import * as validate from './mainnet/validators/validate-shared'
6-
import { run } from './processor'
79

810
export const processor = {
911
stateSchema: 'mainnet-processor',

src/main-oeth.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import 'tsconfig-paths/register'
2+
3+
import { run } from '@processor'
14
import * as exchangeRatesPostProcessor from '@shared/post-processors/exchange-rates'
25
import { processStatus } from '@templates/processor-status'
36

@@ -13,7 +16,6 @@ import * as morphoAave from './oeth/processors/morpho-aave'
1316
import * as strategies from './oeth/processors/strategies'
1417
import * as vault from './oeth/processors/vault'
1518
import * as validateOeth from './oeth/validators/validate-oeth'
16-
import { run } from './processor'
1719

1820
export const processor = {
1921
stateSchema: 'oeth-processor',

src/main-ogv.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import 'tsconfig-paths/register'
2+
3+
import { run } from '@processor'
14
import { processStatus } from '@templates/processor-status'
25

36
import * as dailyStats from './ogv/post-processors/daily-stats'
47
import * as governance from './ogv/post-processors/governance'
58
import * as ogv from './ogv/processors/ogv'
69
import * as ogvSupply from './ogv/processors/ogv-supply'
7-
import { run } from './processor'
810

911
export const processor = {
1012
stateSchema: 'ogv-processor',

src/main-ousd.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import 'tsconfig-paths/register'
2+
3+
import { run } from '@processor'
14
import * as exchangeRates from '@shared/post-processors/exchange-rates'
25
import { processStatus } from '@templates/processor-status'
36

@@ -7,7 +10,6 @@ import { erc20s } from './ousd/processors/erc20s'
710
import * as ousd from './ousd/processors/ousd'
811
import * as strategies from './ousd/processors/strategies/strategies'
912
import * as validateOusd from './ousd/validators/validate-ousd'
10-
import { run } from './processor'
1113

1214
export const processor = {
1315
stateSchema: 'ousd-processor',

src/main.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
import 'tsconfig-paths/register'
2+
3+
import { run } from '@processor'
4+
15
import arbitrum from './main-arbitrum'
26
import mainnet from './main-mainnet'
37
import oeth from './main-oeth'
48
import ogv from './main-ogv'
5-
import ousd from './main-ousd'
6-
import { run } from './processor'
9+
10+
// import ousd from './main-ousd'
711

812
run(mainnet)
913
run(arbitrum)
1014
run(oeth)
11-
// run(ogv)
15+
run(ogv)
1216
// run(ousd)

src/mainnet/processors/balancer/balancer.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import {
55
createBalancerProcessor,
66
createBalancerSetup,
77
} from '@templates/balancer'
8-
import { tokens } from '@utils/addresses'
98

10-
import { Context } from '../../../processor'
9+
import { Context } from '@processor'
1110

1211
const ousdResetFrom = 11585978
1312
const oethDeployFrom = 16933090

src/mainnet/processors/curve/curve.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
createCurveSetup,
66
} from '@templates/curve'
77

8-
import { Context } from '../../../processor'
8+
import { Context } from '@processor'
99

1010
const ousdResetFrom = 11585978
1111
const oethDeployFrom = 16933090

src/mainnet/processors/liquidity-sources.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LiquiditySource, LiquiditySourceType } from '@model'
22

3-
import { Context } from '../../processor'
3+
import { Context } from '@processor'
44

55
const sources = new Map<string, LiquiditySource>()
66

src/mainnet/processors/maverick.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import {
44
createMaverickProcessor,
55
createMaverickSetup,
66
} from '@templates/maverick'
7-
import { tokens } from '@utils/addresses'
87

9-
import { Context } from '../../processor'
8+
import { Context } from '@processor'
109

1110
const oethDeployFrom = 16933090
1211

src/mainnet/processors/native.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import { NativeBalance } from '@model'
22
import { EvmBatchProcessor } from '@subsquid/evm-processor'
3-
import {
4-
OETH_VAULT_ADDRESS,
5-
OUSD_VAULT_ADDRESS,
6-
oethStrategyArray,
7-
ousdStrategyArray,
8-
} from '@utils/addresses'
93
import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater'
104
import { getNativeBalances } from '@utils/nativeBalance'
115
import { minBy } from 'lodash'
126

13-
import { Context } from '../../processor'
7+
import { Context } from '@processor'
148

159
/**
1610
* We end up with a lot of initial 0 balance entities.

src/mainnet/validators/validate-shared.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { jsonify } from '@utils/jsonify'
55
import assert from 'assert'
66
import { sortBy } from 'lodash'
77

8-
import { Block, Context } from '../../processor'
8+
import { Block, Context } from '@processor'
99

1010
export const name = 'validate-shared'
1111

src/oeth/post-processors/daily-stats/daily-stats.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
MoreThanOrEqual,
2727
} from 'typeorm'
2828

29-
import { Context } from '../../../processor'
29+
import { Context } from '@processor'
3030

3131
dayjs.extend(utc)
3232

src/oeth/processors/balancer-meta-pool.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import * as balancerMetaPoolStrategy from '@abi/balancer-meta-pool-strategy'
22
import * as metaStablePool from '@abi/balancer-meta-stable-pool'
33
import * as baseRewardPool4626 from '@abi/base-reward-pool-4626'
44
import { OETHBalancerMetaPoolStrategy } from '@model'
5+
import { Context } from '@processor'
56
import { ensureExchangeRates } from '@shared/post-processors/exchange-rates'
67
import { EvmBatchProcessor } from '@subsquid/evm-processor'
78
import { getBalancerStrategyHoldings } from '@templates/strategy/strategy-balancer'
89
import { RETH_ADDRESS, WETH_ADDRESS } from '@utils/addresses'
910
import { getLatestEntity } from '@utils/utils'
1011

11-
import { Context } from '../../processor'
1212
import { oethStrategies } from './strategies'
1313

1414
const strategyDeployBlock = 18156219

src/oeth/processors/ccip.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { BridgeTransfer, BridgeTransferState } from '@model'
66
import { EvmBatchProcessor } from '@subsquid/evm-processor'
77
import { logFilter } from '@utils/logFilter'
88

9-
import { Context } from '../../processor'
9+
import { Context } from '@processor'
1010

1111
// Code Reference: https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip-offchain
1212
// https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip-offchain/typescript/src/get-status.ts

src/oeth/processors/curve-lp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { getLatestEntity } from '@utils/utils'
1111
import { pad } from 'viem'
1212

13-
import { Context } from '../../processor'
13+
import { Context } from '@processor'
1414

1515
interface ProcessResult {
1616
curveLPs: OETHCurveLP[]

src/oeth/processors/dripper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { OETH_DRIPPER_ADDRESS, WETH_ADDRESS } from '@utils/addresses'
77
import { getLatestEntity, trackAddressBalances } from '@utils/utils'
88
import { pad } from 'viem'
99

10-
import { Context } from '../../processor'
10+
import { Context } from '@processor'
1111

1212
interface ProcessResult {
1313
drippers: OETHDripper[]

src/oeth/processors/exchange-rates.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ensureExchangeRates } from '@shared/post-processors/exchange-rates'
22
import { EvmBatchProcessor } from '@subsquid/evm-processor'
33
import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater'
44

5-
import { Context } from '../../processor'
5+
import { Context } from '@processor'
66

77
export const from = 16933090 // OETH Deploy
88

src/oeth/processors/frax-staking.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { EvmBatchProcessor } from '@subsquid/evm-processor'
55
import { OETH_FRAX_STAKING_ADDRESS, SFRXETH_ADDRESS } from '@utils/addresses'
66
import { pad } from 'viem'
77

8-
import { Context } from '../../processor'
8+
import { Context } from '@processor'
99

1010
interface ProcessResult {
1111
fraxStakings: OETHFraxStaking[]

src/oeth/processors/morpho-aave.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { EvmBatchProcessor } from '@subsquid/evm-processor'
66
import { OETH_MORPHO_AAVE_ADDRESS, WETH_ADDRESS } from '@utils/addresses'
77
import { pad } from 'viem'
88

9-
import { Context } from '../../processor'
9+
import { Context } from '@processor'
1010

1111
interface ProcessResult {
1212
morphoAaves: OETHMorphoAave[]

src/oeth/processors/strategies/strategies.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
addresses,
2222
} from '@utils/addresses'
2323

24-
import { Context } from '../../../processor'
24+
import { Context } from '@processor'
2525

2626
export const oethStrategies: readonly IStrategyData[] = [
2727
{

src/oeth/processors/vault.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { getLatestEntity, trackAddressBalances } from '@utils/utils'
1515
import { pad } from 'viem'
1616

17-
import { Context } from '../../processor'
17+
import { Context } from '@processor'
1818

1919
interface ProcessResult {
2020
vaults: OETHVault[]

src/oeth/validators/validate-oeth/validate-oeth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { jsonify } from '@utils/jsonify'
1212
import assert from 'assert'
1313
import { sortBy } from 'lodash'
1414

15-
import { Block, Context } from '../../../processor'
15+
import { Block, Context } from '@processor'
1616

1717
export const name = 'validate-oeth'
1818

src/ogv/post-processors/daily-stats.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
MoreThanOrEqual,
1010
} from 'typeorm'
1111

12-
import { Context } from '../../processor'
12+
import { Context } from '@processor'
1313

1414
dayjs.extend(utc)
1515

src/ogv/post-processors/governance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { GOVERNANCE_ADDRESS } from '@utils/addresses'
1313
import { env } from '@utils/env'
1414
import { formatEther } from 'viem'
1515

16-
import { Block, Context, Log } from '../../processor'
16+
import { Block, Context, Log } from '@processor'
1717

1818
export const from = 15491391 // https://etherscan.io/tx/0x0e04e429248c384e6b36229edf8eb5a77bec7023c58808c21b702edfcbc0e0d6
1919

src/ogv/processors/ogv-supply.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { EvmBatchProcessor } from '@subsquid/evm-processor'
44
import { OGV_ADDRESS, VEOGV_ADDRESS } from '@utils/addresses'
55
import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater'
66

7-
import { Context } from '../../processor'
7+
import { Context } from '@processor'
88

99
export const from = 14439231 // https://etherscan.io/tx/0x9295cac246169f06a3d4ec33fdbd87fced7a9e19ea61177cae75034e45ae66f4
1010

src/ogv/processors/ogv.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { EvmBatchProcessor } from '@subsquid/evm-processor'
1010
import { ADDRESS_ZERO, OGV_ADDRESS, VEOGV_ADDRESS } from '@utils/addresses'
1111

12-
import { Block, Context, Log } from '../../processor'
12+
import { Block, Context, Log } from '@processor'
1313

1414
export const from = 14439231 // https://etherscan.io/tx/0x9295cac246169f06a3d4ec33fdbd87fced7a9e19ea61177cae75034e45ae66f4
1515
export const veogvFrom = 15089597 // https://etherscan.io/tx/0x70c582e56ea1c49b7e9df70a0b40ddbfac9362b8b172cb527c329c2302d7d48a

src/ousd/post-processors/daily-stats/daily-stats.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
MoreThanOrEqual,
2222
} from 'typeorm'
2323

24-
import { Context } from '../../../processor'
24+
import { Context } from '@processor'
2525

2626
dayjs.extend(utc)
2727

src/ousd/processors/curve/curve.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from '@templates/curve'
77
import { tokens } from '@utils/addresses'
88

9-
import { Context } from '../../../processor'
9+
import { Context } from '@processor'
1010

1111
const ousdResetFrom = 11585978
1212
const oethDeployFrom = 16933090

src/ousd/processors/strategies/strategies.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
createStrategyRewardSetup,
1111
} from '@templates/strategy-rewards'
1212

13-
import { Context } from '../../../processor'
13+
import { Context } from '@processor'
1414
import { aaveStrategy } from './aave-strategy'
1515
import { convexMetaStrategy } from './convex-meta-strategy'
1616
import { fluxStrategy } from './flux-strategy'

src/ousd/processors/vault.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { getLatestEntity, trackAddressBalances } from '@utils/utils'
1212
import { pad } from 'viem'
1313

14-
import { Context } from '../../processor'
14+
import { Context } from '@processor'
1515

1616
interface ProcessResult {
1717
vaults: OUSDVault[]

0 commit comments

Comments
 (0)