Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pancake Swap with LINE Chatbot

Pancake Swap with LINE Chatbot

LINE Developers Thailand

October 16, 2021
Tweet

More Decks by LINE Developers Thailand

Other Decks in Technology

Transcript

  1. PANCAKE SWAP WITH LINE CHATBOT


    View full-size slide

  2. • DeFi, Yield Farming & PancakeSwap


    • Smart Contract Query


    • Designing Flex Message


    • Rich Menu Switch Action
    AGENDA

    View full-size slide

  3. What is DeFi?
    Decentralized finance is a system by which financial products become available on a public decentralized blockchain network.

    View full-size slide

  4. What is Blockchain?

    View full-size slide

  5. What is Yield Farming?
    The practice of staking or lending crypto assets in order to generate high returns or rewards in the form of additional cryptocurrency (CoinMarketCap

    View full-size slide

  6. What is PancakeSwap?

    View full-size slide

  7. The Problem
    😢 😭 😱
    Most DeFi live on web
    Hard to check portfolio on mobile device on native app

    View full-size slide

  8. Let’s Build Your Own DeFi Tracker

    View full-size slide

  9. SMART


    CONTRACT QUERY
    PART 1

    View full-size slide

  10. What is Smart Contract?

    View full-size slide

  11. What is MasterChef?

    View full-size slide

  12. Connecting to Smart Contract with Web3
    JSON RPC
    Views, Submit
    Transaction
    RPC Node Blockchain
    Client

    View full-size slide

  13. Writing the Query Using Web3
    https://medium.com/linedevth/eed4951679f3

    View full-size slide

  14. DESIGNING FLEX
    MESSAGE
    PART 2

    View full-size slide

  15. Designing Flex Message

    View full-size slide

  16. Using function to represent Flex content

    View full-size slide

  17. Using function to represent Flex content

    View full-size slide

  18. Using function to represent Flex content

    View full-size slide

  19. Some Improvement?
    🤔
    I still need to remember my wallet address
    What if I have multiple wallet address? Any easy way to store them.

    View full-size slide

  20. RICH MENU


    SWITCH ACTION
    PART 3

    View full-size slide

  21. What Is Rich Menu Switch Action?

    View full-size slide

  22. 1. Do an action 2. Webhook event
    Bot application
    3. Request Rich menu
    4. Set Rich menu
    LINE server
    Client
    Richmenu Switching With Webhook

    View full-size slide

  23. Richmenu Switch Action
    1. Richmenu

    Switch Action
    2. Set Rich
    Menu
    LINE server
    Client

    View full-size slide

  24. Richmenu with Wallet Address
    richmenu-alias-wallet1 richmenu-alias-wallet2

    View full-size slide

  25. Richmenu with Wallet Address
    Message Action:
    0x1234...5678
    richmenu-alias-wallet1 richmenu-alias-wallet2

    View full-size slide

  26. Richmenu with Wallet Address
    Richmenu Switch Action:
    richmenu-alias-wallet2
    richmenu-alias-wallet1 richmenu-alias-wallet2

    View full-size slide

  27. Richmenu with Wallet Address
    Richmenu Switch Action:
    richmenu-alias-wallet1
    richmenu-alias-wallet1 richmenu-alias-wallet2

    View full-size slide

  28. Richmenu with Wallet Address

    View full-size slide

  29. Create Richmenu and set Image

    View full-size slide

  30. Create Richmenu and set Image

    View full-size slide

  31. Richmenu with Wallet Address

    View full-size slide

  32. No need to remember address now!

    View full-size slide

  33. medium.com/linedevth

    View full-size slide