Skip to content

Commit 2a68892

Browse files
chore: Prepare for public release (#72)
1 parent 9688480 commit 2a68892

File tree

4 files changed

+20
-166
lines changed

4 files changed

+20
-166
lines changed

README.md

Lines changed: 20 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ Dexter is the first DEX which is implemented as a generalized state transition e
66

77
### Scope
88

9-
At launch, it will support the Stable-5-Pool type (introduced by curve) and the Weighted pool type (introduced by balancer), each of which designed for the following objectives,
9+
At launch, it will support the Stable Pool type (introduced by curve) and the Weighted pool type (introduced by balancer), each of which designed for the following objectives:
1010

11-
- **Stable-5-Pool -::-** Can be leveraged to develop specialized pools for liquid staking assets which can provide best trade execution.
12-
- **Weighted Pool -::-** Can be leveraged to develop re-balancing driven pool strategies which can maximize LP returns.
11+
* **Stable Pool**: Can be leveraged to develop specialized pools for liquid staking assets which can provide best trade execution.
12+
* **Weighted Pool**: Can be leveraged to develop re-balancing driven pool strategies which can maximize LP returns.
1313

14-
Dexter generator (modified version of astroport generator) can be used to incentivize pool’s LP tokens with dual rewards, i.e the DEX’s token (not live at launch) and a proxy reward incentive that is given by any 3rd party staking contract.
15-
16-
- Custom generator proxy adapter contracts need to be written for these 3rd party staking contracts to add them to the generator.
14+
Router can be used to perform trades across different pools in one go, while Multitasking (a modified version of the [Anchor staking contract](https://github.com/Anchor-Protocol/anchor-token-contracts/tree/main/contracts/staking)) can be used to incentivize pool’s LP tokens with rewards that is given by any 3rd party.
1715

1816
## Development
1917

@@ -22,166 +20,22 @@ Dexter generator (modified version of astroport generator) can be used to incent
2220
- Rust v1.44.1+
2321
- `wasm32-unknown-unknown` target
2422
- Docker
25-
- [LocalTerra](https://github.com/terra-project/LocalTerra)
26-
- Node.js v16
2723

2824
### Envrionment Setup
2925

30-
1. Install `rustup` via https://rustup.rs/
31-
32-
2. Add `wasm32-unknown-unknown` target
33-
34-
```sh
35-
rustup default stable
36-
rustup target add wasm32-unknown-unknown
37-
```
38-
39-
3. Compile contracts and generate wasm builds. Make sure the current working directory is set to the root directory of this repository, then
40-
41-
```bash
42-
cargo build
43-
docker run --rm -v "$(pwd)":/code \
44-
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
45-
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
46-
cosmwasm/workspace-optimizer:0.12.6
47-
```
48-
49-
4. Install Node libraries required:
50-
51-
```bash
52-
cd scripts
53-
npm install
54-
```
55-
56-
5. Deploy scripts:
57-
58-
Persistence is a permissioned network. You will have to wait for the proposals to pass and re-run scripts so its partly a manual process. We have shared addresses for our dexter instance deployment on testnet which you can interact with to test pool functions.
59-
60-
```
61-
Persistence testnet: https://rpc.testnet.persistence.one:443, test-core-1
62-
Persistence mainnet: https://rpc.persistence.one:443, core-1
63-
```
64-
65-
```bash
66-
node --experimental-json-modules --loader ts-node/esm testnet_deploy.ts
67-
```
68-
69-
### Persistence Network Endpoints
70-
71-
| Network Name | Chain Id | RPC Endpoint | LCD Endpoint |
72-
| ------------ | ----------- | ----------------------------------------- | ------------------------------------- |
73-
| `Mainnet` | core-1 | "https://rpc.persistence.one:443" | "http://rest.persistence.one" |
74-
| `Testnet` | test-core-1 | "https://rpc.testnet.persistence.one:443" | "http://rest.testnet.persistence.one" |
75-
76-
<br>
77-
### Interacting with Persistence Network (via JS / TS) :
78-
79-
- You can use `cosmossdkjs` to interact with dexter protocol on Persistence network.
80-
81-
```
82-
npm install cosmossdkjs
83-
```
84-
85-
- Create `CosmosChainClient` instance to interact with chain.
86-
87-
```
88-
import { CosmosChainClient, cosmwasm } from "cosmossdkjs";
89-
90-
91-
const CHAIN_ID = "test-core-1";
92-
const fee_denom = "uxprt";
93-
const rpcEndpoint = "https://rpc.testnet.persistence.one:443";
94-
95-
const client = await CosmosChainClient.init(MNEMONIC , {
96-
rpc: rpcEndpoint,
97-
chainId: CHAIN_ID,
98-
gasPrices: {
99-
denom: fee_denom,
100-
amount: "2000000",
101-
},
102-
gasAdjustment: "1.5",
103-
},
104-
{
105-
bip39Password: "",
106-
hdPaths: [stringToPath("m/44'/118'/0'/0/0")],
107-
prefix: "persistence",
108-
}
109-
);
110-
111-
// Get wallet address
112-
const [Account] = await client.wallet.getAccounts();
113-
const wallet_address = Account.address;
114-
console.log(`WALLET ADDRESS = ${wallet_address}`);
115-
116-
// Get chain height
117-
const height = await client.wasm.getHeight();
118-
console.log(`Blockchain height = ${height}`);
119-
120-
// Get xprt balance
121-
const balance_res = await client.wasm.getBalance( wallet_address, fee_denom);
122-
let wallet_balance = Number(balance_res["amount"])/10**6;
123-
console.log(`Wallet's XPRT balance = ${wallet_balance}`);
124-
125-
// Execute contract - Create pool
126-
let create_pool_exec_msg = {
127-
create_pool_instance: {
128-
pool_type: { xyk: {} },
129-
asset_infos: [
130-
{ native_token: { denom: fee_denom } },
131-
{ token: { contract_addr: network.test_tokens_addresses[0] } },
132-
],
133-
},
134-
}; const res = await client.wasm.execute(
135-
wallet_address,
136-
contract_address,
137-
msg,
138-
{ amount: coins(2_000_000, "uxprt"), gas: "200000" },
139-
memo,
140-
funds
141-
);
142-
let txhash = res["transactionHash"];
143-
console.log(`Tx executed -- ${txhash}`);
144-
```
145-
146-
- You can find more examples [here](https://github.com/dexter-zone/dexter_core/blob/main/scripts/helpers/helpers.ts)
147-
148-
<br>
149-
<br>
150-
151-
### Interacting with Persistence Network (via Python) :
152-
153-
- You can use `cosmos_SDK` to interact with dexter protocol on Persistence network. cosmos_SDK is a python package forked from terra_SDK and is being repurposed to be able to support multiple cosmos blockchains. You can refer to terra_SDK's documentation which should work in for cosmos_SDK too.
154-
155-
```
156-
pip install -U cosmos_SDK
157-
```
158-
159-
- Create `LCDClient` instance to interact with chain.
160-
161-
```
162-
from cosmos_sdk.client.lcd import LCDClient
163-
from cosmos_sdk.key.mnemonic import MnemonicKey
164-
165-
mnemonic = <MNEMONIC_PHRASE>
166-
167-
# Persistence client
168-
persistence_client = LCDClient(chain_id="core-1", url="http://rest.core.persistence.one")
169-
mk = MnemonicKey(mnemonic,"persistence")
170-
persistence_wallet = persistence_client.wallet(mk)
171-
172-
# Query a contract
173-
config_response = client.wasm.contract_query(contract_addr , {"config":{}})
174-
print(config_response)
175-
```
176-
177-
- `cosmos_SDK` is a W.I.P and execute functions are not working atm.
178-
179-
### Persistence :: DEVNET INSTANCE
180-
181-
Refer to artifacts/test_core-1.json to get the list of proposal ids and addresses with the dexter deployment on Persistence testnet.
182-
183-
| Name | Code Id | Instantiated Address |
184-
| ------------------ | ------- | ---------------------------------------------------------------------- |
185-
| `Dexter Vault` | 6 | persistence1u5ytk4hvgk33uwa0jqlyjx0rjpsc4xu4m4lv0aem9emf5mtlzejsu2pzc0 |
186-
| `Dexter Keeper` | 7 | persistence10y2sxew858txsfufrv366hkdm5lgn8w6dkhtxv8mdsmh7z8yuzfqgj6eg2 |
187-
| `Dexter Generator` | 13 | persistence1n6nvtuv37kevcexhrxns2ukqvut3xmagwfpxezcxtpxfexrzryus9mtdat |
26+
* Install `rustup` via https://rustup.rs/
27+
* Add `wasm32-unknown-unknown` target
28+
```bash
29+
rustup default stable
30+
rustup target add wasm32-unknown-unknown
31+
```
32+
* Compile contracts, test them and generate wasm builds. Make sure the current working directory is set to the root directory of this repository, then
33+
```bash
34+
cargo build
35+
cargo test
36+
docker run --rm -v "$(pwd)":/code \
37+
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
38+
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
39+
cosmwasm/workspace-optimizer:0.12.12
40+
```
41+
* Use [dexter deploy cli](https://github.com/dexter-zone/dexter-deployment-cli) to deploy them on the persistence network.

audit/v1_oak.pdf

576 KB
Binary file not shown.

audit/v1_peckshield.pdf

395 KB
Binary file not shown.

docs/Overview.drawio.png

-4.75 KB
Loading

0 commit comments

Comments
 (0)