Aldrin Labs recently released dTWAP - distributed TWAP order
What is dTWAP
dTWAP - distributed TWAP order.
TWAP - means execution over time (read more here: https://en.wikipedia.org/wiki/Time-weighted_average_price)
What does it mean "distributed"?
It describes the nature of dTWAP implementation:
- You create dTWAP order ( example: buy $10mln SOL over next 2 weeks )
- dTWAP program will lock $10mln and start slowly unlock it for execution
- dTWAP executor bot will notice arbitrage opportunity against any other source of liquidity and execute the ticket
So distributed means that your order might be executed across many liquidity sources from Serum/AMM to private liquidity pool by some VC
So how to create a bot that will be generating revenue?
Well, it's quite easy actually, first you need to learn node.js basics
Then you need to create a simple node.js web-server in Typescript and figure out how to deploy it to Heroku for example
Then you can just add this file https://github.com/aldrin-exchange/aldrin-sdk/blob/feature/dtwap-executor/examples/dtwap/dtwapSwap.ts
to your project, import it, setup private key in ENV and you are good to go
Don't forget to tweak priceDiff at Line 13! At this point (27mar 2022) priceDiff must be at least bigger than 0.5 to be profitable with execution against Aldrin AMM
- integrate with aggregator
- integrate with CEX
- integrate with own liquidity
dTWAP right now is in private beta mode, so volume might be not that interesting, but it's good opportunity to learn how to create own bot and prepare for full launch in few weeks!
Top comments (4)
currently dTWAP is running for a pair of SOL / USDC, are other pairs being considered?
good question, sir
yes, Aldrin Labs will add all major liquid pairs and we plan to make it permissionless later in future, so anyone will be able to add own token
I will try this step