1010| +--------+ +----------+ | | +----------+ +--------+ |
1111| | Oracle | | Exporter | | | | Exporter | | Oracle | |
1212| +--------+ +----------+ | | +----------+ +--------+ |
13- | | ^ ^ | | ^ ^ | |
14- +------|-------------- |--|-------+ +-----|--|--- ----------|---------+
15- | | | | | | +------------------------+
16- | +-------- |---------------|------ ---+ | | Pythd Websocket API |
17- | | Local Store | |<---------------+-------+ +------+ |
18- | +-------- |---------------|------ ---+ | | | |<--|JRPC | |
19- v | | | v | |Adapter| | WS | |
13+ | | ^ ^ ^ | | ^ ^ ^ | |
14+ +------|-----------|-- |--|-------+ +-----|--|--| ----------|---------+
15+ | | | | | | | | +------------------------+
16+ | +--| -----|---------------|-----| ---+ | | Pythd Websocket API |
17+ | | | Local Store | | |<---------------+-------+ +------+ |
18+ | +--| -----|---------------|-----| ---+ | | | |<--|JRPC | |
19+ v | | | | | v | |Adapter| | WS | |
2020 +--------------------|---------------|--------|-----------+ | | |-->|Server| |
2121 | | Global Store | | |---->+-------+ +------+ |
2222 +--------------------|---------------|--------|-----------+ | ^ | |
@@ -39,7 +39,8 @@ Publisher data write path:
3939- The Adapter then transforms this into the Pyth SDK data structures and sends it to the Local Store.
4040- The Local Store holds the latest price data the user has submitted for each price feed.
4141- The Exporters periodically query the Local Store for the latest user-submitted data,
42- and send it to the RPC node.
42+ and send it to the RPC node. They query the Global Store to get the on-chain status to dynamically
43+ adjust the compute unit price (if enabled).
4344
4445Publisher data read path:
4546- The Oracles continually fetch data from the RPC node, and pass this to the Global Store.
@@ -128,7 +129,9 @@ impl Agent {
128129 // Spawn the primary network
129130 jhs. extend ( network:: spawn_network (
130131 self . config . primary_network . clone ( ) ,
132+ network:: Network :: Primary ,
131133 local_store_tx. clone ( ) ,
134+ global_store_lookup_tx. clone ( ) ,
132135 primary_oracle_updates_tx,
133136 primary_keypair_loader_tx,
134137 logger. new ( o ! ( "primary" => true ) ) ,
@@ -138,7 +141,9 @@ impl Agent {
138141 if let Some ( config) = & self . config . secondary_network {
139142 jhs. extend ( network:: spawn_network (
140143 config. clone ( ) ,
144+ network:: Network :: Secondary ,
141145 local_store_tx. clone ( ) ,
146+ global_store_lookup_tx. clone ( ) ,
142147 secondary_oracle_updates_tx,
143148 secondary_keypair_loader_tx,
144149 logger. new ( o ! ( "primary" => false ) ) ,
0 commit comments