Challenges with Crypto Asssets
-
Volatility Of Prices
- The cryptocurrency market is characterized by steep rises and sudden dramatic falls. An interesting quirk of cryptocurrency is that multiple coins tend to rise and fall in tandem. Except for a few who hold the likes of BTC and ETH, others invested in Crypto currencies have lost lot of money.
-
No Intrinsic Value
- Other than a handfull of Cryptocurrencies like Bitcoin, Ethereum and few others, 90% of the tradable Crupto currencies are valued at less than a Dollar and most of them are even less than a dime. These are mostly the utility tokens with no instrinsic value but are locked in with a hope the prices will increase riding on Bitcoin and Ethereum spikes.
-
Zero returns
- Unlike Traditional market investments, Crypto Currencies offer no returns or dividends as Crypto asset is not a fiat currency and is only limited to monetary value when converted to a cash. Speculation and hope drives the investors to venture into crypto currency. In reality people have spent their hard earned money in coins that have neither increased in value nor they got any ROI for many years, becoming a dead investment.
-
Conversion Issues
- In addition to lack of legislation, the other big obstacle that stands in the way of cryptocurrency holders like Bitcoin traders and users is the challenge to spend their holdings. Conversion remains a huge hurdle for Bitcoin vendors. As Bitcoin is not a fiat currency and is only limited to monetary value when converted to a cash equivalent, not many vendors go for its conversions for other cryptocurrency types.
Proposal
|
Market Opportunity
|
SLPR Coin - Token Classification
SLPR Coin is a Crypto security: an asset on a blockchain that, in addition, offers the prospect of future payments, for example a share of profits.
KYC, AML and Suitability Requirements
KYC Requirements
- The SEC requires that a new customer provide detailed financial information that includes :
- name
- date of birth
- identification numbers
- address
- employment status
- annual income
- net worth
- investment objectives
- Suitability Requirements
- the client's age,
- other investments,
- tax status,
- financial needs,
- investment experience,
- investment time horizon,
- liquidity needs,
- risk tolerance.
Suitability Obligations
-
Rule 2111 lists the three main suitability obligations for firms and associated persons.
- Reasonable-basis suitability requires a broker to have a reasonable basis to believe, based on reasonable diligence, that the recommendation is suitable for at least some investors. Reasonable diligence must provide the firm or associated person with an understanding of the potential risks and rewards of the recommended security or strategy.
- Customer-specific suitability requires that a broker, based on a particular customer’s investment profile, has a reasonable basis to believe that the recommendation is suitable for that customer. The broker must attempt to obtain and analyze a broad array of customer-specific factors to support this determination.
- Quantitative suitability requires a broker with actual or de facto control over a customer’s account to have a reasonable basis for believing that a series of recommended transactions, even if suitable when viewed in isolation, is not excessive and unsuitable for the customer when taken together in light of the customer’s investment profile.
AML requirements
-
Each member shall develop and implement a written anti-money laundering program reasonably designed to achieve and monitor the member's compliance with the requirements of the Bank Secrecy Act (31 U.S.C. 5311, et seq.), and the implementing regulations promulgated thereunder by the Department of the Treasury. Each member's anti-money laundering program must be approved, in writing, by a member of senior management. The anti-money laundering programs required by this Rule shall, at a minimum,
- Establish and implement policies and procedures that can be reasonably expected to detect and cause the reporting of transactions required under 31 U.S.C. 5318(g) and the implementing regulations thereunder;
- Establish and implement policies, procedures, and internal controls reasonably designed to achieve compliance with the Bank Secrecy Act and the implementing regulations thereunder;
- Provide for annual (on a calendar-year basis) independent testing for compliance to be conducted by member personnel or by a qualified outside party, unless the member does not execute transactions for customers or otherwise hold customer accounts or act as an introducing broker with respect to customer accounts (e.g., engages solely in proprietary trading or conducts business only with other broker-dealers), in which case such "independent testing" is required every two years (on a calendar-year basis);
- Designate and identify to FINRA (by name, title, mailing address, e-mail address, telephone number, and facsimile number) an individual or individuals responsible for implementing and monitoring the day-to-day operations and internal controls of the program (such individual or individuals must be an associated person of the member) and provide prompt notification to FINRA regarding any change in such designation(s);
- Provide ongoing training for appropriate personnel; and
- Include appropriate risk-based procedures for conducting ongoing customer due diligence, to include, but not be limited to:
- Understanding the nature and purpose of customer relationships for the purpose of developing a customer risk profile; and
- Conducting ongoing monitoring to identify and report suspicious transactions and, on a risk basis, to maintain and update customer information. For purposes of paragraph (f)(ii), customer information shall include information regarding the beneficial owners of legal entity customers (as defined in 31 CFR 1010.230(e)).
Prerequisites
Solidity "^5.17.0" | Truffle "^1.0.17" | Ganache "^5.17.0" | Meta Mask "^5.17.0" |
OpenZeppelin "^2.5.1" | Webpack "^4.32.2" | Web3 "^1.2.5-rc.0" | Python "^3.5.0" |
React Js | Javascript | HTML5 | CSS |
Smart Contracts
-
Contract Features
-
CROWDSALE: Base architecture for crowdsales. Sets up a wallet to collect funds. Framework to send Ether to the Smart Contract & compute the amount of Tokens disbursed based on the rate.
-
MINTEDCROWDSALE: The contract will mint Tokens anytime they are purchased, instead of having a preset total supply. The total amount of tokens in distribution is determined by how many are actually sold.
-
TIMEDCROWDSALE: Sets parameters to start (openingTime) and end (closingTime) the Crowdsale.
-
CAPPEDCROWDSALE: Sets the max amount of runds it can raise in the Crowdsale.
-
WHITELISTCROWDSALE: Sets parameters to fullfill KYC requirements. Match contributions in the Crowdsale to real people. Investors must be WhiteListed before they can purchase Tokens.
-
STAGED CROWDSALE: Creates 2 stages (pre-sale and public sale) to set rates where investors can receive more Tokens in the pre-sale vs the public sale. In pre-sale, funds go to the wallet, not to the refund escrow vault.
-
REFUNDABLECROWDSALE: Sets a minimum goal of funds to raise in the Crowdsale. If goal isn't reached, it will refund investors.
-
DISTRIBUTION & VESTING: Set amount of Tokens to distribute to Founders, Company, and Public.
-
-
ERC20 SLPRCoin
-
SLPRCoin simply inherits the standard
ERC20Mintable
andERC20Detailed
contracts, by taking the thedecimals
parameter which is hardcoded to18
in our solidity program. -
This contract initiates ERC20Mintable contract by passing the Name, Symbol and decimals parameters.
-
-
SLPRCoinCrowdsale
-
SLPRCoinCrowdsale inherits the following OpenZeppelin contracts:
-
Crowdsale
- Sets up the basic crowdsale architecture and passes essential functions into our contract such as
buyTokens
,_preValidatePurchase
,_deliverTokens
,_processPurchase
, and_forwardFunds
, which make the token verification, purchasing, and deposit possible. In addition, it provides therate
,wallet
, andtoken
parameters which are passed into our contract'sconstructor
.
- Sets up the basic crowdsale architecture and passes essential functions into our contract such as
-
MintedCrowdsale
- Enables the crowdsale contract to inherit the
mint
properties from our token'sERC20Mintable
component. This allows the contract to be the minter during the duration of the crowdsale. At the end of the sale, the contract transfers theminter
to thewallet
once thefinalization
function is called.
- Enables the crowdsale contract to inherit the
-
CappedCrowdsale
- Sets a
cap
to limit the funds raised during our crowdsale. Uses the_preValidatePurchase
function to check that thecap
isn't exceeded before allowing the purchase to move forward.
- Sets a
-
TimedCrowdsale
- Allows the contract to set up
open
andclose
times for our fund-raising period. Uses the_preValidatePurchase
function to enforce theonlyWhileOpen
modifier before allowing the purchase to proceed.
- Allows the contract to set up
-
WhitelistCrowdsale
- Designates the crowdsale contract as a
WhitelistAdmin
so that it can set accounts asWhiteListed
once they pass KYC, Suitability, and AML requirements during the Registration process.
- Designates the crowdsale contract as a
-
RefundablePostDeliveryCrowdsale
-
Since
RefundablePostDeliveryCrowdsale
inherits theRefundableCrowdsale
contract, which requires agoal
parameter, we must call theRefundableCrowdsale
constructor fromSLPRCoinCrowdsale
constructor as well as the others.RefundablePostDeliveryCrowdsale
does not have its own constructor, so we will just use theRefundableCrowdsale
constructor that it inherits. -
If the
RefundableCrowdsale
constructor is not called with proper arguments, theRefundablePostDeliveryCrowdsale
will fail since it relies on it (it inherits fromRefundableCrowdsale
), and does not have its own constructor.
-
-
Additional Contract Properties:
TokenTimelock
to freeze funds during trading period using thereleaseTime
parameter. Allows us to ensure that investors do not withdraw or trade their tokens before series ends.Contributions mapping
to maintain public records of all investor contributions, which can be called using thegetUserContribution
function created within the contract.Capped Crowdsale
to designate variable token pricing duringPreICO
andICO
stages. Uses theenum
value type to create stages as user-defined types.Distribution Percentages
to allocate specific percentages in our Token Issuance strategy acrossPublic Sale
,Founders
,Foundation
, andPartners
funds.
-
-
-
SLPRCoinCrowdsaleDeployer
-
In this contract, The parameters for all of the features of our crowdsale, such as the
name
,symbol
,wallet
for fundraising,goal
, Cap, rate, etc. are defined in the SLPRCoinSaleDeployer contract which instantiates SLPRCoinCrowdSale and SLPRCoin contracts by passing these parameters at the deployment time. -
We will use
now
andnow + 24 weeks
to set the sale Opening and closing times in ourSLPRCoinCrowdsaleDeployer
contract.
-
Designing Algorithmic Trading
- Strategies Explored
- Machine Learning
- Simple Moving Average Crossover
- Momentum
- Python Tools Utilized
- Alpaca API for data acquisition
- NumPy & Pandas for data cleaning
- Oanda v20 API for trading
- TPQOA wrapper classes for logic
- The ZeroMQ Module for sockets
- Plotly Dash for visualization and dashboard implementation
- Points of Interest
- The machine learning trader performed at 55% accuracy in sample and 53% accuracy out of sample on the ability to predict the direction of the price movement of the EUR/USD pair
- Transaction costs heavily affected portfolio performance, and further study into the development of a stronger model with better hyper-parameters is underway.
- Problems & Solutions
- Trying to code during closed markets Solution: Create a fake ticker class, run it on a published socket and subscribe to it via test code. The fake ticker class would use a Euler discretization of geometric Brownian motion to simulate random price movements.
- Receiving socket messages and running code with the same file. Solution: A combination of multithreading, multiprocessing, and asynchronous computing was researched. Solutions will be implemented and live in updated versions.
dApp Development
-
Setting up the development environment
There are a few technical requirements before we can develop and deploy the dApp. Please install the following:
-
install Node.js and node package manager npm by downloading it from https://npmjs.org
Node.js v8+ LTS and npm (comes with Node) Once we have those installed, we only need one command to install Truffle:
`npm install -g truffle`
-
Creating a dApp project directory.
-
create a directory in your preferred folder of choice and then moving inside it and run the following command from the powershell from this folder:
truffle init
-
This will create default truffle directory structure containing the following:
- contracts/: Contains the Solidity source files for our smart contracts. There is an important contract in here called Migrations.sol, which we'll talk about later.
- migrations/: Truffle uses a migration system to handle smart contract deployments. A migration is an additional special smart contract that keeps track of changes.
- test/: Contains both JavaScript and Solidity tests for our smart contracts truffle-config.js: Truffle configuration file
-
-
Writing the smart contract
- Refer to the Smart Contract development section above
-
Compiling and migrating the smart contract
-
To compile a Truffle project, change to the root of the directory where the project is located and then follow the instructions as documented at https://www.trufflesuite.com/docs/truffle/getting-started/compiling-contracts
truffle compile
-
-
Testing the smart contract
-
Creating a user interface to interact with the smart contract
-
Using Javascript, HTML5 Document Object Model and W3 CSS, we have developed the Contract forms dynamically without having to create each of the form elements. For more information on DOM and CSS, please refer to https://w3schools.com. A snapshot of the user interface of our contract is given below:
-
deploying the contract to localtestnet
-
Once the contracts are compiled, run the following command on powershell:
truffle migrate
- This will bundle the contracts source (json files) into budle folder that can be accessed via node.js that runs on webpack or the liteserver, a local instance of web server
-
Interacting with the dapp in a browser
-
initiate the webpack server that will launch the html code interacting with javascript and smart contract at the backend.
-
In the webpack.config file located int he dapp folder, enter the network address e.g: localhost and portnumber: 8080 with index.html as the firt page to be opend and specify where the index.js that interacts swith the browser and smartcontract in the backend.
npm run start
-
where start is the webpack handler invoking hte localhost:portnumber.
-
-
Deploying the dApp and Solidity Contracts to live Testnet
-
Open the MetaMask plugin on your Browser and select the preferred testnets like Kovan and Ropsten where you can get ETHs from their faucets.
-
Open the Truffleconfig.js and edit the following code block by entering the LiveTestnet like Kovan or Ropsten's network detgails. You can find in in Metmask when you connect to the respective networks, under the networksettings:
module.exports = { networks: { ganache: { host: "https://ropsten.infura.io/v3/undefined", network_id: "3" // Match any network id } } };
- save the file and run
Truffle migrate
in the powershell to deploy the contract on livetestnet and then upon successfull migration, runnpm run start
command to launch your dApp. you are all Set to go!!
- save the file and run