synapsecns / sanguine

Synapse Monorepo
MIT License
38 stars 29 forks source link

3rd party relayer promexporter #3008

Closed trajan0x closed 2 weeks ago

trajan0x commented 1 month ago

The need has arisen to export to grafana third party relayer balances on all-chains. To do this, you should:

  1. Get all unique relayer addresses & assets here at boot and at some interval
  2. Perform periodic batch calls in this fashioned https://github.com/synapsecns/sanguine/blob/master/contrib/promexporter/exporters/bridge.go#L102 and update metrics called rfq_relayer_balance
greptile-apps[bot] commented 1 month ago
  1. Fetch unique relayer addresses and assets from https://rfq-api.omnirpc.io/quotes at boot and at regular intervals.

  2. Implement periodic batch calls similar to the pattern in contrib/promexporter/exporters/bridge.go at line 102:

// Example function to fetch relayer balances
func fetchRelayerBalances() {
    // Fetch data from the API
    // Parse the response to get unique relayer addresses and assets
    // Perform batch calls to get balances
    // Update the rfq_relayer_balance metrics
}
  1. Update the rfq_relayer_balance metrics accordingly.

References

/contrib/promexporter /docs/bridge/docs/rfq/API/upsert-quote.api.mdx /services/rfq/relayer/inventory/export_test.go /agents/contracts/test/attestationharness/generate.go /contrib/promexporter/exporters /contrib/promexporter/exporters/bridge.go /contrib/promexporter/internal/gql/explorer/generate.go /packages/sdk-router/src/sdk.test.ts /contrib/promexporter/exporters/submitter.go /services/rfq/relayer/dashboards /docs/bridge/docs/rfq/API/upsert-quotes.api.mdx /services/rfq/relayer/dashboards/dashboard.json /agents/contracts/test/snapshotharness/generate.go /docs/bridge/docs/rfq/Relayer /agents/contracts/test/summitharness/summitharness.metadata.go /services/rfq/api/docs/swagger.yaml /docs/bridge/docs/rfq/Relayer/Relayer.md /contrib/promexporter/exporters/exporter.go /services/explorer /services/rfq/api/model/response.go /services/rfq/relayer/relapi/server.go /services/rfq/relayer /packages/contracts-rfq/deployments/op_sepolia /services/rfq/relayer/quoter/quoter.go /agents/contracts/test/summitharness/doc.go

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a ๐Ÿ‘ if this is helpful and ๐Ÿ‘Ž if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/synapsecns/sanguine/master) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)