Observed since 21 Oct, 11:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xshikhar/nexus-agents-atoma
A specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.
A specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.
Create a .env file in the sui-agent directory with the following variables:
PORT=2512
ATOMASDK_BEARER_AUTH=your_atoma_sdk_auth_token
POST /query
Content-Type: application/json
Request Body:
{
"prompt": "your natural language query here"
}
The agent uses a tool registry system for managing different operations. Each tool follows this structure:
{
name: string; // Unique identifier for the tool
description: string; // What the tool does
parameters: {
// Parameters the tool accepts
name: string;
type: string;
description: string;
required: boolean;
}
[];
process: Function; // The actual implementation
}
The agent supports various token types on Sui, including:
@types/interface.ts for full list)curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "what is the current price of SUI and USDC"}'
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "show me information for pool 0x123..."}'
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "show me the top 5 pools by APR"}'
# Deposit into top APR pools
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "deposit 1 SUI into each of the top 5 pools by APR with 1% slippage from my wallet 0x123..."}'
# Deposit into top TVL pools
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "find the top 3 pools by TVL and deposit 0.5 SUI into each from wallet 0x123... with 0.5% slippage"}'
# Deposit into top fee-generating pools
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "deposit 2 SUI each into the top 10 pools by fees from my wallet 0x123... using 1% slippage"}'
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "withdraw 1000000 LP tokens from pool 0xabc... using wallet 0x123... with 0.5% slippage"}'
# Get staking positions
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "show me the staking positions for wallet 0x123..."}'
# Get total SUI TVL in staking
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "what is the total SUI TVL in staking?"}'
# Get afSUI exchange rate
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "what is the current afSUI to SUI exchange rate?"}'
# Create staking transaction
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "stake 100 SUI from wallet 0x123... with validator 0xabc..."}'
curl -X POST http://localhost:2512/query \
-H "Content-Type: application/json" \
-d '{"prompt": "transfer 1 SUI from 0xsender to 0xrecipient"}'
src/export async function yourTool(param1: string): Promise<string> {
try {
// Your implementation
return JSON.stringify([
{
reasoning: 'Explanation of what happened',
response: 'The result',
status: 'success',
query: 'Original query',
errors: [],
},
]);
} catch (error) {
return JSON.stringify([
{
reasoning: 'What went wrong',
response: 'Error message',
status: 'failure',
query: 'Original query',
errors: [error.message],
},
]);
}
}
src/tools/ToolRegistry.ts:tools.registerTool(
'your_tool_name',
'Description of your tool',
[
{
name: 'param1',
type: 'string',
description: 'Parameter description',
required: true,
},
],
yourTool,
);
The agent uses a standardized error response format:
{
reasoning: string; // Why the error occurred
response: string; // User-friendly error message
status: "failure"; // Error status
query: string; // Original query
errors: string[]; // Array of error messages
}
npm test
npm run build
npm run dev
Apache License 2.0. See LICENSE for details.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^1.7.9 | runtime |
dotenvEnvironment{
"local_name": "dotenv",
"alias": false,
"peer_metadata": null
} | ^16.4.7 | runtime |
mongooseEnvironment{
"local_name": "mongoose",
"alias": false,
"peer_metadata": null
} | ^8.10.0 | runtime |
navi-sdkEnvironment{
"local_name": "navi-sdk",
"alias": false,
"peer_metadata": null
} | ^1.4.24 | runtime |
atoma-sdkEnvironment{
"local_name": "atoma-sdk",
"alias": false,
"peer_metadata": null
} | github:atoma-network/atoma-sdk-typescript | runtime |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.7.3 | runtime |
@mysten/suiEnvironment{
"local_name": "@mysten/sui",
"alias": false,
"peer_metadata": null
} | 1.1.0 | runtime |
aftermath-ts-sdkEnvironment{
"local_name": "aftermath-ts-sdk",
"alias": false,
"peer_metadata": null
} | ^1.2.49 | runtime |
@bluefin-exchange/bluefin-v2-clientEnvironment{
"local_name": "@bluefin-exchange/bluefin-v2-client",
"alias": false,
"peer_metadata": null
} | ^6.1.29 | runtime |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^8.57.0 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^3.4.2 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^20.11.19 | development |
@types/dotenvEnvironment{
"local_name": "@types/dotenv",
"alias": false,
"peer_metadata": null
} | ^8.2.0 | development |
@typescript-eslint/parserEnvironment{
"local_name": "@typescript-eslint/parser",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | development |
@typescript-eslint/eslint-pluginEnvironment{
"local_name": "@typescript-eslint/eslint-plugin",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | development |
Source distribution
{
"shasum": "b25e896b1df1199196129ee56f1d127611348476",
"tarball": "https://registry.npmjs.org/@0xshikhar/nexus-agents-atoma/-/nexus-agents-atoma-1.0.0.tgz",
"fileCount": 35,
"integrity": "sha512-ZN1UeFV7yvLiu5u88HWwNfGyC7jbePPsxw4yVI4xc4zP4x82oZb1MleHfUknZ8mticq7hMJ+YxDBCWp0CVXx4w==",
"signatures": [
{
"sig": "MEUCIQDQvZSWK/7a5l4gkj8pPoQ62Fw3aFH0fJUJAbUmVH/fwwIgY8Ceh1FOyyqQTnnULfVtCAa0uGwOQk2g/6aqwespWi0=",
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
}
],
"unpackedSize": 418679
}Observed since 21 Oct, 11:27 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:23916b6b5d64c19d4079b3d4ee0e0fa73e3677d1834cc9bc382ac65091729ad6