From b2943846365d9d2f1855514c593fc578ec17a18e Mon Sep 17 00:00:00 2001 From: shoom3301 Date: Tue, 24 Dec 2024 17:00:36 +0500 Subject: [PATCH] docs: add info about TradingSDK to main readme --- README.md | 47 +++++++++++++++++++++++++++++++++++++++--- docs/images/CoW.png | Bin 5289 -> 5722 bytes src/trading/README.md | 11 ++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 055102d3..174cd625 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,50 @@ yarn add @cowprotocol/cow-sdk ``` -### Content +## [Trading SDK](./src/trading/README.md) + +CoW Protocol is intent based, decentralized trading protocol that allows users to trade ERC-20 tokens. + +The basic swap flow: +1. 🔎 Get a quote (price) for a trade (_or define your own price with a limit order_) +2. ✍️ Sign the order +3. ✅ Post the order to the order-book + +The easiest way to start trading is to use the `TradingSdk`: + +```typescript +import { SupportedChainId, OrderKind, TradeParameters, TradingSdk } from '@cowprotocol/cow-sdk' + +// Initialize the SDK +const sdk = new TradingSdk({ + chainId: SupportedChainId.SEPOLIA, + signer: '', + appCode: '', +}) + +// Define trade parameters +const parameters: TradeParameters = { + kind: OrderKind.BUY, + sellToken: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14', + sellTokenDecimals: 18, + buyToken: '0x0625afb445c3b6b7b929342a04a22599fd5dbb59', + buyTokenDecimals: 18, + amount: '120000000000000000' +} + +// Post the order +const orderId = await sdk.postSwapOrder(parameters) + +console.log('Order created, id: ', orderId) +``` + +This example is the simplest way to trade on CoW Protocol. + +You might want to use more advanced parameters like `receiver`, `partiallyFillable`, `validTo` and others. +Check the [Trading SDK documentation](./src/trading/README.md) for more details. + + +## Other utilities - `OrderBookApi` - provides the ability to retrieve orders and trades from the CoW Protocol order-book, as well as add and cancel them - `OrderSigningUtils` - serves to sign orders and cancel them using [EIP-712](https://eips.ethereum.org/EIPS/eip-712) @@ -38,8 +81,6 @@ const subgraphApi = new SubgraphApi({ chainId }) const orderSigningUtils = new OrderSigningUtils() ``` -## Quick start - ### Sign, fetch, post and cancel order For clarity, let's look at the use of the API with a practical example: diff --git a/docs/images/CoW.png b/docs/images/CoW.png index 2016dfa6d8c2a57dc3e55ed619611ad562591d0e..79cf43c91ac7bdc3119d751e8c27eb0dba9e60ff 100644 GIT binary patch literal 5722 zcmd6r)l(Y`u=a7c65J(FtY~p45HwhzNO1}TCrELZQe2A_E5#+ayl6@V_u}rB;8q+? zznSmi{0V1fXMa0;^<3?B3z1ZZez#9%e0w`geScmL`lJj{RjtJSl?KV<7@ z>MQ>v8Nc`c!T8PoCiI^;VXwE^dT3aZ3wVil*TfemQ)XMENSn~kGO^VtHb%!He>XkF zffwntYT90}e#y0PYW0<=xg&?w)4l@#>-77v#fGIQj~aMrsiu_>@)!#ZQy z1h%H{<;*^(Wv5}#i}EqO4)O(mY0%Q}erLeWlc8Svwo;$x1k&|NzpAoM|Nl3hEEiRe zlrMwzKLD$J9z`Xtgm@&$SrKu&WEnECOo*7YDD~P1VnpOIT1K80lCpwVKkQj(dx?Oj z{lbD}yEPcf(bGR-lqUu&pK?r&vKk$)*(ru)HMtFc4@>XPZ-{3RH)@QRp%`;`J6H*T zvNs!VmFPtx1TnDv=Y3-rKtnsv!&m4~iYyxH-h+(bV;Gc;KdoJTF2~L$e|Y;krU47; zVtt7ZePCqHM{j@T-j>eZRXu#k$>CIuEquRyJqD6m{HC#tCmd{jDEsxtMCC}-z`Aht z)T{h)G~=tKAa6Q(>mq=?voE0wak#zvFvB@S4T4wAVv)=b28XaVRVcPxUcA%}YNFY6wA<-AdZoKQ;t7BX0n5TAVA?{XeMb-D zl^gz4`XIvabSLk-m-!*Ph_@d?{SRbx$_Q>peJ4(3o>JAzn^e{BCBggj_pOQGIWeY5 zLZ1hNSyJHmimdgUSmTXsCw-{`3?vu(U{?Ws6g5%E8EDRs`#6k0~8qX$x4W zI9op5ZJwg#&j<{@_-I5= zBXdMFlGoi{2lY)sdXo6$tyGlhH>@Wwkl4TGYCPbf|+e2P<(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QV99KNHV-MBG0<@q|+` z9*9)2RcfsWo7Q$V$p#eK@UA}s?LBc67WAW(OGrz;F5cNF1Tf7qC?l8omWySm15aAul^i80swfArjt~dZN<@3flqs>YAu8A1E zekM>U%%b&7i2`sr&yQh4#k7QfB+=-_{y2e-Z+Zd^QZoD%z?5gN!aNFt{loA6yH!r% zXJ1?wl3tdcxwmpQpco`il;MspQRdKI%e(yrei9%fJc-q1g?X;fmWycL8*krd)sm!T z1zK>hNO0t6|%mL>gQah~#$- z^x}R!&kwKCczx>CPh3A6JIEAF#srWn+M+-3FfB7t$Mb&Y?XP2CRZDX`-HU(pC_|Tu z#jGb5V@k$rh8pviPBU|@s<2&Pu+0Vgc$$p{@$PYEnVHVzx?;#CP!q2{&0gAKBq=EL zIoCEt_uGQiGgi~&s>x^bVvFNxmKVP@+KR9E#a0jZ8J|5rpoeqVnnRVbUVR`r(`I_y z%bYpXbD6{O5?|`O`h68x_N^2Z)#tmscu0c`bj>R7ajE*+_TEOgp5QbW1d&+@kLeJ# zxuxoSYa8?;uz4e*(nu43k6qvvwKe&tRiox2xS$Y~j#K@~eOYKKaQEt#bgdQ=PtoR& zYwGS{es%O?^iZLDL)jnFzbI_%& z!s^r>5Dnx#kyJnZqU-feUo}z*kjYYlNC1}wKkF?CipFACr`?)2C}eA2DRdVJs7X0wq{;5mAG-4<3nk35J&XP zmeg7JMkekmkKg}^mDHx37Tuc;_JB@})dYJ=@$X4}vVq2urK{1*xBX)tmadWuHy0)UN(X(AUQ1t5<_*13ujt#z(jNH^-&y-3B+6JRm9qf^ zZO2jWiH(?Q+-+N=PLr2b0`Js_qyhY5DG{gbMVECAlSu$Sbt?UmwR%j3EV_>~gbN%} fks$hcQ6JB%(5GSOy^(PJCPrjrV5VQG=NR=rsqZ22 diff --git a/src/trading/README.md b/src/trading/README.md index a113ed94..30956a30 100644 --- a/src/trading/README.md +++ b/src/trading/README.md @@ -1,5 +1,12 @@ # Trading SDK +CoW Protocol is intent based, decentralized trading protocol that allows users to trade ERC-20 tokens. + +The basic swap flow: +1. 🔎 Get a quote (price) for a trade +2. ✍️ Sign the order +3. ✅ Post the order to the order-book + The CoW Protocol provides very flexible and powerful trading capabilities. However, this flexibility comes with a cost: the complexity of the protocol. This SDK serves to simplify the interaction with the CoW Protocol. @@ -25,6 +32,10 @@ The SDK provides three main functions: - `postLimitOrder` - create a limit order - `getQuote` - fetch a quote for a swap order +And two for specific cases: + - `postSellNativeCurrencyOrder` - create an order to sell blockchain native tokens (ETH for Ethereum) + - `getPreSignTransaction` - get a transaction to sign the order with a smart-contract wallet (EIP-1271) + ### Initialization The SDK requires the following parameters: