6SR Fantom-Stellar Bridge Pool

Cover image

Announcing the Fantom/Stellar Bridge Pool

The simple UI for the pool can be found here.

Over the past few months, I've been slowing implementing the components for a liquidity pool that creates a floating exchange rate between the WFTM token on the Fantom Opera network and the Stellar network.

  • Fantom is a Layer 1 Ethereum protocol with smart contract support, that runs at a very high speed with very low fees. It has broad support, and there are a number of dApps available for it.
  • Stellar is an "open network for storing and moving money." It has an integrated distributed order book, and solves the big problem ethereum has with contract allowances by using account trustlines.

The system is designed with the following use case in mind:

  • Use the lending features available in the Fantom Network to borrow against your crypto.
  • Transfer the borrowed money to stellar, were you can use AQUA rewards, or other high-yield assets to generate yield (e.g. yUSDC).
  • Harvest the yielded assets, and use the pool to transfer the small amounts back into Fantom, paying off the loan bit-by-bit with the harvested funds.

The bridge pool has 3 main components:

  1. The Account Creator.
  2. The Smart Contract, found at address 0x3b4c7e7d0b8680cff79bd0de7827098c3608ddc7.
  3. The Liquidity Pool, which can be accessed through the FTM-ssrwFTM pool in Spooky Swap.

Account Creator

The account creator is a simple web app that will create an account for you in the system.

Account Creator

To use it, simply input the destination address into the appropriate box, and then click "check or create". This will give you a unique account ID that you can use to send to the pool, and it will send the corresponding amount of WFTM on the other side to your address.

The fees and limits for the transaction are displayed on the detail page, as well as the current balances for the pool and the estimated exchange rate:

Rate Example

To use it, send WFTM to the specified address (to go from stellar to fantom):

Stellar Example 1

Or use the swap operation of the contract (to go from fantom to stellar):

Note that the amount is the raw amount, meaning 1 WFTM is 1 * 10^18.

Fantom Example 1

Smart Contract

The source code for the contract is verified in FTMScan, and can be found in github.

The contract is used to deposit and withdraw wFTM into the pool, given the following market conditions:

  • The rate is positive. If the rate is less than 1, then this means that the pool is too far out of balance, and withdrawals and deposits are paused until it is back in balance. The rate can be found in the read contract section.
  • The contract is not otherwise paused by the administrator.

NOTE: there is no UI for the contract. Interaction with the "deposit" and "withdraw" contract actions can be done using FTMScan and Metamask browser plugins.

Withdraw amounts are in ssrwFTM, and the exchange rate can be calculated with:

1 wFTM = (rate / 10^36) ssrwFTM

Fantom Example 2

Liquidity Pool

If the contract is paused, or you need a more convenient way to exchange ssrwFTM, there is a traditional LP using Spooky Swap.

Spooky Swap Example

Users can deposit and withdraw from this pool as they would any other Spooky Swap LP.

We hope everyone finds this tool useful. For more information and discussion, check out our telegram: