Can i use javascript for calculation in defi app?

I want to make an DeFi app using internet computer, i have some question about javascript security and Motoko abilities?

  • Is that good idea If i use CanCan user identify for this ?
  • is that secure if i use javascript for calculation and then send calculated data into Motoko ?
  • If above answer is No!, How difficulty Motoko can handle ?
  • Is that any transaction fee for changing data in the canister ?

Good to see other defi applications, what kind of project are you working on?

  • Yeah, the internet-identity canister seems the ideal way to handle auth
  • What sort of calculations? You should still validate on the backend
  • State writes have costs, but it’s up to you to decide how to pass that to users
1 Like

Thanks for replay.

  • An investment DApp for now, then exchange DApp for next step.
  • I want to loop into huge amount of referrals into many levels then calculate user interest, so i cant trust javascript for this? then i should make Motoko version of my loops. any suggestion would be helpful for this.
  • Where can i read about costs ?

I think you only need to pass in the referrer during user signup, then calculate everything internally. I would recommend having some sort of sign up cost in order to discourage self-referrals.

Have you thought about what tokens look like?

Not sure if detailed info on cycle costs is available yet.

1 Like

Thanks for the tip,

Yes, i want to connect into all blockchains using any wallet exist, then wait for transaction event and save data into user account…, give them interest for freezing their assets also by inviting people.