DeFi using Acala and Laminar

Using Acala’s Mandala Network and Laminar’s Flow Exchange

Luke Schoen
7 min readAug 1, 2020

Acala

git clone git@github.com:<YOUR_GITHUB_USERNAME/Acala.git
git remote add upstream https://github.com/AcalaNetwork/Acala
cd Acala
git pull --rebase upstream master
git submodule update --init --recursive
docker build --tag acala:latest .
docker images
docker run --detach --name acala-latest acala:latest
docker ps -a
docker exec -it acala-latest bash
/usr/local/bin/acala --dev --execution=native -lruntime=debug
Acala Mandala Testnet Node terminal logs
Polkadot.js Accounts (Acala Mandala Testnet)
  • Accounts (Ethereum-based): Ethereum accounts may also be imported using MetaMask browser extension. Switch MetaMask to Kovan testnet. Load an account that has a Kovan Ether balance.
MetaMask Browser Extension connected to Kovan Testnet
  • Tokens (Substrate-based): Request ACA (to pay for fees) tokens for an account by running !drip <MY_ACCOUNT_ADDRESS> in the #acala-faucet channel in the Polkadot DeFI on Discord group https://discord.gg/Z4JtEmM
  • Tokens (Ethereum-based): Obtain Kovan Testnet ETH from a faucet https://faucet.kovan.network/. Obtain Kovan Testnet Compound’s DAI ERC-20 tokens from https://app.compound.finance/ in the DAI deposit section by enabling Kovan Testnet ETH as collateral, borrowing DAI using that collateral, and then swapping them using Acala Network or Laminar (for Flow Network F___ tokens). Note: This functionality is incomplete.
Borrowing DAI in exchange for ETH using Compound Finance
  • Wallet (Cross-Chain/Mint renBTC) https://apps.acala.network/wallet: Acala tab: Used to view balances, transfer tokens between accounts, air dropped tokens (ACA, KAR), and view cross-chain transaction history. Account, transaction, and Acala Mandala Testnet chain details may also be viewed using Subscan https://acala-testnet.subscan.io.
  • Wallet > Cross-Chain tab > [aUSD sub-tab] Used to transfer Acala’s stablecoin aUSD from the Acala Mandala Testnet chain to other chains on the Polkadot Network (e.g. LaminarChain). Click “Transfer” button calls and runs the logic of the transfer extrinsic of Acala’s Currencies runtime module, which is part of the ORML (Open Runtime Module Library) https://github.com/open-web3-stack/open-runtime-module-library/blob/c41cfebacc1342ae2e401f85affe48f65708da50/currencies/src/lib.rs#L148, which is a submodule of the Acala repository. Go to the Laminar Flow Exchange https://flow.laminar.one/dashboard, which is connected to the separate LaminarChain, connect the same account from Polkadot.js Extension, and verify that your account on the LaminarChain has the amount of aUSD (ACA Dollar) stablecoin that you transferred from the Acala Mandala Testnet chain.
Cross-Chain > aUSD
  • Wallet > Cross-Chain tab > [renBTC sub-tab] Used to mint renBTC (type of Bitcoin provided by Ren) using your XBTC (type of Bitcoin provided by the ChainX protocol) that may then be used as collateral on the Acala Network. It may be necessary to first Swap some tokens in exchange for XBTC using https://apps.acala.network/swap (e.g. aUSD to XBTC).
Cross-Chain > renBTC
Loans
Swap tokens
Staking DOTs

Laminar

Balances
  • Margin Trading https://flow.laminar.one/margin: Used for opening/closing margin trading positions on Contract for Differences (CFD) symbol pairs (e.g. ETHUSD) using a Liquidity Pool of a Liquidity Provider (e.g. Laminar).
Margin Trading Pools
  • Margin Trading > Basic: Click “Fast Buy/Sell” to quickly Buy/Sell a leveraged (x2 — x20) position on a symbol pair.
Margin Trading (Basic)
  • Margin Trading > Detailed: Alternatively click anywhere else on the row of a symbol pair to open a Trading View (e.g. https://flow.laminar.one/margin/0/AUDUSD) that displays a Price Chart, System Risk Parameters, Position/Order History, and Buy/Sell section.
Margin Trading (Detailed)
Synthetic Asset Exchange (Swap)
Liquidity Providers of Liquidity Pools

Acala Mandala Address: 5DHcRs9udMCKtEmJEABY2HpECyTHHxgLL85pFFzN72SatAoQ

References

--

--