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

#162 - Update publish script for tesnet #163

Merged
merged 6 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pdr_backend/models/test/test_predictoor_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_soonest_timestamp_to_predict(predictoor_contract):
@enforce_types
def test_get_trueValSubmitTimeout(predictoor_contract):
trueValSubmitTimeout = predictoor_contract.get_trueValSubmitTimeout()
assert trueValSubmitTimeout == 4 * 12 * SECONDS_PER_EPOCH
assert trueValSubmitTimeout == 3 * 24 * 60 * 60


@enforce_types
Expand Down
100 changes: 61 additions & 39 deletions pdr_backend/publisher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,67 @@

if web3_config.w3.eth.chain_id == 8996:
fund_dev_accounts(accounts_to_fund, web3_config.owner, OCEAN)
publish(
s_per_epoch=300,
s_per_subscription=60 * 60 * 24,
base="ETH",
quote="USDT",
source="binance",
timeframe="5m",
trueval_submitter_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260", # on arge
feeCollector_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
rate=3,
cut=0.2,
web3_config=web3_config,
)

publish(
s_per_epoch=300,
s_per_subscription=60 * 60 * 24,
base="ETH",
quote="USDT",
source="kraken",
timeframe="5m",
trueval_submitter_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260", # on arge
feeCollector_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
rate=3,
cut=0.2,
web3_config=web3_config,
)
publish(
s_per_epoch=300,
s_per_subscription=60 * 60 * 24,
base="BTC",
quote="TUSD",
source="binance",
timeframe="5m",
trueval_submitter_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
feeCollector_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
rate=3,
cut=0.2,
web3_config=web3_config,
)

publish(
s_per_epoch=300,
s_per_subscription=60 * 60 * 24,
base="BTC",
quote="TUSD",
source="binance",
timeframe="5m",
trueval_submitter_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
feeCollector_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
rate=3,
cut=0.2,
web3_config=web3_config,
)
publish(
s_per_epoch=300,
s_per_subscription=60 * 60 * 24,
base="XRP",
quote="USDT",
source="binance",
timeframe="5m",
trueval_submitter_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
feeCollector_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
rate=3,
cut=0.2,
web3_config=web3_config,
)

publish(
s_per_epoch=300,
s_per_subscription=60 * 60 * 24,
base="XRP",
quote="USDT",
source="binance",
timeframe="5m",
trueval_submitter_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
feeCollector_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
rate=3,
cut=0.2,
web3_config=web3_config,
)
if web3_config.w3.eth.chain_id == 23295:
rate = 3 / (1 + 0.2 + 0.001)
pair_list = ["BTC", "ETH", "BNB", "XRP", "ADA", "DOGE", "SOL", "LTC", "TRX", "DOT"]
helper_contract = get_address(web3_config.w3.eth.chain_id, "PredictoorHelper")

for pair in pair_list:
publish(
s_per_epoch=300,
s_per_subscription=60 * 60 * 24,
base=pair,
quote="USDT",
source="binance",
timeframe="5m",
trueval_submitter_addr=helper_contract,
feeCollector_addr="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260",
rate=rate,
cut=0.2,
web3_config=web3_config,
)

if web3_config.w3.eth.chain_id == 23294:
raise NotImplementedError("Mainnet deployment configuration is missing")
2 changes: 1 addition & 1 deletion pdr_backend/publisher/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def publish(
web3_config,
):
pair = base + "/" + quote
trueval_timeout = 4 * 12 * s_per_epoch
trueval_timeout = 60 * 60 * 24 * 3
owner = web3_config.owner
ocean_address = get_address(web3_config.w3.eth.chain_id, "Ocean")
fre_address = get_address(web3_config.w3.eth.chain_id, "FixedPrice")
Expand Down
Loading