Это видео недоступно.
Сожалеем об этом.

Vault Math - How much shares to mint? How much token to withdraw? | DeFi

Поделиться
HTML-код
  • Опубликовано: 20 май 2022
  • Math for vault. How much shares to mint on deposit? How much amount to withdraw?
    Notes
    github.com/t4s...
    #Solidity #SmartContract #Ethereum #スマートコントラクト
    Take a course
    www.smartcontr...
    Follow
    / programmersmart
    / discord
    t.me/smartcont...
    smartcontractp...

Комментарии • 36

  • @smartcontractprogrammer
    @smartcontractprogrammer  2 года назад +2

    0:00 - What is a vault?
    1:49 - Deposit - How much shares to mint?
    5:40 - Withdraw - How much token to withdraw?
    Notes
    github.com/t4sk/notes
    Take a course
    www.smartcontract.engineer/

  • @franckyking93
    @franckyking93 2 года назад +4

    Awesome stuff! Could you do a solidity example, please? That would be super useful to understand how to translate math to well structured code. Thanks.

  • @MartinMarchev
    @MartinMarchev Год назад

    Great content as always. Thanks for sharing!

  • @dev.regotube
    @dev.regotube 2 года назад +4

    I’m smelling an ERC4626 video

    •  4 месяца назад

      Personally, I think this video teachs you the concept while ERC-4626 helps you to implement the idea more easily.

  • @sadeeshkumar654
    @sadeeshkumar654 2 года назад +1

    Thank you professor ❤️

  • @drtech6521
    @drtech6521 Год назад

    Great Content! 💫

  • @ManuelAstilleroFuentes
    @ManuelAstilleroFuentes 2 года назад +1

    Great! On the other hand: which app do you use to make such clarifying presentations?

  • @sanjayojha1
    @sanjayojha1 Год назад

    So Vault and LP are same? In LP you need to add pair to token while in Vault you can add single/multiple token? Both rewards user in term of APR?

  • @catreunion
    @catreunion 2 года назад

    Thank you 🙏

  • @autismavenue9223
    @autismavenue9223 2 года назад

    Ser, possible to make a tutorial how to actually write this in Solidity?

  • @vishalkulkarni3977
    @vishalkulkarni3977 2 года назад

    thank you sir
    can you tell us from where we can read complete defi

  • @marcopiccioli8691
    @marcopiccioli8691 2 года назад +1

    Hi thanks for the amazing video. The final formula to calculate the amount of shares to mint seems to me the same of the formula used to calculate the amount of LP to mint after a liquidity provision, same thing applies for the withdraw math, am I right? Thanks

  • @mosipvp
    @mosipvp 2 года назад +1

    a = sB/T - vault owner percent
    cuz owner as/is a partner by investor on profit

    • @smartcontractprogrammer
      @smartcontractprogrammer  2 года назад

      Vault owner percent can be included in B

    • @mosipvp
      @mosipvp 2 года назад

      @@smartcontractprogrammer correct, but some ghoul like cj never in B.
      as always thank u

  • @DeadBabyFoetus
    @DeadBabyFoetus 2 года назад

    When you say "shares" do you just mean tokens? The whole point of shares is that they stay constant, whereas number of tokens can change. (Thinking of rebasing models like Ampleforth)

  • @iamgadgetboy
    @iamgadgetboy Год назад

    Would you recommend your code from courses safe to use in production and do you offer in your course safe methods for production. Love your easily explained courses btw. Excellent work here. Thanks for your contribution. This has given me ideas for future projects. ❤🎉

    • @smartcontractprogrammer
      @smartcontractprogrammer  Год назад

      no, code is simplified for education purpose.
      production code will have more checks

  • @vijayguru7648
    @vijayguru7648 5 месяцев назад +1

    can't this be frontrunned when the vault has zero balance ?

  • @KirillDvoretskov
    @KirillDvoretskov 2 года назад

    COOL

  • @viktorlavrenenko1713
    @viktorlavrenenko1713 2 года назад

    Buddy, is the diagram for the witdraw correct? Where a B-a and s T-s.

  • @andreujuanc
    @andreujuanc 2 года назад

    Brilliant! Is this a segway to EIP2646? :P

  • @blahblah-rn1ts
    @blahblah-rn1ts Год назад

    How is this supposed to work if the vault is empty?

    • @blahblah-rn1ts
      @blahblah-rn1ts Год назад

      ok, in that case a = s

    • @veliea5160
      @veliea5160 Год назад

      @@blahblah-rn1ts why a=s. Why we are assuming that ratio is 1-1. If I deposit eth or dai, regardless of what I deposit, why am I getting same shares?

    • @smartcontractprogrammer
      @smartcontractprogrammer  Год назад +1

      because you can't deposit ETH into a DAI vault. you cant deposit DAI into a ETH vault

    •  4 месяца назад

      @@smartcontractprogrammer that's right! Unless he is considering a different type of vault where he would need to consider rate changes as well.