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

refactor: Provider Ticker Interface (PR1) #322

Merged
merged 33 commits into from
Apr 9, 2024

Conversation

davidterpay
Copy link
Contributor

@davidterpay davidterpay commented Apr 5, 2024

NOTE:
Most of the changes are updating the market and oracle configs.

@@ -14,7 +14,6 @@ import (
wsmetrics "github.com/skip-mev/slinky/providers/base/websocket/metrics"
providertypes "github.com/skip-mev/slinky/providers/types"
"github.com/skip-mev/slinky/providers/types/factory"
mmtypes "github.com/skip-mev/slinky/x/marketmap/types"
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note, every single alias that is relevant to a provider will now utilize the ProviderTicker interface as oppose to mmtypes.Ticker. The aggregator now maps (provider, off-chain-ticker) -> price. This will make it much easier to index prices from the aggregator with a specified market map.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the following is true...it's been hard to reason about things because of the rewrites going on. Let me know if this makes sense or is completely wrong.

This means we now have 2 uniqueness constraints right? mmtypes.Ticker--this is what we would call a "canonical ticker" or something like that which is base/quote. This has to be unique across all Markets and that is enforced in the keeper.

And now we have off-chain-ticker which is similar, but only has to be unique per Provider. That's not really enforced anywhere. It's checked in ProviderTickersFromMarketMap. If we hit an offchain ticker we've already seen, we ignore it. Right now the only thing that could be different between them is the json metadata so it's probably not a big deal, but it would result in indeterminism based on iteration order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, there should be a unique-ness check based on the off-chain-ticker and the json metadata. Our assumption atm is that In no case should the same provider have the same off-chain-ticker but have different json meta-data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should probably add that as a check in the module.

@davidterpay davidterpay marked this pull request as ready for review April 5, 2024 21:00
@aljo242
Copy link
Contributor

aljo242 commented Apr 5, 2024

run make format plz

@davidterpay
Copy link
Contributor Author

@aljo242 is that fine to run with broken changes?

oracle/types/market.go Show resolved Hide resolved
oracle/types/market.go Outdated Show resolved Hide resolved
oracle/types/market.go Outdated Show resolved Hide resolved
oracle/types/market.go Outdated Show resolved Hide resolved
oracle/types/oracle.go Outdated Show resolved Hide resolved
@davidterpay davidterpay changed the title feat: Provider Ticker Interface refactor: Provider Ticker Interface (PR1) Apr 5, 2024
oracle/types/provider.go Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a weird thing to include in this PR. Not sure how we didn't already have this function also.

@@ -14,7 +14,6 @@ import (
wsmetrics "github.com/skip-mev/slinky/providers/base/websocket/metrics"
providertypes "github.com/skip-mev/slinky/providers/types"
"github.com/skip-mev/slinky/providers/types/factory"
mmtypes "github.com/skip-mev/slinky/x/marketmap/types"
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the following is true...it's been hard to reason about things because of the rewrites going on. Let me know if this makes sense or is completely wrong.

This means we now have 2 uniqueness constraints right? mmtypes.Ticker--this is what we would call a "canonical ticker" or something like that which is base/quote. This has to be unique across all Markets and that is enforced in the keeper.

And now we have off-chain-ticker which is similar, but only has to be unique per Provider. That's not really enforced anywhere. It's checked in ProviderTickersFromMarketMap. If we hit an offchain ticker we've already seen, we ignore it. Right now the only thing that could be different between them is the json metadata so it's probably not a big deal, but it would result in indeterminism based on iteration order.

Base: "ETH",
Quote: "USD",
},
Metadata_JSON: "{}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this field was different from the metadata json for the other ProviderConfig, what is the expected behavior?

oracle/types/market.go Outdated Show resolved Hide resolved
Copy link
Contributor

@nivasan1 nivasan1 left a comment

Choose a reason for hiding this comment

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

left comments

cfg.Name,
cfg.OffChainTicker,
cfg.Metadata_JSON,
DefaultTickerDecimals,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we using a default TickerDecimals here? Should this even be relevant to providers if we're moving to big.Float arithmetic in providers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, yea i guess scaling up the values without a notion of the necessary precision before hitting aggregation probably just adds overhead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point

if cfg.Name != name {
continue
}
if _, ok := seenOffChainTickers[cfg.OffChainTicker]; ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like a validation that should be performed in the ValidateBasic for ProviderConfig?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also should we not be failing here if we see two separate offchain tickers in a ProviderConfig as we're iterating over a map it's not clear which we choose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea i brought this up in slack.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oracle/types/market.go Outdated Show resolved Hide resolved

// PriceResponse is a type alias for the price response. A price response is
// composed of a map of resolved prices and a map of unresolved prices. Resolved
// prices are the prices that were successfully fetched from the API, while
// unresolved prices are the prices that were not successfully fetched from the API.
PriceResponse = providertypes.GetResponse[mmtypes.Ticker, *big.Int]
PriceResponse = providertypes.GetResponse[ProviderTicker, *big.Int]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to use an interface as a reference into a map (ifaces are reference types). Can't we just use the OffChainTicker string as the index into ResolvedPrices for each provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would check out the follow up PRs, but using only the offchain ticker as a primary key would not give us the amount of info we need to determine what we are parsing when we get a response.

TickerPrices = map[ProviderTicker]*big.Int

// AggregatorPrices is a type alias for a map of off-chain ticker to the price.
AggregatorPrices = map[string]*big.Int
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the diff between this and `ResolvedPrices

Copy link
Contributor Author

Choose a reason for hiding this comment

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

each provider is responsible for returning prices per ProviderTicker, the aggregator is only aware of [providerName, off-chain-ticker] -> price. So when we have a market map we know how to directly consume each of the prices. This change will be more understandable once i get around to updating the main oracle.

oracle/types/provider.go Show resolved Hide resolved
}

// NewProviderTickers returns a new list of provider tickers.
func NewProviderTickers(tickers ...ProviderTicker) ProviderTickers {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are we using this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check out the later PRs, we use it as a helper function to get more or less the same functionality we had with the ProviderMarketMap. just helps maintain internal state of things we are going to need a good amount (like off-chain-ticker to provider ticker mappings).

davidterpay and others added 11 commits April 8, 2024 12:44
)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* remove dec

* refactor: WebSocket Providers with ProviderTickers interface (PR3) (#328)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* init

* nits
@@ -227,7 +222,7 @@ func (o *OracleImpl) fetchPrices(provider types.PriceProviderI) {
zap.String("price", result.Value.String()),
zap.Duration("diff", diff),
)
timeFilteredPrices[pair] = result.Value
timeFilteredPrices[pair.GetOffChainTicker()] = result.Value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that the aggregator now stores prices indexed by
providername -> off-chain-ticker -> price. This greatly reduces the amount of complexity that the aggregator has to deal with with a given market map.

// GetScalingFactor returns the scaling factor for the price based on the difference between
// the token decimals in the erc20 token contracts or similar.
func GetScalingFactor(
first, second int64,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using int64 instead of uin64 in case of overflow from subtraction

Comment on lines +12 to +13
//
// NOTE: This function should only be used for testing purposes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we use this in our main aggregation function now, we will effectively be calculating the medians per off-chain ticker and not the cannonical chain representation of the ticker.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this to a test-utils

@@ -0,0 +1,216 @@
package dydx
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved most of the previous functionality into this file just to keep em separate.

}

// ConvertMarketParamsToMarketMap converts a dYdX market params response to a slinky market map response.
func (h *APIHandler) ConvertMarketParamsToMarketMap(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should have a discussion on this.

// updateMetaDataCache unmarshals the metadata JSON for each ticker and adds it to the
// metadata map.
func (pf *APIPriceFetcher) updateMetaDataCache(ticker types.ProviderTicker) (TickerMetadata, error) {
if metadata, ok := pf.metaDataPerTicker[ticker.GetJSON()]; ok {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The primary key is here is the json field, @nivasan1 do you think thats fine or should we just use the offchain ticker?

davidterpay and others added 3 commits April 9, 2024 16:14
* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* fix?

* fix

* fix

* fix

* fixed forever
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 65.39548% with 245 lines in your changes are missing coverage. Please review.

Project coverage is 56.11%. Comparing base (97a9827) to head (b0c8f47).

❗ Current head b0c8f47 differs from pull request most recent head 4e159c4. Consider uploading reports for the commit 4e159c4 to get more accurate results

Files Patch % Lines
pkg/math/oracle/aggregator.go 11.42% 30 Missing and 1 partial ⚠️
providers/apis/dydx/parse.go 72.00% 24 Missing and 4 partials ⚠️
oracle/types/provider.go 15.62% 27 Missing ⚠️
cmd/slinky-config/main.go 0.00% 25 Missing ⚠️
...viders/apis/defi/uniswapv3/pool/uniswap_v3_pool.go 0.00% 21 Missing ⚠️
oracle/types/market.go 51.35% 18 Missing ⚠️
providers/static/api_handler.go 0.00% 13 Missing ⚠️
providers/factories/oracle/websocket.go 16.66% 10 Missing ⚠️
x/mm2/types/utils.go 0.00% 10 Missing ⚠️
providers/static/utils.go 0.00% 8 Missing ⚠️
... and 23 more
Additional details and impacted files
@@                  Coverage Diff                  @@
##           feat/market-map-2     #322      +/-   ##
=====================================================
- Coverage              56.66%   56.11%   -0.55%     
=====================================================
  Files                    243      245       +2     
  Lines                  11664    11461     -203     
=====================================================
- Hits                    6609     6431     -178     
- Misses                  4448     4462      +14     
+ Partials                 607      568      -39     

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

cmd/slinky-config/main.go Show resolved Hide resolved
x/mm2/types/utils.go Outdated Show resolved Hide resolved
{
Name: static.Name,
OffChainTicker: fmt.Sprintf("%d", price),
OffChainTicker: ticker.String(),
Metadata_JSON: fmt.Sprintf(`{"price": %f}`, price),
Copy link
Contributor

Choose a reason for hiding this comment

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

static provider now works by having a price JSON file as its Metadata JSON

pkg/math/oracle/median.go Outdated Show resolved Hide resolved
pkg/math/oracle/median.go Outdated Show resolved Hide resolved
Comment on lines +26 to +39
PriceProviderFactory = factory.BaseProviderFactory[ProviderTicker, *big.Float]

// PriceProviderFactory is a type alias for the price provider factory. This
// specifically only returns price providers that implement the provider interface.
PriceProviderFactoryI = factory.ProviderFactory[mmtypes.Ticker, *big.Int]
PriceProviderFactoryI = factory.ProviderFactory[ProviderTicker, *big.Float]

// PriceProvider is a type alias for the base price provider. This specifically
// implements the provider interface for the price provider along with the
// additional base provider methods.
PriceProvider = base.Provider[mmtypes.Ticker, *big.Int]
PriceProvider = base.Provider[ProviderTicker, *big.Float]

// PriceProviderI is a type alias for the price provider. This specifically
// implements the provider interface for the price provider.
PriceProviderI = providertypes.Provider[mmtypes.Ticker, *big.Int]
PriceProviderI = providertypes.Provider[ProviderTicker, *big.Float]
Copy link
Collaborator

Choose a reason for hiding this comment

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

These feel very similar and are confusing. Can we consolidate into a single alias/interface for each of these?


// AggregatedProviderPrices is a type alias for the aggregated provider prices. This is
// a map of provider names to their respective ticker prices.
AggregatedProviderPrices = aggregator.AggregatedProviderData[string, TickerPrices]
AggregatedProviderPrices = aggregator.AggregatedProviderData[string, AggregatorPrices]
Copy link
Collaborator

Choose a reason for hiding this comment

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

map[string]map[string]*big.Float

Does it make sense to move all of this stuff into aggregator/aggregator.go so we don't have to consult multiple files to figure out this is just a nested map?

Comment on lines +100 to +101
// ticker.
AggregatorPrices = map[string]*big.Float
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call this ProviderPrices or smth so it indicates where this is used

oracle/types/provider.go Outdated Show resolved Hide resolved
davidterpay and others added 2 commits April 9, 2024 19:23
* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* temp

* bye

* gen

* fix

* fmt

* regen mocks

* fix?

* fix

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>
@davidterpay davidterpay merged commit a4e398b into feat/market-map-2 Apr 9, 2024
7 of 8 checks passed
aljo242 added a commit that referenced this pull request Apr 10, 2024
* new market

* gen

* fix

* wip

* dep

* ok

* tidy

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* init hooks

* add to keeper

* test

* add hooks

* genesis hook

* fix

* this is my legacy

* ok

* lint

* init

* market query

* types

* events

* proto

* module defs

* beautify

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* feat(`x/marketmap`): init types and validation (#266)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* len

* cp

* ok

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* comment

* expand tests

* better errors

---------

Co-authored-by: David Terpay <[email protected]>

* fix

* feat(`x/marketmap`): params type (#267)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* ok

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* comment

* expand tests

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`):  genesis and validation (#268)

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

* feat(`x/marketmap`): keeper methods (#270)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* beautify

* merchandise

* comment

* export func

* test

* expand tests

* fix

* bye

* fix

* fix vuln

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): tx and msg service (#273)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* beautify

* merchandise

* fix

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* nolint

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): query server (#275)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marktmap`): keeper genesis (#276)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* test

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* fix

* feat(`x/marketmap`): keeper hooks (#279)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* init hooks

* add to keeper

* test

* add hooks

* genesis hook

* fix

* this is my legacy

* ok

* lint

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): query cli (#280)

* init

* market query

* fix

* feat(`x/marketmap`): events (#281)

* types

* events

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): add `Admin` param (#293)

* add admin

* fix

* better check

* revert

* update proto

* clean

* fix

* set

* test

* fix

* test

* fix

* proto

* best

* capacity

* ok

* refactor: Provider Ticker Interface (PR1) (#322)

* init

* init

* remove code that should not be here

* remove code that should not be here v2

* testing nit

* cr

* removing decimals from if

* refactor: API Price Providers with Provider Ticker Interface (PR2) (#325)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* remove dec

* refactor: WebSocket Providers with ProviderTickers interface (PR3) (#328)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* init

* nits

* factory methods

* oracle math done

* done with build

* done with build

* done with dydx basic changes

* updating

* update

* dydx provider done

* done with oracle testing

* done with providers

* build

* configs

* config nit

* nits

* update aggregator

* refactor: marketmap full conversion (#333)

* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* fix?

* fix

* fix

* fix

* fixed forever

* ok

* nits

* tidy

* remove GetProvider

* refactor: `mm2` -> `marketmap` (#334)

* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* temp

* bye

* gen

* fix

* fmt

* regen mocks

* fix?

* fix

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

---------

Co-authored-by: Alex Johnson <[email protected]>

* chore: Cleaning up deadcode (#337)

* init

* nit

* tidy other readmes

* more nits

* chore: `marketmap` cleanup (#338)

* proto

* fix

* comment

* comment out test

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* ok

* sure

* tidy all

* readme

---------

Co-authored-by: David Terpay <[email protected]>
beer-1 pushed a commit to beer-1/slinky that referenced this pull request Apr 11, 2024
* new market

* gen

* fix

* wip

* dep

* ok

* tidy

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* init hooks

* add to keeper

* test

* add hooks

* genesis hook

* fix

* this is my legacy

* ok

* lint

* init

* market query

* types

* events

* proto

* module defs

* beautify

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* feat(`x/marketmap`): init types and validation (skip-mev#266)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* len

* cp

* ok

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* comment

* expand tests

* better errors

---------

Co-authored-by: David Terpay <[email protected]>

* fix

* feat(`x/marketmap`): params type (skip-mev#267)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* ok

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* comment

* expand tests

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`):  genesis and validation (skip-mev#268)

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

* feat(`x/marketmap`): keeper methods (skip-mev#270)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* beautify

* merchandise

* comment

* export func

* test

* expand tests

* fix

* bye

* fix

* fix vuln

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): tx and msg service (skip-mev#273)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* beautify

* merchandise

* fix

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* nolint

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): query server (skip-mev#275)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marktmap`): keeper genesis (skip-mev#276)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* test

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* fix

* feat(`x/marketmap`): keeper hooks (skip-mev#279)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* init hooks

* add to keeper

* test

* add hooks

* genesis hook

* fix

* this is my legacy

* ok

* lint

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): query cli (skip-mev#280)

* init

* market query

* fix

* feat(`x/marketmap`): events (skip-mev#281)

* types

* events

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): add `Admin` param (skip-mev#293)

* add admin

* fix

* better check

* revert

* update proto

* clean

* fix

* set

* test

* fix

* test

* fix

* proto

* best

* capacity

* ok

* refactor: Provider Ticker Interface (PR1) (skip-mev#322)

* init

* init

* remove code that should not be here

* remove code that should not be here v2

* testing nit

* cr

* removing decimals from if

* refactor: API Price Providers with Provider Ticker Interface (PR2) (skip-mev#325)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* remove dec

* refactor: WebSocket Providers with ProviderTickers interface (PR3) (skip-mev#328)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* init

* nits

* factory methods

* oracle math done

* done with build

* done with build

* done with dydx basic changes

* updating

* update

* dydx provider done

* done with oracle testing

* done with providers

* build

* configs

* config nit

* nits

* update aggregator

* refactor: marketmap full conversion (skip-mev#333)

* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* fix?

* fix

* fix

* fix

* fixed forever

* ok

* nits

* tidy

* remove GetProvider

* refactor: `mm2` -> `marketmap` (skip-mev#334)

* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* temp

* bye

* gen

* fix

* fmt

* regen mocks

* fix?

* fix

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

---------

Co-authored-by: Alex Johnson <[email protected]>

* chore: Cleaning up deadcode (skip-mev#337)

* init

* nit

* tidy other readmes

* more nits

* chore: `marketmap` cleanup (skip-mev#338)

* proto

* fix

* comment

* comment out test

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* ok

* sure

* tidy all

* readme

---------

Co-authored-by: David Terpay <[email protected]>
nivasan1 added a commit that referenced this pull request Apr 11, 2024
* compute gov addr after config changed

* Fix type removal

* chore(deps): bump github.com/cosmos/ibc-go/v8 in /tests/integration (#320)

Bumps [github.com/cosmos/ibc-go/v8](https://github.com/cosmos/ibc-go) from 8.0.0 to 8.2.0.
- [Release notes](https://github.com/cosmos/ibc-go/releases)
- [Changelog](https://github.com/cosmos/ibc-go/blob/v8.2.0/CHANGELOG.md)
- [Commits](cosmos/ibc-go@v8.0.0...v8.2.0)

---
updated-dependencies:
- dependency-name: github.com/cosmos/ibc-go/v8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Johnson <[email protected]>
Co-authored-by: David Terpay <[email protected]>

* chore(deps): bump github.com/gagliardetto/solana-go from 1.9.3 to 1.10.0 (#327)

Bumps [github.com/gagliardetto/solana-go](https://github.com/gagliardetto/solana-go) from 1.9.3 to 1.10.0.
- [Release notes](https://github.com/gagliardetto/solana-go/releases)
- [Changelog](https://github.com/gagliardetto/solana-go/blob/main/CHANGELOG.md)
- [Commits](gagliardetto/solana-go@v1.9.3...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/gagliardetto/solana-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Johnson <[email protected]>
Co-authored-by: David Terpay <[email protected]>

* chore(deps): bump supplypike/setup-bin from 3 to 4 (#336)

Bumps [supplypike/setup-bin](https://github.com/supplypike/setup-bin) from 3 to 4.
- [Release notes](https://github.com/supplypike/setup-bin/releases)
- [Commits](supplypike/setup-bin@v3...v4)

---
updated-dependencies:
- dependency-name: supplypike/setup-bin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Terpay <[email protected]>

* chore(deps): bump github.com/gagliardetto/binary from 0.7.7 to 0.8.0 (#326)

Bumps [github.com/gagliardetto/binary](https://github.com/gagliardetto/binary) from 0.7.7 to 0.8.0.
- [Release notes](https://github.com/gagliardetto/binary/releases)
- [Changelog](https://github.com/gagliardetto/binary/blob/master/CHANGELOG.md)
- [Commits](gagliardetto/binary@v0.7.7...v0.8.0)

---
updated-dependencies:
- dependency-name: github.com/gagliardetto/binary
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Johnson <[email protected]>

* chore(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2 (#331)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.63.0 to 1.63.2.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.63.0...v1.63.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Johnson <[email protected]>
Co-authored-by: David Terpay <[email protected]>

* chore(deps): bump github.com/klauspost/compress from 1.17.7 to 1.17.8 (#330)

Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.17.7 to 1.17.8.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](klauspost/compress@v1.17.7...v1.17.8)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Johnson <[email protected]>
Co-authored-by: David Terpay <[email protected]>

* feat: `x/marketmap` v2 (#265)

* new market

* gen

* fix

* wip

* dep

* ok

* tidy

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* init hooks

* add to keeper

* test

* add hooks

* genesis hook

* fix

* this is my legacy

* ok

* lint

* init

* market query

* types

* events

* proto

* module defs

* beautify

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* feat(`x/marketmap`): init types and validation (#266)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* len

* cp

* ok

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* comment

* expand tests

* better errors

---------

Co-authored-by: David Terpay <[email protected]>

* fix

* feat(`x/marketmap`): params type (#267)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* ok

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* comment

* expand tests

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`):  genesis and validation (#268)

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

* feat(`x/marketmap`): keeper methods (#270)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* beautify

* merchandise

* comment

* export func

* test

* expand tests

* fix

* bye

* fix

* fix vuln

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): tx and msg service (#273)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* beautify

* merchandise

* fix

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* nolint

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): query server (#275)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marktmap`): keeper genesis (#276)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* test

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* fix

* feat(`x/marketmap`): keeper hooks (#279)

* clean

* new market

* gen

* fix

* wip

* dep

* update

* cute

* clean

* params

* fix

* len

* cp

* init

* ok

* cute

* add

* errors

* fix

* keeper test

* nice

* cdc

* msg
:

* msg

* clean

* update

* fix tests

* query

* query setup

* query

* query

* init hooks

* add to keeper

* test

* add hooks

* genesis hook

* fix

* this is my legacy

* ok

* lint

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* Update x/mm2/types/market.go

Co-authored-by: David Terpay <[email protected]>

* fix

* test

* newline

* remove

* test

* fix

* fix

* fix

* fix

* beautify

* merchandise

* fix

* fix

* fix

* fix

* get params

* test

* comment

* export func

* test

* invalid bech32

* check

* bet

* format

* expand tests

* fix

* bye

* fix

* 0 len

* fix

* fix vuln

* fixington

* fix

* nolint

* check

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): query cli (#280)

* init

* market query

* fix

* feat(`x/marketmap`): events (#281)

* types

* events

---------

Co-authored-by: David Terpay <[email protected]>

* feat(`x/marketmap`): add `Admin` param (#293)

* add admin

* fix

* better check

* revert

* update proto

* clean

* fix

* set

* test

* fix

* test

* fix

* proto

* best

* capacity

* ok

* refactor: Provider Ticker Interface (PR1) (#322)

* init

* init

* remove code that should not be here

* remove code that should not be here v2

* testing nit

* cr

* removing decimals from if

* refactor: API Price Providers with Provider Ticker Interface (PR2) (#325)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* remove dec

* refactor: WebSocket Providers with ProviderTickers interface (PR3) (#328)

* init

* more changes

* api providers

* more nits

* cr

* cr 2

* init

* nits

* factory methods

* oracle math done

* done with build

* done with build

* done with dydx basic changes

* updating

* update

* dydx provider done

* done with oracle testing

* done with providers

* build

* configs

* config nit

* nits

* update aggregator

* refactor: marketmap full conversion (#333)

* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* fix?

* fix

* fix

* fix

* fixed forever

* ok

* nits

* tidy

* remove GetProvider

* refactor: `mm2` -> `marketmap` (#334)

* wip

* suite

* renames

* renames

* all tests passing

* lint pass

* fix e2e

* temp

* bye

* gen

* fix

* fmt

* regen mocks

* fix?

* fix

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

---------

Co-authored-by: Alex Johnson <[email protected]>

* chore: Cleaning up deadcode (#337)

* init

* nit

* tidy other readmes

* more nits

* chore: `marketmap` cleanup (#338)

* proto

* fix

* comment

* comment out test

* fix

* fix

---------

Co-authored-by: David Terpay <[email protected]>

* ok

* sure

* tidy all

* readme

---------

Co-authored-by: David Terpay <[email protected]>

* fix test

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Eric <[email protected]>
Co-authored-by: Alex Johnson <[email protected]>
Co-authored-by: Nikhil Vasan <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Terpay <[email protected]>
@zrbecker zrbecker deleted the terpay/api-provider-tickers branch November 5, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants