-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from ionicprotocol/development
Main deploy
- Loading branch information
Showing
8,448 changed files
with
71,540 additions
and
68,336 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node | ||
{ | ||
"name": "Node.js & TypeScript", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "npm install", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { linea, neon, zkevm } from '@ionicprotocol/chains'; | ||
import { linea, mode, neon, zkevm } from '@ionicprotocol/chains'; | ||
|
||
import { pythConfig as lineaPythConfig } from './linea'; | ||
import { pythConfig as modePythConfig } from './mode'; | ||
import { pythConfig as neonPythConfig } from './neon'; | ||
import { pythConfig as zkevmPythConfig } from './zkevm'; | ||
|
||
export const chainIdToConfig = { | ||
[neon.chainId]: neonPythConfig, | ||
[linea.chainId]: lineaPythConfig, | ||
[zkevm.chainId]: zkevmPythConfig, | ||
[mode.chainId]: modePythConfig, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { PythAssetConfig } from '../types'; | ||
|
||
import { pythConfig as commonPythConfig } from './common'; | ||
|
||
export const pythConfig: PythAssetConfig[] = [ | ||
...commonPythConfig, | ||
{ | ||
// price feed for WETH | ||
priceId: '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace', | ||
configRefreshRateInSeconds: 3600, | ||
validTimePeriodSeconds: 86400, // 24 hrs | ||
deviationThresholdBps: 100, // 1% | ||
}, | ||
{ | ||
// price feed for USDC | ||
priceId: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a', | ||
configRefreshRateInSeconds: 3600, | ||
validTimePeriodSeconds: 86400, // 24 hrs | ||
deviationThresholdBps: 100, // 1% | ||
}, | ||
{ | ||
// price feed for USDT | ||
priceId: '0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b', | ||
configRefreshRateInSeconds: 3600, | ||
validTimePeriodSeconds: 86400, // 24 hrs | ||
deviationThresholdBps: 100, // 1% | ||
}, | ||
// { | ||
// // price feed for WBTC | ||
// priceId: '0xc9d8b075a5c69303365ae23633d4e085199bf5c520a3b90fed1322a0342ffc33', | ||
// configRefreshRateInSeconds: 3600, | ||
// validTimePeriodSeconds: 86400, // 24 hrs | ||
// deviationThresholdBps: 100, // 1% | ||
// }, | ||
// { | ||
// // price feed for UNI | ||
// priceId: '0x78d185a741d07edb3412b09008b7c5cfb9bbbd7d568bf00ba737b456ba171501', | ||
// configRefreshRateInSeconds: 3600, | ||
// validTimePeriodSeconds: 86400, // 24 hrs | ||
// deviationThresholdBps: 100, // 1% | ||
// }, | ||
// { | ||
// // price feed for SNX | ||
// priceId: '0x39d020f60982ed892abbcd4a06a276a9f9b7bfbce003204c110b6e488f502da3', | ||
// configRefreshRateInSeconds: 3600, | ||
// validTimePeriodSeconds: 86400, // 24 hrs | ||
// deviationThresholdBps: 100, // 1% | ||
// }, | ||
// { | ||
// // price feed for LINK | ||
// priceId: '0x8ac0c70fff57e9aefdf5edf44b51d62c2d433653cbb2cf5cc06bb115af04d221', | ||
// configRefreshRateInSeconds: 3600, | ||
// validTimePeriodSeconds: 86400, // 24 hrs | ||
// deviationThresholdBps: 100, // 1% | ||
// }, | ||
// { | ||
// // price feed for DAI | ||
// priceId: '0xb0948a5e5313200c632b51bb5ca32f6de0d36e9950a942d19751e833f70dabfd', | ||
// configRefreshRateInSeconds: 3600, | ||
// validTimePeriodSeconds: 86400, // 24 hrs | ||
// deviationThresholdBps: 100, // 1% | ||
// }, | ||
// { | ||
// // price feed for BAL | ||
// priceId: '0x07ad7b4a7662d19a6bc675f6b467172d2f3947fa653ca97555a9b20236406628', | ||
// configRefreshRateInSeconds: 3600, | ||
// validTimePeriodSeconds: 86400, // 24 hrs | ||
// deviationThresholdBps: 100, // 1% | ||
// }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { JsonRpcProvider } from '@ethersproject/providers'; | ||
import { Wallet } from 'ethers'; | ||
|
||
import { chainIdToConfig } from './config'; | ||
import config from './config/service'; | ||
import { Updater } from './services'; | ||
import { setUpSdk } from './utils'; | ||
|
||
export const run = async (): Promise<void> => { | ||
const provider = new JsonRpcProvider(config.rpcUrl); | ||
const signer = new Wallet(config.adminPrivateKey, provider); | ||
|
||
const sdk = setUpSdk(config.chainId, signer); | ||
const assetConfig = chainIdToConfig[config.chainId]; | ||
const updater = await new Updater(sdk).init(assetConfig); | ||
|
||
sdk.logger.info(`Starting update loop bot on chain: ${config.chainId}`); | ||
sdk.logger.info(`Config for bot: ${JSON.stringify({ ...config, adminPrivateKey: '*****' })}`); | ||
await updater.updateFeeds(); | ||
}; | ||
|
||
run(); |
Oops, something went wrong.