# Events in daml

**URL:** <https://forum.canton.network/t/events-in-daml/3514>\
**Category:** App Development\
**Created:** [November 29, 2021, 5:16am UTC](https://forum.canton.network/t/events-in-daml/3514 "2021-11-29T05:16:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bels3](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bels3/32/2677_2.png) [@Bels3](https://forum.canton.network/u/Bels3)\
**Post date:** [November 29, 2021, 5:16am UTC](https://forum.canton.network/t/events-in-daml/3514/1 "2021-11-29T05:16:52Z")

</div>

How would you write a redeem function for a loyalty points system in a manner that you set the conversion ratio and whenever a user uses his or her points it burns the points in the wallet thus eventually reflecting on the account balance? In java script this is possible through the use of events but am having a hard time to implement the same using daml. Any assistance will be appreciated.

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [November 29, 2021, 8:42am UTC](https://forum.canton.network/t/events-in-daml/3514/2 "2021-11-29T08:42:19Z")

</div>

Hi @Bels3 and welcome to the Daml forum 👋

Can you provide an example of what exactly you’re struggling with? Knowing things like

1. The workflow you’d like to implement
2. What you’ve implemented so far in Daml

Would help us in answering your question better 😀

---

<div class="post-metadata">

**Author:** ![Bels3](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bels3/32/2677_2.png) [@Bels3](https://forum.canton.network/u/Bels3)\
**Post date:** [November 29, 2021, 9:20am UTC](https://forum.canton.network/t/events-in-daml/3514/3 "2021-11-29T09:20:55Z")

</div>

attached is the work flow.  
I am thinking on _how to implement the functionality of earning and redeeming points using Daml_. I recently started learning Daml and it’s been quite an experience. I need guidance on the best way to implement it.

 ![work flow.PNG](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/c/ce2c4aed296524878a9b3fd7ea1a5773e54a7617.png)

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [November 29, 2021, 9:51am UTC](https://forum.canton.network/t/events-in-daml/3514/4 "2021-11-29T09:51:54Z")

</div>

Thnx for posting the workflow @Bels3 🙂

I’d suggest looking into the [Daml part of the IOU example in the docs](https://docs.daml.com/app-dev/bindings-java/quickstart.html) as a starting point. It explains how to issue and transfer tokens.

Also check out our [free introduction to Daml course](https://daml.talentlms.com/catalog/info/id:132) that explains how to create an NFT marketplace with royalty payments.

Sorry, I guess looking at an example code snippet that you’re struggling with might give more information on what’s the starting issue that you’re having with implementing the loyalty rewards system.

---

<div class="post-metadata">

**Author:** ![quidagis](https://avatars.discourse-cdn.com/v4/letter/q/dbc845/32.png) [@quidagis](https://forum.canton.network/u/quidagis)\
**Post date:** [November 29, 2021, 9:03pm UTC](https://forum.canton.network/t/events-in-daml/3514/5 "2021-11-29T21:03:53Z")

</div>

That workflow diagram is terrific. What was it created with?

---

<div class="post-metadata">

**Author:** ![SteveSeow](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/steveseow/32/2785_2.png) [@SteveSeow](https://forum.canton.network/u/SteveSeow)\
**Post date:** [November 30, 2021, 2:45am UTC](https://forum.canton.network/t/events-in-daml/3514/6 "2021-11-30T02:45:59Z")

</div>

@Bels3 Awesome project to tackle! I’m one of the Developer Advocates at DA and I will be happy to explore this with you.

First off, your scenario is perfect for a Daml implementation! Two: This would probably take more than this forum to do a proper architecture overview, information architecture, etc.

Beyond the architecture and design, you would probably want to start with breakdown the templates that are required in your specific use case, and what data you need, etc. Nemanja has already asked, but what is your familiarity with Daml at this moment?

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [December 14, 2021, 12:24pm UTC](https://forum.canton.network/t/events-in-daml/3514/7 "2021-12-14T12:24:25Z")

</div>

Hi @Bels3 👋

Were you able to make progress with the loyalty points system?

---

<div class="post-metadata">

**Author:** ![Bels3](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bels3/32/2677_2.png) [@Bels3](https://forum.canton.network/u/Bels3)\
**Post date:** [December 14, 2021, 3:58pm UTC](https://forum.canton.network/t/events-in-daml/3514/8 "2021-12-14T15:58:05Z")

</div>

Yes I actually made a breakthrough for sure. I appreciate the concern.

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [December 14, 2021, 4:20pm UTC](https://forum.canton.network/t/events-in-daml/3514/9 "2021-12-14T16:20:38Z")

</div>

Thnx for letting us know @Bels3 🙂 Anything you can share here?
