terra-revival / backtest

Python backtesting engine for USTC or any Terra Classic Stable Algos
Other
6 stars 2 forks source link

Divergence protocol specification for DEX #14

Open faffyswap opened 1 year ago

faffyswap commented 1 year ago

Starting testing against a DEX makes it much easier for us. Indeed we don't have to deal with all the complexity associated with limit order books, hence allowing us to focus on the divergence tax mechanism in this first iteration.

faffyswap commented 1 year ago

One of the main issue we're hitting revolves around arbitrage. If you tax or prevent people from selling, then price does not move. But you also prevent market activity. Basically you're just closing the shop.

As @413x45h4w mentioned that's perhaps why TFL ended up tweaking the algo parameters during the crash. It might seem counterintuitive but they were trying to keep markets functioning.

Problem of how the divergence tax is specified in the proposal is that it makes it not easy to deal with:

Below is an implementation proposal whereby we'd allow everything to happen as usual. But would then tax the output. This solves a lots of technical issues, but is not as effective as described in the prop. Seems like a good place to start though.

Long story short:

image

RedlineDrifter commented 1 year ago

It's important we determine how trading fees are applied and collected across the various DEXs and CEXs if they are to be included with the divergence protocol.

image