8000 refactor: remove market config from oracle and providers by davidterpay · Pull Request #132 · skip-mev/connect · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

refactor: remove market config from oracle and providers #132

Merged
merged 14 commits into from
Feb 21, 2024

Conversation

davidterpay
Copy link
Contributor
@davidterpay davidterpay commented Feb 15, 2024

NOTE: This PR is breaking and must be merged into feat/marketmap after all other PRs that branch on this are merged here.

  • since we are using the marketmap module to determine the set of providers and tickers they are responsible for, i am removing the separate oracle config that exists rn.
  • moving the file to be json based instead of toml based since the marketmap types are json as well (default of proto)

@davidterpay davidterpay marked this pull request as ready for review February 15, 2024 19:12
@aljo242 aljo242 changed the title Deleting market config from oracle and providers refactor: remove market config from oracle and providers Feb 15, 2024
@aljo242
Copy link
Contributor
aljo242 commented Feb 15, 2024

tests failing

@davidterpay davidterpay marked this pull request as draft February 15, 2024 20:28
@davidterpay
Copy link
Contributor Author

tests will keep failing till all other changes are merged into this branch

@@ -59,63 +59,63 @@ const (
// WebSocketConfig defines a config for a websocket based data provider.
type WebSocketConfig struct {
// Enabled is a flag that indicates whether the provider is websocket based.
Enabled bool `mapstructure:"enabled" toml:"enabled"`
Enabled bool `json:"enabled"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't the Enabled field mostly put in place to work around peculiarities w/ generating configs via toml? I'm thinking it doesn't make sense to have now--a provider will be enabled if there are feeds for it to fetch and disabled if not.

// Market defines the market configurations for how currency pairs will be resolved to a
// final price. Each currency pair can have a list of convertable markets that will be used
// to convert the price of the currency pair to a common currency pair.
Market AggregateMarketConfig `mapstructure:"market" toml:"market"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the aggregation logic going to be configured now without AggregateMarketConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to reference the marketmap module, which will have the relevant market information.

davidterpay and others added 11 commits February 15, 2024 17:37
* type swap

* alias

* alias

* use constants in tests
* binance

* coinbase and coingecko

* nits

* static

* type alias maximalism

* format
* coinbase and coingecko

* nits

* bitfinex

* bitstamp

* bybit

* nits

* nit

* websocket first pass

* nits

* format
…162)

* init

* testing

* more testing

* cr

* init

* nits

* update

* nits

---------

Co-authored-by: aljo242 <alex@skip.money>
* init

* testing

* more testing

* cr

* init

* nits

* init

* nits

* e2e fixes

* cr nits
@davidterpay davidterpay marked this pull request as ready for review February 21, 2024 23:46
Copy link
codecov bot commented Feb 21, 2024

Codecov Report

Attention: 423 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (feat/marketmap@0032933). Click here to learn what that means.

Files Patch % Lines
providers/factories/oracle/websocket.go 0.00% 60 Missing ⚠️
providers/factories/oracle/api.go 0.00% 38 Missing ⚠️
oracle/types/market.go 56.06% 22 Missing and 7 partials ⚠️
providers/factories/oracle/factory.go 0.00% 28 Missing ⚠️
pkg/math/oracle/median.go 70.65% 22 Missing and 5 partials ⚠️
providers/static/api_handler.go 0.00% 19 Missing ⚠️
providers/apis/binance/api_handler.go 70.73% 6 Missing and 6 partials ⚠️
providers/websockets/bitfinex/parse.go 57.14% 11 Missing and 1 partial ⚠️
providers/websockets/bitfinex/ws_data_handler.go 61.29% 6 Missing and 6 partials ⚠️
providers/websockets/mexc/ws_data_handler.go 50.00% 6 Missing and 6 partials ⚠️
... and 28 more
Additional details and impacted files
@@                Coverage Diff                @@
##             feat/marketmap     #132   +/-   ##
=================================================
  Coverage                  ?   59.21%           
=================================================
  Files                     ?      225           
  Lines                     ?     8896           
  Branches                  ?        0           
=================================================
  Hits                      ?     5268           
  Misses                    ?     2980           
  Partials                  ?      648           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidterpay davidterpay merged commit 4cfc73b into feat/marketmap Feb 21, 2024
aljo242 pushed a commit that referenced this pull request Feb 22, 2024
* init

* rm mapstructure

* chore: swapping types in the main oracle to use ticker (#133)

* type swap

* alias

* alias

* use constants in tests

* chore: Updating API providers with new types (#139)

* binance

* coinbase and coingecko

* nits

* static

* type alias maximalism

* format

* chore: Updating all WS providers with new types (#143)

* coinbase and coingecko

* nits

* bitfinex

* bitstamp

* bybit

* nits

* nit

* websocket first pass

* nits

* format

* chore: Updating types based on new marketmap schema (#155)

* init

* testing

* more testing

* cr

* chore: Updating provider factories with new market map configuration (#162)

* init

* testing

* more testing

* cr

* init

* nits

* update

* nits

---------

Co-authored-by: aljo242 <alex@skip.money>

* chore: Updating conversion aggregation function (#164)

* init

* testing

* more testing

* cr

* init

* nits

* init

* nits

* e2e fixes

* cr nits

---------

Co-authored-by: Alex Johnson <alex@skip.money>
aljo242 pushed a commit that referenced this pull request Feb 22, 2024
* gen new

* msg

* fix

* add test

* fix

* gen new proto

* generalize

* fix

* format

* test

* fully test

* update

* fix

* ok

* ok

* Update x/marketmap/keeper/msg_server.go

Co-authored-by: David Terpay <35130517+davidterpay@users.noreply.github.com>

* Update x/marketmap/keeper/msg_server.go

Co-authored-by: David Terpay <35130517+davidterpay@users.noreply.github.com>

* refactor: remove market config from oracle and providers (#132)

* init

* rm mapstructure

* chore: swapping types in the main oracle to use ticker (#133)

* type swap

* alias

* alias

* use constants in tests

* chore: Updating API providers with new types (#139)

* binance

* coinbase and coingecko

* nits

* static

* type alias maximalism

* format

* chore: Updating all WS providers with new types (#143)

* coinbase and coingecko

* nits

* bitfinex

* bitstamp

* bybit

* nits

* nit

* websocket first pass

* nits

* format

* chore: Updating types based on new marketmap schema (#155)

* init

* testing

* more testing

* cr

* chore: Updating provider factories with new market map configuration (#162)

* init

* testing

* more testing

* cr

* init

* nits

* update

* nits

---------

Co-authored-by: aljo242 <alex@skip.money>

* chore: Updating conversion aggregation function (#164)

* init

* testing

* more testing

* cr

* init

* nits

* init

* nits

* e2e fixes

* cr nits

---------

Co-authored-by: Alex Johnson <alex@skip.money>

* update

* godoc

* update validation

* feat: emit events for creating market (#163)

* constants

* create market event

---------

Co-authored-by: David Terpay <35130517+davidterpay@users.noreply.github.com>
@zrbecker zrbecker deleted the terpay/remove-market-config branch November 5, 2024 21:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0