Skip to content

Commit

Permalink
feat: Update uniswap provider to use new websocket api (#308)
Browse files Browse the repository at this point in the history
* replace uniswap provider with new websocket api
  • Loading branch information
zarazan authored Nov 13, 2023
1 parent 4ff8c0e commit 9ca4545
Show file tree
Hide file tree
Showing 7 changed files with 330 additions and 686 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ issues:
- path: _test\.go
linters:
- gosec
- path: oracle/provider/*
linters:
- gosec
- linters:
- lll
source: "https://"
Expand Down
39 changes: 13 additions & 26 deletions ojo-provider-config/currency-pairs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,55 +99,49 @@ 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]]
base = "SFRXETH"
providers = [
"eth-uniswap",
]
quote = "WETH"

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

[[currency_pairs]]
base = "stATOM"
Expand All @@ -164,13 +158,6 @@ providers = [
]
quote = "OSMO"

[[currency_pairs]]
base = "CMST"
providers = [
"crescent",
]
quote = "USDC"

[[currency_pairs]]
base = "DAI"
providers = [
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"
2 changes: 1 addition & 1 deletion oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func NewProvider(
return provider.NewMockProvider(), nil

case provider.ProviderEthUniswap:
return provider.NewUniswapProvider(ctx, logger, providerName.String(), endpoint, providerPairs...), nil
return provider.NewUniswapProvider(ctx, logger, endpoint, providerPairs...)
}

return nil, fmt.Errorf("provider %s not found", providerName)
Expand Down
Loading

0 comments on commit 9ca4545

Please sign in to comment.