Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add diagram #29

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ A collection of services to index, store, and transform data related to Syntheti

## Services

![Data Stack Diagram](./static/diagram.png)

At a high level, the data stack contains a set of services to listen to onchain events, store that event data in a Postgres database, then transform and aggregate that data into a format that is useful for analytics.

Read more about each service:
* [**Database**](./postgres/) - A Postgres database used to store raw and transformed data.
* [**Indexers**](./indexers/) - Blockchain indexers using Subsquid archives to index Synthetix smart contracts. These indexers are used to populate a Postgres database with raw event log data.
* [**Transformers**](./transformers/) - Services that transform raw event log data into a format that is more useful for querying. These services are used to populate a Postgres database with transformed data using [dbt](https://www.getdbt.com/).
* [**Dashboard**](./dashboard/) - A collection of dashboards built using [streamlit](https://streamlit.io/) and connected directly to the Postgres database.

For more information about these services, visit the README in the respective directory.

## Usage

### Configuration
Expand Down
109 changes: 109 additions & 0 deletions static/diagram.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<mxfile host="app.diagrams.net" modified="2024-02-08T22:36:19.894Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" etag="TfVoUwfV5U71_-ros65d" version="23.1.2" type="device">
<diagram name="Page-1" id="rFEMjwONDgXLVHUbBiYk">
<mxGraphModel dx="1018" dy="1383" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="R1emBW7lre0Wp2ynIHXj-4" value="&lt;h1 style=&quot;font-size: 16px;&quot;&gt;Onchain Events&lt;/h1&gt;" style="rounded=0;whiteSpace=wrap;html=1;align=center;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="25" y="460" width="165" height="300" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-16" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="S-hfegwOmEvxK6TibCQ1-2" target="R1emBW7lre0Wp2ynIHXj-10">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="S-hfegwOmEvxK6TibCQ1-2" value="Base Mainnet" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="42.5" y="530" width="130" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-17" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-1" target="R1emBW7lre0Wp2ynIHXj-11">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-1" value="Base Testnet" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="42.5" y="590" width="130" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-18" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-2" target="R1emBW7lre0Wp2ynIHXj-12">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-2" value="Optimism Mainnet" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="42.5" y="650" width="130" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-19" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-3" target="R1emBW7lre0Wp2ynIHXj-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-3" value="Optimism Testnet" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="42.5" y="710" width="130" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-5" value="Postgres Database" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;verticalAlign=top;fontSize=16;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="340" y="460" width="360" height="300" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-24" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-10" target="R1emBW7lre0Wp2ynIHXj-20">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-10" value="B-M Indexer" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="220" y="530" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-25" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-11" target="R1emBW7lre0Wp2ynIHXj-21">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-11" value="B-T Indexer" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="220" y="590" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-26" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-12" target="R1emBW7lre0Wp2ynIHXj-22">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-12" value="OP-M Indexer" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="220" y="650" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-27" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-13" target="R1emBW7lre0Wp2ynIHXj-23">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-13" value="OP-T Indexer" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="220" y="710" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-30" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-20" target="R1emBW7lre0Wp2ynIHXj-28">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-20" value="Raw B-M db" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="365" y="530" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-31" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-21" target="R1emBW7lre0Wp2ynIHXj-28">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-21" value="Raw B-T db" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="365" y="590" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-32" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-22" target="R1emBW7lre0Wp2ynIHXj-28">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-22" value="Raw OP-M db" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="365" y="650" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-33" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-23" target="R1emBW7lre0Wp2ynIHXj-28">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-23" value="Raw OP-T db" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="365" y="710" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-35" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="R1emBW7lre0Wp2ynIHXj-28" target="R1emBW7lre0Wp2ynIHXj-34">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-28" value="&lt;b&gt;dbt&lt;/b&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="495" y="530" width="30" height="210" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-34" value="&lt;b&gt;Analytics db&lt;/b&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="555" y="530" width="120" height="210" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-36" value="B-M schema" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
<mxGeometry x="570" y="570" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-37" value="B-T schema" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
<mxGeometry x="570" y="610" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-38" value="OP-M schema" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
<mxGeometry x="570" y="650" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="R1emBW7lre0Wp2ynIHXj-39" value="OP-T schema" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
<mxGeometry x="570" y="690" width="90" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file added static/diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.