以太幣交易所 以太幣交易所
Ctrl+D 以太幣交易所
ads

Curve穩定幣設計白皮書(中英文參照版本)_THE

Author:

Time:1900/1/1 0:00:00

原文作者:MichaelEgorov,CurveFinance

原文編譯:JamesX,iZUMiResearch

穩定幣的設計中有幾個概念是最重要的:借貸-清算AMM算法,PegKeeper,貨幣政策。但主要的設計點是在LLAMMA:用一個特殊用途的AMM代替傳統超額抵押借貸的清算流程。

Inthisdesign,ifsomeoneborrowsagainstcollateral,evenatliquidationthreshold,andthepriceofcollateraldipsandbounces-nosignificantlosshappen.Forexample,accordingtosimulationsusinghistoricdataforETH/USDsinceSep2017?,ifoneleavestheCDPunattendedfor3daysandduringthistimethepricedropof10%belowtheliquidationthresholdhappened-only1%ofcollateralgetslost.

在這種設計中,如果有人用抵押品借款,即使是在清算閾值,抵押品的價格下跌后反彈--也不會發生明顯的損失。例如,根據自?2017?年?9?月以來使用ETH/USD的歷史數據進行的模擬,如果放著CDP無人看管?3?天,在此期間,價格下跌至低于清算價格?10%的情況發生的話,也只有?1%的抵押品被損失。

持續清算/無需清算的AMM

ThecoreideaofthestablecoindesignisLending-LiquidatingAMMAlgorithm.Theideaisthatitconvertsbetweencollateral(forexample,ETH)andthestablecoin(let’scallitUSDhere).Ifthepriceofcollateralishigh-auserhasdepositsallinETH,butasitgoeslower,itconvertstoUSD.ThisisverydifferentfromtraditionalAMMdesignswhereonehasUSDontopandETHonthebottominstead.

穩定幣設計的核心思想是Lending-LiquidatingAMM算法。這個想法是,它在抵押品和穩定幣之間進行轉換。如果抵押品的價格很高--用戶的存款都是ETH,但當價格降低時,它就會轉換為USD穩定幣。這與傳統的AMM設計有很大不同,傳統的AMM設計是將USD穩定幣放在上面,ETH放在下面。

Thebelowdescriptiondoesn’tserveasfullyself-consistentrigorousproofs.Alotofthat(especiallytheinvariant)areobtainedfromdimensionalconsiderations.Moreresearchmightberequiredtohaveafullmathematicaldescription,howeverthebelowisbelievedtobeenoughtoimplementinpractice.

下面的描述并不能作為一個完全自洽的嚴謹證明。很多東西都是從各種維度考慮得到的。要有一個完整的數學描述,可能需要更多的研究,然而下面的描述被認為足以支持在智能合約中實施。

Thisisonlypossiblewithanexternalpriceoracle.Inanutshell,ifonemakesatypicalAMM(forexamplewithabondingcurvebeingapieceofhyperbola)andrampsits“centerprice”from(forexample)downtoup,thetokenswilladiabaticallyconvertfrom(forexample)USDtoETHwhileprovingliquidityinbothwaysontheway(Fig.3?).Itissomewhatsimilartoavoidedcrossing(alsocalledLandau-Zenertransition)inquantumphysics(thoughonlyasanidea:mathematicaldescriptionoftheprocesscouldbeverydifferent).Therangewheretheliquidityisconcentratediscalledbandhere,attheconstantpobandhasliquidityfrompcdtopcu.Weseekforpcd(po)andpcu(po)beingfunctionsofpoonly,functionsbeingmoresteepthanlinearand,hence,growingfasterthanpo(Fig.4?).Inaddition,let’sdefifinepricesp↓andp↑beingpriceswherep↓(po)=po,andp↑(po)=po,definingendsofbandsinadiabaticlimit(e.g.p=po).

Curve:當前版本原生穩定幣 crvUSD 需重新部署:金色財經報道,Curve Finance 發推稱,在對其原生穩定幣 crvUSD 的部署進行同行審計后,發現當前版本的 crvUSD 需要重新部署,部署將在今日進行。此外,因為部署腳本中存在錯誤,veCRV 不會獲得費用。

今日消息,Curve 原生穩定幣 crvUSD 已在主網上部署了智能合約,但還未部署 UI。[2023/5/4 14:42:49]

這只有通過外部預言機喂價才能實現。簡而言之,如果一個人做了一個典型的AMM,并將其"中心價格"從下降到上升,代幣將從USD“絕熱”地轉換為ETH,同時在過程中提供兩種方式的流動性。這有點類似于量子物理學中的“回避交叉”。

流動性集中的范圍在這里被稱為“波段”,在恒定的po波段有從pcd到pcu的流動性。我們尋求pcd(po)和pcu(po)只作為po的函數,函數比線性更陡峭,因此,增長速度比po快。此外,讓我們把價格p↓和p↑定義為p↓(po)=po和p↑(po)=po的價格,定義為絕熱極限中的波段兩端。

Figure3?:Behaviorofan“AMMwithanexternalpricesource”.Externalpricepcenterdeterminesapricearoundwhichliquidityisformed.AMMsupportsliquidityconcentratedfrompricespcdtopcu,pcd<pcenter<pcu.Whencurrentpricepisoutofrangebetweenpcdandpcu,AMMiseitherfullyinstablecoin(whenatpcu)orfullyincollateral(whenatpcd).Whenpcd≤p≤pcu,AMMpriceisequaltothecurrentpricep.

Figure4?:AMMwhichwesearchfor.WeseektoconstructanAMMwherepcdandpcuaresuchfunctionsofpothatwhenpogrows,theygrowevenfaster.Inthiscase,thisAMMwillbeallinETHwhenETHisexpensive,andallinUSDwhenETHischeap.

Westartfromanumberofbandswhere,similarlytoUniswap?3?,hyperbolicshapeofthebondingcurveispreservedbyaddingvirtualbalances.Letsay,theamountofUSDisx,andtheamountofETHisy,thereforethe“amplifified”constant-productinvariantwouldbe:

我們從一些波段開始,與Uniswap?3?類似,通過增加“虛擬余額”,保留了粘合曲線的雙曲形狀。比方說,USD的數量是x,ETH的數量是y,因此"增強的"常數-產品不變性將是:

Wealsocandenotex?0≡x??fandy?0≡ygsothattheinvariantcanbewrittenasafamiliarI=?x?0y?0.However,fandgdonotstayconstant:theychangewiththeexternalpriceoracle(andsodoestheinvariantI,soitisonlytheinvariantwhiletheoraclepricepoisunchanged).Atagivenpo,fandgareconstantacrosstheband.Asmentionedbefore,wedenotep↑asthetoppriceofthebandandp↓asthebottompriceoftheband.WedefifineA(ameasureofconcentrationofliquidity)insuchawaythat:

Curve DAO正在投票為MATIC/ETH池添加Gauge:金色財經報道,Curve DAO正在投票為MATIC/ETH池添加Gauge,投票將于1月29日結束。

Curve表示,看到V2池在不同代幣流動性充足的情況下的表現后,巨鯨開始要求在以太坊上提供更多Gauge。之后,每幾周會增加一個,將先從針對MATIC/ETH池的投票開始。”[2023/1/23 11:26:57]

我們也可以表示x?0?≡xf和y?0?≡yg,這樣不變式就可以寫成熟悉的I=x?0y?0?。然而,f和g并不是保持不變的:它們隨著外部預言機價格的變化而變化。在給定的po下,f和g在整個波段內是不變的。如前所述,我們把p↑表示為波段的頂部價格,p↓表示為波段的底部價格。我們對A的定義是這樣的:

Thepropertywearelookingforissuchthathigherpriceposhouldleadtoevenhigherpriceatthesamebalances,sothatthecurrentmarketprice(whichwill,onaverage,followpo)islowerthanthat,andthebandwilltradetowardsbeingallinETH(andtheoppositeisalsotruefortheotherdirection).Itispossibletofindmanywaystosatisfythatbutweneedone:

我們正在尋找的屬性是這樣的:更高的價格po應該導致在相同的余額下更高的價格,因此,當前的市場價格低于這個價格,并且波段將朝著全部為ETH的方向交易。可以找到很多方法來滿足,但我們需要這樣一個:

wherey?0isap?0?-dependentmeasureofdepositsinthecurrentband,denominatedinETH,defifinedinsuchawaythatwhencurrentpricep,p↑andpoareequaltoeachother,theny=y?0andx=0(seethepointatpo=p↑onFig.4?).Thenifwesubstituteyatthatmoment:

其中y?0?是一個與p?0?相關的衡量當前波段存款的指標,以ETH為單位,其定義是:當當前價格p、p↑和po相互相等時,則y=y?0?,x=?0?。那么,如果我們把那一刻的y替換掉:

Priceisequaltodx?0/dy?0whichthenforaconstant-productinvariantis:

價格等于dx?0/dy?0?,那么對于一個恒定的產品不變量來說,就是:

Onecansubstitutesituationswherepo=p↑orpo=p↓withx=0ory=0correspndinglytoverifythattheaboveformulasareself-consistent.

我們可以用x=?0?或y=?0?來代替po=p↑或po=p↓的情況,以驗證上述公式是自洽的。

Typicallyforaband,weknowp↑and,hence,p↓,po,constantA,andalsoxandy(currentdepositsintheband).Tocalculateeverything,weneedtofindyo.Itcanbefoundbysolvingthequadraticequationfortheinvariant:

通常對于一個波段,我們知道p↑,因此也知道p↓、po、常數A,還有x和y。為了計算剩下的一切,我們需要找到yo。它可以通過解決不變量的二次方程來找到:

Frax Finance為Curve上Fantom 4 pool的投票者提供近25萬美元獎勵:金色財經消息,算法穩定幣協議FraxFinance為Curve上Fantom 4 pool的veCRV投票者提供近25萬美元獎勵,獎勵將以FXS形式支付,并于4月21日8:00正式啟動。(pitch.money)[2022/4/18 14:31:31]

whichturnsintothequadraticequationagainstyo:

這就變成了針對yo的二次方程:

Inthesmartcontract,wesolvethisquadraticequationinget_y?0function.

在智能合約中,我們在get_y?0?函數中解決這個二次方程。

Whileoraclepricepostaysconstant,theAMMworksinanormalway,e.g.sellsETHwhengoingup/buysETHwhengoingdown.Bysimplysubstitutingx=0forthe“currentdown”pricepcdory=0forthe“currentup”pricepcuvaluesintotheequationoftheinvariantrespectively,itispossibletoshowthatAMMpricesatthecurrentvalueofpoandthecurrentvalueofp↑are:

在預言機價格po保持不變的情況下,AMM以正常的方式工作,例如,上漲時賣出ETH/下跌時買入ETH。通過簡單地將x=?0?替換為"當前下跌"的價格pcd或y=?0?替換為"當前上漲"的價格pcu值分別代入不變量方程,就可以說明在po的當前值和p↑的當前值下的AMM價格是:

Anotherpracticallyimportantquestionis:ifpricechangesupordownsoslowlythattheoraclepricepoisfullycapabletofollowitadiabatically,whatamounty↑ofETH(ifthepricegoesup)orx↓ofUSD(ifthepricegoesdown)willthebandendupwith,givencurrentvaluesxandyandthatwestartalsoatp=po.Whileit’snotanimmediatelytrivialmathematicalproblemtosolve,numericcomputationsshowedaprettysimpleanswer:

另一個重要的實際問題是:如果價格的變化如此緩慢,以至于預言機價格po完全能夠”絕熱地”跟隨它,那么在給定當前值x和y,并且我們也從p=po開始的情況下,這個波段最終會得到多少y↑的ETH或x↓的USD。雖然這不是一個立即可以解決的數學問題,但數字計算顯示了一個相當簡單的答案:

WewillusetheseresultswhenevaluatingsafetyoftheloanaswellasthepotentiallossesoftheAMM.

在評估借貸的安全性以及AMM的潛在損失時,我們將使用這些結果。

Nowwehaveadescriptionofoneband.Wesplitallthepricespaceintobandswhichtoucheachotherwithpricesp↓andp↑sothatifwesetabasepricepbaseandhaveabandnumbern:

現在我們有了對一個波段的描述。我們把所有的價格空間分成若干波段,這些波段的價格p↓和p↑相互接觸,因此,如果我們設定一個基礎價格pbase,并有一個波段號n:

Recur完成500萬美元種子輪融資,DeFiAlliance領投:3月31日消息,NFT品牌體驗公司Recur宣布完成500萬美元種子輪融資,由DeFiAlliance領投,IOSGVentures、CourtsideVC、Gemini、JSTCapital、DelphiDigital、VoltCapital、Nascent、CMTDigital、Hashed以及GaryVaynerchuk、ConsenSys創始人JosephLubin、Behance創始人ScottBelsky等個人投資者參投。Recur為去中心化的持續版權收入設置了標準,Recur資產目前在以太坊網絡上,但之后會陸續在其他公鏈上進行布局,并且能夠在其平臺上交易相應的品牌NFT。[2021/3/31 19:33:15]

ItispossibletoprovethatthesolutionofEq.7andEq.5foranybandgives:

對于任何一個波段,可以證明公式?7?和公式?5?的解都可以得到:

whichshowsthattherearenogapsbetweenthebands.

這表明波段之間沒有空隙。

TradesoccurwhilepreservingtheinvariantfromEq.1?,howeverthecurrentpriceinsidetheAMMshiftswhenthepricepo:itgoesupwhenpogoesdownandviceversacubically,ascanbeseenfromEq.8.

交易發生的同時保留了公式?1?的不變性,然而,當價格為po時,AMM內部的當前價格會發生變化:當po下降時,它就會上升,反之亦然,從公式?8?可以看出。

LLAMMAvsStablecoin

StablecoinisaCDPwhereoneborrowsstablecoinagainstavolatilecollateral(cryptocurrency,forexample,againstETH).ThecollateralisloadedintoLLAMMAinsuchapricerange(suchbands)thatifpriceofcollateralgoesdownrelativelyslowly,theETHgetsconvertedintoenoughstablecointocoverclosingtheCDP(whichcanhappenviaaself-liquidation,orviaanexternalliquidationifthecoverageistooclosetodangerouslimits,ornotcloseatallwhilewaitingforthepricebounce).

穩定幣是一種CDP,人們以不穩定的抵押品來借入穩定幣。抵押品被加載到LLAMMA的價格范圍內,如果抵押品的價格下降相對緩慢,ETH被轉換成足夠的穩定幣來覆蓋關閉CDP。

Whenauserdepositscollateralandborrowsastablecoin,theLLAMMAsmartcontractcalculatesthebandswheretolocatethecollateral.?Whenthepriceofthecollateralchanges,itstartsgettingconvertedtothestablecoin.Whenthesystemis“underwater”,useralreadyhasenoughUSDtocovertheloan.Theamountofstablecoinswhichcanbeobtainedcanbecalculatedusingapublicget_x_downmethod.Ifitgivesvaluestooclosetotheliquidationthresholds-anexternalliquidatorcanbeinvolved(typicallyshouldn’thappenwithinafewdaysorevenweeksafterthecollateralpricewentdownandsideways,orevenwillnothappeneverifcollateralpricenevergoesuporgoesbackuprelativelyquickly).Ahealthmethodreturnsaratioofget_x_downtodebtplusthevalueincreaseincollateralwhenthepriceiswellabove“liquidation”.

Mercurity Finance已開啟流動性挖礦:11月26日,Mercurity Finance官方宣布,已開啟流動性挖礦。Mathwallet現支持Mercurity Finance流動性挖礦計劃,在11416200區塊前,用戶可參與3倍的流動性挖礦周期活動,即以比平均速度快3倍的速度進行流動性挖礦。此前11月19日,Mercurity Finance表示將于區塊高度11279200開啟流動性挖礦,到11416200之前均為3倍的流動性挖礦周期,從區塊11416200到區塊25505200,將以常規速度開采。[2020/11/26 22:10:04]

當用戶存入抵押品并借入一個穩定幣時,LLAMMA智能合約會計算出抵押品所在的波段。當抵押品的價格變化時,它開始被轉換為穩定幣。當系統處于"水下"時,用戶已經有足夠的USD來支付貸款。可以獲得的穩定幣數量可以通過一個公共的get_x_down方法來計算。如果它給出的數值過于接近清算閾值--外部清算人可以參與進來。當價格遠高于"清算"時,一個健康的方法會返回get_x_down與債務的比率,再加上抵押品的價值增加。

Whenastablecoinchargesinterest,thisshouldbereflectedintheAMM,too.Thisisdonebyadjustingallthegridofprices.So,whenastablecoinchargesinterestrater,allthegridofpricesintheAMMshiftsupwardswiththesameraterwhichisdoneviaabase_pricemultiplier.So,themultipliergoesupovertimeaslongasthechargedrateispositive.

當一個穩定幣收取利息時,這應該反映在AMM中。也要反映出來。這是通過調整價格的所有網格來實現的。因此,當一個穩定幣收取利率r時,AMM中的所有價格格都會向上移動,與相同的利率r,這是通過一個基礎價格乘數完成的。所以,只要收取的利率是正的,乘數會隨著時間的推移而上升。

Whenwecalculateget_x_downorget_y_up,wearefirstlookingfortheamountsofstablecoinandcollateralx?andy?ifcurrentpricemovestothecurrentpricepo.Thenwelookathowmuchstablecoinorcollateralwegetifpoadiabaticallychangestoeitherthelowestpriceofthelowestband,orthehighestpriceofthehighestbandrespectively.Thisway,wecangetameasureofhowmuchstablecoinwewillwhichisnotdependentonthecurrentinstantaneousprice,whichisimportantforsandwichattackresistance.

當我們計算get_x_down或get_y_up時,我們首先要找的是如果當前價格移動到當前價格po的穩定幣和抵押品x?和y?的數量。然后我們看一下,如果po絕熱地變化到最低區間的最低價格,或最高區間的最高價格,我們分別得到多少穩定幣或抵押品。這樣,我們就可以得到一個衡量我們將獲得多少穩定幣的標準,它不依賴于當前的瞬時價格,這對夾層攻擊的阻力很重要。****

ItisimportanttopointoutthattheLLAMMAusespodefinedasETH/USDpriceasapricesource,andourstablecoincouldbetradedunderthepeg(ps<1?)oroverpeg(ps>1?).Ifps<1?,thenpriceintheLLAMMAisp>po.

需要指出的是,LLAMMA使用定義為ETH/USD價格的po作為價格來源,我們的穩定幣可以在掛鉤之下或超過掛鉤進行交易。如果ps<1?,那么LLAMMA中的價格就是p>po。

Inadiabaticapproximation,p=po/ps,andallthecollateral<>stablecoinconversionwouldhappenatahigheroracleprice/asiforaclepricewaslowerandequalto:

在絕熱近似中,p=po/ps,所有抵押品<>穩定幣的轉換將發生在較高的預言機價格上/就像預言機價格較低且等于:

Atthisprice,theamountofstablecoinsobtainedatconversionishigherbyfactorof1/ps(ifps<1?).

在這個價格下,轉換時獲得的穩定幣的數量要高出?1/ps的系數。

Itislessdesirabletohaveps>1forprolongedtimes,andforthatwewillusethestabilizer(seenext)

在長時間內,ps>1?是不太理想的,為此我們將使用穩定器。

自動穩定器和貨幣政策

Whenps>1(forexample,becauseoftheincreaseddemandforstablecoin),thereispeg-keepingreserveformedbyanasymmetricdepositintoastableswapCurvepoolbetweenthestablecoinandaredeemablereferencecoinorLPtoken.Onceps>1?,thePegKeepercontractisallowedtomintuncollateralizedstablecoinand(only!)depositittothestableswappoolsingle-sidedinsuchawaythatthefinalpriceafterthisisstillnolessthan1.Whenps<1?,thePegKeeperisallowedtowithdraw(asymmetrically)andburnthestablecoin.

當ps>1?時,就會有錨定的儲備,由穩定幣和可贖回的參考幣或LP代幣之間的不對稱存款到stableswapCurve池形成。一旦ps>1?,PegKeeper合約被允許鑄造無抵押的穩定幣,并且只將其單邊存入stableswap池,這樣做之后的最終價格仍然不低于?1?。當ps<1?時,PegKeeper被允許提取并燒毀穩定幣。

Theseactionscausepricepstoquicklydepreciatewhenit’shigherthan1andappreciateiflowerthan1becauseasymmetricdepositsandwithdrawalschangetheprice.Eventhoughthemintisuncollateralized,thestablecoinappearstobeimplicitlycollateralizedbyliquidityinthestablecoinpool.Thewholemint/burncycleappears,attheend,tobeprofitablewhileprovidingstability.

這些行為導致價格ps高于?1?時迅速貶值,低于?1?時升值,因為不對稱的存款和提款改變了價格。即使這部分“鑄幣”是沒有抵押的,但穩定幣似乎是由穩定幣池中的流動性隱性抵押支持的。整個鑄幣/燃燒周期在最后似乎是有利可圖的,同時提供了穩定性。

Let’sdenotetheamountofstablecoinmintedtothestabilizer(debt)asdstandthefunctionwhichcalculatesnecessaryamountofredeemableUSDtobuythestablecoininastableswapAMMget_dxasfdx().Then,inordertokeepreservesnotverylarge,weusethe“slow”mechanismofstabilizationviavaryingtheborrowr:

讓我們把鑄造給穩定器的穩定幣數量表示為dst,把計算在stableswapAMMget_dx中購買穩定幣所需的可贖回USD數量的函數表示為fdx。然后,為了保持“儲備”不是非常大,我們通過改變借款r來使用"緩慢"的穩定機制。

wherehisthechangeinpsatwhichtheraterchangesbyfactorof2(higherpsleadstolowerr).Theamountofstabilizerdebtdstwillequilibrateatdifferentvaluedependingontherateatps=1r?0.Therefore,wecan(insteadofsettingmanually)bereducingr?0whiledst/supplyislargerthansometargetnumber(forexample,5%)(therebyincentivizingborrowerstoborrow-and-dumpthestablecoin,decreasingitspriceandforcingthesystemtoburnthedst)orincreasingifit’slower(therebyincentivizingborrowerstoreturnloansandpushingpsup,forcingthesystemtoincreasethedebtdstandthestabilizerdeposits).

其中h是ps的變化,速率r的變化為?2?倍。穩定器債務dst的數量將根據ps=?1r?0?的速率在不同的值上平衡。因此,我們可以在dst/supply大于某個目標數字時減少r?0?,或者在它較低時增加。

Conclusion/總結

Thepresentedmechanismscan,hopefully,solvetheriskinessofliquidationsforstablecoin-makingandborrowingpurposes.Inaddition,stabilizerandautomaticmonetarypolicymechanismscanhelpwithpeg-keepingwithouttheneedofkeepingoverlybigPSMs.

希望所提出的機制能夠解決為制造穩定幣和借貸目的而進行清算的風險性。此外,穩定器和自動貨幣政策機制可以幫助保持價格錨定,而不需要保持過大的PSM。

Tags:THEANDICERICEtothezenithREDPANDA價格ice幣官網Pricetools

歐易交易所app官網下載
Double Earning Monday #12:Double the stable profit and High APR_GAT

Gate.ioHodl&Earnplatformiscommittedtohelpingusersgainmoreprofits.Asofnow.

1900/1/1 0:00:00
ZT將下架部分幣種_MOON

親愛的ZT用戶: 為給用戶提供更好的交易體驗,ZT會對已上線項目進行嚴格審查,根據項目下架規則,ZT決定對TUSD,GST,HUNT,LUNR,WNDR,DFA,TLOS,AQT,STORE.

1900/1/1 0:00:00
Gate.io Double No-Touch_Fortune Smiles is Listed: 100x Your Profits & Share $50,000

DurationNovember23-December1,12:00(UTC)Details:DoubleNo-Touch_FortuneSmiles.

1900/1/1 0:00:00
持有比特幣的人越來越多,你是其中之一嗎?_比特幣

小型比特幣持有者仍大量購買比特幣根據Glassnode共享的數據,自FTX交易所崩潰以來,比特幣“蝦”增加了96,200個比特幣.

1900/1/1 0:00:00
CrossTower考慮收購加密公司并成立救助基金_CRO

本文來自彭博社,原文作者:EmilyNicolleOdaily星球日報譯者|余順遂除了競購已破產的加密借貸平臺VoyagerDigital之外.

1900/1/1 0:00:00
以太坊:Vitalik Buterin提出審查區塊的解決方案_以太坊

根據鏈上數據,大約72%的合并后以太坊區塊符合OFAC標準。新提議的mev-boost功能允許驗證者最大化以太坊的審查阻力.

1900/1/1 0:00:00
ads