<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rafael Cosman on Medium]]></title>
        <description><![CDATA[Stories by Rafael Cosman on Medium]]></description>
        <link>https://medium.com/@RafaelCosman?source=rss-fe4e577e86e2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cfe7W1cEVyohMcLk4jdUfQ.jpeg</url>
            <title>Stories by Rafael Cosman on Medium</title>
            <link>https://medium.com/@RafaelCosman?source=rss-fe4e577e86e2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 21:27:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@RafaelCosman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Postmortem: tfUSDC Price Irregularity]]></title>
            <link>https://medium.com/@RafaelCosman/postmortem-tfusdc-price-irregularity-c949cf35fe4d?source=rss-fe4e577e86e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c949cf35fe4d</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Rafael Cosman]]></dc:creator>
            <pubDate>Wed, 11 May 2022 10:43:03 GMT</pubDate>
            <atom:updated>2022-05-11T21:55:00.707Z</atom:updated>
            <content:encoded><![CDATA[<h4>Review of TrueFi’s DAO Pools token pricing methodology that exposed tfToken holders to limited arbitrage risk</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Dgm56-CC4CDj8LwR" /></figure><p><strong>In summary</strong>: On April 27th, 2022, a member of the <a href="https://www.apwine.fi/">APWine</a> team reported a drop in the price of tfUSDC, the LP token of TrueFi’s USDC DAO portfolio. After some internal investigation, we determined that this was due to an issue in the way these portfolios interpolate loan value.</p><p><strong>No principal funds were at risk of loss</strong>, although the price reporting discrepancy resulted in a potential arbitrage opportunity centered around loan repayments which could have affected tfToken (tfUSDC, tfTUSD, tfUSDT, tfBUSD) holders.</p><p><strong>At this time, this arbitrage opportunity has been closed with an interim fix</strong>. After extensive review, a plan involving a contract upgrade is in the works. This post will be updated once this mitigation is live.</p><p>A necessary <strong>pause to protocol fees</strong> will mean TRU stakers will not enjoy tfUSDC rewards for loan repayments until a final fix agreed on by the community, developed, audited, and deployed. There is no interruption to TRU incentives for stakers, however, currently +20% APY.</p><h3>In Simple Terms: Irregularities in tfToken Price Calculator</h3><p>tfTokens represent a lender’s claim to the principal and interest in TrueFi’s DAO portfolios, which lend the USDC, USDT, TUSD, and BUSD stablecoins to reputable crypto funds. Using USDC as an example, when a USDC loan goes out, the value of tfUSDC increases gradually until the repayment date to reflect the interest generated by the new loan, minus a protocol fee that goes to the treasury. This code has been working as written and performing as intended, but it introduced noticeable price irregularities as large loans began to introduce large protocol fees.</p><p>To date, tfUSDC would go up in price over the span of the loan to reflect the incoming interest payments, ignoring the protocol fee until the repayment date. This meant the protocol fee would hit tfUSDC all at once. Especially large loans, the type of which TrueFi is increasingly making in these pools, could temporarily push short-term tfUSDC yield into the negative. Though no principal was ever at risk, this fluctuation created a limited arbitrage opportunity on tfTokens that could have affected the expected yields enjoyed by TrueFi lenders.</p><p>While a solution that would calculate the protocol fee on loan origination and spread out its cost smoothly to tfTokens over the full term of each loan has been proposed, we believe it’s imperative to involve the community in having a voice in changes to the protocol.</p><p>Before the fix is audited and deployed, a temporary solution has been to pause the protocol fee across all DAO pools. This immediately eliminates the arbitrage vulnerability, but will mean <strong>TRU stakers will not enjoy tfUSDC awards on loan repayment until the final fix is live.</strong></p><p>It’s important to note unsecured lending on TrueFi carries risks commensurate with the competitive yields. Besides protocol fees, tfToken price may go down due to other causes like defaults or penalties. Though the tfToken pricing code was working as written, its design now needs to be upgraded for the scale of TrueFi today.</p><h3>Deeper Look: DAO portfolio follows standard share price</h3><p>Assuming no defaults and no idle fund strategy, the total TOKEN value of a tf{TOKEN} DAO portfolio is calculated as</p><blockquote><em>total value = liquid value + illiquid value</em></blockquote><p>where liquid value is mostly the TOKEN balance held by the DAO portfolio, and illiquid value is mostly the sum of values of outstanding loans:</p><blockquote><em>illiquid value = sum(loan values)</em></blockquote><p>Disregarding liquid exit fees, when a lender joins or exits a portfolio, their underlying TOKENs are exchanged for tf{TOKEN}s (or vice versa) at a common share price of:</p><blockquote><em>share price = total value / total supply</em></blockquote><p>Notably, this means that lender actions (joining and exiting) should not materially affect share price. Only borrower actions (e.g., paying back interest or defaulting) should affect the share price.</p><h3>Loan value is linear over a loan term</h3><p>We calculate the value of a single loan as if it increases in a straight line, block-by-block, over the loan term.</p><p>At the beginning of the loan term, the loan value should be principal. At the end of the loan term, the loan value should be principal + interest. At any time between 0 and term, the loan value is given by</p><blockquote><em>loan value = principal + interest * time / loan term</em></blockquote><p>Under ideal repayment circumstances, these endpoints ought to line up perfectly with principal TOKENs transferred to the borrower and principal + interest TOKENs returned from the borrower. This would present no discontinuities in the overall portfolio value over time.</p><p>Having no discontinuities is great, because a sudden jump or drop would be an opportunity for arbitrage. If a sneaky lender could predict a discontinuity, then they could join and then exit (or exit and then join) around the loan repayment, at the expense of other lenders in the portfolio.</p><h3>Discontinuity in share price</h3><p>Unfortunately, in our DAO portfolios, we had overlooked a discontinuity caused by instant fees taken during loan repayment:</p><p>1. When a loan is repaid, the protocol assesses a 10% fee on the interest of the loan. This causes loan value to instantly drop from principal + interest to principal + (interest — fee) == principal + 90% * interest.</p><p>2. If necessary, this fee amount is swapped for USDC, as a convenience for stakers to claim.</p><blockquote>The swap may result in some DEX slippage losses, but stablecoins typically don’t have much relative movement against each other.</blockquote><blockquote>Moreover, any losses here don’t translate to changes in share price, since the fee has already left the portfolio.</blockquote><p>3. The USDC fee amount is then reinvested into the tfUSDC DAO portfolio on behalf of stkTRU holders.</p><blockquote>Like with any other join or exit, this reinvestment should not affect portfolio value.</blockquote><p>Therefore the price drop comes purely from a 10% * interest fee that is taken when a loan is repaid.</p><h3>Historical discontinuities</h3><p>In the past, each loan repayment also caused this small price drop, but we had not noticed due to a couple factors:</p><ol><li>The loan principal was typically smaller, relative to the portfolio value.</li></ol><blockquote>We typically don’t issue large loans relative to portfolio value, to reduce risk from a single borrower.</blockquote><blockquote>However, if portfolio value subsequently decreases due to lender exits, then the remaining loans take up a greater proportion of portfolio value.</blockquote><p>2. The loan term was typically shorter, again resulting in a smaller interest amount relative to the portfolio value.</p><p>3. We didn’t see several loan repayments occur around the same time.</p><blockquote>If loan1, loan2, and loan3 all repay around the same time, then the fees value drop is 10% * (interest1 + interest2 + interest3), which can be 3x larger than the price drop from a single loan repayment.</blockquote><h3>Mitigations and Conclusion</h3><p>To immediately address this vulnerability, TrueFi technical contributors on the TrustToken team agreed to freeze TrueFi’s protocol fees on the DAO Pools. This quickly closes the arbitrage attack vector on tfTokens by pausing the fee that causes the token’s price irregularity, but it comes with a tradeoff:</p><p><strong>While protocol fees are paused to allow a formal upgrade to be discussed, designed, audited, and deployed, TRU stakers will not receive tfToken rewards during loan repayments. </strong>TRU incentives of +20% APY remain unaffected. This decision was made to protect TrueFi’s users and is not expected to result in substantial unrealized gains, it <em>will</em> affect TrueFi’s stakers until the final fix is live and protocol fees return.</p><p>Many thanks to our friends and partners at <a href="https://medium.com/u/61c39ff7eaa8">APWine Finance</a>, and TrueFi community members who reported these price discrepancies, as well as the engineers contributing to TrueFi who determined the root cause and fixed the issue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c949cf35fe4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TrueFi: Kicking Off Year 2]]></title>
            <link>https://medium.com/@RafaelCosman/truefi-kicking-off-year-2-f1d836ba8a90?source=rss-fe4e577e86e2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1d836ba8a90</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[lending]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Rafael Cosman]]></dc:creator>
            <pubDate>Wed, 22 Dec 2021 16:32:44 GMT</pubDate>
            <atom:updated>2021-12-22T16:32:44.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ModlOi63IQ50aIi0qve9EA.png" /></figure><h4>Annual Letter from TrustToken CEO <a href="https://medium.com/u/fe4e577e86e2">Rafael Cosman</a></h4><p>Approximately one year ago, on Saturday Nov 21, 2020, the TrustToken team gathered in the Zoom war-room to launch TrueFi, DeFi’s first protocol for uncollateralized lending. Tension was high. We couldn’t afford a single mistake.</p><h4>Since then, TrueFi has:</h4><ul><li><strong>Surpassed </strong><a href="https://dune.xyz/tt_tyler/State-of-TrueFi?num_days=365"><strong>$1Bn in TVL</strong></a></li><li><strong>Originated </strong><a href="https://dune.xyz/tt_tyler/truefi-loan-stats"><strong>$1Bn in loans</strong></a></li><li><strong>Generated </strong><a href="https://dune.xyz/tt_tyler/truefi-loan-stats"><strong>$8.5mm in interest</strong></a><strong> for lenders</strong></li><li><strong>Generated </strong><a href="https://dune.xyz/tt_tyler/truefi-loan-stats"><strong>$970k in fees</strong></a><strong> for TRU governance participants</strong></li></ul><p>Having a live protocol helped us learn quickly, and we focused year one on improving both the product and its lending book. In year 1, TrueFi’s lending book focused primarily on crypto hedge funds and trading firms.</p><p><strong>This work helped TrueFi to become one of the largest DeFi protocols globally, and THE world’s largest protocol for unsecured lending.</strong></p><p>That’s excellent news. <strong>But $1Bn TVL is just 0.1% of the $1Tn we are now aiming for </strong>— because we have always known that something more is required to get TrueFi to its next level of success.</p><p><strong>Specifically- TrueFi cannot become <em>the protocol for global lending</em> if it <em>only</em> targets its existing market of crypto-native lenders and borrowers.</strong> While maintaining and growing our existing lending strategy remains a key goal, TrueFi <strong>must</strong> start lending in TradFi markets such as venture debt, corporate debt, CDOs &amp; CLOs, and many more. <strong>In 2022, it will.</strong></p><p><strong>Year 2 of TrueFi is focused on opening the protocol to independent asset managers. These partners will help take TrueFi from $1Bn to $1Tn.</strong> We have been laying the groundwork for this transition for many months and will be sharing more details of our plans soon.</p><blockquote><strong>Expect year 2 to be exciting, but to include inevitable growing pains. We do not get from $1Bn to $1Tn by following a beaten path.</strong></blockquote><p>We’re tremendously excited about where TrueFi is and where it’s going. I personally am glad to have the opportunity in my lifetime to build something truly innovative and impactful. And I’m glad to have you with us.</p><p>Onwards,</p><p><em>Rafael Cosman</em></p><p><em>CEO and Cofounder, TrustToken</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1d836ba8a90" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>