Skip to content

Commit 7276279

Browse files
author
Will Pote
committed
Initial commit: 2
1 parent b583dc1 commit 7276279

File tree

15 files changed

+477
-303
lines changed

15 files changed

+477
-303
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ node_modules
22
.vscode
33
build
44
cdk.out
5+
.yalc
6+
yalc.lock
57
dist
68
.DS_Store

bin/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import 'source-map-support/register';
33
import * as cdk from 'aws-cdk-lib';
44
import { RoutingAPIStack } from './stacks/routing-api-stack';
5+
import dotenv from 'dotenv'
6+
dotenv.config();
57

68
const app = new cdk.App();
79
new RoutingAPIStack(app, 'RoutingAPIStack');

bin/stacks/routing-dashboard-stack.ts

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class RoutingDashboardStack extends cdk.NestedStack {
1818
new aws_cloudwatch.CfnDashboard(this, 'RoutingAPIDashboard', {
1919
dashboardName: 'RoutingDashboard',
2020
dashboardBody: JSON.stringify({
21+
periodOverride: 'inherit',
2122
widgets: [
2223
{
2324
height: 6,
@@ -86,23 +87,34 @@ export class RoutingDashboardStack extends cdk.NestedStack {
8687
x: 0,
8788
type: 'metric',
8889
properties: {
89-
metrics: [
90-
['AWS/ApiGateway', 'Latency', 'ApiName', apiName],
91-
['...', { stat: 'p90' }],
92-
['...', { stat: 'p50' }],
93-
],
90+
metrics: [['AWS/ApiGateway', 'Latency', 'ApiName', apiName]],
91+
view: 'timeSeries',
92+
stacked: false,
93+
region,
94+
period: 300,
95+
stat: 'p90',
96+
title: 'Latency p90 | 5min',
97+
},
98+
},
99+
{
100+
type: 'metric',
101+
x: 0,
102+
y: 18,
103+
width: 24,
104+
height: 6,
105+
properties: {
94106
view: 'timeSeries',
95107
stacked: false,
108+
metrics: [[NAMESPACE, 'QuotesFetched', 'Service', 'RoutingAPI']],
96109
region,
110+
title: 'Average Quotes Fetched Per Swap',
97111
period: 300,
98-
stat: 'p100',
99-
title: 'Latency | 5min',
100112
},
101113
},
102114
{
103115
height: 12,
104116
width: 24,
105-
y: 18,
117+
y: 24,
106118
x: 0,
107119
type: 'metric',
108120
properties: {
@@ -128,6 +140,29 @@ export class RoutingDashboardStack extends cdk.NestedStack {
128140
title: 'Latency Breakdown | 5min',
129141
},
130142
},
143+
{
144+
type: 'metric',
145+
x: 0,
146+
y: 30,
147+
width: 24,
148+
height: 9,
149+
properties: {
150+
view: 'timeSeries',
151+
stacked: false,
152+
metrics: [
153+
[NAMESPACE, 'Top2directswappool', 'Service', 'RoutingAPI'],
154+
['.', 'Top2ethquotetokenpool', '.', '.'],
155+
['.', 'Topbytvl', '.', '.'],
156+
['.', 'Topbytvlusingtokenin', '.', '.'],
157+
['.', 'Topbytvlusingtokeninsecondhops', '.', '.'],
158+
['.', 'Topbytvlusingtokenout', '.', '.'],
159+
['.', 'Topbytvlusingtokenoutsecondhops', '.', '.'],
160+
],
161+
region: region,
162+
title: 'Top N Pools Used From Sources in Best Route | 5min',
163+
stat: 'Maximum',
164+
},
165+
},
131166
],
132167
}),
133168
});

lib/cron/cache-pools.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ export type SubgraphPool = {
1313
liquidity: string;
1414
token0: {
1515
symbol: string;
16+
id: string;
1617
};
1718
token1: {
1819
symbol: string;
20+
id: string;
1921
};
2022
totalValueLockedETH: string;
2123
};
@@ -43,9 +45,11 @@ const handler: ScheduledHandler = async (
4345
id
4446
token0 {
4547
symbol
48+
id
4649
}
4750
token1 {
4851
symbol
52+
id
4953
}
5054
feeTier
5155
liquidity

lib/ext/other/commons.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

lib/ext/other/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/handlers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { quoteHandler } from './quote';
1+
import { quoteHandler } from './quote/quote';
22

33
module.exports = { quoteHandler };

lib/handlers/quote.ts

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)