ERC-7527: Token Bound Function Oracle AMM

PEEPanEIP · 7 Mar 2025 · 52:08

Lanyin Zhang presents ERC-7527, a standard with interfaces that wrap fungible tokens into NFTs and unwrap them again through an embedded function oracle automated market maker. The episode covers on-chain pricing, the economics paper behind the design and use cases such as WrapCoin and PremiumDAO. It is an episode of the PEEPanEIP series hosted by Pooja Ranjan.

Speakers

Topics

From PEEPanEIP, hosted by ECH Institute.

Transcript

you probably need a some sort of tokenization with financial abilities Community engagement can be fostered with ERC 7527 as well it is permissionless so everything is onchain I believe this EIP would bring like more liquidity or even more self-provided liquidity [Music] [Music] hello and welcome back to Peep and your

goto podcast for deep dives into ethereum's latest proposals and Innovation most of us know about nfts and defi but have you ever thought about nft liquidity automated pricing and seamless defi integration is there a standard that Bridges the gap between these words let's find out [Music] this is peep anep episode 144 brought to you by EC Institute I'm your host Puja ranjan and today we are exploring ERC 7527 token bound function Oracle emm documented in September 2023 this ERC is in draft status to break it all down we

are joined by Lon Jang one of the co-authors of the proposal welcome L hello I see that this proposal has the potential to attract both nft and defi users which represent a significant portion of the blockchain community I'm really excited to learn more about this ERC but before we dive into the details could you start by sharing a bit about yourself your professional background and your involvement in the ethereum ecosystem yeah of course so I'm one of the main author of ERC 7527 and a core member of Premium D so ERC 527 builds upon the

fundamental work and insights from premium Dow and our community members whose contributions were instrumental in developing the concepts that LEDs to year season 5 27 our collect efforts in exploring and developing premium token mechanism helped shape the core idea presented in the standard here today USC 7527 so personally I'm a researcher and protocal designer in decentralized incentives with background in both economics and computer science my path has been like shaped by a deep interest

in economics Theory and in practical applications of the economic theories while pursuing an economic track towards a PhD I discovered the transformative potential of blockchain and smart contracts I started to engage with ethereum community and this led me to a pivotal decision to apply my economic P perspectives to the emerging field of defi so after engage with like the ethereum community and learn more about eips I started to dive deep into the smart contracts and also Hons for example like East Global and other like

East Denver hexons and events and conferences after that I became a founder of Agent B and rcoin so rcoin was based on ERC 7527 and agent ball is more like a economic infra for AI agents which also like engage something with your CM 527 like use the idea of B that is pretty interesting introduction thank you for sharing I'm already seeing an implementation as you are leading the project which has this particular implementation for ERC 7527 so yeah I'm super excited to learn more about it I understand there is a

presentation so without further Ado let's peep in let's get started so today I'm going to introduce foam f amm that's token Bond function Oracle so this is an abstract and overview of ERC 7527 it outlines interfaces for wrapping ec20 or E into USC 721 and unrep the IRC 721 to erc20 or the it's a underlying asset a function Oracle feeds like mint or burn prices based on an embedded

equation of function Oracle like with automated Market maker which executes and clears the mint and burn of nmts and the graph here displays the structure for a user what is the use use of ERC 7527 so you can input erc20 token or E into the um foam and then the foam would get price feed from the function Oracle and then it will mint a ERC 721 for you and if you want to burn this nft by

destroying it the function Oracle will also feed a price and you get to unwrap them into erc20 tokens or E tokens so the motivation behind it is like liquidity problem as we all know like the industry of crypto is about liquidity so liquidity can be a significant challenge in decentralized systems like this especially for Unique or less commonly traded tokens like n FS so to foster a trustless nft ecosystem the motivation behind function Oracle automated Market maker is to

provide automated onchain pricing solution for nfts with liquidity through transparence more contract mechanisms so let me explain more about the motivation that it is not just to prevail liquidity for nft is more about creating a new mechanism to provide a onchain pricing Discovery mechanism for different applications so they can use nft as a proof of something like proof of their work or proof of any premium so it's not

just about like Identity or just about artwork it's more about premium and the liquidity enhancement allows it to have um more financial identity so that the nft can engage with more like Landing protocols and defi protocols these kind of financial instruments in defi so let's have a overview of onchain asset pricing first so there are three main kinds of on chain pricing mechanism for right now the first one is automated Market maker which utilize the formula of x yals to K gaining the most

consensus employed by Unis Swap and the second one is the bonding curve mechanism it directly codes based on factors such as Supply with examples including like curve and pumped off on and the the third one is auction based mechanism this may not sound as like popular as the previous two but it is very common actually notable examples includes GDA and VR GDA referring to paradigms work so first amm curves amm curves commonly in the form of x * Y = 2 K where X refers to the balance of like s

set X in the pool and Y represents the balance of s y in a pool K is the constant that is when you perform a swap the amm would make sure that like new x times New Y still equals to the constant K so it has a lot Advantage like for example as most commonly used swap solution it has strongest consensus and secondly for erc20 exchanges the amm curve solution is currently like the best solution however amm curve has significant drawbacks including like LP

problems so for LPS of the amm curve they face several issues for example source of liquidity providers for newly issued tokens I mean the token isser must provide initial liquidity to ensure users to have enough liquidity to do the exchange ensuring the source of subsequent liquidity is challenging and the third party liquidity provide providers or even token issuers might withdraw LPS leading to the rapid loss of liquidity in amm pools and management of liquidity is also a problem such as the impermanent loss this makes LP

management a complex task moreover like me attack also results in losses for Vari participants the most malicious MVB attack on amm curve is the sandwich attack any transaction without slippage settings is like vulnerable to sandwich attacks resulting in like significant asset losses for users so next Bond incre It generally includes like the following parameters Supply token issue token and the curve the supply token is like the underlying token of the bonding curve pool for

example e probably etherum generally users are allowed to use Supply token to purchase issue tokens from the pool in some cases it can work like in reverse like allowing users to solve their issue tokens back to the pool and exchange for the supply token the supply token is typically like a fible token and for the issue token it can be like funable token or non funable token but like most commonly still like funable tokens it is the other type of token that users can purchase using the supply token and calculate it according to to the curve

the curve is the most important thing for the bounding curve it determines the price and some applications uses a single curve to like both the buy and sell prices While others use like more complex mechanism where buy and sell prices follow different curves the spread between these prices effectively act as a transaction tax compared to amm curve pricing mechanism the biggest advantage of the bonding curve is that it does not Ray on initial liquidity the token issuer does not need to prepare a large amount of liquidity but can directly issue tokens relying on user

injected liquidity to maintain the price this is extremely beneficial for so-called curation markets curation markets were like one of the early discussion topics on ethereum aimed at like allowing groups to co coordinate more effectively and profit from the value they co-created toward a common goal for bonding curves the largest problem is that tokens are unable to operate for long periods due to overly mechanical rules for for applications or on the apps they use curves do their

token insurance or facilitate their application it can have the problem of like the two transparent curve caused the early participants to have significant gain and later on many BS participate early to like claim the part that's early partici ipants could have gain and then exit later so Bots can like extract a lot of value which caused the losses of the midterm participants for like pump off fund this problem also exists but pump off fun

creatively used like bonding curves only as an like early LP F raising tools which to the amm model for trading later they this approach approach uh reduced the impact of mechanical curves to some extent I guess yeah and auction mechanisms auctions are like also a common pricing mechanism suitable for any as said due to its great ability due to technical issues we generally do not conduct like sealed auctions on chain typically we just use Dutch auction and English auction

that auction is the most commonly used auction of blockchain actually aset is auctioned like starting from a preset highest price and the price gradually decreases over time until the deal is made an English auction is that during a fixed period the price of the asset is gradually decreased and the highest price in the end would win like the auction winner is who gives the highest price and then GDA can be used for both fundable and non-fungible token

Insurance characterized by like completing all token inssurance with a single launch without like needing the issuer to manually start each token auction the principle is to initiate auction s for all issue tokens at different starting prices upon Insurance compared to like GDA VR GDA incorporates a Time Factor allowing the token issuer to set a token release curve if the token issuer exceeds the expected release curve VR GDA will increase the

price to curve demand conversely it will lower the demand to like increase in demand for both GDA and VR GDA they are primly used for Assa issuance but they also have significant issues like users tend to wait for uh lower prices as time goes on when all users choose to wait the asset price continuously declines in fact GDA and VR GDA can be seen as variants of bonding curve mechanism which does not solve the problem of bonding curve while losing

the secondary Market functionality overall GDA and VR GDA only solve the primary Market issue without addressing the secondary Market problem after the auction ends the token issuer can choose to place the auction assets into like amm Market however more likely the issue with conductor soft R seing to promote the project for auction participants the acquired asset like liquidity and the asset pricing is relatively unrealistic all right let's introduce USC

7527 IRC 7527 system consists like three following parts here as you can see App Factory and agency so Factory is something that deploys app and agency is a pool for a like reserving assets a pool and a vault the agency continuously provide like buy and sell quotes based on the internal functions that is pH when a user accepts a buy Cod they can deposit and then like deposit the

pre-specified assets for example the fo G gives a price to the agency and user can deposit that part of year C20 or E into the agency then the a like the app will minant a nft for the user this action is called rep similarly if you want to unrap you just like come to the AP and burn the nft and the agency will give another price from the foam then give back the year C20 and E to you that's a process of unwrap so app here is asset type that inherits from

nft and due to like the guarantee from the agency it provides the liquidity backed by agency and form this kind asset can always maintain its like liquidity if you don't understand for right now it is not a problem and I'll introduce more technical detail later and um this is also a introduction so let me explain a little bit more about the key concept here the first one is wrap so WP is basically kind of like the simplest solution to use the your cm5

27 it's like similar to a bonding curve the foam are within the agency and people can like the users can use rra function to call the foam to give a priz code and then later on perform like rep action however this solution does not solve the problems inherent in like bonding curve here we employ a more interesting function to incorporate user Behavior into the final quote results the specific function used in the um

foam would depend on the price of the last transaction and the time difference between the current and previous transactions that is if you let's use the example of the graph here if you want to W at this point at a like early point you will have a low price however if more and more people gets to rep then the price would go up however if people AR rep the price would go down so it's a dynamic pricing system that allows more

variety of pricing rather than you just use the bonding curve to eliminate the factor of time we are incorporating the time factor to perform a more Dynamic price Discovery so for the on rep mechanism here our implementation use a like deck like function with like the last appended price in the stack would pop first at the unwrap price that is basically l in last out let's get into more details into the

specifications so for the asset in the EIP we structured it as like with five parameters currency premium fee recipient mint fee percent and burn fee percent so that's basically you need to First Define a type of currency that is either you give a address of erc20 like the contract address or just use the zero as it and the premium here is basically the base premium that is the starting point of your auction so

the price the the function will the foam would allow the price to go up and then go down during one single time period that like between the last transaction and the next transaction and the premium here determines the very initial price starting from from where and for from the next transaction the price would depending on like the previous transaction and the fee recipient is like obviously an address of someone who's receiving the transaction fees and

you can give % for both mint and burn functions on the left hand side is the like graph of ERC 7527 so you have a factory and the factory can deploy agency and like the AP and the AP would um issue ERC 7527 token here and for a normal user they will interact with the agency to wrap and unwrap and the agency have the foam we just talked about inside and given the price and then mint

and burn nft so these are the major functions with here like rep and on wrap rep is taking like an address tool that is if you rep you will receive a nft and the parameter will cast in here and they can also have some data from the user and if you want to unwrap you also have a address too that is where you can like receive the e or year C20 from the

agency and then you must also provide the token ID to specify which one like ERC 21 token are you going to destroy are you going to burn and then function guess strategy here on the strategy includes the ability that foam can perform you can Implement a form yourself and you can write a description here to specify your strategy so guess strategy will allow people to see your strategy and get what you are implementing with the phone and here get

on rep Oracle and get rep Oracle are two specific functions that you can like get the information from the the Oracle returning the price and fee of unwrapping and this one Returns the price and fee of wrapping that's basically during like function call like the other function can call this function to get the prizes and then use the price to implement them into and burn burn here mint here and this is a structure for a so the a is the major one for dealing the USC

7527 token s token part so it has major function to Mint and burn the token and they will be sent to the person who meant like the address who minant this token and also burn the specified token here can set agency that's how you Bond the A and agency they are like meant to be bond together so like we are guaranteed the security of the funds and your liquidity so you can make sure that the the money are going to the right

rout right agency by like setting the agency and you can get agency to check which agency is bond to the a like this contract and you can also get name and Supply these basic information from here yes and more about settings these are more settings about agency settings you have to have things like asset type and some data and also the implementation address and also some data in the a as well so for the factory you need some

information to deploy agency and AP and that's how you can use Factory to to implement these two and Factory is actually uh optional so it is fairly possible to implement just agency and AP however it it would be very convenient to use Factory to like write a factory contract and to deploy agency and a so advantages of ERC 7527 so the first one is you get full liquidity by like assets are guaranteed

with wrap and on Wrap guaranteed with on wrap so first you wrap rate and secondly you can unwrap directly from the VA and calculated by the foam so you do not need to interact with a secondary Market to sell your nft to anybody else by for example listing on openc it's just like you can interact with the pool and sell your nft by just burn it to the A and agency and the funds will get back to you and here self-provided liquidity also like saying that the liquidity are

within the smart contract so the fonds are locked in the agency VA and you are not going to worry about your funds are like extracted by any liquidity providers so the liquidity provider role or the user row are kind of similar like the same in this kind of setting everyone plays the same game and people will need to uh wrap and unrap to interact with the smart contract and if you want to stake it you do not need to move the funds in

the agency rather you can use like smart contract communication to do the proof we have another EIP about communicating different smart contracts and but here we just like talk about like agency you can get information from this contract instead of you need to use the fund or move the fund to other for example custodial contracts and it meets Community interest because users involved in wrapping from a community driven by

economic interest promoting the development of relevant agencies that is when users have that is when users have year C 7527 tokens they are naturally bonded with the agencies or the idea or the concept or the entity related to this token and if more and more people join the price will naturally goes up and they have the incentive to um be align with the agency instead of just selling the token or just dumping their

their tokens so this Foster a community by having nfts and creating a bond between the communities and moreover the dynamic Game Theory allows people to engage this healthy mechanism like they can use play with the auctions mechanism like they can trying to find a good point to buy however they will not wait until the last minute to let the price go down because people can like buy at the some at some point of the price is rising so

there's more interesting things happening here with the dynamic game series design instead of just bonding curve you know the price would go up later on definitely yeah and you know exactly how much percent it's going to goes up if you are experienced with the same Bond and curve this captures the formal if more people get to wrap and price would go up quickly like more quickly than you thought probably so there can be more applications and use cases of ERC 7527 for example tokenize intangible assets like there are more kind of

assets that can be tokenized on chain however there's no pricing mechanism for them but if you have a some sort of concept not like mcoin like just a a like something you can have engage with and you want a identity system for example you are creating an AI agent and you want people who engage with the AI agent to have a token to display their Identity or you want the AI agent themselves to have like identities you probably need a some sort of

tokenization with uh Financial abilities previously we only have nft however nfts are not great as for financially for for integrating with other Financial tools other like defi tools usually only engage withc 20 however withc 7527 all can be possible like all in one token many previous Solutions are using like fragmentation of nfts however these makes nft into breakdown into like erc20 losing a lot of like original nonf

fundable features of nfts and next the community engagement so nft has a natural like Community engagement ability for example we can see like that many nft communities have very strong like uh emotions and bondings because they have a prove of themselves as identity using them as Avatar Community engagement can be fostered with ERC 7527 as well it can also like help our works to do financialization like tokenization and also build up their IP

and public relations so one of the use case we have explored is rcoin rcoin is a peerto pool automic premium system on ethereum launched on ethereum in June 2024 and rep coin offers like a normal novel approach to like premiums eliminating the need for third party liquidity founder parties custody or permission it integrates token inssurance price prediction and liquidity quantifying and forecasting economic activity through token Dynamics this

represents a dynamic paradigm shift in decentralized economy offering a streamlined and efficient model so rcoin can transform like maybe programable assets into Allin one ERC 7527 tokens including ining AI agents payment accounts game assets and more yeah that's one of use case we've exp for and all about year C7 527 this was a great presentation lion I really appreciate you taking out time to explain it in in detail I think it's

somehow help people who may not had a look on the EIP the documentation that you have done but this was great you explained so many things the existing challenges key terms M attack uh and the issues that this particular proposal is trying to [Music] solve I have a few followup questions I understand this the basic concept revolves around wrapping and unwrapping of token and the proposal suggest just that we do it with erc20 or even with e talking a little bit more on that I'm

trying to understand because rap coin is one of the use case here I'm trying to understand like how this rrap coin or the use case of this proposal is any different than the custodial wallet provider there also we give our token keep it there and we can take it out after a period of time and we get the Justified difference of rates in there so why people should use this one this is a like non-custodial system so first of all it is permissionless so everything is like on chain so in a like custodial system maybe you can also like see your

transaction from this this address to this address but once the funds are in their wallet you don't know where it's going actually for instance if you are like making custodial like purchase of token then you are probably don't have a ability to trace back the token if the part the third party soft Ruck or just basically rug however if in this case this system does not require a certain SE party to build a website or build a application or even build a front end

for you if you are a programmer you can directly interact with this protocol and this is on ethereum and nobody can like change it because it is not upgradable and no one has access to for example like the the agency so if you are have have the ability you can even do a front end based on it so that people can use this is permissionless and we believe the openness code and smart contract have great influence on future um projects and applications because when

open source or permissionless happens more opportunities and more inspir ations is going to spark up based on this this seems like a great tool for people who may have coding abilities or understanding of the contract I really hope that one day someone come up with an app or maybe a project and may be able to provide the apis for people who have less understanding of smart contract but may be able to make use of this proposal it seems really good to secure our Fund in a way that we hold the keys I mean in in a custodial way

and that to on ethereum great work on that side that's a good point and we find out that one of the problem is that you have to need to like cod to interact with the smart contract however if we are implementing tools with AI and you can use natural language to directly say I want to rep and you just interact with the smart contract this could be fantastic and we are trying to build this very good application here a little bit related question but different because we are talking about more than a users or an individual's fund how does

ERC 7527 integrate with defi protocol like dexes or any lending platform and also maybe if can help with the fractionalized nfds so with defi protocol we have a another like ERC 7615 this is another like EIP implemented to solve the problem that funds are locked in the agency however we can still use a communication mechanism to get update of the fund so that you can use the fund to take like

St in other places and integrate with other defi like protocols so it is possible to use like push or or like communication mechanism to communicate the Vault here in year CM 521 and to integrate with other like defi uh protocols by giving like sending out broadcasting the information here to the Defi and then basically you can like use defi protocols generate yield or do Landing stuff that's the way you did it so it's probably like you deposit some

money into the bank and you got a deposit you got a check and you do not move the money and you just use the check to other places as I have have this money and I want to get some like Landing or interest and they can use this as collateral so that's the way it works very interesting so the proposal 7615 that you mentioned about the communicating between different smart contract it would not only help with defi but I think this communication could be used for many more use cases in the blockchain ecosystem yeah and it is very similar to SP like unisp vforce hook it's also like once some event

happening on the chain and the event would like tell basically communicate to other smart contract and they can use the information from this event very interesting defi has unlimited possibilities I think people like you who are adding more the standards making it even more interesting to follow well one question that always comes to mind whenever we are talking about money defi token is about security what security measures are in place to prevent manipulation reeny attack and Oracle exploit for the security concerns as this is a open standard we do not have

very strict method to like check everyone implemented year C 7527 must have this but we would warn people to check if like agency and a are bonded so if someone like maliciously Implement like agency like wrongly or have a interface that people can upgrade it that's probably a sign that it is dangerous and people should be be aware of that agency and a should be like bonded to ensure the security and they

should be in a state that not upgradeable or in a very open way I trans like I mean they should have a open source of um the code to check if there is malicious implementation of the agency and AP I'm not sure if all projects undergo any kind of audit but I think in this case it may be required just to ensure that the implementation is done in the right way and not in a way to commit fraud this is like erc20 there are a lot of malicious year c20s and there are a lot of ec20 Security checks projects are doing for example

onchain security checking and like proactively checking the security of the project so when you implement erc20 or year c721 or year C 7527 they are the same you need to be aware of it is possible people are coding maliciously have their own implementations very true It's always important to be careful and the project has to be audited I mean if if a user can ensure that the Project's audit report is made public and then engage with that kind of projects very true yeah very well uh looking ahead if you

have to summarize what kind of impact do you think ERC 7527 will bring to the nft Defi and brother ethereum adoption I believe this EIP would bring like more liquidity or even more self-provided liquidity on chain it's crypto native rather than located anywhere off chain and custodial so it's a progress to go more fully on chain and it is a exploration of how we can Implement nfts as um premium token or as the token that

you can use in different scenarios with more interrup ability so I mean is an experiment of fully onchain standard and is it is a Improvement of full liquidity and self-provided liquidity and it engage with more Dynamic Behavior or user behaviors it's welcoming more user interaction rather than just one line of implementation of code it's a dynamic system rather than a like static thing on CH very interesting I hope many new

implementers come around and come up with different ideas different use cases I look forward to get some big changes with these kind of proposals thank you yeah well uh that brings to the end of the question answer session however we do have another section which is called Rapid File [Music] round in this round we try to share a few questions for which you can respond in just one word or a sentence uh this is just made for entertainment purposes so please feel free to speak your heart if you're ready we can perhaps go ahead

with that I mean everything on here all right so let's started biggest challenge in nft adoption liquidity what makes an nft unique compared to an erc20 token identity name one key advantage of decentralized Finance over traditional Finance permissionless your favorite nft Marketplace open C in one word what is the main goal of defi equality if your ERC had a theme what would it be called Dynamic would you rather pay, guay in

gas or explain amm to your grandom explain amm to my grandom what's the weirdest thing you have seen tokenized on an nft nothing weird actually NF is cool if you could rename blockchain to something cooler what would it be I think blockchain is like really good name it's another interesting one if vitalic butterin were to comment on your ERC what would you want him to say great Implement awesome very well uh that was the end of the question list here sounds good well that brings us to the end of

today's episode it's been a great discussion about ERC 7527 and how it could improve nft liquidity and Def integration a big thank you to you the author of this proposal for joining us and sharing your inside with us people if you want to learn more about ERC 7527 please check out the links in the description and I would also like to thank everyone who participated to my colleagues at e especially Akash and wiing for helping putting this episode together and of course thank you for listening if you enjoyed this episode don't forget to subscribe and share with your fellow ethereum Enthusiast until

next time keep exploring keep building and keep pushing ethereum forward this is Puja ranan signing off