Curve - Code Explaind - get_y() | DeFi

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 มิ.ย. 2024
  • Curve StableSwap has complex code, difficult to understand, one of them being the function get_y. This video explains how the function get_y is implemented.
    github.com/t4sk/defi-by-examp...
    #DeFi #Curve #SmartContract #Ethereum
    References
    Curve curve.fi/
    Follow on Twitter: @ProgrammerSmart / programmersmart
    Join me on Discord: / discord
    Website: smartcontractprogrammer.com
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 24

  • @rattle_
    @rattle_ 3 ปีที่แล้ว

    Awesome video! Love the code explanation videos.

  • @sarens596
    @sarens596 ปีที่แล้ว

    Wonderful, you hit every points

  • @atayurejonathan6582
    @atayurejonathan6582 2 ปีที่แล้ว +1

    great, now I got to learn vyper to use curve

  • @benng5271
    @benng5271 ปีที่แล้ว

    Thank you very much for your detailed explain about Curve underlying math. It really helps. It would be nice if you can make another video to cover Curve crypto swap math too. It uses gamma to calculate get_dy seems it's a different story to stable swap.

  • @if432
    @if432 2 ปีที่แล้ว

    Thank god I found this!!!!

  • @grassfrens
    @grassfrens 11 หลายเดือนก่อน

    thanks for the video! any idea on how to get the input amount given the output on curve v2?

    • @smartcontractprogrammer
      @smartcontractprogrammer  11 หลายเดือนก่อน

      solve the Curve's equation using Newton's method.

    • @grassfrens
      @grassfrens 11 หลายเดือนก่อน

      @@smartcontractprogrammer fees are dependent on the post-trade reserves though

  • @markolazic6352
    @markolazic6352 ปีที่แล้ว

    Great video!
    Can you explain the origin of Amp = A * n ** (n-1)?

  • @sattayakongkom8222
    @sattayakongkom8222 2 ปีที่แล้ว

    how to work vy with solidity contract ? etc import or inheritance thx.

  • @thoyo
    @thoyo 3 ปีที่แล้ว

    It's there a reason you coded this in vyper over solidity?

    • @smartcontractprogrammer
      @smartcontractprogrammer  3 ปีที่แล้ว +2

      Curve is written in Vyper

    • @thoyo
      @thoyo 3 ปีที่แล้ว +1

      @@smartcontractprogrammer gotcha. Thx!

  • @cyberdisco9724
    @cyberdisco9724 2 ปีที่แล้ว

    Can't thank you enough for covering this material! Doesn't g(y) = 0? Since you're subtracting all the terms from the left. Wouldn't that make the derivative zero everywhere?

    • @smartcontractprogrammer
      @smartcontractprogrammer  2 ปีที่แล้ว +1

      here we're using Newton's method to find a specific y* such that g(y*) = 0
      the function g(y) is not necessary = 0 for all y

    • @cyberdisco9724
      @cyberdisco9724 2 ปีที่แล้ว

      @@smartcontractprogrammer sweet, thanks for clarification

  • @0xsupersane920
    @0xsupersane920 3 ปีที่แล้ว

    EVM can run in Vyper? I thought it was only Solidity.

  • @3rdvoidmen594
    @3rdvoidmen594 3 ปีที่แล้ว

    Can you make a video on the ether honeypot works...where the guy autowithraws ether when the victim tries to send in ether to reterive the tokens...the one where eth private key is publicaly put in groups and stuff..

  • @fevicoI
    @fevicoI 3 ปีที่แล้ว +1

    It was hard to understand

  • @fevicoI
    @fevicoI 3 ปีที่แล้ว +1

    Am I that dumb?

  • @Lopol2010
    @Lopol2010 2 ปีที่แล้ว

    I wonder if there is something like 'getAmountIn' but for curve pool. Like get_x which will return you amount of x needed to get amount of y.