Tron Wallet & Trading Bot on Alexa aka Mule Trading Bot is a Tron Wallet & Trading Bot on Alexa for the disabled, visually impaired and voice multitasking that helps an individual to buy cryptocurrency, get information on trending cryptocurrencies and also store the holdings in the app just by giving voice commands to Alexa . Main features are listed below.
a) Trading Features :

  • Place LIMIT/MARKET order in Binance
  • Cancel any open orders in Binance

b) Wallet Features : (acts as a wallet to hold your holdings)

  • Store your cryptocurrency holding
  • Remove the holding that was stored
  • Get information on your crypto portfolio
  • Fetches trending cryptocurrencies in market
  • Provide current price of any cryptocurrency


Cryptocurrency trading has exploded in popularity over the last several years. People who engage in day-to-day trading can usually make a lot of money. Because cryptocurrencies are so volatile that their value may change in a matter of seconds, crypto trading bots have emerged to help automate the trading process.

Even voice-based services has gained it's importance for it's ease of use, time-saving, personalized experience or for its enhanced customer engagement over the years.

Taking all of these into consideration the idea of making use of Alexa for trading came into thought :) . As there are different types of crypto bots in the market today, I wanted to create a bot which not only helps in trading but also acts as a wallet which captures holding information of different cryptocurrencies from different wallets.

What it does

Mule Trading Bot - The Alexa skill functions as a wallet, storing your holdings information and displaying the current value of your crypto portfolio, as well as assisting you in buying and selling cryptocurrencies on the Binance Platform with only a few voice commands.

Brief introduction of each feature Mule Trading Bot

a) Trading Features :

  • Place LIMIT/MARKET order in Binance:

Users may utilize this functionality to place a variety of buy orders, ranging from market orders to considerably more complicated orders like Limit orders. This may be accomplished by providing some basic information such as the amount, currency type, and so on.

  • Cancel any open orders in Binance :

Users can use this functionality to cancel any open orders that are pending or have not been performed.

b) Wallet Features : (acts as a wallet to hold your holdings)

  • Store your cryptocurrency holding:

Instead of manually checking their holdings in a variety of exchanges, including both decentralised and centralised, users can add their holdings information to the Mule trading bot and get real-time value of their portfolio.

  • Remove the holdings that was stored:

When users sell assets on any exchange, they can use this functionality to remove their holdings that they had stored in the Mule Trading bot.

  • Get information on your crypto portfolio:

This feature displays the total worth of the user's portfolio as well as specific information on the various assets that the user is presently holding.

  • Fetches trending cryptocurrencies in market:

This feature will get the most trending cryptocurenicies from Coingecko (a platform that does a fundamental analysis of the whole crypto market), allowing the user to make informed decisions.

  • Provide current price of any cryptocurrency:

This function allows users to find out the current price of any cryptocurrency.


  1. Anypoint Platform Account (Trial account also works) .

  2. Amazon Developer Account (To create Alexa skill interface and to test it in Alexa Simulator).

  3. Binance Account (API key of Binance Account). Navigate to Profile -> API Management -> Create API Key to obtain the API key. alt text

  4. API Key of CoinMarketCap API and coinapi .To obtain a coinmarket API key, visit https://pro.coinmarketcap.com/ and register, and to obtain a coinapi API key, visit https://www.coinapi.io/ and register.

  5. Twilio Account SID and AuthToken, which you will receive after creating a Twilio account at https://twilio.com/try-twilio.

  6. Alexa App installed in your phone.

Architectural Diagram :

The plan is to use Alexa as the front end and MuleSoft as the back end for this project. API-led connectivity is used in the architecture to connect data to applications using reusable and purposeful APIs. The Alexa skill interface has been configured to use the Experience API endpoint, which is an HTTPS web service. It communicates with the Process API and processes the output for the end user, using the process status retrieved from the System API, which has third-party endpoints configured.

alt text

Project Development :

After having an Amazon Developer Account created, you can login to Alexa Console and create an Alexa skill.

Steps to create Alexa skill interface:

  • Click on to Create Skill, provide the name of the skill. In our case it's a Mule trading bot.
  • Then we can choose the template of the skill if required, else we can choose the option to start from Scratch.
  • Provide a unique invocation name as it is a custom skill, it is necessary to provide the invocation name, which is required to begin the skill.

alt text

  • Under the intents section we can specify the intents. As Alexa intent represents an action that fulfills a user's spoken request. A set of likely spoken phrases can be mapped to the intents.
  • The JSON Editor section gives you skill interface information in JSON format.

alt text

(Get Mule trading bot skill Alexa interface in the source code repository by the name JSON schema.json.)

Some skills require the ability to connect the identity of an Alexa end user with a user in another system, such as Twitter, Facebook, Amazon, and many others. To accomplish that, you’d use a process called account linking, which provides a secure way for Alexa skills to connect with third-party systems requiring authentication.

For Mule trading bot skill the Basics of Account Linking with the Login with Amazon (LWA) Service has been implemented.

Account Linking Step by Step:

alt text

Step 1: Create a Login with Amazon (LWA) Security Profile

  • Connect to https://developer.amazon.com and authenticate with your Amazon credentials
  • Click on “Login with Amazon” then “Security Profiles”

alt text

  • Click on “Create a New Security Profile”

alt text

  • Under security profile management web settings be sure to copy your Client ID and Client Secret from the Web Settings tab to a text editor so they're easily available. You’ll need these values later in the process.

alt text

Step 2: Configure Account Linking in the Alexa Developer Console

Now that you’ve configured Login with Amazon, you can configure Account Linking for your Alexa skill.

  • Under the “Build” tab for your skill, click “Account Linking” on the left side.
  • Under the “Build” tab for your skill, click “Account Linking” on the left side. To enable account linking, turn on the “Do you allow users to create an account or link to an existing account with you?” toggle.

alt text

  • Choose “Allow users to enable skill without account linking” if you want to allow users to start to use the skill without Account Linking and let them link their account later during the skill usage (see Optional Account Linking for the details).

alt text

  • The last step is to configure Login with Amazon to accept our redirection URLs. The redirection URLs are given on the Alexa Developer Console, 1 per geographic area, under “Redirect URL”. These are the URLs starting by https://pitangui.amazon.com/… (North America) or https://layla.amazon.com/... (EU and India) https://alexa.amazon.co.jp... (Far East)
  • Go back to the Login with Amazon console. Next to the Security Profile you created in Step 1, click the button with the gear icon and select “Web Settings” from the menu.
  • Click the "Edit" button in the lower right, then enter the Redirect URL, as it appears on the ASK Developer Console.

Step 3: Write Your Custom Skill Code

  • { "session": { "sessionId": "SessionId.7c77f955-ae5e-46f1-a9ca-3fb354b1ce77", "application": { "applicationId": "amzn1.echo-sdk-ams.app.fb2fc3e7-55e7-4f05-851e-7ad308a6b499" }, "user": { "userId": "amzn1.ask.account.AFP3ZWPOS2BGJR7OWJZ3DHPKMOMNWY4AY66FUR7ILBWANIHQN73QHMAHCTVTAHFPUV3WAFNGKBYW5LFUE2WV4CCGEISSPHBHCW5SCYJDL3DLWRRRBB4CQIP3X3PV65V2AYMMXSNFPKHPZJFVAH5AHKHDLAER67H3AHL4XBUU76XEH5BGDZZNGV5T6HHAGN6KGZI777J3VA7WGPA" }, "new": true }, "request": { "type": "IntentRequest", "requestId": "EdwRequestId.b595d667-caa3-4818-8d4a-c7a31e8adddc", "timestamp": "2016-05-27T15:36:26Z", "intent": { "name": "SayHello", "slots": {} }, "locale": "en-US" }, "version": "1.0" }
  • Notice that the “user” section contains a userId properties, but no OAuth access token is available yet as we did not authenticate our user yet. Whenever users invoke intents in your skill that rely on information obtained from account linking, your skill code should return a “LinkAccount” card to be displayed in the Alexa app or the Alexa web site.

MuleSoft API Implementation:

Experience API:

  • It has single base path /alexa . When a user interacts with your Alexa Skill, the Endpoint will receive POST requests with parameters in JSON format that are passed to Alexa Skill.
  • payload.request.intent."name" will return the name of the intent from the POST request body.

alt text

  • Experience API routes requests to the appropriate Process API endpoints based on the intent invoked by the Alexa skill.

alt text

Process API:

It has ten different endpoints, and the request is routed to the appropriate endpoint based on the invoked intent from user via Alexa.

\LaunchRequest : It is called from the experience API when the user invokes the skill by providing an invocation name. If the user has connected their Amazon account to the skill through the Alexa app, they will receive a welcome message.

Intent-Invoking phrases example:

  • Start Mule Trading Bot
  • Open Mule Trading Bot

alt text

\CurrentPrice: It is used to get the current price of cryptocurrency.

Intent-Invoking phrases example:

  • Current value of Bitcoin
  • What's the price of Shiba

alt text

\StoreHolding: This endpoint allows users to save their holding information in Mule Trading Bot and sends a notification to the user's phone with the number of holdings and the name of the cryptocurrency that has been saved.

The Twilio connector is used to send messages, and the object store is used to save the holdings data.

Intent-Invoking phrases example:

  • Store 1000 tron

alt text

\RemoveHolding: If holdings are stored, it aids in the removal of the holding.

Intent-Invoking phrases example:

  • Remove 100 tron
  • Could you please take 1 ethereum out of my wallet

alt text

\CurrentHolding: This endpoint allows users to retrieve their crypto portfolio information which had been stored in Mule Trading Bot .

Intent-Invoking phrases example:

  • Please read my portfolio
  • Give me an Update on my portfolio

alt text

\TrendingCrypto: It helps in providing the name of top 5 trending cryptocurrencies .It routes the request to system API to get the information.

Intent-Invoking phrases example:

  • Fetch me the list of trending cryptocurrencies
  • Trending crypto currency

alt text

\PlaceLimitOrder: It helps in placing LIMIT order for BUY/SELL on the Binance Platform.

Intent-Invoking phrases example:

  • Fetch me the list of trending cryptocurrencies
  • Trending crypto currency

alt text

\PlaceMarketOrder: It facilitates in placing MARKET order for BUY/SELL order on the Binance Platform.

Intent-Invoking phrases example:

  • Fetch me the list of trending cryptocurrencies
  • Trending crypto currency

alt text

\CancelOrder: It assists in the cancellation of open orders on the Binance platform.

Intent-Invoking phrases example:

  • Please cancel open orders on binance
  • Cancel my open orders

\AMAZON.StopIntent: When a user wants to stop processing the current intent and end their interaction with a bot, this endpoint can be triggered by providing following phrase to Alexa .

  • Stop
  • Exit

System API:

The system layer API has seven different endpoints, including four Binance endpoints, a coinapi endpoint, a coinMarketcap endpoint and a coingecko endpoint.

/marketOrder and /limitOrder: These are two of the system API POST endpoints that accept BUY/SELL requests for LIMIT or MARKET orders from Process API and executes it by calling the Binance API.

  • The JSON request payload is converted to application/x-www-form-urlencoded format before being sent to the Binance API.
  • The Binance API expects a signature field. The cryptographic key is generated using a cryptographic hash function such as SHA-256 using Binance secret as the key and the rest of the parameters (key-value pairs ) as the value. This cryptographic key is going to be the value for signature field.

alt text

\openOrders: It returns an array containing a list of open orders on the Binance Platform.

\cancelOrders: This is the DELETE endpoint, which allows you to cancel all open orders on the Binance Platform. It expects a cryptocurrency symbol, a millisecond timestamp, and a signature in the request body with the mime type application/x-www-form-urlencoded.

alt text

/coinMarket: It provides the information of the cryptocurrency. It is called by process API when user ask for current price of the crypto.

/imageurl: This endpoint calls coinapi internally to fetch the cryptocurrency Icon in png format. This image is used the display Interface of Alexa.

/tredningCrypto: Provides the list of top 5 trending cryptocurrencies by calling Coingecko API.

Steps to Configure Experience API endpoint to Alexa Skill Interface :

  • Navigate to skill interface -> Endpoint -> Select HTTPS for Service Endpoint type -> Configure the exp API URL at the Default Region .

alt text Alexa Interface and MuleSoft are now connected. When you try to use an Alexa device or an Alexa simulator to invoke the skill, it will prompt you to connect your Amazon account to the skill. To do so, open the Alexa app or go to https://alexa.amazon.in/ and sign in with your Amazon account.

The account linking is shown below after logging in to https://alexa.amazon.in/.

  • Choose Your Skills (at the top right corner) -> DEV SKILLS -> Mule trading Bot (your skill)

alt text

  • Select Settings - >Then Link Account

alt text

alt text

  • Provide your Amazon account Credentials and signi-n

alt text

After successful sign-in you'll see the the below screen.

alt text

Challenges Faced :

To be honest, it was more challenging to write a blog about the project than it was to implement it ;). Aside from that, working with the Binance API was a challenge. Ran into a few problems when trying to execute some Binanace APIs .It was a little unclear to know what went wrong. A few blogs aided me in resolving the issue.

What we learned

  • A high-level overview of developing an Alexa skill interface.

  • Account linking between an Alexa skill and an Amazon service.

  • MuleSoft's ability to serve as the backend source for the Alexa skill interface and to enable basic trading via voice commands.

  • MuleSoft's versatility in connecting to various systems with its readymade connectors, as well as understanding some of the Mulesoft connectors usage, such as Object Store and Twilio

What's next for Mule Trading Bot

This product has the potential to revolutionize how people trade(BUY/SELL). Even those with less technical understanding will be able to trade on complex platforms like Binance using Alexa.

Trading feature can be improvised by making it self-contained without the need for human participation, making smart judgments at the correct moment and acting precisely on price movement. Binance Web Socket APIs can be used to stream real-time price, volume, orders, price, and time data, allowing us to create an automated program/implementation in Mulesoft using the Web Socket connector to buy and sell cryptocurrency at the optimal time, with the goal of maximizing the user's profit.

Built With

Share this project:


posted an update

Tron Wallet & Trading Bot (Mule) code was developed and deployed on Amazon Alexa Echo Show 5 (2nd Gen, 2021 release) linked below for anyone deploying but I am continually testing on other versions and making updates for those with different versions that I find compatible.

Log in or sign up for Devpost to join the conversation.