xiaodao
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Unisave 采访稿 上一次我们采访了小岛的 DeFi 项目 Y3D,她向我们剧透自己正在开发一个结合 Uniswap 和 Yearn 的新项目 —— Unisave。两个月后目前这个项目已经在币安智能链上开始挖矿并锁仓 150 万美金了,不过看起来她又在这个项目里加入了一些其他特性,让我们来与小岛讨论一下这个新项目吧。 以下是采访内容。另,本文并非投资建议,投资有风险,请谨慎。 Q:我们看到 Unisave 最近在币安智能链上发布了,并且得到了币安官方社交媒体的转推,能说一下为什么这次不在以太坊上开发,而选择去币安智能链吗? ![](https://i.imgur.com/Siw28WJ.png) A:总的来说有以下三个原因: 1. 手续费 2. 兼容性 3. 优质资产 最主要原因还是以太坊开发实在太贵了,过去几个月我光部署合约就花掉了大约 10 个以太,折合人民币大约 30000 元吧,对于一个独立开发者来说实在负担不起。对比之下币安智能链现在部署合约的费用简直🥬白菜价,几乎可以忽略不记。 另一方面币安智能链可以说是目前与以太坊兼容性最好的开发环境没有之一,不少公有链平台虽然也支持 EVM 但是却不能很好的支持以太坊生态中的其他开发者工具,平时可能觉得没什么影响,但是恰好需要使用它们的时候没有这些轮子会极大的增加开发成本。 另外一个原因是币安智能链上有很多优质的代币资产,而这在一些生态还没有起步的新兴公链上又是不具备的。 ![](https://i.imgur.com/RFpXmiw.png) 最后币安智能链现在还在非常早期的阶段,官方还会对对开发者进行一些实质的帮助,有不少生态红利。所以总的说来说币安智能链可能是目前平衡性最好的开发环境。 Q:能说一下 Unisave 的开发历程吗。 A:其实我们已经在币安智能链主网上跑了一个月,发布了三个版本。第一个版本是在 Uniswap 的基础上,把每一个交易对,视作一个 Vault,连接进机枪池进行挖矿,目前我们选用的是 YFII,理论上任何无损策略的机枪池都可以,如果 YFI 的 YIP-51 得到通过的话,我们也可以使用 YFI,当然这个也可以自己写来进一步优化性能。 后来我们注意到作为一个新生的 AMM,我们很难和已经形成了护城河的其他 AMM 进行竞争,不管是原版的 Uniswap 还是分叉王者 Sushiswap,就连币安智能链上的 Pancakeswap 的 TVL 当时都是我们几千倍,所以我们就又增加了一个 feature,叫做虚流动性,让 Unisave 可以引用外部的流动性计算自己的滑点,以达到「四两拨千斤」的效果。 这次更新之后,作为 Dex 的基本面,交易量比锁仓量开始得到极大的提升,甚至有的交易对滑点还要优于 Pancake 和 Sushi,仅次于 Uniswap,而这是在我们的 TVL 差竞争对手几个数量级的情况下。后来我们又优化了一下自动挖矿的逻辑,并加入了更多的链上 Event 优化 Info 信息,发布了目前的版本。 Q:能简单介绍一下什么是「虚流动性」吗? A:「虚流动性」就是参与滑点计算,但合约内部没有资产 Backup 的外部流动性。 其实「虚流动性」的概念,最早我们在设计 Kyubey 的 DAICO 和 Matataki 上 Fan 票的 Initial Liquidity Offer 的算法时就曾经计划过,因为最早的 Bancor 的流动性众筹算法,所有的流动性都会锁在合约里,那么开发者和创作者就没有办法使用这笔资金去从事开发和创作活动,当时我们的设计就是,能否随着时间的推移,缓慢的将一部分实流动性,转换为虚流动性,而让创作者从合约中取出资金? 后来在设计 Unisave 算法陷入困境的时候,我看到了 B 站上的《混元形意太极拳》系列。马掌门说中国传统功夫的核心打法,就是要打接化发,就是要讲阴阳相济、虚实相生、借力打力,恍惚间我突终于大悟了。。。 ![](https://i.imgur.com/MaqxYiB.jpg) Unisave 的虚流动性也是如此,最早的对 Unisave 里虚流动性的设计,是直接拿 Uniswap 相同 Pair 的流动性,这样我的流动性就是外部加内部,因此我的滑点 always 比 Uniswap 更低。 Q:能说一下静态「虚流动性」算法,和动态「虚流动性」算法的区别吗? 上面说到的「虚流动性」的设计,显然是会被闪电贷攻击的。我们需要使用一个绝对安全的 Oracle 算法,并且,在引入了 Oracle 合约之后,我们还可以再引入一个 Observer 合约去主动的更新虚流动性,从而做到类似 DODO 里主动做市商算法的效果。我们称使用了 Overver 合约,动态调整「虚流动性」的算法为「自适应做市商算法」,这个算法命名是向我的人生 Mentor 之一,CMU 大学的博士生导师,Link-Cut Tree 的发明人,Daniel Sleator 教授致敬,Link-Cut Tree 里所使用的 Splay, 又叫自适应平衡树,而且那个数据结构里也恰好有「虚边」和「实边」的概念。 ![](https://i.imgur.com/8zjK46t.png) 不过这个 Overver 的合约目前还在艰难的审计过程之中,所以目前 BSC 上上线的 Unisave 还不是完全形态,不过即使现在生产环境使用的是静态的「虚流动性」算法,也非常值得推敲,因为她已经相当于杠杆化 LP Token,以扩大潜在的无常损失为代价,在同等价格波动下,能够让 LP 获得更高的手续费,这已经是一个非常有意义的设计。我在 Medium 和 Matataki 上都做了数学推导,虚流动性占比和手续费收入,以及交易窗口之间的函数关系。有兴趣的读者可以去看我 [之前的那篇文章](https://matataki.io/p/5616)。 BTW,我前几年的时候在北京大学遇到 Daniel Sleator 教授,甚至还讨论了一下以太币和比特币的问题,很惊讶的是 Sleator 和我说他曾经持有过一些以太币,不过后来全卖掉了。。。不知道他后来买回来了没有。。。 ![](https://i.imgur.com/SduHYP8.jpg) 最后总结一下我的修改就是: - 计算价格和滑点:考虑「虚」+「实」。 - 计算流动性:只考虑「实」。 之前说到,Uniswap 最大的问题就是其极低的资金利用率和糟糕的交易滑点。而我们对 Uniswap 只做出了最少程度的修改,但牵一发而动全身,已经完全改变了 Uniswap 的性态。甚至后续还可以通过扩展 Oberver 合约来去模拟 Curve、Bancor、亦或是 DODO 的 Bounding Curve。 ![](https://i.imgur.com/XNeJJIz.jpg) 「自适应做市商算法」确实是我目前为止最完美的一个作品。。。 Q:能说一下 Unisave 和 Y3D 的关系吗? A:其实 Unisave 和 Y3D 设计思路上还是一脉相承的,我们甚至复制了很多 Y3D 时候设计的代码,比如聚合器的部分,以及现在挖矿的合约。我们发现很多 Uniswap-Like 的 Fork 在挖矿结束之后都经历了一个流动性断崖的情况,但是我们最早版本的 Y3D,在三个月过后依然维持了超过 83.33% 的 TVL,原因就是因为我们引入了 P3D 的机制,来奖励项目的长期支持者,这其实就是入门级别的 Gamefication 的设计。 所以这一次 Unisave 的最后两个矿池,一个 BUSD/USDT 的稳定币 LP 五倍池,和最后的 Y3D/BUSD LP 十倍池,我们都在此延续了这个设计。 BTW,Y3D/BUSD 的挖矿将在今天晚上 21:00,恰好在 YFII 社区的 DeFi Tuesday 之后开始,今晚的直播中我也会介绍我们具体的算法设计和数据,有兴趣的可以留意一下。 ![](https://i.imgur.com/mEYB12g.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully