Skip to content

Commit

Permalink
uniswap provider fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zarazan committed Nov 8, 2023
1 parent b132692 commit c732bf5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
20 changes: 0 additions & 20 deletions ojo-provider-config/currency-pairs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,55 +99,35 @@ base = "WETH"
providers = [
"eth-uniswap"
]

quote = "USDC"
[[currency_pairs.pair_address_providers]]
address = "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640"
provider = "eth-uniswap"

[[currency_pairs]]
base = "WBTC"
providers = [
"eth-uniswap"
]

quote = "WETH"
[[currency_pairs.pair_address_providers]]
address = "0xcbcdf9626bc03e24f779434178a73a0b4bad62ed"
provider = "eth-uniswap"

[[currency_pairs]]
base = "CBETH"
providers = [
"eth-uniswap"
]

quote = "WETH"
[[currency_pairs.pair_address_providers]]
address = "0x840deeef2f115cf50da625f7368c24af6fe74410"
provider = "eth-uniswap"

[[currency_pairs]]
base = "LINK"
providers = [
"eth-uniswap"
]

quote = "WETH"
[[currency_pairs.pair_address_providers]]
address = "0xa6cc3c2531fdaa6ae1a3ca84c2855806728693e8"
provider = "eth-uniswap"

[[currency_pairs]]
base = "RETH"
providers = [
"eth-uniswap",
]

quote = "WETH"
[[currency_pairs.pair_address_providers]]
address = "0xa4e0faA58465A2D369aa21B3e42d43374c6F9613"
provider = "eth-uniswap"

[[currency_pairs]]
base = "stATOM"
Expand Down
5 changes: 0 additions & 5 deletions ojo-provider-config/endpoints.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
name = "binance"
rest = "https://api1.binance.com"
websocket = "stream.binance.com:9443"

[[provider_endpoints]]
name = "eth-uniswap"
rest = "http://104.197.233.185:8000/subgraphs/name/ojo-network/unidexer"
websocket = "not supported"
5 changes: 3 additions & 2 deletions oracle/provider/uniswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
const (
uniswapWSHost = "localhost:5005"

Check failure on line 19 in oracle/provider/uniswap.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

G101: Potential hardcoded credentials (gosec)
uniswapWSPath = "ws"
uniswapRestHost = "localhost:5005"
uniswapWSScheme = "ws"
uniswapRestHost = "http://localhost:5005"
uniswapRestPath = "/assetpairs"
uniswapAckMsg = "ack"
)
Expand Down Expand Up @@ -79,7 +80,7 @@ func NewUniswapProvider(
}

wsURL := url.URL{
Scheme: "wss",
Scheme: uniswapWSScheme,
Host: endpoints.Websocket,
Path: uniswapWSPath,
}
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ func (s *IntegrationTestSuite) TestWebsocketProviders() {

var waitGroup sync.WaitGroup
for key, pairs := range cfg.ProviderPairs() {
waitGroup.Add(1)
providerName := key
currencyPairs := pairs

waitGroup.Add(1)
go func() {
defer waitGroup.Done()
endpoint := endpoints[providerName]
ctx, cancel := context.WithCancel(context.Background())
s.T().Logf("Checking %s provider with currency pairs %+v", providerName, currencyPairs)
pvd, _ := oracle.NewProvider(ctx, providerName, getLogger(), endpoint, currencyPairs...)
pvd, err := oracle.NewProvider(ctx, providerName, getLogger(), endpoint, currencyPairs...)
require.NoError(s.T(), err)
pvd.StartConnections()
time.Sleep(60 * time.Second) // wait for provider to connect and receive some prices
checkForPrices(s.T(), pvd, currencyPairs, providerName.String())
Expand Down

0 comments on commit c732bf5

Please sign in to comment.