Skip to content
Price feed bot that fetches ICX/USD price that is fed into Daedric
C# PowerShell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Rhizome logo

Marvin : Price Bot for Daedric : Price Feed SCORE



Marvin is a price feed application (bot) designed to provide an hourly price update to a Daedric SCORE running on the ICON Public Blockchain (see here: Marvin has been written in .Net Core 2.1 and is able to run on Windows, Ubuntu or on Amazon Web Services Lambda (

Table of Contents



[Install .NET Core SDK]

Register Microsoft key and feed

$ wget -q -O packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb

Install the .NET SDK

$ sudo apt-get install apt-transport-https
$ sudo apt-get update
$ sudo apt-get install dotnet-sdk-2.1


$ cd /Marvin/Marvin-Ubuntu 


$ dotnet publish -c Release -r ubuntu.16.04-x64


Marvin is designed to be driven via some appconfig.

$ nano /Marvin/Marvin-Ubuntu/appsettings.json 

default should look like this:

  "LogPath": "/home/usr/Marvin/logs/log.log",
  "Keystore": "/home/usr/Marvin/config/yeouido/keystore/operator.icx",
  "Daedric_Address": "cx58ca994194cf0c6a2a68b789d81c70484a5675b3",
  "Network_Url": ""

Update the configuration to meet your needs


I have yet to successfully run a .NET Core application as a background Daemon on Ubuntu so next best thing is to have this run from cron

$ crontab -e 

see example of the crontab that is run every hour

 0 * * * * /usr/bin/dotnet /Marvin/Marvin-Ubuntu/bin/Release/netcoreapp2.1/ubuntu.16.04-x64/publish/Marvin-Ubuntu.dll "yourkeystorepassword" 

you can change this to run every minute to test it is working like so:

 * * * * * /usr/bin/dotnet /Marvin/Marvin-Ubuntu/bin/Release/netcoreapp2.1/ubuntu.16.04-x64/publish/Marvin-Ubuntu.dll "keystorepassword" 



[Install .NET Core SDK]

download & install


open Command Prompt (as Administrator) and navigate to:

cd /Marvin/Marvin-Windows


dotnet build --runtime win-x64 --configuration Release

Create Windows Service

see below for an example if Marvin was located in "F:\dev\Marvin"

sc create Marvin binPath= "F:\dev\Marvin\Marvin\Marvin-Windows\bin\Release\netcoreapp2.2\win-x64\Marvin-Windows.exe" start=auto  


Marvin is designed to be driven via some appconfig.

open in a text editor: /Marvin/Marvin-Windows/appsettings.json

default should look like this:

  "LogPath": "F:/dev/marvin/log.log",
  "Keystore": "F:/dev/Marvin/config/mainnet/keystore/operator.icx",
  "Daedric_Address": "cxcc00000000000000000000000000000000000",
  "Network_Url": "",
  "Price_Increment": 3600000

Price_Increment is how often to fetch for new prices default once per hour.


Start Windows Service

sc start Marvin yourkeystorepassword



[.NET Core SDK 2.1] (AWS only supports 2.1 at this point) [AWS Developers Account] [AWS SDK for Visual Studio 2017/2019] [Basic understanding of AWS Permissions]

download & install configure and install AWS SDK for Visual Studio


NOTE : Make sure the regions used are all the same

  • Open Visual Studio, right click on the AWSMarvin-Lambda project and click Publish to AWS Lambda
  • Enter the function name AWSMarvin-Lambda, select .NET Core 2.1, click Next
  • Under Role dropdown select New Role based on AWS managed policy : AWSLambdaBasicExecutionRole, then click upload.

Configure Environment Variables

  • Open AWS Developers Console at, click on the new function we created
  • Go down to environment variables and enter the 3 settings for Daedric_Address, Network_Url, Test_Transactions

Configure Private Key

  • Open AWS Secret Manager at
  • Click Store a new secret, select Other type of secrets, enter MarvinKeystoreKey, and it's value
  • Click Next, enter MarvinKeystoreKey for the name for the secret policy, click Next, Click Store


  • Open AWS IAM at
  • Click Roles, then click lambda_exec_AWSMarvin-Lambda
  • Click Add Inline Policy
  • Under Service select Secrets Manager
  • Under Actions->Read select GetSecretValue
  • Under Resources select All Resources
  • Select Review Policy, enter a policy name, click Create


To schedule the Lambda function to run on a schedule open

Click Events->Rules, Click Create Rule, Schedule and select the schedule you want Click Add Target, in the function dropdown select AWSMarvin-Lambda Click Configure, enter a name and click Create


Confirmation of Marvin running can be found in the logs (see log file in LogPath specified in Configuration. example log file output:

NOTE (for Windows): Please allow for the full 1 hour to confirm Marvin is working as this is how it is configured. Alternatively, stop the service and change the "Price_Increment": 3600000 to a lower setting for testing purposes.

2019-08-15 21:43:32.351 +08:00 [INF] Starting Marvin...
2019-08-15 21:43:32.465 +08:00 [INF] ------------------------------
2019-08-15 21:43:32.465 +08:00 [INF] Getting current price...
2019-08-15 21:43:38.359 +08:00 [INF] ICXUSD current price: 5086328541551993856
2019-08-15 21:43:38.726 +08:00 [INF] Updating Daedric...
2019-08-15 21:43:39.994 +08:00 [INF] Deadric updated tx hash: 0x41f7ee3d9955e501058d6349df57c2c540409cf83462d8e5943e991d2c702fa9

Also confirm on ICON tracker:

You can’t perform that action at this time.