以太幣交易所 以太幣交易所
Ctrl+D 以太幣交易所
ads
首頁 > ADA > Info

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

Author:

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

Curve穩定幣設計白皮書的中英文參照版本,加入一些輔助理解的中文注釋,也修正了一些原版的拼寫錯誤,供大家參考學習。

Subscribe

Overview

Thedesignofthestablecoinhasfewconcepts:lending-liquidatingammalgorithm(LLAMMA),PegKeeper,MonetaryPolicyarethemostimportantones.ButthemainideaisinLLAMMA:replacingliquidationswithaspecial-purposeAMM.

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

![Figure2:Dependenceofthelossonthepriceshiftrelativetotheliquidationthreshold.Timewindowfortheobservationis3days

圖2:損失對相對于清算閾值的價格變動的依賴性。觀察的時間窗口為3天

](https://images.mirror-media.xyz/publication-images/_U6Ii9j2PLODLS07-HyTO.png?height=662&width=842)

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

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

AMMforcontinuousliquidation/deliquidation(LLAMMA)

持續清算/無需清算的AMM

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

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

Neo Smart Economy:暫停了鏈接Neo鏈的跨鏈橋服務,用戶資產安全:7月2日消息,Neo Smart Economy發推稱,幾個小時前其暫停了鏈接Neo鏈的跨鏈橋服務,用戶資產安全。團隊將與Poly Network保持密切溝通以獲取進一步信息。[2023/7/2 22:13:22]

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).Therangewheretheliquidityisconcentratediscalled?band?here,attheconstant?po?bandhasliquidityfrom?pcd?to?pcu.Weseekfor?pcd(po)and?pcu(po)beingfunctionsof?po?only,functionsbeingmoresteepthanlinearand,hence,growingfasterthan?po(Fig.4).Inaddition,let’sdefifineprices?p↓and?p↑?beingpriceswhere?p↓(po)=?po,and?p↑(po)=?po,definingendsofbandsinadiabaticlimit(e.g.?p?=?po).

這只有通過外部預言機喂價才能實現。簡而言之,如果一個人做了一個典型的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.圖3:"具有外部價格來源的AMM"的行為。外部價格pcenter決定了圍繞流動性形成的一個價格。AMM支持流動性集中在價格pcd到pcu之間,pcd<pcenter<pcu。當當前價格p超出pcd和pcu之間的范圍時,AMM要么完全進入穩定幣,要么完全進入抵押品。當pcd≤p≤pcu時,AMM價格等于當前價格p。

Bitfinex將支持Stargate Finance(STG)合約轉換:據官方公告,Bitfinex宣布將支持Stargate Finance(STG)的合約轉換,預計將于2023年3月15日進行。擬議的STG再發行旨在降低來自潛在受損錢包中非法STG轉移的風險。

Bitfinex計劃于2023年3月13日下午3:00(UTC時間)暫停STG代幣存取款。一旦合約轉換操作完成,STG存取款將在新合約上恢復。在此期間,交易不會受到影響。STG恢復存取款后Bitfinex將及時通知客戶。

請注意:Bitfinex只支持以太坊網絡(ERC-20)上的STG。[2023/3/9 12:51:41]

Figure4:AMMwhichwesearchfor.WeseektoconstructanAMMwherepcdandpcuaresuchfunctionsofpothatwhenpogrows,theygrowevenfaster.Inthiscase,thisAMMwillbeallinETHwhenETHisexpensive,andallinUSDwhenETHischeap.圖4:我們尋找的AMM。我們試圖構建一個AMM,其中pcd和pcu是po的函數,當po增長時,它們增長得更快。在這種情況下,當ETH昂貴時,這個AMM將全部轉換為ETH,而當ETH便宜時,全部轉換為USD。

Westartfromanumberofbandswhere,similarlytoUniswap3,hyperbolicshapeofthebondingcurveispreservedbyaddingvirtualbalances.Letsay,theamountofUSDis?x,andtheamountofETHis?y,thereforethe“amplifified”constant-productinvariantwouldbe:

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

Thepropertywearelookingforissuchthathigherprice?po?shouldleadtoevenhigherpriceatthesamebalances,sothatthecurrentmarketprice(whichwill,onaverage,follow?po)islowerthanthat,andthebandwilltradetowardsbeingallinETH(andtheoppositeisalsotruefortheotherdirection).Itispossibletofindmanywaystosatisfythatbutweneedone:

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

where?y0isa?p0-dependentmeasureofdepositsinthecurrentband,denominatedinETH,defifinedinsuchawaythatwhencurrentprice?p,?p↑?and?po?areequaltoeachother,then?y?=?y0and?x?=0(seethepointat?po?=?p↑?onFig.4).Thenifwesubstitute?y?atthatmoment:

BitMEX將于3月9日進行主網系統升級:3月2日消息,BitMEX發推稱,今日已經按照規劃在測試網上成功完成升級。根據此前公布的計劃,BitMEX將于3月9日(預計UTC時間00:15)在主網上暫停交易并進行相同的系統升級。[2023/3/2 12:38:17]

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

Priceisequalto?dx0/dy0?whichthenforaconstant-productinvariantis:

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

Onecansubstitutesituationswhere?po?=?p↑?or?po?=?p↓?with?x?=0or?y?=0correspndinglytoverifythattheaboveformulasareself-consistent.

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

Typicallyforaband,weknow?p↑?and,hence,?p↓,?po,constant?A,andalso?x?and?y?(currentdepositsintheband).Tocalculateeverything,weneedtofind?yo.Itcanbefoundbysolvingthequadraticequationfortheinvariant:

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

whichturnsintothequadraticequationagainst?yo:

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

Inthesmartcontract,wesolvethisquadraticequationinget_y0function.

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

Whileoracleprice?po?staysconstant,theAMMworksinanormalway,e.g.sellsETHwhengoingup/buysETHwhengoingdown.Bysimplysubstituting?x?=0forthe“currentdown”price?pcd?or?y?=0forthe“currentup”price?pcu?valuesintotheequationoftheinvariantrespectively,itispossibletoshowthatAMMpricesatthecurrentvalueof?po?andthecurrentvalueof?p↑?are:

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

摩根大通加密錢包已在美國成為注冊商標:11月21日消息,美國商標律師Mike Kondoudis發推稱,美國專利商標局已于11月15日批準摩根大通申請注冊的J.P. MORGAN WALLET商標,涵蓋虛擬貨幣轉賬與兌換、加密支付處理、虛擬支票賬戶和金融服務。[2022/11/22 7:53:54]

WewillusetheseresultswhenevaluatingsafetyoftheloanaswellasthepotentiallossesoftheAMM.

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

Nowwehaveadescriptionofoneband.Wesplitallthepricespaceintobandswhichtoucheachotherwithprices?p↓?and?p↑?sothatifwesetabaseprice?pbase?andhaveabandnumber?n:

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

ItispossibletoprovethatthesolutionofEq.7andEq.5foranybandgives:

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

whichshowsthattherearenogapsbetweenthebands.

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

TradesoccurwhilepreservingtheinvariantfromEq.1,howeverthecurrentpriceinsidetheAMMshiftswhentheprice?po:itgoesupwhen?po?goesdownandviceversacubically,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”.

互換市場完全定價美聯儲在接下來兩次會議將累計加息150個基點:金色財經報道,互換市場完全定價美聯儲在接下來兩次會議將累計加息150個基點。(金十)[2022/7/13 2:11:11]

當用戶存入抵押品并借入一個穩定幣時,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是不太理想的,為此我們將使用穩定器。

AutomaticStabilizerandMonetaryPolicy

自動穩定器和貨幣政策

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

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

Theseactionscauseprice?ps?toquicklydepreciatewhenit’shigherthan1andappreciateiflowerthan1becauseasymmetricdepositsandwithdrawalschangetheprice.Eventhoughthemintisuncollateralized,thestablecoinappearstobeimplicitlycollateralizedbyliquidityinthestablecoinpool.Thewholemint/burncycleappears,attheend,tobeprofitablewhileprovidingstability.

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

Let’sdenotetheamountofstablecoinmintedtothestabilizer(debt)as?dst?andthefunctionwhichcalculatesnecessaryamountofredeemableUSDtobuythestablecoininastableswapAMMget_dxas?fdx().Then,inordertokeepreservesnotverylarge,weusethe“slow”mechanismofstabilizationviavaryingtheborrow?r:

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

where?h?isthechangein?ps?atwhichtherate?r?changesbyfactorof2(higher?ps?leadstolower?r).Theamountofstabilizerdebt?dst?willequilibrateatdifferentvaluedependingontherateat?ps?=1?r0.Therefore,wecan(insteadofsettingmanually)bereducing?r0while?dst/supply?islargerthansometargetnumber(forexample,5%)(therebyincentivizingborrowerstoborrow-and-dumpthestablecoin,decreasingitspriceandforcingthesystemtoburnthe?dst)orincreasingifit’slower(therebyincentivizingborrowerstoreturnloansandpushing?ps?up,forcingthesystemtoincreasethedebt?dst?andthestabilizerdeposits).

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

Conclusion/總結

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

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

Tags:THEANDICEINGethereum-classicWallkandaRICEShopping.io Governance

ADA
觀點:用戶體驗并非阻礙Crypto大規模采用的主要原因_NEAR

用戶體驗最常被認為是加密貨幣被"主流采用"的常見障礙。這一連串的問題是這樣的:Gas費很奇怪而且不直觀,"MATIC到底是什么?"。非人類可讀的地址,"0x...字符串到底是什么?".

1900/1/1 0:00:00
SocialFi的未來:數據所有權、更公平的價值分配和行為數據的價值化_WEB

SocialFi是當下最為熱門的Web3敘事之一。不過,需要注意,目前SocialFi的使用者大多的參與動力是空投預期。與其說他們是SocialFi的參與者,不如說他們是加密空投的「投機者」.

1900/1/1 0:00:00
穿越牛熊的mfers:反脆弱性、文化即效用、無為而治。_FER

熊市躺平之余,終究忍不住想build一下,不會寫代碼,就寫寫文章吧。為什么要寫mfers呢,因為mfers是我的第一個nft,就像初戀,人生至美是初見.

1900/1/1 0:00:00
零知識證明網絡:一種自頂向下方法_ARK

導語 本文不重在講述ZK技術的技術細節,而在于盡可能多的描繪ZK的應用方向,ZK技術的迭代仍在持續進行中,但是技術的落地需要應用來承載.

1900/1/1 0:00:00
觀點:Web3 創作者經濟需要深度而非廣度_WEB

過去與現在 大家普遍對創作者經濟走過Web1和Web2、邁進Web3的理解是:從只有OGC到PGC到增加UGC,從少數資源主導到互聯網大眾平臺主導到去中心化,從觀看者到參與者到擁有者.

1900/1/1 0:00:00
解讀Curve穩定幣:可提高協議收入,減少借貸清算帶來的負面影響_CRV

去中心化穩定幣賽道市場廣闊,但大都“創業未半,而中道崩阻”,曾經數百億美元市值的LUNA和UST也在短時間內歸零。如今,坐擁37億美金TVL的Curve也開始加入競爭.

1900/1/1 0:00:00
ads