Skip to content

Commit

Permalink
feat: Set up deployment for Polymarket (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidterpay authored Jul 31, 2024
1 parent 80677ea commit d2766f1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ USE_UNISWAPV3_BASE_MARKETS ?= false
USE_COINGECKO_MARKETS ?= false
USE_COINMARKETCAP_MARKETS ?= false
USE_OSMOSIS_MARKETS ?= false
USE_POLYMARKET_MARKETS ?= false
SCRIPT_DIR := $(CURDIR)/scripts
DEV_COMPOSE ?= $(CURDIR)/contrib/compose/docker-compose-dev.yml

Expand All @@ -41,6 +42,7 @@ export USE_UNISWAPV3_BASE_MARKETS ?= $(USE_UNISWAPV3_BASE_MARKETS)
export USE_COINGECKO_MARKETS ?= $(USE_COINGECKO_MARKETS)
export USE_COINMARKETCAP_MARKETS ?= $(USE_COINMARKETCAP_MARKETS)
export USE_OSMOSIS_MARKETS ?= $(USE_OSMOSIS_MARKETS)
export USE_POLYMARKET_MARKETS ?= $(USE_POLYMARKET_MARKETS)
export SCRIPT_DIR := $(SCRIPT_DIR)

BUILD_TAGS := -X github.com/skip-mev/slinky/cmd/build.Build=$(TAG)
Expand Down
2 changes: 2 additions & 0 deletions contrib/compose/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
"--use-coingecko=$USE_COINGECKO_MARKETS",
"--use-coinmarketcap=$USE_COINMARKETCAP_MARKETS",
"--use-osmosis=$USE_OSMOSIS_MARKETS",
"--use-polymarket=$USE_POLYMARKET_MARKETS",
"--temp-file=data/markets.json",
]
environment:
Expand All @@ -24,6 +25,7 @@ services:
- USE_COINGECKO_MARKETS=${USE_COINGECKO_MARKETS:-false}
- USE_COINMARKETCAP_MARKETS=${USE_COINMARKETCAP_MARKETS:-false}
- USE_OSMOSIS_MARKETS=${USE_OSMOSIS_MARKETS:-false}
- USE_POLYMARKET_MARKETS=${USE_POLYMARKET_MARKETS:-false}
volumes:
- markets_data:/data
networks:
Expand Down
6 changes: 6 additions & 0 deletions scripts/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var (
useCoinGecko = flag.Bool("use-coingecko", false, "use coingecko markets")
useCoinMarketCap = flag.Bool("use-coinmarketcap", false, "use coinmarketcap markets")
useOsmosis = flag.Bool("use-osmosis", false, "use osmosis markets")
usePolymarket = flag.Bool("use-polymarket", false, "use polymarket markets")
tempFile = flag.String("temp-file", "markets.json", "temporary file to store the market map")
)

Expand Down Expand Up @@ -93,6 +94,11 @@ func main() {
marketMap = mergeMarketMaps(marketMap, marketmaps.OsmosisMarketMap)
}

if *usePolymarket {
fmt.Fprintf(flag.CommandLine.Output(), "Using polymarket markets\n")
marketMap = mergeMarketMaps(marketMap, marketmaps.PolymarketMarketMap)
}

if err := marketMap.ValidateBasic(); err != nil {
fmt.Fprintf(flag.CommandLine.Output(), "failed to validate market map: %s\n", err)
panic(err)
Expand Down
5 changes: 3 additions & 2 deletions scripts/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
set -eux

go run $SCRIPT_DIR/genesis.go --use-core=$USE_CORE_MARKETS --use-raydium=$USE_RAYDIUM_MARKETS \
--use-uniswapv3-base=$USE_UNISWAPV3_BASE_MARKETS --use-coingecko=$USE_COINGECKO_MARKETS \
--use-coinmarketcap=$USE_COINMARKETCAP_MARKETS --use-osmosis=$USE_OSMOSIS_MARKETS --temp-file=markets.json
--use-uniswapv3-base=$USE_UNISWAPV3_BASE_MARKETS --use-coingecko=$USE_COINGECKO_MARKETS \
--use-polymarket=$USE_POLYMARKET_MARKETS --use-coinmarketcap=$USE_COINMARKETCAP_MARKETS \
--use-osmosis=$USE_OSMOSIS_MARKETS --temp-file=markets.json
MARKETS=$(cat markets.json)

echo "MARKETS content: $MARKETS"
Expand Down

0 comments on commit d2766f1

Please sign in to comment.