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

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

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:社區提出建立WBTC/sBTC Base Pool提案:金色財經報道,Curve發布公告稱,由于Ren v1版本即將下線,社區提出建立WBTC/sBTC Base Pool的新提案并已啟動投票。[2022/12/4 21:21:20]

這只有通過外部預言機喂價才能實現。簡而言之,如果一個人做了一個典型的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:

Uphold獲批收購美國經紀交易商JNK Securities:金色財經報道,加密貨幣支付處理器和交易所運營商Uphold已獲得美國金融業監管局(FINRA)批準以收購經紀交易商JNK Securities。此次收購的目的是允許Uphold在今年晚些時候在美國發行部分股票,同時為用戶提供一個在加密貨幣、股票、碳信用、貴金屬和其他資產之間進行交易的界面。[2021/4/1 19:34:26]

我們也可以表示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。它可以通過解決不變量的二次方程來找到:

數據:Curve近24小時交易量環比上升124.05%:據歐科云鏈OKLink數據顯示,截至今日18時,以太坊上Dex交易量約合4.75億美元。其中交易量排名前三的分別是Uniswap V2 2.25億美元,環比上升6.48%,Curve 0.68億美元,環比上升124.05%以及0x 0.38億美元,環比上升26.71%。[2020/11/13 20:44:57]

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:

動態 | Capital Global Securities涉足加密領域 將向NYCQ基金注資1000萬美元:據NewsBTC消息,總部位于舊金山的美國Capital Global Securities宣布涉足加密貨幣和區塊鏈領域,將向CityBlock capital推出的私人數字風險投資基金NYCQ Fund LP注資1000萬美元。[2019/7/29]

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”.

動態 | QuarkChain與韓國證券公司NH Investment&Securities達成戰略合作:據QuarkChain(QKC)官方推特,QuarkChain與NH Investment&Securities簽署了基于QuarkChain開發的數字資產管理服務的合作備忘錄,將為后者提供技術支持。NH Investment&Securities是韓國最大的證券公司之一,管理資產凈值為2200億美金,業務范疇涵蓋財富管理、投資銀行、經紀和商業銀行業務等。[2018/9/13]

當用戶存入抵押品并借入一個穩定幣時,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:THEANDICEPRITHEKEYcandy幣官網justice幣值得投資嗎Princess Striker Gem

fil幣價格今日行情
專訪Acala聯合創始人:回應平臺恢復情況和未來計劃_ACA:CAL

自?8月14日的aUSD錯誤鑄造事件已經過去了三個多月,前不久,Acala在社區直播中闡述了該事件的經過和原因。在這段時間里,Acala團隊采取了各項平臺恢復措施.

1900/1/1 0:00:00
哈亞火山HOTV,一個比Shib更加純粹的MeMe._REN:SHIB

回顧上一輪牛市,大家肯定對Shib這個八個月漲了幾十萬倍的MeMe印象深刻。有人從中一幣暴富,有人踏空惋惜不已,當然還有一些在Shib二級市場新高的時候,一邊高喊「Shib不辜負所有人」一邊猛沖.

1900/1/1 0:00:00
Gate.io 啟動1億美元行業專項流動性扶持計劃_Gate.io:HTT

Gate.io是目前行業最大的現貨幣對資產交易平臺,全球現貨交易量Top3,全球用戶超過1200萬。作為穿越多輪牛熊的大型資產交易平臺,Gate.io有信心和責任助力全行業重振信心.

1900/1/1 0:00:00
硬件錢包實用手冊 盤點:安全便捷玩轉加密應用_ONE:KEY

隨著FTX事件的持續發酵,多個平臺提幣困難,中心化加密金融設施迎來一波嚴重的信任危機。比特幣開源區塊鏈專家AndreasAntonopoulos的那句「Notyourkeys,Notyourcr.

1900/1/1 0:00:00
Polygon (MATIC) 能否在 2023 年飆升?_LYG:POLY

2022年,Polygon(MATIC)是加密貨幣市場中與星巴克、迪士尼和Nubank等重要公司合作最多的網絡之一.

1900/1/1 0:00:00
Akula創始人稱加密風投Paradigm抄襲其代碼_DIG:AIG

11月26日消息,以太坊客戶端Erigon近日宣布不再支持Rust版本Akula,因為近期發現一個基于Rust語言的Ethereum實現將開放源代碼,其范圍幾乎與Akula相同.

1900/1/1 0:00:00
ads