Commit Graph

345 Commits

Author SHA1 Message Date
dependabot[bot] 696abe1844
build(deps-dev): bump eslint from 7.26.0 to 7.27.0 in /token-swap/js (#1776)
Bumps [eslint](https://github.com/eslint/eslint) from 7.26.0 to 7.27.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.26.0...v7.27.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 12:21:34 +00:00
dependabot[bot] c6cd23fa2e
build(deps): bump dotenv from 9.0.2 to 10.0.0 in /token-swap/js (#1778)
Bumps [dotenv](https://github.com/motdotla/dotenv) from 9.0.2 to 10.0.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v9.0.2...v10.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:44:28 +00:00
dependabot[bot] 50665fd549
build(deps-dev): bump eslint-plugin-import in /token-swap/js (#1774)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.23.2 to 2.23.3.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.23.2...v2.23.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:12:17 +00:00
dependabot[bot] 62c59b0453
build(deps-dev): bump ts-node from 9.1.1 to 10.0.0 in /token-swap/js (#1773)
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.1.1 to 10.0.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v9.1.1...v10.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:08:30 +00:00
dependabot[bot] 79f31e320f
build(deps): bump @solana/web3.js in /token-swap/js (#1762)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.11.0...v1.12.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 10:38:04 +00:00
akamutsu 4915c0910a
Implementation of stable curve methods (#1488)
* WIP: Implementation of the remainder of stablecurve methods

* Edits based on PR feedback

* revert SwapVersion

* PR fixes

* checked add / sub

* reverted to using RoundDirection instead of LiquidityProviderOperaiton

* removed LiquidityProviderOperation enum

* Revert flipped parameters

* initial attempt at noramlized_value

* use d for noramlize value for stable curve

* TradeDirection instead of RoundDirection for trading_tokens_to_pool_tokens

* reimplemented the trading_tokens_to_pool tokens function for stable

* Typo

* fix rounding errors in pool_tokens_to_trading_tokens

* try different values of amplification factor in test for stable curve

* fixed broken tests, use constant_product normalized_value function

* use cubic solver

* fix noramlize_value function bad maths

* redid noramlized value for one last time

* added more proptests

* Get tests to work

* Fixup for prod usage

Co-authored-by: Yutaro Mori <me@yutaromori.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-05-19 02:44:01 +02:00
dependabot[bot] e8c97e3cb2
build(deps-dev): bump start-server-and-test in /token-swap/js (#1752)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.12.1 to 1.12.2.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.12.1...v1.12.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 11:18:28 +00:00
dependabot[bot] 1beeb9fd21
build(deps-dev): bump eslint-plugin-import in /token-swap/js (#1749)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.23.0 to 2.23.2.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.23.0...v2.23.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 10:42:08 +00:00
dependabot[bot] 9da22609af
build(deps): bump @solana/web3.js in /token-swap/js (#1750)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.10.1...v1.11.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 10:41:13 +00:00
dependabot[bot] 6b82600d05
build(deps-dev): bump eslint-plugin-import in /token-swap/js (#1741)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.22.1 to 2.23.0.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.22.1...v2.23.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-14 10:35:28 +00:00
dependabot[bot] 56572e32cb
build(deps-dev): bump flow-bin from 0.142.0 to 0.151.0 in /token-swap/js (#1719)
Bumps [flow-bin](https://github.com/flowtype/flow-bin) from 0.142.0 to 0.151.0.
- [Release notes](https://github.com/flowtype/flow-bin/releases)
- [Commits](https://github.com/flowtype/flow-bin/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 10:37:55 +00:00
Elliott Benisty 58221fc9ae
Fix potential vulnerabilities in programs using spl-token CPIs by adding program id checks (#1714)
* Add spl-token program id check helper function. Add program id to instruction bindings.

* Run cargo fmt

* Fixup tests

* Skip ATA tests when custom token program-id

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-12 22:36:41 +00:00
dependabot[bot] 3709ac60db
build(deps-dev): bump prettier from 2.2.1 to 2.3.0 in /token-swap/js (#1703)
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 14:05:42 +00:00
dependabot[bot] 5a9eebd692
build(deps): bump @solana/web3.js in /token-swap/js (#1702)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.10.0...v1.10.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 13:30:21 +00:00
dependabot[bot] d3d527e26b
build(deps): bump dotenv from 8.2.0 to 9.0.2 in /token-swap/js (#1701)
Bumps [dotenv](https://github.com/motdotla/dotenv) from 8.2.0 to 9.0.2.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v8.2.0...v9.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:57:47 +00:00
dependabot[bot] 88eb28625b
build(deps-dev): bump start-server-and-test in /token-swap/js (#1700)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.12.0...v1.12.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:25:58 +00:00
dependabot[bot] 0007114121
build(deps-dev): bump eslint from 7.21.0 to 7.26.0 in /token-swap/js (#1698)
Bumps [eslint](https://github.com/eslint/eslint) from 7.21.0 to 7.26.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.21.0...v7.26.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 11:47:39 +00:00
dependabot[bot] 7f3ccec305
build(deps): bump buffer-layout from 1.2.0 to 1.2.1 in /token-swap/js (#1696)
Bumps [buffer-layout](https://github.com/pabigot/buffer-layout) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/pabigot/buffer-layout/releases)
- [Changelog](https://github.com/pabigot/buffer-layout/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pabigot/buffer-layout/commits/v1.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 10:34:31 +00:00
Pierre 6ac82f9caf
token-swap typescript: Move things around, fix typing problems (#1643)
* Move things around, fix typing problems

* oups output built in src

* fix typegen

* fix cli

* fix linting, apply review comments and add forgotten package-lock.json change

* remove typegen.sh and move simpler command to package.json

* Move things around, remove babel and rollup

* Update packages

* Add browser dist to eslintignore

Co-authored-by: Arrowana <8245419+Arrowana@users.noreply.github.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-05-10 22:30:13 +02:00
dependabot[bot] 2522d937d2
build(deps): bump hosted-git-info from 2.8.8 to 2.8.9 in /token-swap/js (#1689)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 13:01:45 +00:00
dependabot[bot] cfc6c582ff
build(deps): bump lodash from 4.17.19 to 4.17.21 in /token-swap/js (#1674)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 09:55:28 +00:00
Trent Nelson 1f36ca301b Bump solana crates to v1.6.7 2021-05-05 04:39:49 +00:00
Jon Cinque 0f4f2b8de9
token-swap: Fix slippage on withdraw tokens (#1637)
* token-swap: Fix withdrawal all tokens slippage

When withdrawing, the slippage check is done before `min`ing the token a
and b amounts, which makes it possible to ignore the desired slippage,
and lose out on a lot more than expected.

This has an additional knock-on effect. When burning all of the pool
tokens, it becomes impossible to ever use it again.

* Check for slippage after getting the actual amount that would be
  traded
* Re-initialize the pool token amount on the next deposit if all pool
  tokens were burned

Fixes #1629

* Fmt + clippy

* Deposit one side on 0 pool tokens just gives new supply back
2021-04-29 14:26:47 +02:00
Jon Cinque ca6d57991a
token-swap js: Fix arg list in ts / flow (#1633) 2021-04-26 20:21:25 +00:00
Michael Vines 1e47030549 Update SPL to Solana v1.6.6 2021-04-23 13:39:51 -07:00
B 9281b6e828
feat: adjust fee constraints (#1596) 2021-04-14 13:33:34 -05:00
Jon Cinque e8f59e42ba
token-swap: Bump crate version to 2.1.0 for release (#1573) 2021-04-05 21:56:38 +02:00
Jon Cinque f309df4f35
token-swap: Update package version to match crates (#1561) 2021-04-01 20:53:59 +02:00
Michael Vines 448be67cfa Update to Solana 1.6.2 2021-03-30 09:38:04 -07:00
B 76f0523e60
Add pausable proposal (#1506)
* feat: add pausable proposal

* fix: update proposal
2021-03-25 16:38:36 -05:00
Derek Anderson 3858d0ae25
fixed formula to match referenced doc [1] + formatting (#1474)
`P_{margin}=iRP` didn't make sense, as P isn't defined, and i is already defined as the price (from the oracle).
the references doc contains `P_{margin}=iR`, so I assume this is a typo.
2021-03-25 09:31:25 -05:00
B bec876dcdc
Proposal for token-swap curve using stake pool account (#1504)
* feat: add new curve proposal

* Update StakePoolStableCurve.md
2021-03-24 11:07:00 -05:00
dependabot[bot] 5df346163f
build(deps-dev): bump @babel/node in /token-swap/js (#1489)
Bumps [@babel/node](https://github.com/babel/babel/tree/HEAD/packages/babel-node) from 7.12.17 to 7.13.12.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.12/packages/babel-node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-23 10:42:30 +00:00
Jon Cinque d336b8b714
stake-pool: Use checked_ceil_div for withdraw calc (#1482)
* stake-pool: Use checked_ceil_div for withdraw calc

When a stake account is totally removed from a stake pool by the
manager, there's a chance that the operation would not take enough of
the manager's pool tokens by 1 due to truncation.

Do a ceiling division instead, and refactor ceiling division into the
math library.

* Use new function name on CLI

* Cargo fmt
2021-03-23 00:33:51 +01:00
Jon Cinque 7316e0fbc3
Ignore test-ledger directory for swap (#1480) 2021-03-22 20:00:40 +01:00
Michael Vines 662f38f939 Bump Solana version to 1.6.1 2021-03-18 04:07:16 +00:00
Michael Vines 626376653d Clippy 2021-03-16 18:33:37 -07:00
Michael Vines 686444088b Bump Solana version to 1.5.15 2021-03-16 18:33:37 -07:00
dependabot[bot] 55896bc1d8
build(deps-dev): bump @babel/plugin-transform-runtime in /token-swap/js (#1399)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.13.7 to 7.13.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-plugin-transform-runtime)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-09 11:34:53 +00:00
dependabot[bot] b2c2ca9d4c
build(deps-dev): bump @babel/core in /token-swap/js (#1390)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.17 to 7.13.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.8/packages/babel-core)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 12:49:11 +00:00
dependabot[bot] 56b3d2a577
build(deps-dev): bump @babel/cli in /token-swap/js (#1389)
Bumps [@babel/cli](https://github.com/babel/babel/tree/HEAD/packages/babel-cli) from 7.12.17 to 7.13.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.0/packages/babel-cli)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 12:12:49 +00:00
dependabot[bot] 6512158239
build(deps-dev): bump rollup from 2.39.0 to 2.40.0 in /token-swap/js (#1388)
Bumps [rollup](https://github.com/rollup/rollup) from 2.39.0 to 2.40.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.39.0...v2.40.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 11:39:22 +00:00
dependabot[bot] 8c1c1163e4
build(deps-dev): bump eslint from 7.20.0 to 7.21.0 in /token-swap/js (#1387)
Bumps [eslint](https://github.com/eslint/eslint) from 7.20.0 to 7.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.20.0...v7.21.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 11:04:53 +00:00
dependabot[bot] b3881b4bed
build(deps): bump @solana/web3.js in /token-swap/js (#1386)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.91.3 to 0.94.2.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.91.3...v0.94.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 10:32:29 +00:00
B 87a849407f
Future proposals for token-swap program (#1379)
* feat: add files

* feat: add pmm proposal

* feat: DMM
2021-03-05 21:35:16 +01:00
Jon Cinque d692ff1505
token-swap: Use solana-test-validator in JS tests (#1367)
* Update swap pool owner in docs

* token-swap: Use solana-test-validator for JS tests

* Revert one more change

* Revert doc change

* Add solana-test-validator to ci

* Fix CI

* Revert docs change

* Move where to deploy programs in CI
2021-03-05 10:34:29 +01:00
Jon Cinque 125593defc
token-swap: Document owner address in README (#1368)
* token-swap: Document owner address in README

* Update docs for clarity, "token swap" -> "pool"

* Cleanup some language

* Add more info to docs too
2021-03-04 20:24:43 +01:00
Jon Cinque 9c12b50703
Update solana-program to 1.5.11 (#1362)
* Update solana-program to 1.5.11

* Update all programs
2021-03-02 19:19:50 +01:00
dependabot[bot] f0e363fe71
build(deps-dev): bump @babel/preset-env in /token-swap/js (#1336)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.17 to 7.13.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.5/packages/babel-preset-env)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-25 08:02:35 +00:00
dependabot[bot] a7f16f7b20
build(deps-dev): bump @babel/plugin-proposal-class-properties (#1335)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-class-properties) from 7.12.13 to 7.13.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.0/packages/babel-plugin-proposal-class-properties)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-24 12:27:13 +00:00