Skip to content

Commit 788a8a0

Browse files
JFWooten4ElliotFriend
authored andcommitted
🐛yarn fixes, format checks
This way only runs the Husky pre-commit if you have yarn installed, which should help with stellar#1044 compatability, given those with write access can quickly (via bot?) run the formatting. i had a lot of problems with this three weeks ago when editing on an offline laptop that didn't have all the dependencies involved. Even though I was going to take care of the nuances on this main desktop here, I couldn't synch up my work to the branch, and thus it was hard to manually override the git commit checks.
1 parent 322dafa commit 788a8a0

File tree

4 files changed

+4888
-5475
lines changed

4 files changed

+4888
-5475
lines changed

.husky/pre-commit

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ G='\033[0;32m'
22
P='\033[0;35m'
33
CLEAN='\033[0;0m'
44

5-
yarn run check:mdx || (echo -e "${G}Hint:${CLEAN} execute ${P}yarn run format:mdx${CLEAN} to format files" && exit 1)
5+
if command -v yarn >/dev/null 2>&1; then
6+
yarn run check:mdx || (echo -e "${G}Hint:${CLEAN} execute ${P}yarn run format:mdx${CLEAN} to format files" && exit 1)
7+
else
8+
echo -e "${G}Hint:${CLEAN} install ${P}yarn${CLEAN} to run pre-commit formatting checks"
9+
exit 0
10+
fi

docs/learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public class orderbook {
301301
double highestBid = Double.parseDouble(bids.get(0).getPrice());
302302
double lowestAsk = Double.parseDouble(asks.get(0).getPrice());
303303
double midpoint = (highestBid + lowestAsk) / 2.0;
304-
304+
305305
return new BigDecimal(midpoint)
306306
.setScale(
307307
7,
@@ -486,7 +486,7 @@ const transaction = newTxBuilder(account, Keypair.fromSecret(privateKey))
486486
selling: astroPeso,
487487
buying: astroDollar,
488488
amount: "1000",
489-
price: midpointPrice.toString(),
489+
price: midpointPrice.toString(),
490490
})
491491
.build();
492492

@@ -525,7 +525,7 @@ func main() {
525525
horizonclient.AccountRequest{AccountID: publicKey}
526526
)
527527
check(err)
528-
528+
529529
price, err := getMidpointPrice(orderbook)
530530
check(err)
531531

@@ -601,9 +601,6 @@ Upon withdrawal in this example, the tokens get returned to the issueing account
601601

602602
When withdrawing from the AMM, the issuer will burn returned NANAs while keeping all earned (or lost) AstroDollars. Some projects use this feature of AMMs to conduct a proejct launch ith their own seedcapitl as the inital half of deposited funds. Contratily, traditional markets prefer selling new issuances through limit offers which can represent fiat currencies, commodities, or any other assets in exchange for a user's valued token.
603603

604-
605-
606-
607604
## Liquidity
608605

609606
### Market Depth
@@ -824,7 +821,6 @@ Liquidity refers to how easily and cost-effectively one asset can be converted t
824821

825822
### Authorization Setup
826823

827-
828824
### Operations
829825

830826
There are two operations that facilitate participation in a liquidity pool: `LiquidityPoolDeposit` and `LiquidityPoolWithdraw`. Use `LiquidityPoolDeposit` to start providing liquidity to the market. Use `LiquidityPoolWithdraw` to stop providing liquidity to the market.
@@ -1375,7 +1371,7 @@ While the network automatically calulates the AMM price product, this does not s
13751371
```python
13761372
# This proposal only introduces a constant product liquidity pool.
13771373
# The invariant for such a liquidity pool is (X + x - Fx) (Y - y) >= XY
1378-
#
1374+
#
13791375
# X and Y are the initial reserves of the liquidity pool
13801376
# F is the fee charged by the liquidity pool
13811377
# x is the amount received by the liquidity pool

0 commit comments

Comments
 (0)