Это видео недоступно.
Сожалеем об этом.
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...
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/
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.
Great content as always. Thanks for sharing!
I’m smelling an ERC4626 video
Personally, I think this video teachs you the concept while ERC-4626 helps you to implement the idea more easily.
Thank you professor ❤️
Great Content! 💫
Great! On the other hand: which app do you use to make such clarifying presentations?
excalidraw
@@smartcontractprogrammer Thanks!!!
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?
Thank you 🙏
Ser, possible to make a tutorial how to actually write this in Solidity?
thank you sir
can you tell us from where we can read complete defi
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
yes
a = sB/T - vault owner percent
cuz owner as/is a partner by investor on profit
Vault owner percent can be included in B
@@smartcontractprogrammer correct, but some ghoul like cj never in B.
as always thank u
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)
It can be tokens, it can be state variables
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. ❤🎉
no, code is simplified for education purpose.
production code will have more checks
can't this be frontrunned when the vault has zero balance ?
yes it's vulnerable to vault inflation
COOL
Buddy, is the diagram for the witdraw correct? Where a B-a and s T-s.
Yes B - a + a = B
Brilliant! Is this a segway to EIP2646? :P
No
@@smartcontractprogrammer :(
How is this supposed to work if the vault is empty?
ok, in that case a = s
@@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?
because you can't deposit ETH into a DAI vault. you cant deposit DAI into a ETH vault
@@smartcontractprogrammer that's right! Unless he is considering a different type of vault where he would need to consider rate changes as well.