From 90c422230d27ac21f3704575bfe07ed5ca86253e Mon Sep 17 00:00:00 2001 From: dcatki <42241987+dcatki@users.noreply.github.com> Date: Mon, 8 Jul 2024 12:47:44 +0100 Subject: [PATCH 1/4] Update wlth-limit-order-single.rain Looking great Pls add 1. Current price of WLTH in USDC in the charts (not done) 2. Units (done) 3. Price per unit 4. Total price (e.g. units x price) --- strategies/wlth/wlth-limit-order-single.rain | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/strategies/wlth/wlth-limit-order-single.rain b/strategies/wlth/wlth-limit-order-single.rain index fe54a0a..3fbc2ca 100644 --- a/strategies/wlth/wlth-limit-order-single.rain +++ b/strategies/wlth/wlth-limit-order-single.rain @@ -101,22 +101,28 @@ scenarios: charts: - base-wlth-buy-metrics: + Buy WLTH, sell USDC single limit order: scenario: limit-orders.buy.metric metrics: - - label: io-ratio-1 + - label: Price value: 0.3.2 - - label: amount-1 + unit-suffix: " WLTH" + description: 'Unit price, USDC per WLTH (stack item 0.3.2)' + - label: Units value: 0.3.3 - - base-wlth-sell-metrics: + unit-suffix: " USDC" + description: 'Units purchased (stack item 0.3.3)' + Buy USDC, sell WLTH single limit order: scenario: limit-orders.sell.metric metrics: - - label: io-ratio-1 + - label: Price value: 0.3.2 - - label: amount-1 + unit-suffix: " USDC" + description: 'Unit price, WLTH per USDC (stack item 0.3.2)' + - label: Units value: 0.3.3 - + unit-suffix: " WLTH" + description: 'Units sold (stack item 0.3.3)' deployments: base-wlth-buy: scenario: limit-orders.buy.prod @@ -182,4 +188,4 @@ deployments: #handle-io trade-count-key: hash(order-hash() count-key), trade-count: get(trade-count-key), - :set(trade-count-key add(trade-count 1)); \ No newline at end of file + :set(trade-count-key add(trade-count 1)); From 8407faaf3dc2508dbc2c8f5820aac831e4110db2 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Mon, 8 Jul 2024 19:59:41 +0530 Subject: [PATCH 2/4] added input amount metric --- strategies/wlth/wlth-limit-order-single.rain | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/strategies/wlth/wlth-limit-order-single.rain b/strategies/wlth/wlth-limit-order-single.rain index 3fbc2ca..e85eb48 100644 --- a/strategies/wlth/wlth-limit-order-single.rain +++ b/strategies/wlth/wlth-limit-order-single.rain @@ -107,22 +107,30 @@ charts: - label: Price value: 0.3.2 unit-suffix: " WLTH" - description: 'Unit price, USDC per WLTH (stack item 0.3.2)' + description: 'Unit price, WLTH per USDC (stack item 0.3.2)' - label: Units value: 0.3.3 unit-suffix: " USDC" - description: 'Units purchased (stack item 0.3.3)' + description: 'Units purchased (stack item 0.3.3)' + - label: Total Price + value: 0.3.4 + unit-suffix: " WLTH" + description: 'Amount of WLTH recevied.' Buy USDC, sell WLTH single limit order: scenario: limit-orders.sell.metric metrics: - label: Price value: 0.3.2 unit-suffix: " USDC" - description: 'Unit price, WLTH per USDC (stack item 0.3.2)' + description: 'Unit price, USDC per WLTH (stack item 0.3.2)' - label: Units value: 0.3.3 unit-suffix: " WLTH" - description: 'Units sold (stack item 0.3.3)' + description: 'Units sold (stack item 0.3.3)' + - label: Total Price + value: 0.3.4 + unit-suffix: " USDC" + description: 'Amount of USDC recevied.' deployments: base-wlth-buy: scenario: limit-orders.buy.prod @@ -160,7 +168,8 @@ deployments: #plottables-metric amount io-ratio: , _: io-ratio-1, - _: ouptut-amount-1; + _: ouptut-amount-1, + input-amount-1: mul(io-ratio-1 ouptut-amount-1); #get-trade-count-prod trade-count-key: hash(order-hash() count-key), From 6fc248ba443a967ca6498bd28c170a0df74c2e10 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Mon, 8 Jul 2024 20:42:11 +0530 Subject: [PATCH 3/4] remove unecessary bindings --- strategies/wlth/wlth-limit-order-single.rain | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/strategies/wlth/wlth-limit-order-single.rain b/strategies/wlth/wlth-limit-order-single.rain index e85eb48..2cc1838 100644 --- a/strategies/wlth/wlth-limit-order-single.rain +++ b/strategies/wlth/wlth-limit-order-single.rain @@ -145,18 +145,6 @@ deployments: #io-ratio-1 !IO ratio for first order. #ouptut-amount-1 !Output amount for first order. -#io-ratio-2 !IO ratio for second order. -#ouptut-amount-2 !Output amount for second order. - -#io-ratio-3 !IO ratio for third order. -#ouptut-amount-3 !Output amount for third order. - -#io-ratio-4 !IO ratio for fourth order. -#ouptut-amount-4 !Output amount for fourth order. - -#io-ratio-5 !IO ratio for fifth order. -#ouptut-amount-5 !Output amount for fifth order. - #count-key "count-key" #plottables !Binding to plot values. #get-trade-count !Binding to get trade count. From 0af982baed8e36c6efc726f6bb8105aa6e1e7154 Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Mon, 8 Jul 2024 21:00:38 +0530 Subject: [PATCH 4/4] add metric --- strategies/wlth/wlth-limit-order-single.rain | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/strategies/wlth/wlth-limit-order-single.rain b/strategies/wlth/wlth-limit-order-single.rain index 2cc1838..3b92732 100644 --- a/strategies/wlth/wlth-limit-order-single.rain +++ b/strategies/wlth/wlth-limit-order-single.rain @@ -107,13 +107,17 @@ charts: - label: Price value: 0.3.2 unit-suffix: " WLTH" - description: 'Unit price, WLTH per USDC (stack item 0.3.2)' - - label: Units + description: 'Unit price, WLTH per USDC (stack item 0.3.2)' + - label: Effective Price (as visible on dex tools) value: 0.3.3 unit-suffix: " USDC" + description: 'Effective price in USDC denomination' + - label: Units + value: 0.3.4 + unit-suffix: " USDC" description: 'Units purchased (stack item 0.3.3)' - label: Total Price - value: 0.3.4 + value: 0.3.5 unit-suffix: " WLTH" description: 'Amount of WLTH recevied.' Buy USDC, sell WLTH single limit order: @@ -123,12 +127,16 @@ charts: value: 0.3.2 unit-suffix: " USDC" description: 'Unit price, USDC per WLTH (stack item 0.3.2)' + - label: Effective Price (as visible on dex tools) + value: 0.3.2 + unit-suffix: " USDC" + description: 'Effective price in USDC denomination' - label: Units - value: 0.3.3 + value: 0.3.4 unit-suffix: " WLTH" description: 'Units sold (stack item 0.3.3)' - label: Total Price - value: 0.3.4 + value: 0.3.5 unit-suffix: " USDC" description: 'Amount of USDC recevied.' deployments: @@ -156,6 +164,7 @@ deployments: #plottables-metric amount io-ratio: , _: io-ratio-1, + effective-ratio-1: inv(io-ratio-1), _: ouptut-amount-1, input-amount-1: mul(io-ratio-1 ouptut-amount-1);