Jump to content

Pathfinding is an AMM? ...but more powerful


Recommended Posts

2 hours ago, jn_r said:

Why should there be?

There wouldn't be a self correcting market dynamic without the arbitrage opportunity. That's how markets work.

2 hours ago, jn_r said:

In practice however there is a difference. For every trade an amount of 0.030% is held back from the amount 'a': This is profit for the liquidity providers

Bingo, that's the spread, the arbitragers opportunity between the dotted lines.


All that aside, I'm still seeing Pathfinding as more powerful than a single AMM. Thank you for informing me about Uniswap's pathfinding through multi AMMs, that's very interesting.

Something about the "hard coded" math formula of these AMMs just dosen't set right with my gut about a market's need for dynamism. 

Edited by KarmaCoverage
Link to comment
Share on other sites

18 minutes ago, KarmaCoverage said:

Isn't that just a synthetic orderbook?


    Sandbox& sb,
    std::shared_ptr<SLE> const& sleCreator,
    AccountID const& account,
    STAmount const& in,
    STAmount const& out,
    std::uint32_t incSequence)
    // We need to place the smallest possible offer.
    // This gives us the best quality but not useful
    // offer size. For now just take 0.01% of the out and calc
    // in. In and out are the total pool size of each
    // currency. The offer size is:
    // takerGets = out / 10000
    // amm const product = in * out
    // takerPays = produce / (out - takerGets) - in

Yes, it will create offer in the orderbook.

Link to comment
Share on other sites

On 10/8/2021 at 4:04 AM, KarmaCoverage said:

All that aside, I'm still seeing Pathfinding as more powerful than a single AMM.

I think you can't compare the two.

An AMM is an algorithm usually embedded in a smart contract to provide liquidity in "swaps" between two (or more) currencies.

Pathfinding is an algorithm that finds the best price and liquidity path to send one currency using another one, passing by different "swaps".

Technically you could use a pathfinder to find the best path from currency A to currency B using both AMM liquidity AND orderbooks liquidity (both DEX and CEX) and other kind of liquidity. Then executing the transaction and having it atomically it's a completely different story and it depends on the blockchains used. You could have a huge path sending for example 3 atomic transactions in XRPL DEX, ethereum AMMs and BSC AMMs and 2 trades in a CEX and several withdrawal/transfer between blockchains.

Edited by tulo
Link to comment
Share on other sites

On 10/9/2021 at 8:31 AM, tulo said:

I think you can't compare the two.

I beg to differ, mostly because I see both as different methods of provisioning or routing liquidity.

The AMMs let anybody without a brain act as a market maker / liquidity provider.

While Orderboods allow anybody to do the same, they do require a little bit more brains. Pathfinding automates & links some of this functionality. 

As you no doubt understand, I believe you have done well building some market making bots for XRPL. I think the tools of Orderbooks & Pathfinding enable a more fine tuning of liquidity provisions than these AMM's methods.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.