Skip to content

Commit 0d97b97

Browse files
authored
feat: update testnet pool oracle addresses
Merge pull request #194 from Neko-Protocol/chore/update-testnet-pool-oracle-addresses
2 parents f289646 + 39b14c2 commit 0d97b97

File tree

14 files changed

+693
-775
lines changed

14 files changed

+693
-775
lines changed

apps/web-app/public/assets/ktb.png

-5.3 KB
Loading

apps/web-app/src/features/admin/components/InterestRateParamsForm.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default function InterestRateParamsForm() {
3232
const [rTwo, setRTwo] = useState("50");
3333
const [rThree, setRThree] = useState("150");
3434
const [reactivity, setReactivity] = useState("0.00002");
35+
const [enabled, setEnabled] = useState(true);
36+
const [lFactor, setLFactor] = useState("80");
37+
const [supplyCap, setSupplyCap] = useState("0");
3538

3639
const pool = POOLS.find((p) => p.id === poolId) ?? POOLS[0];
3740
const assets = pool.assets;
@@ -48,6 +51,11 @@ export default function InterestRateParamsForm() {
4851
r_two: pctTo7(parseFloat(rTwo) || 0),
4952
r_three: pctTo7(parseFloat(rThree) || 0),
5053
reactivity: Math.round(parseFloat(reactivity) * SCALAR_7) || 0,
54+
enabled,
55+
l_factor: pctTo7(parseFloat(lFactor) || 0),
56+
supply_cap: BigInt(
57+
Math.round((parseFloat(supplyCap) || 0) * 10 ** 7)
58+
),
5159
};
5260

5361
if (params.target_util > 9_500_000) {
@@ -249,6 +257,49 @@ export default function InterestRateParamsForm() {
249257
/>
250258
</div>
251259

260+
<div className="grid grid-cols-2 gap-4">
261+
<div>
262+
<label className="block text-sm text-white/70 mb-1">
263+
l_factor (%)
264+
</label>
265+
<input
266+
type="number"
267+
min="0"
268+
max="100"
269+
step="0.1"
270+
value={lFactor}
271+
onChange={(e) => setLFactor(e.target.value)}
272+
className="w-full rounded-xl bg-[#2A2A2A] border border-white/10 px-4 py-2.5 text-white focus:outline-none focus:ring-2 focus:ring-[#229EDF]"
273+
/>
274+
</div>
275+
<div>
276+
<label className="block text-sm text-white/70 mb-1">
277+
supply_cap (0 = unlimited)
278+
</label>
279+
<input
280+
type="number"
281+
min="0"
282+
step="1"
283+
value={supplyCap}
284+
onChange={(e) => setSupplyCap(e.target.value)}
285+
className="w-full rounded-xl bg-[#2A2A2A] border border-white/10 px-4 py-2.5 text-white focus:outline-none focus:ring-2 focus:ring-[#229EDF]"
286+
/>
287+
</div>
288+
</div>
289+
290+
<div className="flex items-center gap-3">
291+
<input
292+
type="checkbox"
293+
id="enabled"
294+
checked={enabled}
295+
onChange={(e) => setEnabled(e.target.checked)}
296+
className="h-4 w-4 rounded border-white/10 bg-[#2A2A2A] text-[#229EDF] focus:ring-[#229EDF]"
297+
/>
298+
<label htmlFor="enabled" className="text-sm text-white/70">
299+
Enabled (accept deposits & borrows)
300+
</label>
301+
</div>
302+
252303
<button
253304
type="submit"
254305
disabled={loading}

apps/web-app/src/features/borrowing/hooks/useBorrowPools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function fetchPoolPools(
5050
let collateralFactor = 0;
5151
try {
5252
const factorTx = await client.get_collateral_factor(
53-
{ rwa_token: collateralToken.contract },
53+
{ neko_token: collateralToken.contract },
5454
{ simulate: true }
5555
);
5656
const factorValue = factorTx.result;

apps/web-app/src/features/borrowing/hooks/useUserBorrowPositions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function fetchPositionData(
4747
),
4848
client.get_d_token_rate({ asset: assetCode }, { simulate: true }),
4949
client.get_collateral(
50-
{ borrower: walletAddress, rwa_token: collateralToken },
50+
{ borrower: walletAddress, neko_token: collateralToken },
5151
{ simulate: true }
5252
),
5353
]);

apps/web-app/src/features/lending/utils/lending.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ export const getCollateral = async (
470470
const collateralTx = await client.get_collateral(
471471
{
472472
borrower: walletAddress,
473-
rwa_token: rwaTokenContract,
473+
neko_token: rwaTokenContract,
474474
},
475475
{ simulate: true }
476476
);

apps/web-app/src/features/stocks/utils/stockInfo.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ export const STOCK_INFO: Record<string, StockInfo> = {
6262
},
6363
KTB: {
6464
logo: "/assets/ktb.png",
65-
name: "KTB Token",
66-
description: "Real-world asset token available on Neko testnet",
65+
name: "Korean Treasury Bond",
66+
description:
67+
"Tokenized Korean government bonds (KTBs) via Etherfuse and Shinhan Securities",
6768
summary:
68-
"KTB is an RWA (real-world asset) token deployed on Stellar testnet for Neko Protocol liquidity and borrowing flows.",
69+
"KTB is an Etherfuse Stablebond backed by short-term Korean Treasury Bonds — South Korean sovereign debt that earns yield on-chain. Issued in partnership with Shinhan Securities, it provides transparent exposure to one of Asia's most stable government bond markets. Available on Stellar, Solana, Base, Polygon, and Monad. Buy on Etherfuse at app.etherfuse.com or test at devnet.etherfuse.com.",
70+
buyInfo: {
71+
platform: "Etherfuse",
72+
url: "https://app.etherfuse.com",
73+
},
6974
},
7075
};

apps/web-app/src/lib/constants/assets.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const ASSETS_BY_NETWORK: Record<NetworkId, Record<string, AssetConfig>> = {
7676
},
7777
KTB: {
7878
code: "KTB",
79-
name: "KTB Token",
79+
name: "Korean Treasury Bond",
8080
contract: "CANIRPAKV2SUEH7O6LIOIQE5GCCIIS7EWFRRXBONIF2F2H6GEBDARAEM",
8181
decimals: 7,
8282
icon: "/assets/ktb.png",

apps/web-app/src/lib/constants/contracts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export {
1212
} from "./generated/contract-errors";
1313

1414
export const LENDING_CONTRACT_ID =
15-
"CCYYGFDBVHMTL3RWDH6L6IY777VLBXDGB4NYBBKTZEH4UR7URAFKWJMI";
15+
"CDTWMEFOCTZOYCOJMTFCDLKKZIDDH5ZUGVYWSIB3R3QCFFQO3VPO6O6Z";
1616

1717
export const LENDING_POOL2_CONTRACT_ID =
18-
"CANU6NELPY5IHDZGEHYH2AKBHKVNMXENMBOVXPOFZ4F6TBHL2FN55N3T";
18+
"CDZWW5XCWA6J3AHZJLN7VU5I5QMMZFUPYKIF3M6IOOWU23C25PXVRI37";
1919

2020
export const ORACLE_CONTRACT_ID =
21-
"CCRCWL4TT4SSTAM3XVJZVXCYNM7GA3HO5SB36AERYJMBVSN5QF25AS6B";
21+
"CCFWASXOQJVJR5WVHRQPQTLCZC3SCBAL2Z67YY4JJAO5GLJLJABQT47I";

apps/web-app/src/lib/services/lending.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ export class LendingService {
832832
...(allowHttpForSoroban && { allowHttp: true }),
833833
});
834834
const tx = await client.get_collateral(
835-
{ borrower: walletAddress, rwa_token: rwaTokenContract },
835+
{ borrower: walletAddress, neko_token: rwaTokenContract },
836836
{ simulate: true }
837837
);
838838
const value = tx.result;
@@ -887,7 +887,7 @@ export class LendingService {
887887
const collateralTx = await this.lendingClient.get_collateral(
888888
{
889889
borrower: walletAddress,
890-
rwa_token: rwaTokenContract,
890+
neko_token: rwaTokenContract,
891891
},
892892
{ simulate: true }
893893
);
@@ -1095,7 +1095,7 @@ export class LendingService {
10951095
try {
10961096
const client = this.getClient(contractId);
10971097
const tx = await client.get_collateral_factor(
1098-
{ rwa_token: rwaToken },
1098+
{ neko_token: rwaToken },
10991099
{ simulate: true }
11001100
);
11011101
const value = tx.result;
@@ -1137,7 +1137,7 @@ export class LendingService {
11371137
}
11381138

11391139
/**
1140-
* Build set_interest_rate_params transaction. Returns XDR for signing.
1140+
* Build queue_set_reserve_params transaction (7-day timelock). Returns XDR for signing.
11411141
*/
11421142
async setInterestRateParams(
11431143
asset: string,
@@ -1147,15 +1147,15 @@ export class LendingService {
11471147
): Promise<LendingOperationResult> {
11481148
try {
11491149
const client = this.getClient(contractId, walletAddress);
1150-
const assembled = await client.set_interest_rate_params({
1150+
const assembled = await client.queue_set_reserve_params({
11511151
asset,
11521152
params,
11531153
});
11541154
const xdrStr = assembled.toXDR();
11551155
return { xdr: xdrStr };
11561156
} catch (error) {
11571157
console.error(
1158-
"Error building set_interest_rate_params transaction:",
1158+
"Error building queue_set_reserve_params transaction:",
11591159
error
11601160
);
11611161
const friendlyError = extractContractError(error, "rwa-lending");

packages/contracts/lending/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ This library was automatically generated by Soroban CLI using a command similar
66

77
```bash
88
soroban contract bindings ts \
9-
--rpc-url https://soroban-testnet.stellar.org \
9+
--rpc-url https://soroban-testnet.stellar.org:443 \
1010
--network-passphrase "Test SDF Network ; September 2015" \
11-
--contract-id CD2ZCQLGQZRUBHO77QVGJXNFP6Y6UIQBBYG5WG6EX5PTQQDNEQITNB5J \
11+
--contract-id CDTWMEFOCTZOYCOJMTFCDLKKZIDDH5ZUGVYWSIB3R3QCFFQO3VPO6O6Z \
1212
--output-dir ./path/to/lending
1313
```
1414

@@ -30,7 +30,7 @@ However, we've actually encountered [frustration](https://github.com/stellar/sor
3030

3131
```json
3232
"scripts": {
33-
"postinstall": "soroban contract bindings ts --rpc-url https://soroban-testnet.stellar.org --network-passphrase \"Test SDF Network ; September 2015\" --id CD2ZCQLGQZRUBHO77QVGJXNFP6Y6UIQBBYG5WG6EX5PTQQDNEQITNB5J --name lending"
33+
"postinstall": "soroban contract bindings ts --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase \"Test SDF Network ; September 2015\" --id CDTWMEFOCTZOYCOJMTFCDLKKZIDDH5ZUGVYWSIB3R3QCFFQO3VPO6O6Z --name lending"
3434
}
3535
```
3636

0 commit comments

Comments
 (0)