# Liquidity Swap - Pulsar
To create a Liquidity-Swap facility for USX-DF, which enables the protocol to swap its protocol-minted USX for DF liquidity in the market.
###### tags: `Deployed Contracts`
## Mainnet
### LiquiditySwap(CurvePrice(USDC) Pulsar sDF)
| Contract Name | Contract Address | Link |
| -------------- | ------------------------------------------ |:------------------------------------------------------------------------------- |
| implementation | 0xe45242483CDC310dE7BEF3cDB8545aB1aF31eB43 | [link](https://etherscan.io/address/0xe45242483CDC310dE7BEF3cDB8545aB1aF31eB43) |
| LiquiditySwap | 0xb173CF446A3aA3420c780d4a034d0e06b1774C08 | [link](https://etherscan.io/address/0xb173CF446A3aA3420c780d4a034d0e06b1774C08) |
| TWAMM | 0xcd43AbA971bEF65555D877657F83093dDFB885b8 | [link](https://etherscan.io/address/0xcd43AbA971bEF65555D877657F83093dDFB885b8) |
| USX/DF Pair | 0xA5f715Cd7555b6b940eBE961e96b9e9be71755FE | [link](https://etherscan.io/address/0xA5f715Cd7555b6b940eBE961e96b9e9be71755FE) |
## Arbitrum
### LiquiditySwap(CurvePrice(USDC) Pulsar)
| Contract Name | Contract Address | Link |
| -------------- | ------------------------------------------ |:------------------------------------------------------------------------------- |
| implementation | 0x689f8897C23eAE7F5c496F42a94c67f179C4310c | [link](https://arbiscan.io/address/0x689f8897C23eAE7F5c496F42a94c67f179C4310c) |
| LiquiditySwap | 0x84E24f5dfCd4dEdACe9bE2a364A5deC99EdA931C | [link](https://arbiscan.io/address/0x84E24f5dfCd4dEdACe9bE2a364A5deC99EdA931C) |
| TWAMM | 0x04538B69f9a637500ECf2b705e05AB38Bab27B7E | [link](https://arbiscan.io/address/0x04538B69f9a637500ECf2b705e05AB38Bab27B7E) |
| USX/DF Pair | 0x4761d4892d413416F002FFef58e844d9bBEd5e9c | [link](https://arbiscan.io/address/0x4761d4892d413416F002FFef58e844d9bBEd5e9c) |
---
### Structure
#### Flow

#### Data

### Features
#### Oracle
1. track real-time USX/USDC price in curve pool(mainnet)
2. track USDC/USD price in chainlink feed
3. aggregate USX/USD price by USX/USDC and USDC/USD
#### Long-term orders
1. place/cancel long-term orders to buy DF by USX
2. get status of orders/prices
#### Strategy
1. if 0.99<USX/USD<1.01, activate the orders; else cancel them
2. save buy-backed DF in sDF, able to withdraw
3. approve POO to add liquidity to dex by buy-backed DF along with it's USX
4. execute any funtions `Owner Only`
#### POO
1. mint USX to strategy
2. add USX/DF liquidity to dex
#### Service
1. monitor price status and trigger the strategy
2. price feed
### Goerli Playgound
#### Tokens
1. [FOX](https://goerli.etherscan.io/address/0x017CFC7eB867fDD598a98e6F9778D0150846C03b)
2. [MEA](https://goerli.etherscan.io/address/0x798F75D3f1556D4475388A410AdA4a6D303EC113)
3. [JON](https://goerli.etherscan.io/address/0xF53c27F61a1239307Bd6F47ef0706e1444a6e14F)
4. [SOW](https://goerli.etherscan.io/address/0xf0e825AbF7C3857fb4ba6d06F95027d7ab4e0845)
5. [USD](https://goerli.etherscan.io/address/0x1C49576991513A65fF369ea5595B3a024d78517B)
#### Faucet
```
allocateTo(address _owner, uint256 value)
```
#### Player
1. [Player](https://goerli.etherscan.io/address/0x18c30d9569feb3ea3644573b013d329dd9fd01af)
### Reference
1. [proposal](docs.google.com/document/d/1761luE5gN9S84jo_Rj2BGPeOKZjW-ddQQzJytlpCzKk)
2. [long-term order playground](https://pulsarswap.com)
3. [docs](https://docs.pulsarswap.com/)
4. [github](https://github.com/PulsarSwap/TWAMM-Contracts)
5. [twamm](https://etherscan.io/address/0xcd43aba971bef65555d877657f83093ddfb885b8)
### Arbitrage
| Column | DF | USX | blocks interval | block number |
| ------ | ------ | ---------- | --------------- | ------------ |
| 1 | 10,000 | 388.3102 | 0 | 16296200 |
| 2 | 30,000 | 1,165.3124 | 1714 | 16297914 |
| 3 | 30,000 | 1,174.5665 | 3134 | 16301048 |
| 4 | 30,000 | 1,161.5626 | 1689 | 16302737 |
| 5 | 30,000 | 1,183.4403 | 3955 | 16306692 |
| 6 | 30,000 | 1,171.9370 | 1810 | 16308502 |
| 7 | 30,000 | 1,177.9442 | 2934 | 16311436 |
| 8 | 30,000 | 1,206.5706 | 4419 | 16315855 |
| 9 | 30,000 | 1,180.3379 | 4150 | 16320005 |