A principal-protected Terra <> Terra forex money market with leveraged Anchor deposits


Stablecoins being used with DeFi are primarily focused on the US dollar, including USDT, USDC, Dai, and (of course) UST. However, this inherently incurs forex risk on principal for anyone not using USD for daily transactions and savings, which may involve relative monetary volatility even if the protocol utilizing stablecoins provides principal protection in USD denomination.

One of the simplest solutions to this is to build a forex money market for stablecoins. The idea would be to borrow USD-pegged stablecoins (such as UST) with another stablecoin pegged to another fiat currency (EUT, AUT, JPT, KRT, etc.) as collateral at a maximum loan-to-value ratio close to 100%, and liquidate the loan when LTV hits max. Unfortunately this approach also has problems on its own;

  • stablecoins outside of USD-pegged ones either barely exist, or even if they do, have poor liquidity.
  • lack of liquidity for non-USD stablecoins poses a significant risk for loan positions incurred with them, as loan liquidations cannot properly occur; contract-based liquidations are better than market liquidations in this regard, but even with such a case, there is lack of incentive for external liquidators to participate.
  • as stablecoins are either 1:1 backed or are synthetic assets on the blockchain (and not actual fiat currencies), they may temporarily de-peg either against their respective fiat currencies or other stablecoins. Cascading liquidations of stablecoin collateral may accelerate and worsen such an event.
  • While there is demand for borrowing USD-pegged stables with non-USD pegged stables as collateral, demand for opposite borrow positions barely exist, resulting in incentivization issues with USD deposits.

As Terra stablecoins are synthetic assets that are freely swappable to and from other Terra stablecoins and Luna, we can take advantage of the Terra platform to solve the issues listed above:

  • Lack of non-USD pegged stablecoins: Terra can mint any stablecoin pegged to any currency or asset as long as there is a reliable oracle source that validators can refer to, and submit on-chain votes.
  • Lack of liquidity for non-USD pegged stablecoins: Terra stablecoins are freely swappable with each other, and thus instead of market-selling non-USD Terra stables the contract can simply execute MsgSwap to stables with higher liquidity, such as UST, when liquidation is triggered.
  • Liquidation depeg risk: there are no market sells involved with liquidations to directly depeg stables on liquidation events, and even if market liquidations are involved (either with UST or Luna), the Terra stability mechanism will kick in to maintain peg.
  • Low borrow demand for non-USD stables: because all Terra stablecoins are freely swappable, we can create leveraged Anchor deposit positions with amplified interest and forex risk to incentivize non-USD stable borrows:
    • a portion of UST liquidity on the money market is deposited to Anchor, and corresponding interest is distributed to UST liquidity providers pro-rata. Interest redirection protocols such as Pylon may be used here.
    • Depositors may create leveraged deposit positions by (i) borrowing other Terra stablecoins against UST, (ii) swapping borrowed stablecoins back to UST, and (iii) repeating this process by re-depositing swapped UST to borrow more Terra stablecoins. As UST liquidity providers are rewarded with Anchor interest, leverage traders are essentially longing against non-USD forex rates at higher risk of liquidation, but also with higher Anchor interest returns.

By adding this forex layer to USD-based DeFi protocols, anyone can instantly add support for any non-USD pegged stablecoin even if the protocol by itself does not include support for non-USD stables.


We define a currency basket of Terra stablecoins with an array of relative value ratios denominated against the IMF SDR:

// example parameter
whitelisted_denoms = ["uusd", "ueur", "usdr", "uaud", "ujpy", "ukrw"]
currency_reserves = ["uusd": 0.3, "ueur": 0.2, "usdr": 0.2,
    "uaud": 0.1, "ujpy": 0.1, "ukrw": 0.1]
deposit_denoms = ["uusd"]
effective_deposit_ratio = 0.7 // proportion of "uusd" to hold in PYLON-UST-DP-TERRA

The sum of all values recorded with this array must equal 1.

At least once in every reserve_adjustment_epoch, the money market contract recalculates the current value delta (currency_reserves_delta) against the currency_reserves parameter, based on current stablecoin liquidity the contract currently holds.

def get_current_currency_reserves():
    // calculate current stablecoin value holdings in SDR denomination
    for denom in whitelisted_denoms:
        sdr_value = denom.balanceOf(this).mul(get_sdr_exchange_rate(denom))
        total_stable_value += sdr_value
    // calculate current_currency_reserves
    for denom in whitelisted_denoms:
        balances_sdr_value = denom.balanceOf(this).mul(get_sdr_exchange_rate(denom))
        current_currency_reserves[denom] = balances_sdr_value.div(total_stable_value)
    return current_currency_reserves
def get_current_currency_reserves_delta():
    // compare against currency_reserves
    for denom in whitelisted_denoms:
        if currency_reserves[denom] >= current_currency_reserves[denom]:
            delta = currency_reserves[denom].sub(current_currency_reserves[denom])
        else if currency_reserves[denom] < current_currency_reserves[denom]:
            delta = current_currency_reserves[denom].sub(currency_reserves[denom])
        currency_reserves_delta[denom] = delta
    return currency_reserves_delta

If at least one of currency_reserves_delta exceeds parameter max_reserves_delta, the money market contract triggers rebalance_reserves(). This is similar to a self-rebalancing ETF mechanism as those of Nebula, or the dynamically re-pegging crypto pools model as proposed by Curve.

There are two conditions that will trigger rebalancing;

  • when demand is skewed for a particular stablecoin,
  • and/or when forex rates change beyond threshold.

For case (i), rebalancing is required to maintain minimum liquidity balance for all stablecoins, although if this continues a governance proposal should be considered to modify the currency_reserves parameter; for case (ii), rebalancing helps to hedge against currency devaluation events.

This currency basket defines base liquidity parameters for the Terra money market. Borrows follow logic of any other smart contract-based money market; liquidations, on the other hand, does not go through asset auctions or market sells but utilizes native on-chain swaps instead.

The liquidation function is roughly defined as:

  • for all borrow positions with [COLLAT_DENOM, BORROW_DENOM], trigger liquidations for borrow positions satisfying BORROW_DENOM_VALUE / COLLAT_DENOM_VALUE > MAX_LTV. Value is directly queried from on-chain oracles.
  • execute MsgSwap from COLLAT_DENOM to BORROW_DENOM until LTV reaches LIQUIDATION_THRESHOLD_LTV. The holder of this borrow position faces a loss equivalent to tobin_tax + liquidation_premium, of which liquidation_premium is given to liquidators that triggered this particular contract call.

For denoms whitelisted under deposit_denoms, a portion of its liquidity specified with effective_deposit_ratio is held as Pylon DP tokens, which in principle are pegged one-to-one with its underlying stablecoin denom, the only difference with aUST being that they represent rights for deposit withdrawals from Anchor for a particular interest redirection contract. Redirected Anchor interest from Pylon are distributed to borrow positions with one of deposit_denoms being used as collateral to borrow other stablecoins. Additionally, if current_deposit_ratio deviates from effective_deposit_ratio by more than max_reserves_delta, this will result in DP tokens either being minted or redeemed to and from UST on rebalance_reserves().

Effectively, this matches deposits and borrows on both sides of the money market, by:

  • providing principal protected endpoints for non-USD stablecoin holders to deposit funds into USD-based DeFi protocols without forex risk
  • incentivizing UST holders with leveraged Anchor interest relayed through Pylon, being able to receive higher yield on stablecoins while absorbing all forex and liquidation risk
  • rebalancing stablecoin liquidity reserves on a temporary supply - demand mismatch.


A. Supporting Anchor deposits for non-USD pegged stablecoins

Anchor currently only supports UST deposits, even though there is significant demand from the community to support non-UST deposits, such as EUT and AUT. There are two primary approaches to achieving this:

  • creating another stablecoin borrow market - not only is this capitally inefficient in terms of borrows, but this also means Anchor needs to support supported_stablecoins * supported_collateral number of borrow pairs.
  • creating a common interest market for non-UST deposits - exact mechanisms for maintaining forex principal protection on non-UST deposits are not clear, and yield may also be volatile following currency exchange rates against the US dollar.

We can use this money market approach with a pooled Anchor interest model to maintain stable yields on non-UST deposits. Roughly put:

  • a proxy contract accepts non-UST deposits (EUT, AUT, etc.), deposits them into the forex money market to borrow UST, and deposits them into Anchor for receiving aUST. The proxy contract mints aEUT, aAUT, etc. back to the user.
  • interest from aUST is periodically re-claimed back to UST, and swapped back to its original deposit denomination. This is pooled in an interest buffer within the proxy contract, and re-compounded to Anchor deposits.
  • copy Anchor interest distribution logic; set an ideal yield for every stablecoin supported, and if interest_emitted > ideal_yield store them in the interest buffer. otherwise, release stablecoins from the interest buffer.

This may enable additional use cases for Anchor, such as receiving KRT interest from KRT Anchor deposits and using them with Chai.

Detailed mechanisms regarding non-UST deposits on Anchor will follow separately on the Anchor forum.

B. Support for Pylon interest redirection in more currencies

As the upcoming Pylon Protocol is simply an interest redirection layer that sits on Anchor, it is trivial that Pylon pools also support UST deposits only. However, in order for apps built on the Pylon SDK to support more integrations across different countries, this also requires supporting non-USD pegged stablecoins.

Mechanisms are similar with the one described above.


Sounds like a super interesting TeFi killer app :smiley:

What kind of LTV do you think should be applied? I’m guessing it would have to atleast be below 98.5 where the arbitrage spread kicks for maintaining the peg?

As a result, what kind of interest rate do you think can non USD depositors expect? I guess it depends on the LTV and the whether leverage is used?

Great idea! Have you checked out DFX? I’m sure we can do some similar for decentralized coins.

LTV depends on historical volatility of the currency being deposited as collateral against the SDR or USD, although further research is required here.

Correct, but in this case leverage deposits are only available for UST depositors as they are the ones who are absorbing forex volatility for non-UST holders accessing USD-based DeFi protocols. This may change in the future when more non-USD based DeFi protocols with sufficient liquidity emerges to justify incentivizing leverage deposits.

DFX is a forex AMM, and not a money market. The point of building a forex money market is to provide principal protection on non-USD stablecoins while accessing USD-based markets by borrowing USD stables with non-USD stables as collateral instead of directly swapping. Different target audience


Very very happy to hear this. I’ve been waiting for someone with much more skills to propose this key functionality as I very much dislike being tied to the USD with my Anchor Earn/Borrow/ANC-UST-LP. I’d much rather run the whole lot with my own Stablecoin which outperforms the USD in the current climate. Thanks heaps. Will be keen to vote on this one.


Would this non-USD stables be included in the Anchor Earn SDK? For example… if an exchange was to list EUT or AUT, would those wallets on the exchange be able to Earn without leaving the exchange? Or will this FX money market only be available via the Anchor app?

Using short an long term vol to create a sliding max LTV works quite well.

HI, I’m an ex-pat living in Thailand and would love to be able to use Terra’s Thai Baht stablecoin. But my concern is once converted from $UST to THT how do I get it offramp? Is there a Thai exchange in the English language that can facilitate this?

May I ask if there is any update on this topic yet? Looking forward to this! Thanks for starting this discussion

Hi @shhong , has this progressed in any capacity?
Thanks in advance.

Nice to hear this very topic come up in today’s AMA! I’d love to use Australian dollars over USD in anchor Earn if it would one day be possible. As mentioned in the AMA, did I hear correctly that there needs to be a large amount of these other stablecoins minted before any work could even commence? Along that thought, I did see that the Australian app-in-progress called Tiiik, apparently is taking wholesale clients - could this be enough to bootstrap that liquidity or would there need to be a massive amount more?
Anyway - would be rad. Following this.