This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
/
serverless.yml
169 lines (153 loc) · 3.73 KB
/
serverless.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
service:
name: uniswap-api-auth
frameworkVersion: ">=1.75.1 <2.0.0"
provider:
name: aws
endpointType: REGIONAL
runtime: nodejs12.x
memorySize: 320 # optional, in MB, default is 1024
timeout: 20 # optional, in seconds, default is 6
logRetentionInDays: 1
usagePlan:
- low: # 5 QPS
quota:
limit: 500000 # 5 * 60 * 60 * 24
period: DAY
throttle:
burstLimit: 10
rateLimit: 5
- medium: # 50 QPS
quota:
limit: 5000000 # 50 * 60 * 60 * 24 rounded up
period: DAY
throttle:
burstLimit: 100
rateLimit: 50
- high: # 100 QPS
quota:
limit: 10000000 # 100 * 60 * 60 * 24 rounded up
period: DAY
throttle:
burstLimit: 200
rateLimit: 100
custom:
# Enable or disable caching globally
apiGatewayCaching:
enabled: true
clusterSize: '0.5' # defaults to '0.5'
ttlInSeconds: 300 # defaults to the maximum allowed: 3600
contentEncoding:
minimumCompressionSize: 0 # Minimum body size required for compression in bytes
plugins:
- serverless-plugin-typescript
- serverless-api-gateway-caching
- serverless-content-encoding
functions:
v1-summary:
handler: src/v1/summary.handler
events:
- http:
method: get
path: /v1/summary
private: true
caching:
enabled: true
ttlInSeconds: 900
v1-tickers:
handler: src/v1/tickers.handler
events:
- http:
method: get
path: /v1/tickers
private: true
caching:
enabled: true
ttlInSeconds: 60
v1-assets:
handler: src/v1/assets.handler
events:
- http:
method: get
path: /v1/assets
private: true
caching:
enabled: true
ttlInSeconds: 3600
v1-orderbook:
handler: src/v1/orderbook.handler
events:
- http:
method: get
path: "/v1/orderbook/{pair}"
private: true
caching:
enabled: true
cacheKeyParameters:
- name: request.path.pair
ttlInSeconds: 3600
v1-trades:
handler: src/v1/trades.handler
events:
- http:
method: get
path: "/v1/trades/{pair}"
private: true
caching:
enabled: true
cacheKeyParameters:
- name: request.path.pair
ttlInSeconds: 900
v2-summary:
handler: src/v2/summary.handler
events:
- http:
method: get
path: /v2/summary
private: true
caching:
enabled: true
ttlInSeconds: 900
v2-tickers:
handler: src/v2/tickers.handler
events:
- http:
method: get
path: /v2/tickers
private: true
caching:
enabled: true
ttlInSeconds: 60
v2-assets:
handler: src/v2/assets.handler
events:
- http:
method: get
path: /v2/assets
private: true
caching:
enabled: true
ttlInSeconds: 3600
v2-orderbook:
handler: src/v2/orderbook.handler
events:
- http:
method: get
path: "/v2/orderbook/{pair}"
private: true
caching:
enabled: true
cacheKeyParameters:
- name: request.path.pair
ttlInSeconds: 3600
v2-trades:
handler: src/v2/trades.handler
events:
- http:
method: get
path: "/v2/trades/{pair}"
private: true
caching:
enabled: true
cacheKeyParameters:
- name: request.path.pair
ttlInSeconds: 900