Page cover image

Swapping is one of the two primary ways to interact with Stabull pools. Users select an asset that they currently hold (input) and a token they would like to swap for (output). The user also specifies an amount of the input or output token they would like to swap. A successfully executed swap transaction will transfer the input token from the user to the pool contact, and the desired output token from the pool to the user. The amount of output token received for every input token is known as the swap rate, and is determined by the pool invariant (the proportion of reserves & the oracle rate). Additionally, a swap fee is collected and split between liquidity providers and the protocol.

Swapping on Stabull is non-custodial and permissionless.

Fee

The fixed swap fee on every Stabull swap is 0.05%, collected as a percentage of the output token.

  • each swap is charged 0.05%

  • this is extracted in the output token

  • e.g. for a swap of 160 NZDS to 100 USDC...

    • 5 cents

What is the fee used for?

  • 50% back into the pool = "LP Fee"

    • 100 USDC and 100 EURS

    • 101 USDC and 101 EURS

  • 50% goes to Treasury Wallet

Protocol Fee

The protocol fee is the proportion of the swap fee, collected by the protocol. This is currently set to 50%, and is allocated towards:

Treasury

50%

Insurance Fund

50%

The protocol fee and its allocation can be amended by governance proposal.

When do LPs realize their share of fee?

At present, the fee revenue will be realised when they withdraw. For a swap of 130 NZDS to 100 USDC, 0.05 USDC will be taken and added to the pool reserves. Each LP token holder will now own the same share of a (slightly) bigger pie. So when they withdraw they get a little bit more than if there was no fee.

Multihop Swaps

Despite assets being paired with USDC in their pool, it is possible to swap between non-paired assets in a single transaction, known as a multihop swap. This is performed by Stabell's router contract, which finds the most cost effective route between multiple pools.

For example a swap from TRYB to EURS will be routed through (1) the TRYB/USDC pool, and (2) the EURS/USDC pool. Both intermediary swaps will incur the swap fee to compensate the LPs of each pool.

Last updated